code
stringlengths
4
1.01M
language
stringclasses
2 values
package org.javarosa.model.xform; import org.javarosa.core.data.IDataPointer; import org.javarosa.core.model.IAnswerDataSerializer; import org.javarosa.core.model.instance.FormInstance; import org.javarosa.core.model.instance.TreeElement; import org.javarosa.core.model.instance.TreeReference; import org.javarosa.core.model.utils.IInstanceSerializingVisitor; import org.javarosa.core.services.transport.payload.ByteArrayPayload; import org.javarosa.core.services.transport.payload.DataPointerPayload; import org.javarosa.core.services.transport.payload.IDataPayload; import org.javarosa.core.services.transport.payload.MultiMessagePayload; import org.javarosa.xform.util.XFormAnswerDataSerializer; import org.javarosa.xform.util.XFormSerializer; import org.kxml2.kdom.Document; import org.kxml2.kdom.Element; import org.kxml2.kdom.Node; import java.io.IOException; import java.util.Enumeration; import java.util.Vector; /** * A visitor-esque class which walks a FormInstance and constructs an XML document * containing its instance. * * The XML node elements are constructed in a depth-first manner, consistent with * standard XML document parsing. * * @author Clayton Sims */ public class XFormSerializingVisitor implements IInstanceSerializingVisitor { /** * The XML document containing the instance that is to be returned */ Document theXmlDoc; /** * The serializer to be used in constructing XML for AnswerData elements */ IAnswerDataSerializer serializer; /** * The root of the xml document which should be included in the serialization * */ TreeReference rootRef; Vector<IDataPointer> dataPointers; boolean respectRelevance = true; public XFormSerializingVisitor() { this(true); } public XFormSerializingVisitor(boolean respectRelevance) { this.respectRelevance = respectRelevance; } private void init() { theXmlDoc = null; dataPointers = new Vector<IDataPointer>(); } @Override public byte[] serializeInstance(FormInstance model) throws IOException { return serializeInstance(model, new XPathReference("/")); } @Override public byte[] serializeInstance(FormInstance model, XPathReference ref) throws IOException { init(); rootRef = FormInstance.unpackReference(ref); if (this.serializer == null) { this.setAnswerDataSerializer(new XFormAnswerDataSerializer()); } model.accept(this); if (theXmlDoc != null) { return XFormSerializer.getUtfBytesFromDocument(theXmlDoc); } else { return null; } } @Override public IDataPayload createSerializedPayload(FormInstance model) throws IOException { return createSerializedPayload(model, new XPathReference("/")); } @Override public IDataPayload createSerializedPayload(FormInstance model, XPathReference ref) throws IOException { init(); rootRef = FormInstance.unpackReference(ref); if (this.serializer == null) { this.setAnswerDataSerializer(new XFormAnswerDataSerializer()); } model.accept(this); if (theXmlDoc != null) { //TODO: Did this strip necessary data? byte[] form = XFormSerializer.getUtfBytesFromDocument(theXmlDoc); if (dataPointers.size() == 0) { return new ByteArrayPayload(form, null, IDataPayload.PAYLOAD_TYPE_XML); } MultiMessagePayload payload = new MultiMessagePayload(); payload.addPayload(new ByteArrayPayload(form, "xml_submission_file", IDataPayload.PAYLOAD_TYPE_XML)); Enumeration en = dataPointers.elements(); while (en.hasMoreElements()) { IDataPointer pointer = (IDataPointer)en.nextElement(); payload.addPayload(new DataPointerPayload(pointer)); } return payload; } else { return null; } } @Override public void visit(FormInstance tree) { theXmlDoc = new Document(); TreeElement root = tree.resolveReference(rootRef); //For some reason resolveReference won't ever return the root, so we'll //catch that case and just start at the root. if (root == null) { root = tree.getRoot(); } if (root != null) { theXmlDoc.addChild(Node.ELEMENT, serializeNode(root)); } Element top = theXmlDoc.getElement(0); String[] prefixes = tree.getNamespacePrefixes(); for (String prefix : prefixes) { top.setPrefix(prefix, tree.getNamespaceURI(prefix)); } if (tree.schema != null) { top.setNamespace(tree.schema); top.setPrefix("", tree.schema); } } private Element serializeNode(TreeElement instanceNode) { Element e = new Element(); //don't set anything on this element yet, as it might get overwritten //don't serialize template nodes or non-relevant nodes if ((respectRelevance && !instanceNode.isRelevant()) || instanceNode.getMult() == TreeReference.INDEX_TEMPLATE) { return null; } if (instanceNode.getValue() != null) { Object serializedAnswer = serializer.serializeAnswerData(instanceNode.getValue(), instanceNode.getDataType()); if (serializedAnswer instanceof Element) { e = (Element)serializedAnswer; } else if (serializedAnswer instanceof String) { e = new Element(); e.addChild(Node.TEXT, serializedAnswer); } else { throw new RuntimeException("Can't handle serialized output for" + instanceNode.getValue().toString() + ", " + serializedAnswer); } if (serializer.containsExternalData(instanceNode.getValue()).booleanValue()) { IDataPointer[] pointers = serializer.retrieveExternalDataPointer(instanceNode.getValue()); for (IDataPointer pointer : pointers) { dataPointers.addElement(pointer); } } } else { //make sure all children of the same tag name are written en bloc Vector<String> childNames = new Vector<String>(); for (int i = 0; i < instanceNode.getNumChildren(); i++) { String childName = instanceNode.getChildAt(i).getName(); if (!childNames.contains(childName)) childNames.addElement(childName); } for (int i = 0; i < childNames.size(); i++) { String childName = childNames.elementAt(i); int mult = instanceNode.getChildMultiplicity(childName); for (int j = 0; j < mult; j++) { Element child = serializeNode(instanceNode.getChild(childName, j)); if (child != null) { e.addChild(Node.ELEMENT, child); } } } } e.setName(instanceNode.getName()); // add hard-coded attributes for (int i = 0; i < instanceNode.getAttributeCount(); i++) { String namespace = instanceNode.getAttributeNamespace(i); String name = instanceNode.getAttributeName(i); String val = instanceNode.getAttributeValue(i); // is it legal for getAttributeValue() to return null? playing it safe for now and assuming yes if (val == null) { val = ""; } e.setAttribute(namespace, name, val); } if (instanceNode.getNamespace() != null) { e.setNamespace(instanceNode.getNamespace()); } return e; } @Override public void setAnswerDataSerializer(IAnswerDataSerializer ads) { this.serializer = ads; } @Override public IInstanceSerializingVisitor newInstance() { XFormSerializingVisitor modelSerializer = new XFormSerializingVisitor(); modelSerializer.setAnswerDataSerializer(this.serializer); return modelSerializer; } }
Java
package io.silverspoon.bulldog.beagleboneblack.devicetree; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintWriter; public class DeviceTreeCompiler { private static final String FIRMWARE_PATH = "/lib/firmware/"; private static final String OBJECT_FILE_PATTERN = "%s%s.dtbo"; private static final String DEFINITION_FILE_PATTERN = "%s%s.dts"; private static final String COMPILER_CALL = "dtc -O dtb -o %s -b 0 -@ %s"; public static void compileOverlay(String overlay, String deviceName) throws IOException, InterruptedException { String objectFile = String.format(OBJECT_FILE_PATTERN, FIRMWARE_PATH, deviceName); String overlayFile = String.format(DEFINITION_FILE_PATTERN, FIRMWARE_PATH, deviceName); File file = new File(overlayFile); FileOutputStream outputStream = new FileOutputStream(file); PrintWriter writer = new PrintWriter(outputStream); writer.write(overlay); writer.close(); Process compile = Runtime.getRuntime().exec(String.format(COMPILER_CALL, objectFile, overlayFile)); int code = compile.waitFor(); if (code > 0) { throw new RuntimeException("Device Tree Overlay compilation failed: " + overlayFile + " could not be compiled"); } } }
Java
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-2.0-xr-w32-bld/build/dom/interfaces/html/nsIDOMHTMLMapElement.idl */ #ifndef __gen_nsIDOMHTMLMapElement_h__ #define __gen_nsIDOMHTMLMapElement_h__ #ifndef __gen_nsIDOMHTMLElement_h__ #include "nsIDOMHTMLElement.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif /* starting interface: nsIDOMHTMLMapElement */ #define NS_IDOMHTMLMAPELEMENT_IID_STR "a6cf90af-15b3-11d2-932e-00805f8add32" #define NS_IDOMHTMLMAPELEMENT_IID \ {0xa6cf90af, 0x15b3, 0x11d2, \ { 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 }} /** * The nsIDOMHTMLMapElement interface is the interface to a [X]HTML * map element. * * This interface is trying to follow the DOM Level 2 HTML specification: * http://www.w3.org/TR/DOM-Level-2-HTML/ * * with changes from the work-in-progress WHATWG HTML specification: * http://www.whatwg.org/specs/web-apps/current-work/ */ class NS_NO_VTABLE NS_SCRIPTABLE nsIDOMHTMLMapElement : public nsIDOMHTMLElement { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMHTMLMAPELEMENT_IID) /* readonly attribute nsIDOMHTMLCollection areas; */ NS_SCRIPTABLE NS_IMETHOD GetAreas(nsIDOMHTMLCollection **aAreas) = 0; /* attribute DOMString name; */ NS_SCRIPTABLE NS_IMETHOD GetName(nsAString & aName) = 0; NS_SCRIPTABLE NS_IMETHOD SetName(const nsAString & aName) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMHTMLMapElement, NS_IDOMHTMLMAPELEMENT_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSIDOMHTMLMAPELEMENT \ NS_SCRIPTABLE NS_IMETHOD GetAreas(nsIDOMHTMLCollection **aAreas); \ NS_SCRIPTABLE NS_IMETHOD GetName(nsAString & aName); \ NS_SCRIPTABLE NS_IMETHOD SetName(const nsAString & aName); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSIDOMHTMLMAPELEMENT(_to) \ NS_SCRIPTABLE NS_IMETHOD GetAreas(nsIDOMHTMLCollection **aAreas) { return _to GetAreas(aAreas); } \ NS_SCRIPTABLE NS_IMETHOD GetName(nsAString & aName) { return _to GetName(aName); } \ NS_SCRIPTABLE NS_IMETHOD SetName(const nsAString & aName) { return _to SetName(aName); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSIDOMHTMLMAPELEMENT(_to) \ NS_SCRIPTABLE NS_IMETHOD GetAreas(nsIDOMHTMLCollection **aAreas) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAreas(aAreas); } \ NS_SCRIPTABLE NS_IMETHOD GetName(nsAString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetName(aName); } \ NS_SCRIPTABLE NS_IMETHOD SetName(const nsAString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetName(aName); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsDOMHTMLMapElement : public nsIDOMHTMLMapElement { public: NS_DECL_ISUPPORTS NS_DECL_NSIDOMHTMLMAPELEMENT nsDOMHTMLMapElement(); private: ~nsDOMHTMLMapElement(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsDOMHTMLMapElement, nsIDOMHTMLMapElement) nsDOMHTMLMapElement::nsDOMHTMLMapElement() { /* member initializers and constructor code */ } nsDOMHTMLMapElement::~nsDOMHTMLMapElement() { /* destructor code */ } /* readonly attribute nsIDOMHTMLCollection areas; */ NS_IMETHODIMP nsDOMHTMLMapElement::GetAreas(nsIDOMHTMLCollection **aAreas) { return NS_ERROR_NOT_IMPLEMENTED; } /* attribute DOMString name; */ NS_IMETHODIMP nsDOMHTMLMapElement::GetName(nsAString & aName) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsDOMHTMLMapElement::SetName(const nsAString & aName) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif #endif /* __gen_nsIDOMHTMLMapElement_h__ */
Java
# Copyright 2016 Nuage Netowrks USA Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import abc import copy import os import oslo_messaging import six from neutron.agent.linux import ip_lib from neutron.common import rpc as n_rpc from neutron import context from neutron_lib import constants from neutron_lib.plugins import directory from neutron_vpnaas.services.vpn import device_drivers from neutron_vpnaas.services.vpn.device_drivers import fedora_strongswan_ipsec from neutron_vpnaas.services.vpn.device_drivers import ipsec from neutron_vpnaas.services.vpn.device_drivers import strongswan_ipsec from nuage_neutron.vpnaas.common import topics from nuage_neutron.vpnaas.nuage_interface import NuageInterfaceDriver from oslo_concurrency import lockutils from oslo_config import cfg from oslo_log import log as logging from oslo_service import loopingcall LOG = logging.getLogger(__name__) TEMPLATE_PATH = os.path.dirname(os.path.abspath(__file__)) IPSEC_CONNS = 'ipsec_site_connections' class NuageIPsecVpnDriverApi(object): """IPSecVpnDriver RPC api.""" def __init__(self, topic): target = oslo_messaging.Target(topic=topic, version='1.0') self.client = n_rpc.get_client(target) def get_vpn_services_on_host(self, context, host): """Get list of vpnservices. The vpnservices including related ipsec_site_connection, ikepolicy and ipsecpolicy on this host """ cctxt = self.client.prepare() return cctxt.call(context, 'get_vpn_services_on_host', host=host) def update_status(self, context, status): """Update local status. This method call updates status attribute of VPNServices. """ cctxt = self.client.prepare() return cctxt.call(context, 'update_status', status=status) @six.add_metaclass(abc.ABCMeta) class NuageIPsecDriver(device_drivers.DeviceDriver): def __init__(self, vpn_service, host): self.conf = vpn_service.conf self.host = host self.conn = n_rpc.create_connection(new=True) self.context = context.get_admin_context_without_session() self.topic = topics.NUAGE_IPSEC_AGENT_TOPIC self.processes = {} self.routers = {} self.process_status_cache = {} self.endpoints = [self] self.conn.create_consumer(self.topic, self.endpoints) self.conn.consume_in_threads() self.agent_rpc = NuageIPsecVpnDriverApi( topics.NUAGE_IPSEC_DRIVER_TOPIC) self.process_status_cache_check = loopingcall.FixedIntervalLoopingCall( self.report_status, self.context) self.process_status_cache_check.start( interval=20) self.nuage_if_driver = NuageInterfaceDriver(cfg.CONF) def _get_l3_plugin(self): return directory.get_plugin(constants.L3) def get_namespace(self, router_id): """Get namespace of router. :router_id: router_id :returns: namespace string. """ return 'vpn-' + router_id def vpnservice_updated(self, context, **kwargs): """Vpnservice updated rpc handler VPN Service Driver will call this method when vpnservices updated. Then this method start sync with server. """ router = kwargs.get('router', None) self.sync(context, [router] if router else []) def tracking(self, context, **kwargs): """Handling create router event. Agent calls this method, when the process namespace is ready. Note: process_id == router_id == vpnservice_id """ router = kwargs.get('router', None) process_id = router['id'] self.routers[process_id] = process_id if process_id in self.processes: # In case of vpnservice is created # before vpn service namespace process = self.processes[process_id] process.enable() def non_tracking(self, context, **kwargs): router = kwargs.get('router', None) process_id = router['id'] self.destroy_process(process_id) if process_id in self.routers: del self.routers[process_id] def ensure_process(self, process_id, vpnservice=None): """Ensuring process. If the process doesn't exist, it will create process and store it in self.processs """ process = self.processes.get(process_id) if not process or not process.namespace: namespace = self.get_namespace(process_id) process = self.create_process( process_id, vpnservice, namespace) self.processes[process_id] = process elif vpnservice: process.update_vpnservice(vpnservice) return process @lockutils.synchronized('vpn-agent', 'neutron-') def sync(self, context, routers): """Sync status with server side. :param context: context object for RPC call :param routers: Router objects which is created in this sync event There could be many failure cases should be considered including the followings. 1) Agent class restarted 2) Failure on process creation 3) VpnService is deleted during agent down 4) RPC failure In order to handle, these failure cases, the driver needs to take sync strategies. """ vpnservices = self.agent_rpc.get_vpn_services_on_host( context, self.host) router_ids = [vpnservice['router_id'] for vpnservice in vpnservices] sync_router_ids = [router['id'] for router in routers] self._sync_vpn_processes(vpnservices, sync_router_ids) self._delete_vpn_processes(sync_router_ids, router_ids) self._cleanup_stale_vpn_processes(router_ids) self.report_status(context) def get_process_status_cache(self, process): if not self.process_status_cache.get(process.id): self.process_status_cache[process.id] = { 'status': None, 'id': process.vpnservice['id'], 'updated_pending_status': False, 'ipsec_site_connections': {}} return self.process_status_cache[process.id] def report_status(self, context): status_changed_vpn_services = [] for process in self.processes.values(): previous_status = self.get_process_status_cache(process) if self.is_status_updated(process, previous_status): new_status = self.copy_process_status(process) self.update_downed_connections(process.id, new_status) status_changed_vpn_services.append(new_status) self.process_status_cache[process.id] = ( self.copy_process_status(process)) # We need unset updated_pending status after it # is reported to the server side self.unset_updated_pending_status(process) if status_changed_vpn_services: self.agent_rpc.update_status(context, status_changed_vpn_services) def _sync_vpn_processes(self, vpnservices, sync_router_ids): for vpnservice in vpnservices: if vpnservice['router_id'] not in self.processes or ( vpnservice['router_id'] in sync_router_ids): process = self.ensure_process(vpnservice['router_id'], vpnservice=vpnservice) router = self.routers.get(vpnservice['router_id']) if not router: continue process.update() def _delete_vpn_processes(self, sync_router_ids, vpn_router_ids): for process_id in sync_router_ids: if process_id not in vpn_router_ids: self.destroy_process(process_id) def _cleanup_stale_vpn_processes(self, vpn_router_ids): process_ids = [pid for pid in self.processes if pid not in vpn_router_ids] for process_id in process_ids: self.destroy_process(process_id) def is_status_updated(self, process, previous_status): if process.updated_pending_status: return True if process.status != previous_status['status']: return True if (process.connection_status != previous_status['ipsec_site_connections']): return True def unset_updated_pending_status(self, process): process.updated_pending_status = False for connection_status in process.connection_status.values(): connection_status['updated_pending_status'] = False def copy_process_status(self, process): return { 'id': process.vpnservice['id'], 'status': process.status, 'updated_pending_status': process.updated_pending_status, 'ipsec_site_connections': copy.deepcopy(process.connection_status) } def update_downed_connections(self, process_id, new_status): """Update info to be reported, if connections just went down. If there is no longer any information for a connection, because it has been removed (e.g. due to an admin down of VPN service or IPSec connection), but there was previous status information for the connection, mark the connection as down for reporting purposes. """ if process_id in self.process_status_cache: for conn in self.process_status_cache[process_id][IPSEC_CONNS]: if conn not in new_status[IPSEC_CONNS]: new_status[IPSEC_CONNS][conn] = { 'status': constants.DOWN, 'updated_pending_status': True } def create_router(self, router): """Handling create router event.""" pass def destroy_router(self, process_id): pass def destroy_process(self, process_id): """Destroy process. Disable the process and remove the process manager for the processes that no longer are running vpn service. """ if process_id in self.processes: process = self.processes[process_id] process.disable() if process_id in self.processes: del self.processes[process_id] def plug_to_ovs(self, context, **kwargs): self.nuage_if_driver.plug(kwargs['network_id'], kwargs['port_id'], kwargs['device_name'], kwargs['mac'], 'alubr0', kwargs['ns_name']) self.nuage_if_driver.init_l3(kwargs['device_name'], kwargs['cidr'], kwargs['ns_name']) device = ip_lib.IPDevice(kwargs['device_name'], namespace=kwargs['ns_name']) for gateway_ip in kwargs['gw_ip']: device.route.add_gateway(gateway_ip) def unplug_from_ovs(self, context, **kwargs): self.nuage_if_driver.unplug(kwargs['device_name'], 'alubr0', kwargs['ns_name']) ip = ip_lib.IPWrapper(kwargs['ns_name']) ip.garbage_collect_namespace() # On Redhat deployments an additional directory is created named # 'ip_vti0' in the namespace which prevents the cleanup # of namespace by the neutron agent in 'ip_lib.py' which we clean. if kwargs['ns_name'] in ip.get_namespaces(): ip.netns.delete(kwargs['ns_name']) class NuageOpenSwanDriver(NuageIPsecDriver): def create_process(self, process_id, vpnservice, namespace): return ipsec.OpenSwanProcess( self.conf, process_id, vpnservice, namespace) class NuageStrongSwanDriver(NuageIPsecDriver): def create_process(self, process_id, vpnservice, namespace): return strongswan_ipsec.StrongSwanProcess( self.conf, process_id, vpnservice, namespace) class NuageStrongSwanDriverFedora(NuageIPsecDriver): def create_process(self, process_id, vpnservice, namespace): return fedora_strongswan_ipsec.FedoraStrongSwanProcess( self.conf, process_id, vpnservice, namespace)
Java
package com.xyp.sapidoc.idoc.enumeration; import java.util.HashSet; import java.util.Set; /** * * @author Yunpeng_Xu */ public enum TagEnum { FIELDS("FIELDS"), RECORD_SECTION("RECORD_SECTION"), CONTROL_RECORD("CONTROL_RECORD"), DATA_RECORD("DATA_RECORD"), STATUS_RECORD("STATUS_RECORD"), SEGMENT_SECTION("SEGMENT_SECTION"), IDOC("IDOC"), SEGMENT("SEGMENT"), GROUP("GROUP"), ; private String tag; private TagEnum(String tag) { this.tag = tag; } public String getTagBegin() { return "BEGIN_" + tag; } public String getTagEnd() { return "END_" + tag; } public static Set<String> getAllTags(){ Set<String> tags = new HashSet<String>(); TagEnum[] tagEnums = TagEnum.values(); for (TagEnum tagEnum : tagEnums) { tags.add(tagEnum.getTagBegin()); tags.add(tagEnum.getTagEnd()); } return tags; } }
Java
/******************************************************************************* * Copyright 2016 Intuit * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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.intuit.wasabi.auditlogobjects; import com.intuit.wasabi.eventlog.events.BucketCreateEvent; import com.intuit.wasabi.eventlog.events.BucketEvent; import com.intuit.wasabi.eventlog.events.ChangeEvent; import com.intuit.wasabi.eventlog.events.EventLogEvent; import com.intuit.wasabi.eventlog.events.ExperimentChangeEvent; import com.intuit.wasabi.eventlog.events.ExperimentCreateEvent; import com.intuit.wasabi.eventlog.events.ExperimentEvent; import com.intuit.wasabi.eventlog.events.SimpleEvent; import com.intuit.wasabi.experimentobjects.Bucket; import com.intuit.wasabi.experimentobjects.Experiment; import org.junit.Assert; import org.junit.Test; import org.mockito.Mockito; import java.lang.reflect.Field; /** * Tests for {@link AuditLogEntryFactory}. */ public class AuditLogEntryFactoryTest { @Test public void testCreateFromEvent() throws Exception { new AuditLogEntryFactory(); EventLogEvent[] events = new EventLogEvent[]{ new SimpleEvent("SimpleEvent"), new ExperimentChangeEvent(Mockito.mock(Experiment.class), "Property", "before", "after"), new ExperimentCreateEvent(Mockito.mock(Experiment.class)), new BucketCreateEvent(Mockito.mock(Experiment.class), Mockito.mock(Bucket.class)) }; Field[] fields = AuditLogEntry.class.getFields(); for (Field field : fields) { field.setAccessible(true); } for (EventLogEvent event : events) { AuditLogEntry aleFactory = AuditLogEntryFactory.createFromEvent(event); AuditLogEntry aleManual = new AuditLogEntry( event.getTime(), event.getUser(), AuditLogAction.getActionForEvent(event), event instanceof ExperimentEvent ? ((ExperimentEvent) event).getExperiment() : null, event instanceof BucketEvent ? ((BucketEvent) event).getBucket().getLabel() : null, event instanceof ChangeEvent ? ((ChangeEvent) event).getPropertyName() : null, event instanceof ChangeEvent ? ((ChangeEvent) event).getBefore() : null, event instanceof ChangeEvent ? ((ChangeEvent) event).getAfter() : null ); for (Field field : fields) { Assert.assertEquals(field.get(aleManual), field.get(aleFactory)); } } } }
Java
package org.artifactory.ui.rest.service.admin.configuration.mail; import org.artifactory.api.config.CentralConfigService; import org.artifactory.descriptor.config.MutableCentralConfigDescriptor; import org.artifactory.rest.common.service.ArtifactoryRestRequest; import org.artifactory.rest.common.service.RestResponse; import org.artifactory.rest.common.service.RestService; import org.artifactory.ui.rest.model.admin.configuration.mail.MailServer; import org.artifactory.ui.rest.service.utils.AolUtils; import org.artifactory.util.HttpUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** * @author Chen Keinan */ @Component @Scope(BeanDefinition.SCOPE_PROTOTYPE) public class GetMailService implements RestService { @Autowired private CentralConfigService centralConfigService; @Override public void execute(ArtifactoryRestRequest request, RestResponse response) { AolUtils.assertNotAol("GetMail"); String contextUrl = HttpUtils.getServletContextUrl(request.getServletRequest()); MailServer mailServer = getMailServerFromConfigDescriptor(contextUrl); // update response with mail server model response.iModel(mailServer); } /** * get mail server from config descriptor and populate data to mail server model * * @return mail server model * @param contextUrl */ private MailServer getMailServerFromConfigDescriptor(String contextUrl) { MutableCentralConfigDescriptor configDescriptor = centralConfigService.getMutableDescriptor(); if (configDescriptor.getMailServer() != null) { return new MailServer(configDescriptor.getMailServer()); } else { MailServer mailServer = new MailServer(); mailServer.setArtifactoryUrl(contextUrl); return mailServer; } } }
Java
from django.conf.urls import patterns, include, url from django.contrib import admin from api import views admin.autodiscover() from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register(r'headings', views.HeadingViewSet) router.register(r'users', views.UserViewSet) urlpatterns = patterns('', url(r'^', include(router.urls)), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')) )
Java
<!DOCTYPE html> <html> <head> <title>OzzA - Apresentação do Layout</title> <meta charset="utf-8" /> <meta lang="pt-BR" /> <meta name="description" content="OzzA - Apresentação do Layout" /> <meta name="keywords" content="OzzA - Apresentação do Layout" /> <meta name="author" content="Mais Interativo" /> <link rel="stylesheet" type="text/css" href="css/style.css" /> </head> <body> <div class="editarperfil-loja-dadospessoais-hover"> <div class="clearfix"></div> </div> </body> </html>
Java
/** * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.hadoop.hive.metastore.api; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; import org.apache.thrift.scheme.TupleScheme; import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.protocol.TProtocolException; import org.apache.thrift.EncodingUtils; import org.apache.thrift.TException; import org.apache.thrift.async.AsyncMethodCallback; import org.apache.thrift.server.AbstractNonblockingServer.*; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import javax.annotation.Generated; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class WriteNotificationLogRequest implements org.apache.thrift.TBase<WriteNotificationLogRequest, WriteNotificationLogRequest._Fields>, java.io.Serializable, Cloneable, Comparable<WriteNotificationLogRequest> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WriteNotificationLogRequest"); private static final org.apache.thrift.protocol.TField TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("txnId", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField WRITE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("writeId", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField DB_FIELD_DESC = new org.apache.thrift.protocol.TField("db", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField FILE_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("fileInfo", org.apache.thrift.protocol.TType.STRUCT, (short)5); private static final org.apache.thrift.protocol.TField PARTITION_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("partitionVals", org.apache.thrift.protocol.TType.LIST, (short)6); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new WriteNotificationLogRequestStandardSchemeFactory()); schemes.put(TupleScheme.class, new WriteNotificationLogRequestTupleSchemeFactory()); } private long txnId; // required private long writeId; // required private String db; // required private String table; // required private InsertEventRequestData fileInfo; // required private List<String> partitionVals; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { TXN_ID((short)1, "txnId"), WRITE_ID((short)2, "writeId"), DB((short)3, "db"), TABLE((short)4, "table"), FILE_INFO((short)5, "fileInfo"), PARTITION_VALS((short)6, "partitionVals"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // TXN_ID return TXN_ID; case 2: // WRITE_ID return WRITE_ID; case 3: // DB return DB; case 4: // TABLE return TABLE; case 5: // FILE_INFO return FILE_INFO; case 6: // PARTITION_VALS return PARTITION_VALS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __TXNID_ISSET_ID = 0; private static final int __WRITEID_ISSET_ID = 1; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.PARTITION_VALS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("txnId", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.WRITE_ID, new org.apache.thrift.meta_data.FieldMetaData("writeId", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.DB, new org.apache.thrift.meta_data.FieldMetaData("db", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.FILE_INFO, new org.apache.thrift.meta_data.FieldMetaData("fileInfo", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InsertEventRequestData.class))); tmpMap.put(_Fields.PARTITION_VALS, new org.apache.thrift.meta_data.FieldMetaData("partitionVals", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WriteNotificationLogRequest.class, metaDataMap); } public WriteNotificationLogRequest() { } public WriteNotificationLogRequest( long txnId, long writeId, String db, String table, InsertEventRequestData fileInfo) { this(); this.txnId = txnId; setTxnIdIsSet(true); this.writeId = writeId; setWriteIdIsSet(true); this.db = db; this.table = table; this.fileInfo = fileInfo; } /** * Performs a deep copy on <i>other</i>. */ public WriteNotificationLogRequest(WriteNotificationLogRequest other) { __isset_bitfield = other.__isset_bitfield; this.txnId = other.txnId; this.writeId = other.writeId; if (other.isSetDb()) { this.db = other.db; } if (other.isSetTable()) { this.table = other.table; } if (other.isSetFileInfo()) { this.fileInfo = new InsertEventRequestData(other.fileInfo); } if (other.isSetPartitionVals()) { List<String> __this__partitionVals = new ArrayList<String>(other.partitionVals); this.partitionVals = __this__partitionVals; } } public WriteNotificationLogRequest deepCopy() { return new WriteNotificationLogRequest(this); } @Override public void clear() { setTxnIdIsSet(false); this.txnId = 0; setWriteIdIsSet(false); this.writeId = 0; this.db = null; this.table = null; this.fileInfo = null; this.partitionVals = null; } public long getTxnId() { return this.txnId; } public void setTxnId(long txnId) { this.txnId = txnId; setTxnIdIsSet(true); } public void unsetTxnId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TXNID_ISSET_ID); } /** Returns true if field txnId is set (has been assigned a value) and false otherwise */ public boolean isSetTxnId() { return EncodingUtils.testBit(__isset_bitfield, __TXNID_ISSET_ID); } public void setTxnIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TXNID_ISSET_ID, value); } public long getWriteId() { return this.writeId; } public void setWriteId(long writeId) { this.writeId = writeId; setWriteIdIsSet(true); } public void unsetWriteId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WRITEID_ISSET_ID); } /** Returns true if field writeId is set (has been assigned a value) and false otherwise */ public boolean isSetWriteId() { return EncodingUtils.testBit(__isset_bitfield, __WRITEID_ISSET_ID); } public void setWriteIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WRITEID_ISSET_ID, value); } public String getDb() { return this.db; } public void setDb(String db) { this.db = db; } public void unsetDb() { this.db = null; } /** Returns true if field db is set (has been assigned a value) and false otherwise */ public boolean isSetDb() { return this.db != null; } public void setDbIsSet(boolean value) { if (!value) { this.db = null; } } public String getTable() { return this.table; } public void setTable(String table) { this.table = table; } public void unsetTable() { this.table = null; } /** Returns true if field table is set (has been assigned a value) and false otherwise */ public boolean isSetTable() { return this.table != null; } public void setTableIsSet(boolean value) { if (!value) { this.table = null; } } public InsertEventRequestData getFileInfo() { return this.fileInfo; } public void setFileInfo(InsertEventRequestData fileInfo) { this.fileInfo = fileInfo; } public void unsetFileInfo() { this.fileInfo = null; } /** Returns true if field fileInfo is set (has been assigned a value) and false otherwise */ public boolean isSetFileInfo() { return this.fileInfo != null; } public void setFileInfoIsSet(boolean value) { if (!value) { this.fileInfo = null; } } public int getPartitionValsSize() { return (this.partitionVals == null) ? 0 : this.partitionVals.size(); } public java.util.Iterator<String> getPartitionValsIterator() { return (this.partitionVals == null) ? null : this.partitionVals.iterator(); } public void addToPartitionVals(String elem) { if (this.partitionVals == null) { this.partitionVals = new ArrayList<String>(); } this.partitionVals.add(elem); } public List<String> getPartitionVals() { return this.partitionVals; } public void setPartitionVals(List<String> partitionVals) { this.partitionVals = partitionVals; } public void unsetPartitionVals() { this.partitionVals = null; } /** Returns true if field partitionVals is set (has been assigned a value) and false otherwise */ public boolean isSetPartitionVals() { return this.partitionVals != null; } public void setPartitionValsIsSet(boolean value) { if (!value) { this.partitionVals = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case TXN_ID: if (value == null) { unsetTxnId(); } else { setTxnId((Long)value); } break; case WRITE_ID: if (value == null) { unsetWriteId(); } else { setWriteId((Long)value); } break; case DB: if (value == null) { unsetDb(); } else { setDb((String)value); } break; case TABLE: if (value == null) { unsetTable(); } else { setTable((String)value); } break; case FILE_INFO: if (value == null) { unsetFileInfo(); } else { setFileInfo((InsertEventRequestData)value); } break; case PARTITION_VALS: if (value == null) { unsetPartitionVals(); } else { setPartitionVals((List<String>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case TXN_ID: return getTxnId(); case WRITE_ID: return getWriteId(); case DB: return getDb(); case TABLE: return getTable(); case FILE_INFO: return getFileInfo(); case PARTITION_VALS: return getPartitionVals(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case TXN_ID: return isSetTxnId(); case WRITE_ID: return isSetWriteId(); case DB: return isSetDb(); case TABLE: return isSetTable(); case FILE_INFO: return isSetFileInfo(); case PARTITION_VALS: return isSetPartitionVals(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof WriteNotificationLogRequest) return this.equals((WriteNotificationLogRequest)that); return false; } public boolean equals(WriteNotificationLogRequest that) { if (that == null) return false; boolean this_present_txnId = true; boolean that_present_txnId = true; if (this_present_txnId || that_present_txnId) { if (!(this_present_txnId && that_present_txnId)) return false; if (this.txnId != that.txnId) return false; } boolean this_present_writeId = true; boolean that_present_writeId = true; if (this_present_writeId || that_present_writeId) { if (!(this_present_writeId && that_present_writeId)) return false; if (this.writeId != that.writeId) return false; } boolean this_present_db = true && this.isSetDb(); boolean that_present_db = true && that.isSetDb(); if (this_present_db || that_present_db) { if (!(this_present_db && that_present_db)) return false; if (!this.db.equals(that.db)) return false; } boolean this_present_table = true && this.isSetTable(); boolean that_present_table = true && that.isSetTable(); if (this_present_table || that_present_table) { if (!(this_present_table && that_present_table)) return false; if (!this.table.equals(that.table)) return false; } boolean this_present_fileInfo = true && this.isSetFileInfo(); boolean that_present_fileInfo = true && that.isSetFileInfo(); if (this_present_fileInfo || that_present_fileInfo) { if (!(this_present_fileInfo && that_present_fileInfo)) return false; if (!this.fileInfo.equals(that.fileInfo)) return false; } boolean this_present_partitionVals = true && this.isSetPartitionVals(); boolean that_present_partitionVals = true && that.isSetPartitionVals(); if (this_present_partitionVals || that_present_partitionVals) { if (!(this_present_partitionVals && that_present_partitionVals)) return false; if (!this.partitionVals.equals(that.partitionVals)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_txnId = true; list.add(present_txnId); if (present_txnId) list.add(txnId); boolean present_writeId = true; list.add(present_writeId); if (present_writeId) list.add(writeId); boolean present_db = true && (isSetDb()); list.add(present_db); if (present_db) list.add(db); boolean present_table = true && (isSetTable()); list.add(present_table); if (present_table) list.add(table); boolean present_fileInfo = true && (isSetFileInfo()); list.add(present_fileInfo); if (present_fileInfo) list.add(fileInfo); boolean present_partitionVals = true && (isSetPartitionVals()); list.add(present_partitionVals); if (present_partitionVals) list.add(partitionVals); return list.hashCode(); } @Override public int compareTo(WriteNotificationLogRequest other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetTxnId()).compareTo(other.isSetTxnId()); if (lastComparison != 0) { return lastComparison; } if (isSetTxnId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnId, other.txnId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetWriteId()).compareTo(other.isSetWriteId()); if (lastComparison != 0) { return lastComparison; } if (isSetWriteId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeId, other.writeId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDb()).compareTo(other.isSetDb()); if (lastComparison != 0) { return lastComparison; } if (isSetDb()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.db, other.db); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); if (lastComparison != 0) { return lastComparison; } if (isSetTable()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetFileInfo()).compareTo(other.isSetFileInfo()); if (lastComparison != 0) { return lastComparison; } if (isSetFileInfo()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileInfo, other.fileInfo); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPartitionVals()).compareTo(other.isSetPartitionVals()); if (lastComparison != 0) { return lastComparison; } if (isSetPartitionVals()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partitionVals, other.partitionVals); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("WriteNotificationLogRequest("); boolean first = true; sb.append("txnId:"); sb.append(this.txnId); first = false; if (!first) sb.append(", "); sb.append("writeId:"); sb.append(this.writeId); first = false; if (!first) sb.append(", "); sb.append("db:"); if (this.db == null) { sb.append("null"); } else { sb.append(this.db); } first = false; if (!first) sb.append(", "); sb.append("table:"); if (this.table == null) { sb.append("null"); } else { sb.append(this.table); } first = false; if (!first) sb.append(", "); sb.append("fileInfo:"); if (this.fileInfo == null) { sb.append("null"); } else { sb.append(this.fileInfo); } first = false; if (isSetPartitionVals()) { if (!first) sb.append(", "); sb.append("partitionVals:"); if (this.partitionVals == null) { sb.append("null"); } else { sb.append(this.partitionVals); } first = false; } sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetTxnId()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'txnId' is unset! Struct:" + toString()); } if (!isSetWriteId()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'writeId' is unset! Struct:" + toString()); } if (!isSetDb()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'db' is unset! Struct:" + toString()); } if (!isSetTable()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'table' is unset! Struct:" + toString()); } if (!isSetFileInfo()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'fileInfo' is unset! Struct:" + toString()); } // check for sub-struct validity if (fileInfo != null) { fileInfo.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class WriteNotificationLogRequestStandardSchemeFactory implements SchemeFactory { public WriteNotificationLogRequestStandardScheme getScheme() { return new WriteNotificationLogRequestStandardScheme(); } } private static class WriteNotificationLogRequestStandardScheme extends StandardScheme<WriteNotificationLogRequest> { public void read(org.apache.thrift.protocol.TProtocol iprot, WriteNotificationLogRequest struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // TXN_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.txnId = iprot.readI64(); struct.setTxnIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // WRITE_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.writeId = iprot.readI64(); struct.setWriteIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // DB if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.db = iprot.readString(); struct.setDbIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // TABLE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.table = iprot.readString(); struct.setTableIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // FILE_INFO if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.fileInfo = new InsertEventRequestData(); struct.fileInfo.read(iprot); struct.setFileInfoIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // PARTITION_VALS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list812 = iprot.readListBegin(); struct.partitionVals = new ArrayList<String>(_list812.size); String _elem813; for (int _i814 = 0; _i814 < _list812.size; ++_i814) { _elem813 = iprot.readString(); struct.partitionVals.add(_elem813); } iprot.readListEnd(); } struct.setPartitionValsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, WriteNotificationLogRequest struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(TXN_ID_FIELD_DESC); oprot.writeI64(struct.txnId); oprot.writeFieldEnd(); oprot.writeFieldBegin(WRITE_ID_FIELD_DESC); oprot.writeI64(struct.writeId); oprot.writeFieldEnd(); if (struct.db != null) { oprot.writeFieldBegin(DB_FIELD_DESC); oprot.writeString(struct.db); oprot.writeFieldEnd(); } if (struct.table != null) { oprot.writeFieldBegin(TABLE_FIELD_DESC); oprot.writeString(struct.table); oprot.writeFieldEnd(); } if (struct.fileInfo != null) { oprot.writeFieldBegin(FILE_INFO_FIELD_DESC); struct.fileInfo.write(oprot); oprot.writeFieldEnd(); } if (struct.partitionVals != null) { if (struct.isSetPartitionVals()) { oprot.writeFieldBegin(PARTITION_VALS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.partitionVals.size())); for (String _iter815 : struct.partitionVals) { oprot.writeString(_iter815); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class WriteNotificationLogRequestTupleSchemeFactory implements SchemeFactory { public WriteNotificationLogRequestTupleScheme getScheme() { return new WriteNotificationLogRequestTupleScheme(); } } private static class WriteNotificationLogRequestTupleScheme extends TupleScheme<WriteNotificationLogRequest> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, WriteNotificationLogRequest struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeI64(struct.txnId); oprot.writeI64(struct.writeId); oprot.writeString(struct.db); oprot.writeString(struct.table); struct.fileInfo.write(oprot); BitSet optionals = new BitSet(); if (struct.isSetPartitionVals()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetPartitionVals()) { { oprot.writeI32(struct.partitionVals.size()); for (String _iter816 : struct.partitionVals) { oprot.writeString(_iter816); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, WriteNotificationLogRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.txnId = iprot.readI64(); struct.setTxnIdIsSet(true); struct.writeId = iprot.readI64(); struct.setWriteIdIsSet(true); struct.db = iprot.readString(); struct.setDbIsSet(true); struct.table = iprot.readString(); struct.setTableIsSet(true); struct.fileInfo = new InsertEventRequestData(); struct.fileInfo.read(iprot); struct.setFileInfoIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list817 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.partitionVals = new ArrayList<String>(_list817.size); String _elem818; for (int _i819 = 0; _i819 < _list817.size; ++_i819) { _elem818 = iprot.readString(); struct.partitionVals.add(_elem818); } } struct.setPartitionValsIsSet(true); } } } }
Java
// // Ingredient.cs // // Author: // Benito Palacios <benito356@gmail.com> // // Copyright (c) 2015 Benito Palacios // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. using System; namespace Downlitor { public struct Ingredient { public Ingredient(string name, int quantity) : this() { Name = name; Quantity = quantity; } public Ingredient(int itemId, int quantity) : this() { Name = ItemManager.Instance.GetItem(itemId); Quantity = quantity; } public string Name { get; private set; } public int Quantity { get; private set; } public override string ToString() { return string.Format("{0} (x{1})", Name, Quantity); } } }
Java
/* * Copyright (c) 2009, Rickard Öberg. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.qi4j.bootstrap; /** * Base class for assembly visitors. Subclass and override * the particular methods you are interested in. */ public class AssemblyVisitorAdapter<ThrowableType extends Throwable> implements AssemblyVisitor<ThrowableType> { public void visitApplication( ApplicationAssembly assembly ) throws ThrowableType { } public void visitLayer( LayerAssembly assembly ) throws ThrowableType { } public void visitModule( ModuleAssembly assembly ) throws ThrowableType { } public void visitComposite( TransientDeclaration declaration ) throws ThrowableType { } public void visitEntity( EntityDeclaration declaration ) throws ThrowableType { } public void visitService( ServiceDeclaration declaration ) throws ThrowableType { } public void visitImportedService( ImportedServiceDeclaration declaration ) throws ThrowableType { } public void visitValue( ValueDeclaration declaration ) throws ThrowableType { } public void visitObject( ObjectDeclaration declaration ) throws ThrowableType { } }
Java
package com.ctrip.framework.cs.enterprise; import com.ctrip.framework.cs.configuration.ConfigurationManager; import com.ctrip.framework.cs.configuration.InitConfigurationException; import com.ctrip.framework.cs.util.HttpUtil; import com.ctrip.framework.cs.util.PomUtil; import com.google.gson.Gson; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.net.HttpURLConnection; import java.net.URL; /** * Created by jiang.j on 2016/10/20. */ public class NexusEnMaven implements EnMaven { class NexusPomInfo{ String groupId; String artifactId; String version; } class RepoDetail{ String repositoryURL; String repositoryKind; } class SearchResult{ RepoDetail[] repoDetails; NexusPomInfo[] data; } class ResourceResult{ ResourceInfo[] data; } class ResourceInfo{ String text; } Logger logger = LoggerFactory.getLogger(getClass()); private InputStream getContentByName(String[] av,String fileName) throws InitConfigurationException { InputStream rtn = null; String endsWith = ".pom"; if(av == null && fileName == null){ return null; }else if(av==null) { endsWith = "-sources.jar"; av = PomUtil.getArtifactIdAndVersion(fileName); } if(av == null){ return null; } String searchUrl = (ConfigurationManager.getConfigInstance().getString("vi.maven.repository.url") + "/nexus/service/local/lucene/search?a=" + av[0] + "&v=" + av[1]); if(av.length >2){ searchUrl += "&g="+av[2]; } logger.debug(searchUrl); try { URL url = new URL(searchUrl); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setConnectTimeout(200); conn.setReadTimeout(500); conn.setRequestMethod("GET"); conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8"); conn.setRequestProperty("Accept", "application/json"); try (Reader rd = new InputStreamReader(conn.getInputStream(), "UTF-8")) { Gson gson = new Gson(); SearchResult results = gson.fromJson(rd, SearchResult.class); if(results.repoDetails!=null && results.data !=null && results.repoDetails.length>0 && results.data.length>0){ NexusPomInfo pomInfo = results.data[0]; String repositoryUrl = null; if(results.repoDetails.length>1){ for(RepoDetail repoDetail:results.repoDetails){ if("hosted".equalsIgnoreCase(repoDetail.repositoryKind)){ repositoryUrl = repoDetail.repositoryURL; break; } } } if(repositoryUrl == null) { repositoryUrl = results.repoDetails[0].repositoryURL; } String pomUrl = repositoryUrl +"/content/"+pomInfo.groupId.replace(".","/")+"/"+pomInfo.artifactId+"/" +pomInfo.version+"/"; if(fileName == null){ ResourceResult resourceResult = HttpUtil.doGet(new URL(pomUrl), ResourceResult.class); for(ResourceInfo rinfo:resourceResult.data){ if(rinfo.text.endsWith(endsWith) && ( fileName == null || fileName.compareTo(rinfo.text)>0)){ fileName = rinfo.text; } } pomUrl += fileName; }else { pomUrl += fileName + endsWith; } logger.debug(pomUrl); HttpURLConnection pomConn = (HttpURLConnection) new URL(pomUrl).openConnection(); pomConn.setRequestMethod("GET"); rtn = pomConn.getInputStream(); } } }catch (Throwable e){ logger.warn("get pominfo by jar name["+av[0] + ' '+av[1]+"] failed",e); } return rtn; } @Override public InputStream getPomInfoByFileName(String[] av, String fileName) { try { return getContentByName(av, fileName); }catch (Throwable e){ logger.warn("getPomInfoByFileName failed!",e); return null; } } @Override public InputStream getSourceJarByFileName(String fileName) { try { return getContentByName(null,fileName); }catch (Throwable e){ logger.warn("getPomInfoByFileName failed!",e); return null; } } }
Java
<div class="navbar-default sidebar" role="navigation"> <div class="sidebar-nav navbar-collapse collapse"> <ul class="nav in" id="side-menu"> <!--<sidebar-search></sidebar-search>--> <li> <a href="" style="border:none; text-align:left;" class="btn btn-default" ng-click="showAbout=!showAbout"><i class="fa fa-question-circle"></i> Help</a> </li> <li> <a ui-sref="main.dashboard" ui-sref-active-if="main.dashboard"> Dashboard</a> </li> <li id="Explore" ng-class="{active: Explore}"> <a href="" ng-click="Explore=!Explore"> <!--<i class="fa fa-sitemap fa-fw"></i> --> Explore<span class="fa arrow"></span></a> <ul class="nav nav-second-level" uib-collapse="!Explore"> <li> <a ui-sref="main.explore" ui-sref-active-if="main.explore"> Explore risks </a> </li> <li> <a target="_blank" href="http://www.pubmed.gov"> Search PubMed </a> </li> <!--<li>--> <!-- <a ui-sref="main.mineLiterature" ui-sref-active-if="main.mineLiterature"> Mine literature </a>--> <!--</li>--> </ul> </li> <li id="carreElements" ng-class="{active: carreElements}"> <a href="" ng-click="carreElements=!carreElements"> <!--<i class="fa fa-sitemap fa-fw"></i> --> CARRE elements<span class="fa arrow"></span></a> <ul class="nav nav-second-level" uib-collapse="!carreElements"> <li> <a ui-sref="main.risk_factors.list" ui-sref-active-if="main.risk_factors"> Risk Factors </a> </li> <li> <a ui-sref="main.risk_evidences.list" ui-sref-active-if="main.risk_evidences"> Risk Evidences </a> </li> <li> <a ui-sref="main.risk_elements.list" ui-sref-active-if="main.risk_elements"> Risk Elements </a> </li> <li> <a ui-sref="main.observables.list" ui-sref-active-if="main.observables"> Observables </a> </li> <li> <a ui-sref="main.citations.list" ui-sref-active-if="main.citations"> Citations </a> </li> <li> <a ui-sref="main.measurement_types.list" ui-sref-active-if="main.measurement_types"> Measurement Types </a> </li> </ul> </li> <li> <a ui-sref="main.medical_experts.list" ui-sref-active-if="main.medical_experts"> Medical experts </a> </li> </ul> </div> <!-- /.sidebar-collapse --> <div pageslide ps-size="{{slideWidth}}px" ps-open="showAbout" ps-side="right"> <div class="row" style="padding:30px; padding-top:15px; padding-bottom:0; margin-bottom:0;"> <a href="" ng-click="showAbout=!showAbout" class="btn btn-primary pull-left"><i class="fa fa-times fa-lg"></i></a> </div> <div class="row" style="padding:50px; margin-top:0; padding-top:0; overflow: auto; height: 90%;"> <div autoscroll ng-include src="'app/about/about.html'"></div> </div> </div> </div>
Java
# # Copyright 2013 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import functools import logbook import math import numpy as np import numpy.linalg as la from six import iteritems from zipline.finance import trading import pandas as pd from . import risk from . risk import ( alpha, check_entry, information_ratio, sharpe_ratio, sortino_ratio, ) log = logbook.Logger('Risk Period') choose_treasury = functools.partial(risk.choose_treasury, risk.select_treasury_duration) class RiskMetricsPeriod(object): def __init__(self, start_date, end_date, returns, benchmark_returns=None): treasury_curves = trading.environment.treasury_curves if treasury_curves.index[-1] >= start_date: mask = ((treasury_curves.index >= start_date) & (treasury_curves.index <= end_date)) self.treasury_curves = treasury_curves[mask] else: # our test is beyond the treasury curve history # so we'll use the last available treasury curve self.treasury_curves = treasury_curves[-1:] self.start_date = start_date self.end_date = end_date if benchmark_returns is None: br = trading.environment.benchmark_returns benchmark_returns = br[(br.index >= returns.index[0]) & (br.index <= returns.index[-1])] self.algorithm_returns = self.mask_returns_to_period(returns) self.benchmark_returns = self.mask_returns_to_period(benchmark_returns) self.calculate_metrics() def calculate_metrics(self): self.benchmark_period_returns = \ self.calculate_period_returns(self.benchmark_returns) self.algorithm_period_returns = \ self.calculate_period_returns(self.algorithm_returns) if not self.algorithm_returns.index.equals( self.benchmark_returns.index ): message = "Mismatch between benchmark_returns ({bm_count}) and \ algorithm_returns ({algo_count}) in range {start} : {end}" message = message.format( bm_count=len(self.benchmark_returns), algo_count=len(self.algorithm_returns), start=self.start_date, end=self.end_date ) raise Exception(message) self.num_trading_days = len(self.benchmark_returns) self.benchmark_volatility = self.calculate_volatility( self.benchmark_returns) self.algorithm_volatility = self.calculate_volatility( self.algorithm_returns) self.treasury_period_return = choose_treasury( self.treasury_curves, self.start_date, self.end_date ) self.sharpe = self.calculate_sharpe() self.sortino = self.calculate_sortino() self.information = self.calculate_information() self.beta, self.algorithm_covariance, self.benchmark_variance, \ self.condition_number, self.eigen_values = self.calculate_beta() self.alpha = self.calculate_alpha() self.excess_return = self.algorithm_period_returns - \ self.treasury_period_return self.max_drawdown = self.calculate_max_drawdown() def to_dict(self): """ Creates a dictionary representing the state of the risk report. Returns a dict object of the form: """ period_label = self.end_date.strftime("%Y-%m") rval = { 'trading_days': self.num_trading_days, 'benchmark_volatility': self.benchmark_volatility, 'algo_volatility': self.algorithm_volatility, 'treasury_period_return': self.treasury_period_return, 'algorithm_period_return': self.algorithm_period_returns, 'benchmark_period_return': self.benchmark_period_returns, 'sharpe': self.sharpe, 'sortino': self.sortino, 'information': self.information, 'beta': self.beta, 'alpha': self.alpha, 'excess_return': self.excess_return, 'max_drawdown': self.max_drawdown, 'period_label': period_label } return {k: None if check_entry(k, v) else v for k, v in iteritems(rval)} def __repr__(self): statements = [] metrics = [ "algorithm_period_returns", "benchmark_period_returns", "excess_return", "num_trading_days", "benchmark_volatility", "algorithm_volatility", "sharpe", "sortino", "information", "algorithm_covariance", "benchmark_variance", "beta", "alpha", "max_drawdown", "algorithm_returns", "benchmark_returns", "condition_number", "eigen_values" ] for metric in metrics: value = getattr(self, metric) statements.append("{m}:{v}".format(m=metric, v=value)) return '\n'.join(statements) def mask_returns_to_period(self, daily_returns): if isinstance(daily_returns, list): returns = pd.Series([x.returns for x in daily_returns], index=[x.date for x in daily_returns]) else: # otherwise we're receiving an index already returns = daily_returns trade_days = trading.environment.trading_days trade_day_mask = returns.index.normalize().isin(trade_days) mask = ((returns.index >= self.start_date) & (returns.index <= self.end_date) & trade_day_mask) returns = returns[mask] return returns def calculate_period_returns(self, returns): period_returns = (1. + returns).prod() - 1 return period_returns def calculate_volatility(self, daily_returns): return np.std(daily_returns, ddof=1) * math.sqrt(self.num_trading_days) def calculate_sharpe(self): """ http://en.wikipedia.org/wiki/Sharpe_ratio """ return sharpe_ratio(self.algorithm_volatility, self.algorithm_period_returns, self.treasury_period_return) def calculate_sortino(self, mar=None): """ http://en.wikipedia.org/wiki/Sortino_ratio """ if mar is None: mar = self.treasury_period_return return sortino_ratio(self.algorithm_returns, self.algorithm_period_returns, mar) def calculate_information(self): """ http://en.wikipedia.org/wiki/Information_ratio """ return information_ratio(self.algorithm_returns, self.benchmark_returns) def calculate_beta(self): """ .. math:: \\beta_a = \\frac{\mathrm{Cov}(r_a,r_p)}{\mathrm{Var}(r_p)} http://en.wikipedia.org/wiki/Beta_(finance) """ # it doesn't make much sense to calculate beta for less than two days, # so return none. if len(self.algorithm_returns) < 2: return 0.0, 0.0, 0.0, 0.0, [] returns_matrix = np.vstack([self.algorithm_returns, self.benchmark_returns]) C = np.cov(returns_matrix, ddof=1) eigen_values = la.eigvals(C) condition_number = max(eigen_values) / min(eigen_values) algorithm_covariance = C[0][1] benchmark_variance = C[1][1] beta = algorithm_covariance / benchmark_variance return ( beta, algorithm_covariance, benchmark_variance, condition_number, eigen_values ) def calculate_alpha(self): """ http://en.wikipedia.org/wiki/Alpha_(investment) """ return alpha(self.algorithm_period_returns, self.treasury_period_return, self.benchmark_period_returns, self.beta) def calculate_max_drawdown(self): compounded_returns = [] cur_return = 0.0 for r in self.algorithm_returns: try: cur_return += math.log(1.0 + r) # this is a guard for a single day returning -100% except ValueError: log.debug("{cur} return, zeroing the returns".format( cur=cur_return)) cur_return = 0.0 # BUG? Shouldn't this be set to log(1.0 + 0) ? compounded_returns.append(cur_return) cur_max = None max_drawdown = None for cur in compounded_returns: if cur_max is None or cur > cur_max: cur_max = cur drawdown = (cur - cur_max) if max_drawdown is None or drawdown < max_drawdown: max_drawdown = drawdown if max_drawdown is None: return 0.0 return 1.0 - math.exp(max_drawdown)
Java
/* * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ /* * This code was generated by https://github.com/googleapis/google-api-java-client-services/ * Modify at your own risk. */ package com.google.api.services.speech.v1.model; /** * Word-specific information for recognized words. * * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is * transmitted over HTTP when working with the Cloud Speech-to-Text API. For a detailed explanation * see: * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> * </p> * * @author Google, Inc. */ @SuppressWarnings("javadoc") public final class WordInfo extends com.google.api.client.json.GenericJson { /** * The confidence estimate between 0.0 and 1.0. A higher number indicates an estimated greater * likelihood that the recognized words are correct. This field is set only for the top * alternative of a non-streaming result or, of a streaming result where `is_final=true`. This * field is not guaranteed to be accurate and users should not rely on it to be always provided. * The default of 0.0 is a sentinel value indicating `confidence` was not set. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.Float confidence; /** * Time offset relative to the beginning of the audio, and corresponding to the end of the spoken * word. This field is only set if `enable_word_time_offsets=true` and only in the top hypothesis. * This is an experimental feature and the accuracy of the time offset can vary. * The value may be {@code null}. */ @com.google.api.client.util.Key private String endTime; /** * Output only. A distinct integer value is assigned for every speaker within the audio. This * field specifies which one of those speakers was detected to have spoken this word. Value ranges * from '1' to diarization_speaker_count. speaker_tag is set if enable_speaker_diarization = * 'true' and only in the top alternative. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.Integer speakerTag; /** * Time offset relative to the beginning of the audio, and corresponding to the start of the * spoken word. This field is only set if `enable_word_time_offsets=true` and only in the top * hypothesis. This is an experimental feature and the accuracy of the time offset can vary. * The value may be {@code null}. */ @com.google.api.client.util.Key private String startTime; /** * The word corresponding to this set of information. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String word; /** * The confidence estimate between 0.0 and 1.0. A higher number indicates an estimated greater * likelihood that the recognized words are correct. This field is set only for the top * alternative of a non-streaming result or, of a streaming result where `is_final=true`. This * field is not guaranteed to be accurate and users should not rely on it to be always provided. * The default of 0.0 is a sentinel value indicating `confidence` was not set. * @return value or {@code null} for none */ public java.lang.Float getConfidence() { return confidence; } /** * The confidence estimate between 0.0 and 1.0. A higher number indicates an estimated greater * likelihood that the recognized words are correct. This field is set only for the top * alternative of a non-streaming result or, of a streaming result where `is_final=true`. This * field is not guaranteed to be accurate and users should not rely on it to be always provided. * The default of 0.0 is a sentinel value indicating `confidence` was not set. * @param confidence confidence or {@code null} for none */ public WordInfo setConfidence(java.lang.Float confidence) { this.confidence = confidence; return this; } /** * Time offset relative to the beginning of the audio, and corresponding to the end of the spoken * word. This field is only set if `enable_word_time_offsets=true` and only in the top hypothesis. * This is an experimental feature and the accuracy of the time offset can vary. * @return value or {@code null} for none */ public String getEndTime() { return endTime; } /** * Time offset relative to the beginning of the audio, and corresponding to the end of the spoken * word. This field is only set if `enable_word_time_offsets=true` and only in the top hypothesis. * This is an experimental feature and the accuracy of the time offset can vary. * @param endTime endTime or {@code null} for none */ public WordInfo setEndTime(String endTime) { this.endTime = endTime; return this; } /** * Output only. A distinct integer value is assigned for every speaker within the audio. This * field specifies which one of those speakers was detected to have spoken this word. Value ranges * from '1' to diarization_speaker_count. speaker_tag is set if enable_speaker_diarization = * 'true' and only in the top alternative. * @return value or {@code null} for none */ public java.lang.Integer getSpeakerTag() { return speakerTag; } /** * Output only. A distinct integer value is assigned for every speaker within the audio. This * field specifies which one of those speakers was detected to have spoken this word. Value ranges * from '1' to diarization_speaker_count. speaker_tag is set if enable_speaker_diarization = * 'true' and only in the top alternative. * @param speakerTag speakerTag or {@code null} for none */ public WordInfo setSpeakerTag(java.lang.Integer speakerTag) { this.speakerTag = speakerTag; return this; } /** * Time offset relative to the beginning of the audio, and corresponding to the start of the * spoken word. This field is only set if `enable_word_time_offsets=true` and only in the top * hypothesis. This is an experimental feature and the accuracy of the time offset can vary. * @return value or {@code null} for none */ public String getStartTime() { return startTime; } /** * Time offset relative to the beginning of the audio, and corresponding to the start of the * spoken word. This field is only set if `enable_word_time_offsets=true` and only in the top * hypothesis. This is an experimental feature and the accuracy of the time offset can vary. * @param startTime startTime or {@code null} for none */ public WordInfo setStartTime(String startTime) { this.startTime = startTime; return this; } /** * The word corresponding to this set of information. * @return value or {@code null} for none */ public java.lang.String getWord() { return word; } /** * The word corresponding to this set of information. * @param word word or {@code null} for none */ public WordInfo setWord(java.lang.String word) { this.word = word; return this; } @Override public WordInfo set(String fieldName, Object value) { return (WordInfo) super.set(fieldName, value); } @Override public WordInfo clone() { return (WordInfo) super.clone(); } }
Java
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ #import "TiProxy.h" #import "TiAnimation.h" #import "TiGradient.h" #import "LayoutConstraint.h" //By declaring a scrollView protocol, TiUITextWidget can access @class TiUIView; /** The protocol for scrolling. */ @protocol TiScrolling /** Tells the scroll view that keyboard did show. @param keyboardTop The keyboard height. */ -(void)keyboardDidShowAtHeight:(CGFloat)keyboardTop; /** Tells the scroll view to scroll to make the specified view visible. @param firstResponderView The view to make visible. @param keyboardTop The keyboard height. */ -(void)scrollToShowView:(TiUIView *)firstResponderView withKeyboardHeight:(CGFloat)keyboardTop; @end void InsetScrollViewForKeyboard(UIScrollView * scrollView,CGFloat keyboardTop,CGFloat minimumContentHeight); void OffsetScrollViewForRect(UIScrollView * scrollView,CGFloat keyboardTop,CGFloat minimumContentHeight,CGRect responderRect); void ModifyScrollViewForKeyboardHeightAndContentHeightWithResponderRect(UIScrollView * scrollView,CGFloat keyboardTop,CGFloat minimumContentHeight,CGRect responderRect); @class TiViewProxy; /** Base class for all Symble views. @see TiViewProxy */ @interface TiUIView : UIView<TiProxyDelegate,LayoutAutosizing> { @protected BOOL configurationSet; @private TiProxy *proxy; TiAnimation *animation; CALayer *gradientLayer; CGAffineTransform virtualParentTransform; id transformMatrix; BOOL childrenInitialized; BOOL touchEnabled; unsigned int animationDelayGuard; // Touch detection BOOL changedInteraction; BOOL handlesTouches; UIView *touchDelegate; // used for touch delegate forwarding BOOL animating; UITapGestureRecognizer* singleTapRecognizer; UITapGestureRecognizer* doubleTapRecognizer; UITapGestureRecognizer* twoFingerTapRecognizer; UIPinchGestureRecognizer* pinchRecognizer; UISwipeGestureRecognizer* leftSwipeRecognizer; UISwipeGestureRecognizer* rightSwipeRecognizer; UISwipeGestureRecognizer* upSwipeRecognizer; UISwipeGestureRecognizer* downSwipeRecognizer; UILongPressGestureRecognizer* longPressRecognizer; //Resizing handling CGSize oldSize; // Image capping/backgrounds id backgroundImage; BOOL backgroundRepeat; TiDimension leftCap; TiDimension topCap; } /** Returns current status of the view animation. @return _YES_ if view is being animated, _NO_ otherwise. */ -(BOOL)animating; /** Provides access to a proxy object of the view. */ @property(nonatomic,readwrite,assign) TiProxy *proxy; /** Provides access to touch delegate of the view. Touch delegate is the control that receives all touch events. */ @property(nonatomic,readwrite,assign) UIView *touchDelegate; /** Returns view's transformation matrix. */ @property(nonatomic,readonly) id transformMatrix; /** Provides access to background image of the view. */ @property(nonatomic,readwrite,retain) id backgroundImage; /** Returns enablement of touch events. @see updateTouchHandling */ @property(nonatomic,readonly) BOOL touchEnabled; @property(nonatomic,readonly) UITapGestureRecognizer* singleTapRecognizer; @property(nonatomic,readonly) UITapGestureRecognizer* doubleTapRecognizer; @property(nonatomic,readonly) UITapGestureRecognizer* twoFingerTapRecognizer; @property(nonatomic,readonly) UIPinchGestureRecognizer* pinchRecognizer; @property(nonatomic,readonly) UISwipeGestureRecognizer* leftSwipeRecognizer; @property(nonatomic,readonly) UISwipeGestureRecognizer* rightSwipeRecognizer; @property(nonatomic,readonly) UILongPressGestureRecognizer* longPressRecognizer; -(void)configureGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer; - (UIGestureRecognizer *)gestureRecognizerForEvent:(NSString *)event; /** Returns CA layer for the background of the view. */ -(CALayer *)backgroundImageLayer; /** Tells the view to start specified animation. @param newAnimation The animation to start. */ -(void)animate:(TiAnimation *)newAnimation; #pragma mark Framework /** Performs view's initialization procedure. */ -(void)initializeState; /** Performs view's configuration procedure. */ -(void)configurationSet; /** Sets virtual parent transformation for the view. @param newTransform The transformation to set. */ -(void)setVirtualParentTransform:(CGAffineTransform)newTransform; -(void)setTransform_:(id)matrix; /* Tells the view to load an image. @param image The string referring the image. @return The loaded image. */ -(UIImage*)loadImage:(id)image; -(id)proxyValueForKey:(NSString *)key; -(void)readProxyValuesWithKeys:(id<NSFastEnumeration>)keys; /* Tells the view to change its proxy to the new one provided. @param newProxy The new proxy to set on the view. */ -(void)transferProxy:(TiViewProxy*)newProxy; /** Tells the view to update its touch handling state. @see touchEnabled */ -(void)updateTouchHandling; /** Tells the view that its frame and/or bounds has chnaged. @param frame The frame rect @param bounds The bounds rect */ -(void)frameSizeChanged:(CGRect)frame bounds:(CGRect)bounds; /** Tells the view to make its root view a first responder. */ -(void)makeRootViewFirstResponder; -(void)animationCompleted; /** The convenience method to raise an exception for the view. @param reason The exception reason. @param subreason The exception subreason. @param location The exception location. */ +(void)throwException:(NSString *) reason subreason:(NSString*)subreason location:(NSString *)location; -(void)throwException:(NSString *) reason subreason:(NSString*)subreason location:(NSString *)location; /** Returns default enablement for interactions. Subclasses may override. @return _YES_ if the control has interactions enabled by default, _NO_ otherwise. */ -(BOOL)interactionDefault; -(BOOL)interactionEnabled; /** Whether or not the view has any touchable listeners attached. @return _YES_ if the control has any touchable listener attached, _NO_ otherwise. */ -(BOOL)hasTouchableListener; -(void)handleControlEvents:(UIControlEvents)events; -(void)setVisible_:(id)visible; -(UIView *)gradientWrapperView; -(void)checkBounds; /** Whether or not a view not normally picked up by the Symble view hierarchy (such as wrapped iOS UIViews) was touched. @return _YES_ if the view contains specialized content (such as a system view) which should register as a touch for this view, _NO_ otherwise. */ -(BOOL)touchedContentViewWithEvent:(UIEvent*)event; - (void)processTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; - (void)processTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event; - (void)processTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event; - (void)processTouchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event; @end #pragma mark TO REMOVE, used only during transition. #define USE_PROXY_FOR_METHOD(resultType,methodname,inputType) \ -(resultType)methodname:(inputType)value \ { \ DeveloperLog(@"[DEBUG] Using view proxy via redirection instead of directly for %@.",self); \ return [(TiViewProxy *)[self proxy] methodname:value]; \ } #define USE_PROXY_FOR_VERIFY_AUTORESIZING USE_PROXY_FOR_METHOD(UIViewAutoresizing,verifyAutoresizing,UIViewAutoresizing)
Java
<!doctype html> <html class="theme-next use-motion "> <head> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/> <meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css"/> <link href="//fonts.googleapis.com/css?family=Lato:300,400,700,400italic&subset=latin,latin-ext" rel="stylesheet" type="text/css"> <link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" /> <link href="/css/main.css?v=0.4.5.2" rel="stylesheet" type="text/css" /> <meta name="keywords" content="Hexo, NexT" /> <link rel="alternate" href="http://AfirSraftGarrier.github.io/atom.xml" title="酷我酷" type="application/atom+xml" /> <link rel="shortcut icon" type="image/x-icon" href="/images/favicon.png?v=0.4.5.2" /> <meta name="description" content="分享即帮助"> <meta property="og:type" content="website"> <meta property="og:title" content="酷我酷"> <meta property="og:url" content="http://www.kuwoku.com/tags/CDN/index.html"> <meta property="og:site_name" content="酷我酷"> <meta property="og:description" content="分享即帮助"> <meta name="twitter:card" content="summary"> <meta name="twitter:title" content="酷我酷"> <meta name="twitter:description" content="分享即帮助"> <script type="text/javascript" id="hexo.configuration"> var CONFIG = { scheme: '', sidebar: 'post', motion: true }; </script> <title> 标签: CDN | 酷我酷 </title> </head> <body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans"> <!--[if lte IE 8]> <div style=' clear: both; height: 59px; padding:0 0 0 15px; position: relative;margin:0 auto;'> <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode"> <img src="http://7u2nvr.com1.z0.glb.clouddn.com/picouterie.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today or use other browser ,like chrome firefox safari." style='margin-left:auto;margin-right:auto;display: block;'/> </a> </div> <![endif]--> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-57622011-1', 'auto'); ga('send', 'pageview'); </script> <script type="text/javascript"> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?227bdbffbd87a1ca50e432dcc6b0960e"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <div class="container one-column "> <div class="headband"></div> <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"><div class="site-meta "> <div class="custom-logo-site-title"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <span class="site-title">酷我酷</span> <span class="logo-line-after"><i></i></span> </a> </div> <p class="site-subtitle" style="border-bottom:none;cursor:pointer" onclick='javascript:(function() { function c() { var e = document.createElement("link"); e.setAttribute("type", "text/css"); e.setAttribute("rel", "stylesheet"); e.setAttribute("href", f); e.setAttribute("class", l); document.body.appendChild(e) } function h() { var e = document.getElementsByClassName(l); for (var t = 0; t < e.length; t++) { document.body.removeChild(e[t]) } } function p() { var e = document.createElement("div"); e.setAttribute("class", a); document.body.appendChild(e); setTimeout(function() { document.body.removeChild(e) }, 100) } function d(e) { return { height : e.offsetHeight, width : e.offsetWidth } } function v(i) { var s = d(i); return s.height > e && s.height < n && s.width > t && s.width < r } function m(e) { var t = e; var n = 0; while (!!t) { n += t.offsetTop; t = t.offsetParent } return n } function g() { var e = document.documentElement; if (!!window.innerWidth) { return window.innerHeight } else if (e && !isNaN(e.clientHeight)) { return e.clientHeight } return 0 } function y() { if (window.pageYOffset) { return window.pageYOffset } return Math.max(document.documentElement.scrollTop, document.body.scrollTop) } function E(e) { var t = m(e); return t >= w && t <= b + w } function S() { var e = document.createElement("audio"); e.setAttribute("class", l); e.src = i; e.loop = false; e.addEventListener("canplay", function() { setTimeout(function() { x(k) }, 500); setTimeout(function() { N(); p(); for (var e = 0; e < O.length; e++) { T(O[e]) } }, 15500) }, true); e.addEventListener("ended", function() { N(); h() }, true); e.innerHTML = " <p>If you are reading this, it is because your browser does not support the audio element. We recommend that you get a new browser.</p> <p>"; document.body.appendChild(e); e.play() } function x(e) { e.className += " " + s + " " + o } function T(e) { e.className += " " + s + " " + u[Math.floor(Math.random() * u.length)] } function N() { var e = document.getElementsByClassName(s); var t = new RegExp("\\b" + s + "\\b"); for (var n = 0; n < e.length; ) { e[n].className = e[n].className.replace(t, "") } } var e = 30; var t = 30; var n = 350; var r = 350; var i = "//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake.mp3"; var s = "mw-harlem_shake_me"; var o = "im_first"; var u = ["im_drunk", "im_baked", "im_trippin", "im_blown"]; var a = "mw-strobe_light"; var f = "//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake-style.css"; var l = "mw_added_css"; var b = g(); var w = y(); var C = document.getElementsByTagName("*"); var k = null; for (var L = 0; L < C.length; L++) { var A = C[L]; if (v(A)) { if (E(A)) { k = A; break } } } if (A === null) { console.warn("Could not find a node of the right size. Please try a different page."); return } c(); S(); var O = []; for (var L = 0; L < C.length; L++) { var A = C[L]; if (v(A)) { O.push(A) } } })() '>给世界酷出我的酷</p> </div> <div class="site-nav-toggle"> <button> <span class="btn-bar"></span> <span class="btn-bar"></span> <span class="btn-bar"></span> </button> </div> <nav class="site-nav"> <ul id="menu" class="menu menu-left"> <li class="menu-item menu-item-home"> <a href="/" rel="section"> <i class="menu-item-icon fa fa-home fa-fw"></i> <br /> 首页 </a> </li> <li class="menu-item menu-item-categories"> <a href="/categories" rel="section"> <i class="menu-item-icon fa fa-th fa-fw"></i> <br /> 分类 </a> </li> <li class="menu-item menu-item-about"> <a href="/about" rel="section"> <i class="menu-item-icon fa fa-user fa-fw"></i> <br /> 关于 </a> </li> <li class="menu-item menu-item-archives"> <a href="/archives" rel="section"> <i class="menu-item-icon fa fa-archive fa-fw"></i> <br /> 归档 </a> </li> <li class="menu-item menu-item-tags"> <a href="/tags" rel="section"> <i class="menu-item-icon fa fa-tags fa-fw"></i> <br /> 标签 </a> </li> <li class="menu-item menu-item-commonweal"> <a href="/404.html" rel="section"> <i class="menu-item-icon fa fa-heartbeat fa-fw"></i> <br /> 公益 </a> </li> <li class="menu-item menu-item-search"> <a href="#" class="st-search-show-outputs"> <i class="menu-item-icon fa fa-search fa-fw"></i> <br /> 搜索 </a> </li> </ul> <div class="site-search"> <script type="text/javascript"> (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){ (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t); e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e); })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st'); _st('install', 'Uf3M4iHJGy3DkfZN1kNM','2.0.0'); </script> </div> </nav> </div> </header> <main id="main" class="main"> <div class="main-inner"> <div id="content" class="content"> <div id="posts" class="posts-collapse"> <div class="collection-title"> <h2 > CDN <small>标签</small> </h2> </div> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2015/12/28/坑爹CDN给在线测试带来的问题/" itemprop="url"> <span itemprop="name">坑爹CDN给在线测试带来的问题</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2015-12-28T22:57:12+08:00" content="2015-12-28" > 12-28 </time> </div> </header> </article> </div> </div> </div> <div class="sidebar-toggle"> <div class="sidebar-toggle-line-wrap"> <span class="sidebar-toggle-line sidebar-toggle-line-first"></span> <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span> <span class="sidebar-toggle-line sidebar-toggle-line-last"></span> </div> </div> <aside id="sidebar" class="sidebar"> <div class="sidebar-inner"> <section class="site-overview sidebar-panel sidebar-panel-active "> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" src="/images/default_avatar.jpg" alt="酷我酷" itemprop="image"/> <p class="site-author-name" itemprop="name">酷我酷</p> </div> <p class="site-description motion-element" itemprop="description">分享即帮助</p> <nav class="site-state motion-element"> <div class="site-state-item site-state-posts"> <a href="/archives"> <span class="site-state-item-count">43</span> <span class="site-state-item-name">日志</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories"> <span class="site-state-item-count">29</span> <span class="site-state-item-name">分类</span> </a> </div> <div class="site-state-item site-state-tags"> <a href="/tags"> <span class="site-state-item-count">43</span> <span class="site-state-item-name">标签</span> </a> </div> </nav> <div class="feed-link motion-element"> <a href="http://AfirSraftGarrier.github.io/atom.xml" rel="alternate"> <i class="fa fa-rss"></i> RSS </a> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/AfirSraftGarrier" target="_blank"> <i class="fa fa-github"></i> GitHub </a> </span> <span class="links-of-author-item"> <a href="https://twitter.com/AfirSraftGarrie" target="_blank"> <i class="fa fa-twitter"></i> Twitter </a> </span> <span class="links-of-author-item"> <a href="http://weibo.com/u/1940794292" target="_blank"> <i class="fa fa-weibo"></i> Weibo </a> </span> <span class="links-of-author-item"> <a href="http://www.douban.com/people/db-acc/" target="_blank"> <i class="fa fa-globe"></i> DouBan </a> </span> <span class="links-of-author-item"> <a href="http://www.zhihu.com/people/afirsraftgarrier-29" target="_blank"> <i class="fa fa-globe"></i> ZhiHu </a> </span> </div> <div class="links-of-author motion-element"> <p class="site-author-name">友情链接</p> <span class="links-of-author-item"> <a href="http://www.lianquna.com" target="_blank">链去哪</a> </span> <span class="links-of-author-item"> <a href="http://www.kuwoku.com" target="_blank">酷我酷</a> </span> <span class="links-of-author-item"> <a href="http://www.keheji.com" target="_blank">壳合集</a> </span> </div> <div class="cc-license motion-element" itemprop="license" style="opacity: 1; display: block; transform: translateX(0px);"> <a href="http://creativecommons.org/licenses/by-nc-sa/4.0" class="cc-opacity" target="_blank" rel="external nofollow"> <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons"> </a> </div> </section> </div> </aside> </main> <footer id="footer" class="footer"> <div class="footer-inner"> <div class="copyright" > &copy; 2015 - <span itemprop="copyrightYear">2016</span> <span class="with-love"> <i class="icon-next-heart fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder"><a class="theme-link" href="http://www.kuwoku.com" style="color:red">酷我酷</a></span> </div> <div class="powered-by"> 由 <a class="theme-link" href="http://hexo.io" target="_blank" style="color:gray">HEXO</a> 强力驱动 </div> <div class="theme-info"> 主题 - <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next" target="_blank" style="color:gray"> NEXT </a> <script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span id="busuanzi_container_site_pv">&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;本站总访问量<span id="busuanzi_value_site_pv"></span>次</span> </div> <div class="theme-info"> <script> (function(){ var bp = document.createElement('script'); bp.src = '//push.zhanzhang.baidu.com/push.js'; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> <script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1257066910'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s95.cnzz.com/z_stat.php%3Fid%3D1257066910%26online%3D1%26show%3Dline' type='text/javascript'%3E%3C/script%3E"));</script> </div> <p style="margin-bottom:-10px;">COPYRIGHT © 酷我酷 粤ICP备14100221号</p> </div> </footer> <div class="back-to-top"></div> <div class="top-to-back"></div> <div class="left-to-right" onClick="leftToRightClick()"></div> <div class="right-to-left" onClick="rightToLeftClick()"></div> <script type="text/javascript"> function leftToRightClick() { nextNaviClick(); } function rightToLeftClick() { preNaviClick(); } function preNaviClick() { if($('i').hasClass("fa-angle-right")) { $('.fa-angle-right').click(); } } function nextNaviClick() { if($('i').hasClass("fa-angle-left")) { $('.fa-angle-left').click(); } } </script> </div> <script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script> <script type="text/javascript"> postMotionOptions = {stagger: 100, drag: true}; </script> <script type="text/javascript"> var duoshuoQuery = {short_name:"AfirSraftGarrier"}; (function() { var ds = document.createElement('script'); ds.type = 'text/javascript';ds.async = true; ds.id = 'duoshuo-script'; ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js'; ds.charset = 'UTF-8'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ds); })(); </script> <script type="text/javascript"> var duoshuo_user_ID = 6224780871593887000 var duoshuo_admin_nickname="酷我酷" </script> <script src="/js/ua-parser.min.js"></script> <script src="/js/hook-duoshuo.js"></script> <script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js"></script> <script type="text/javascript" src="/js/fancy-box.js?v=0.4.5.2"></script> <script type="text/javascript" src="/js/helpers.js?v=0.4.5.2"></script> <script type="text/javascript" src="/vendors/velocity/velocity.min.js"></script> <script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js"></script> <script type="text/javascript" src="/js/motion.js?v=0.4.5.2" id="motion.global"></script> <script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script> <script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script> <script type="text/javascript" src="/js/bootstrap.js"></script> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ], processEscapes: true, skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'] } }); </script> <script type="text/x-mathjax-config"> MathJax.Hub.Queue(function() { var all = MathJax.Hub.getAllJax(), i; for (i=0; i < all.length; i += 1) { all[i].SourceElement().parentNode.className += ' has-jax'; } }); </script> <script type="text/javascript" src="http://cdn.staticfile.org/mathjax/2.4.0/MathJax.js"></script> <script type="text/javascript" src="http://cdn.staticfile.org/mathjax/2.4.0/config/TeX-AMS-MML_HTMLorMML.js"></script> <!-- custom analytics part create by xiamo --> <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script> <script>AV.initialize("t2rSFICpuTnyyi6nOFHsnHaM", "s1slrYanIAFr41TM32fuwKAi");</script> <script> function showTime(Counter) { var query = new AV.Query(Counter); $(".leancloud_visitors").each(function() { var url = $(this).attr("id").trim(); query.equalTo("url", url); query.find({ success: function(results) { if (results.length == 0) { var content = $(document.getElementById(url)).text() + ': 0'; $(document.getElementById(url)).text(content); return; } for (var i = 0; i < results.length; i++) { var object = results[i]; var content = $(document.getElementById(url)).text() + ': ' + object.get('time'); $(document.getElementById(url)).text(content); } }, error: function(object, error) { console.log("Error: " + error.code + " " + error.message); } }); }); } function addCount(Counter) { var Counter = AV.Object.extend("Counter"); url = $(".leancloud_visitors").attr('id').trim(); title = $(".leancloud_visitors").attr('data-flag-title').trim(); var query = new AV.Query(Counter); query.equalTo("url", url); query.find({ success: function(results) { if (results.length > 0) { var counter = results[0]; counter.fetchWhenSave(true); counter.increment("time"); counter.save(null, { success: function(counter) { var content = $(document.getElementById(url)).text() + ': ' + counter.get('time'); $(document.getElementById(url)).text(content); }, error: function(counter, error) { console.log('Failed to save Visitor num, with error message: ' + error.message); } }); } else { var newcounter = new Counter(); newcounter.set("title", title); newcounter.set("url", url); newcounter.set("time", 1); newcounter.save(null, { success: function(newcounter) { console.log("newcounter.get('time')="+newcounter.get('time')); var content = $(document.getElementById(url)).text() + ': ' + newcounter.get('time'); $(document.getElementById(url)).text(content); }, error: function(newcounter, error) { console.log('Failed to create'); } }); } }, error: function(error) { console.log('Error:' + error.code + " " + error.message); } }); } $(function() { var Counter = AV.Object.extend("Counter"); if ($('.leancloud_visitors').length == 1) { addCount(Counter); } else if ($('.post-title-link').length > 1) { showTime(Counter); } }); </script> </body> </html>
Java
package org.squbs.httpclient.japi import org.squbs.httpclient.endpoint.Endpoint /** * Created by lma on 7/15/2015. */ object EndpointFactory { def create(uri: String) = Endpoint(uri) }
Java
#!/usr/bin/python #-*-coding:utf8-*- from bs4 import BeautifulSoup as Soup #import pandas as pd import glob import sys import re """ Version xml de cfdi 3.3 """ class CFDI(object): def __init__(self, f): """ Constructor que requiere en el parámetro una cadena con el nombre del cfdi. """ fxml = open(f,'r').read() soup = Soup(fxml,'lxml') #============componentes del cfdi============ emisor = soup.find('cfdi:emisor') receptor = soup.find('cfdi:receptor') comprobante = soup.find('cfdi:comprobante') tfd = soup.find('tfd:timbrefiscaldigital') self.__version = comprobante['version'] self.__folio = comprobante['folio'] self.__uuid = tfd['uuid'] self.__fechatimbrado = tfd['fechatimbrado'] self.__traslados = soup.find_all(lambda e: e.name=='cfdi:traslado' and sorted(e.attrs.keys())==['importe','impuesto','tasaocuota','tipofactor']) self.__retenciones = soup.find_all(lambda e: e.name=='cfdi:retencion' and sorted(e.attrs.keys())==['importe','impuesto']) #============emisor========================== self.__emisorrfc = emisor['rfc'] try: self.__emisornombre = emisor['nombre'] except: self.__emisornombre = emisor['rfc'] #============receptor======================== self.__receptorrfc = receptor['rfc'] try: self.__receptornombre = receptor['nombre'] except: self.__receptornombre = receptor['rfc'] #============comprobante===================== self.__certificado = comprobante['certificado'] self.__sello = comprobante['sello'] self.__total = round(float(comprobante['total']),2) self.__subtotal = round(float(comprobante['subtotal']),2) self.__fecha_cfdi = comprobante['fecha'] self.__conceptos = soup.find_all(lambda e: e.name=='cfdi:concepto') self.__n_conceptos = len(self.__conceptos) try: self.__moneda = comprobante['moneda'] except KeyError as k: self.__moneda = 'MXN' try: self.__lugar = comprobante['lugarexpedicion'] except KeyError as k: self.__lugar = u'México' tipo = comprobante['tipodecomprobante'] if(float(self.__version)==3.2): self.__tipo = tipo else: tcomprobantes = {'I':'Ingreso', 'E':'Egreso', 'N':'Nomina', 'P':'Pagado'} self.__tipo = tcomprobantes[tipo] try: self.__tcambio = float(comprobante['tipocambio']) except: self.__tcambio = 1. triva, trieps, trisr = self.__calcula_traslados() self.__triva = round(triva,2) self.__trieps = round(trieps,2) self.__trisr = round(trisr,2) retiva, retisr = self.__calcula_retenciones() self.__retiva = round(retiva,2) self.__retisr = round(retisr,2) def __str__(self): """ Imprime el cfdi en el siguiente orden emisor, fecha de timbrado, tipo de comprobante, rfc emisor, uuid,_ receptor, rfc receptor, subtotal, ieps, iva, retiva, retisr, tc, total """ respuesta = '\t'.join( map(str, self.lista_valores)) return respuesta def __calcula_traslados(self): triva, trieps, trisr = 0., 0., 0 for t in self.__traslados: impuesto = t['impuesto'] importe = float(t['importe']) if(self.__version=='3.2'): if impuesto=='IVA': triva += importe elif impuesto=='ISR': trisr += importe elif impuesto=='IEPS': trieps += importe elif(self.__version=='3.3'): if impuesto=='002': triva += importe elif impuesto=='001': trisr += importe elif impuesto=='003': trieps += importe return triva, trieps, trisr def __calcula_retenciones(self): retiva, retisr = 0., 0. for t in self.__retenciones: impuesto = t['impuesto'] importe = float(t['importe']) if(self.__version=='3.2'): if(impuesto=='ISR'): retisr += importe elif(impuesto=='IVA'): retiva += importe elif(self.__version=='3.3'): if(impuesto=='002'): retiva += importe elif(impuesto=='001'): retisr += importe return retiva, retisr @property def lista_valores(self): v = [self.__emisornombre,self.__fechatimbrado, self.__tipo, self.__emisorrfc ] v += [self.__uuid, self.__folio, self.__receptornombre, self.__receptorrfc ] v += [self.__subtotal, self.__trieps, self.__triva] v += [self.__retiva, self.__retisr, self.__tcambio, self.__total] return v @property def dic_cfdi(self): d = {} d["Emisor"] = self.__emisornombre d["Fecha_CFDI"] = self.__fechatimbrado d["Tipo"] = self.__tipo d["RFC_Emisor"] = self.__emisorrfc d["Folio_fiscal"] = self.__uuid d["Folio"] = self.__folio d["Receptor"] = self.__receptornombre d["RFC_Receptor"] = self.__receptorrfc d["Subtotal"] = self.__subtotal d["IEPS"] = self.__trieps d["IVA"] = self.__triva d["Ret IVA"] = self.__retiva d["Ret ISR"] = self.__retisr d["TC"] = self.__tcambio d["Total"] = self.__total return d @property def certificado(self): return self.__certificado @property def sello(self): return self.__sello @property def total(self): return self.__total @property def subtotal(self): return self.__subtotal @property def fechatimbrado(self): return self.__fechatimbrado @property def tipodecambio(self): return self.__tcambio @property def lugar(self): return self.__lugar @property def moneda(self): return self.__moneda @property def traslado_iva(self): return self.__triva @property def traslado_isr(self): return self.__trisr @property def traslado_ieps(self): return self.__trieps @property def n_conceptos(self): return self.__n_conceptos @property def conceptos(self): return self.__conceptos @property def folio(self): return self.__folio @staticmethod def columnas(): return ["Emisor","Fecha_CFDI","Tipo","RFC_Emisor","Folio_fiscal","Folio","Receptor", "RFC_Receptor", "Subtotal","IEPS","IVA","Ret IVA","Ret ISR","TC","Total"] @staticmethod def imprime_reporte(nf, nr): reporte = "Número de archivos procesados:\t {}\n".format(nf) reporte += "Número de filas en tsv:\t {}\n".format(nr) if(nf!=nr): reporte += "\n\n**** Atención ****\n" return reporte L = glob.glob('./*.xml') #R = [ patt[1:].strip().lower() for patt in re.findall('(<cfdi:[A-z]*\s|<tfd:[A-z]*\s)',fxml)] if __name__=='__main__': salida = sys.argv[1] fout = open(salida,'w') columnas = CFDI.columnas() titulo = '\t'.join(columnas)+'\n' fout.write(titulo) nl = 0 for f in L: try: #print("abriendo {0}".format(f)) rcfdi = CFDI(f) dic = rcfdi.dic_cfdi vals = [dic[c] for c in columnas] strvals = ' \t '.join(map(str, vals))+'\n' fout.write(strvals) nl += 1 except: assert "Error en archivo {0}".format(f) fout.close() nr = len(L) rep = CFDI.imprime_reporte(nr, nl) print(rep)
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-GB" xml:lang="en-GB" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Statistics of Degree in UD_Croatian-SET</title> <link rel="root" href=""/> <!-- for JS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/> <link rel="stylesheet" type="text/css" href="../../css/style.css"/> <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/> <link rel="stylesheet" type="text/css" href="../../css/hint.css"/> <script type="text/javascript" src="../../lib/ext/head.load.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.2/anchor.min.js"></script> <script>document.addEventListener("DOMContentLoaded", function(event) {anchors.add();});</script> <!-- Set up this custom Google search at https://cse.google.com/cse/business/settings?cx=001145188882102106025:dl1mehhcgbo --> <!-- DZ 2021-01-22: I am temporarily hiding the search field to find out whether it slows down loading of the title page. <script> (function() { var cx = '001145188882102106025:dl1mehhcgbo'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = 'https://cse.google.com/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); })(); </script> --> <!-- <link rel="shortcut icon" href="favicon.ico"/> --> </head> <body> <div id="main" class="center"> <div id="hp-header"> <table width="100%"><tr><td width="50%"> <span class="header-text"><a href="http://universaldependencies.org/#language-">home</a></span> <span class="header-text"><a href="https://github.com/universaldependencies/docs/edit/pages-source/treebanks/hr_set/hr_set-feat-Degree.md" target="#">edit page</a></span> <span class="header-text"><a href="https://github.com/universaldependencies/docs/issues">issue tracker</a></span> </td><td> <gcse:search></gcse:search> </td></tr></table> </div> <hr/> <div class="v2complete"> This page pertains to UD version 2. </div> <div id="content"> <noscript> <div id="noscript"> It appears that you have Javascript disabled. Please consider enabling Javascript for this page to see the visualizations. </div> </noscript> <!-- The content may include scripts and styles, hence we must load the shared libraries before the content. --> <script type="text/javascript"> console.time('loading libraries'); var root = '../../'; // filled in by jekyll head.js( // External libraries // DZ: Copied from embedding.html. I don't know which one is needed for what, so I'm currently keeping them all. root + 'lib/ext/jquery.min.js', root + 'lib/ext/jquery.svg.min.js', root + 'lib/ext/jquery.svgdom.min.js', root + 'lib/ext/jquery.timeago.js', root + 'lib/ext/jquery-ui.min.js', root + 'lib/ext/waypoints.min.js', root + 'lib/ext/jquery.address.min.js' ); </script> <h2 id="treebank-statistics-ud_croatian-set-features-degree">Treebank Statistics: UD_Croatian-SET: Features: <code class="language-plaintext highlighter-rouge">Degree</code></h2> <p>This feature is universal. It occurs with 3 different values: <code class="language-plaintext highlighter-rouge">Cmp</code>, <code class="language-plaintext highlighter-rouge">Pos</code>, <code class="language-plaintext highlighter-rouge">Sup</code>.</p> <p>31236 tokens (16%) have a non-empty value of <code class="language-plaintext highlighter-rouge">Degree</code>. 11316 types (32%) occur at least once with a non-empty value of <code class="language-plaintext highlighter-rouge">Degree</code>. 4920 lemmas (27%) occur at least once with a non-empty value of <code class="language-plaintext highlighter-rouge">Degree</code>. The feature is used with 3 part-of-speech tags: <tt><a href="hr_set-pos-ADJ.html">ADJ</a></tt> (22931; 11% instances), <tt><a href="hr_set-pos-ADV.html">ADV</a></tt> (7943; 4% instances), <tt><a href="hr_set-pos-DET.html">DET</a></tt> (362; 0% instances).</p> <h3 id="adj"><code class="language-plaintext highlighter-rouge">ADJ</code></h3> <p>22931 <tt><a href="hr_set-pos-ADJ.html">ADJ</a></tt> tokens (95% of all <code class="language-plaintext highlighter-rouge">ADJ</code> tokens) have a non-empty value of <code class="language-plaintext highlighter-rouge">Degree</code>.</p> <p>The most frequent other feature values with which <code class="language-plaintext highlighter-rouge">ADJ</code> and <code class="language-plaintext highlighter-rouge">Degree</code> co-occurred: <tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt> (20684; 90%), <tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt> (15101; 66%).</p> <p><code class="language-plaintext highlighter-rouge">ADJ</code> tokens may have the following values of <code class="language-plaintext highlighter-rouge">Degree</code>:</p> <ul> <li><code class="language-plaintext highlighter-rouge">Cmp</code> (588; 3% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>veći, veće, manji, veća, veću, većeg, bolje, bolji, niže, većim</em></li> <li><code class="language-plaintext highlighter-rouge">Pos</code> (21823; 95% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>novi, prvi, drugi, sve, svi, vanjskih, glavni, novih, nove, prošle</em></li> <li><code class="language-plaintext highlighter-rouge">Sup</code> (520; 2% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>najveći, najbolji, najveća, najveće, najvećih, najbolje, najboljeg, najvažnije, najvećim, najvećem</em></li> <li><code class="language-plaintext highlighter-rouge">EMPTY</code> (1206): <em>1., 2004., 2008., 2007., 2009., 2006., 2., 2005., 2010., 21.</em></li> </ul> <table> <tr><th>Paradigm <i>velik</i></th><th><tt>Pos</tt></th><th><tt>Cmp</tt></th><th><tt>Sup</tt></th></tr> <tr><td><tt><tt><a href="hr_set-feat-Animacy.html">Animacy</a></tt><tt>=Inan</tt>|<tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Acc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>veliki</em></td><td><em>veći</em></td><td><em>najveći</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Animacy.html">Animacy</a></tt><tt>=Inan</tt>|<tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Acc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Ind</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velik, veći</em></td><td></td><td></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Acc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velike</em></td><td><em>veće</em></td><td><em>najveće</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Acc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>veliku</em></td><td><em>veću</em></td><td><em>najveću</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Acc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velike</em></td><td><em>veće</em></td><td></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Acc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td></td><td><em>veće</em></td><td><em>najveće</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Acc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>veća</em></td><td></td><td><em>najveća</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Dat</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikom</em></td><td></td><td><em>najvećem</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Dat</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikoj</em></td><td><em>većoj</em></td><td><em>najvećim</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Dat</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikim</em></td><td></td><td><em>najvećim</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Gen</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikog, velika, velikoga</em></td><td><em>većeg</em></td><td><em>najvećeg, najveća</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Gen</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikih</em></td><td><em>većih</em></td><td><em>najvećih</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Gen</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velike</em></td><td><em>veće</em></td><td><em>najveće</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Gen</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikih</em></td><td><em>većih</em></td><td><em>najvećih</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Gen</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikog, najvećeg</em></td><td><em>većeg</em></td><td></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Gen</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikih</em></td><td></td><td><em>najvećih</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Ins</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikim</em></td><td><em>većim</em></td><td><em>najvećim</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Ins</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikim</em></td><td></td><td><em>najvećim</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Ins</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikom</em></td><td><em>većom</em></td><td><em>najvećom</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Ins</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikim</em></td><td><em>većim</em></td><td><em>najvećima</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Ins</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>najvećim</em></td><td></td><td></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Loc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikom</em></td><td><em>većem</em></td><td><em>najvećem</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Loc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikim</em></td><td></td><td></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Loc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikoj</em></td><td><em>većoj</em></td><td><em>najvećoj</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Loc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikim</em></td><td></td><td></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Loc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velikom</em></td><td></td><td></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Loc</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velikim</em></td><td></td><td><em>najvećim</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Nom</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>veliki</em></td><td><em>veći</em></td><td><em>najveći</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Nom</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>veliki</em></td><td></td><td><em>najveći</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Nom</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velika</em></td><td><em>veća</em></td><td><em>najveća</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Nom</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Fem</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velike</em></td><td></td><td><em>najveće</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Nom</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>veliko</em></td><td><em>veće</em></td><td><em>najveće</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Nom</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Def</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Neut</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Plur</tt></tt></td><td><em>velika</em></td><td><em>veća</em></td><td><em>najveća</em></td></tr> <tr><td><tt><tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=Nom</tt>|<tt><a href="hr_set-feat-Definite.html">Definite</a></tt><tt>=Ind</tt>|<tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=Masc</tt>|<tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=Sing</tt></tt></td><td><em>velik</em></td><td></td><td></td></tr> </table> <p><code class="language-plaintext highlighter-rouge">Degree</code> seems to be <strong>lexical feature</strong> of <code class="language-plaintext highlighter-rouge">ADJ</code>. 96% lemmas (4025) occur only with one value of <code class="language-plaintext highlighter-rouge">Degree</code>.</p> <h3 id="adv"><code class="language-plaintext highlighter-rouge">ADV</code></h3> <p>7943 <tt><a href="hr_set-pos-ADV.html">ADV</a></tt> tokens (94% of all <code class="language-plaintext highlighter-rouge">ADV</code> tokens) have a non-empty value of <code class="language-plaintext highlighter-rouge">Degree</code>.</p> <p>The most frequent other feature values with which <code class="language-plaintext highlighter-rouge">ADV</code> and <code class="language-plaintext highlighter-rouge">Degree</code> co-occurred: <tt><a href="hr_set-feat-PronType.html">PronType</a></tt><tt>=EMPTY</tt> (6480; 82%).</p> <p><code class="language-plaintext highlighter-rouge">ADV</code> tokens may have the following values of <code class="language-plaintext highlighter-rouge">Degree</code>:</p> <ul> <li><code class="language-plaintext highlighter-rouge">Cmp</code> (603; 8% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>više, dalje, manje, kasnije, bolje, ranije, brže, češće, lakše, dulje</em></li> <li><code class="language-plaintext highlighter-rouge">Pos</code> (7224; 91% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>samo, još, također, već, posto, međutim, oko, vrlo, danas, kada</em></li> <li><code class="language-plaintext highlighter-rouge">Sup</code> (116; 1% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>najviše, najmanje, najbolje, najčešće, najvjerojatnije, najradije, najgore, najteže, Najdalje, najbrže</em></li> <li><code class="language-plaintext highlighter-rouge">EMPTY</code> (485): <em>uključujući, zahvaljujući, govoreći, ističući, dodajući, ukazujući, tražeći, opisujući, pozivajući, sl.</em></li> </ul> <table> <tr><th>Paradigm <i>mnogo</i></th><th><tt>Pos</tt></th><th><tt>Cmp</tt></th><th><tt>Sup</tt></th></tr> <tr><td><tt></tt></td><td><em>mnogo, više</em></td><td><em>više</em></td><td><em>najviše</em></td></tr> </table> <p><code class="language-plaintext highlighter-rouge">Degree</code> seems to be <strong>lexical feature</strong> of <code class="language-plaintext highlighter-rouge">ADV</code>. 95% lemmas (749) occur only with one value of <code class="language-plaintext highlighter-rouge">Degree</code>.</p> <h3 id="det"><code class="language-plaintext highlighter-rouge">DET</code></h3> <p>362 <tt><a href="hr_set-pos-DET.html">DET</a></tt> tokens (5% of all <code class="language-plaintext highlighter-rouge">DET</code> tokens) have a non-empty value of <code class="language-plaintext highlighter-rouge">Degree</code>.</p> <p>The most frequent other feature values with which <code class="language-plaintext highlighter-rouge">DET</code> and <code class="language-plaintext highlighter-rouge">Degree</code> co-occurred: <tt><a href="hr_set-feat-Case.html">Case</a></tt><tt>=EMPTY</tt> (362; 100%), <tt><a href="hr_set-feat-Gender.html">Gender</a></tt><tt>=EMPTY</tt> (362; 100%), <tt><a href="hr_set-feat-Number.html">Number</a></tt><tt>=EMPTY</tt> (362; 100%), <tt><a href="hr_set-feat-Number-psor.html">Number[psor]</a></tt><tt>=EMPTY</tt> (362; 100%), <tt><a href="hr_set-feat-Person.html">Person</a></tt><tt>=EMPTY</tt> (362; 100%), <tt><a href="hr_set-feat-Poss.html">Poss</a></tt><tt>=EMPTY</tt> (362; 100%), <tt><a href="hr_set-feat-PronType.html">PronType</a></tt><tt>=EMPTY</tt> (199; 55%).</p> <p><code class="language-plaintext highlighter-rouge">DET</code> tokens may have the following values of <code class="language-plaintext highlighter-rouge">Degree</code>:</p> <ul> <li><code class="language-plaintext highlighter-rouge">Cmp</code> (93; 26% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>više, manje</em></li> <li><code class="language-plaintext highlighter-rouge">Pos</code> (263; 73% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>nekoliko, mnogo, pola, puno, posto, malo, dosta, dovoljno, previše, koliko</em></li> <li><code class="language-plaintext highlighter-rouge">Sup</code> (6; 2% of non-empty <code class="language-plaintext highlighter-rouge">Degree</code>): <em>najviše</em></li> <li><code class="language-plaintext highlighter-rouge">EMPTY</code> (7332): <em>koji, to, koje, koja, svoje, ove, toga, sve, kojima, koju</em></li> </ul> <table> <tr><th>Paradigm <i>mnogo</i></th><th><tt>Pos</tt></th><th><tt>Cmp</tt></th><th><tt>Sup</tt></th></tr> <tr><td><tt></tt></td><td><em>mnogo</em></td><td><em>više</em></td><td><em>najviše</em></td></tr> </table> <h2 id="relations-with-agreement-in-degree">Relations with Agreement in <code class="language-plaintext highlighter-rouge">Degree</code></h2> <p>The 10 most frequent relations where parent and child node agree in <code class="language-plaintext highlighter-rouge">Degree</code>: <tt>ADJ –[<tt><a href="hr_set-dep-advmod.html">advmod</a></tt>]–&gt; ADV</tt> (1139; 83%), <tt>ADJ –[<tt><a href="hr_set-dep-conj.html">conj</a></tt>]–&gt; ADJ</tt> (803; 97%), <tt>ADV –[<tt><a href="hr_set-dep-advmod.html">advmod</a></tt>]–&gt; ADV</tt> (296; 75%), <tt>ADV –[<tt><a href="hr_set-dep-conj.html">conj</a></tt>]–&gt; ADV</tt> (83; 86%), <tt>ADJ –[<tt><a href="hr_set-dep-amod.html">amod</a></tt>]–&gt; ADJ</tt> (59; 72%), <tt>ADJ –[<tt><a href="hr_set-dep-discourse.html">discourse</a></tt>]–&gt; ADV</tt> (56; 80%), <tt>ADV –[<tt><a href="hr_set-dep-amod.html">amod</a></tt>]–&gt; ADJ</tt> (44; 94%), <tt>ADJ –[<tt><a href="hr_set-dep-advcl.html">advcl</a></tt>]–&gt; ADJ</tt> (39; 89%), <tt>ADJ –[<tt><a href="hr_set-dep-nsubj.html">nsubj</a></tt>]–&gt; ADJ</tt> (23; 100%), <tt>ADJ –[<tt><a href="hr_set-dep-parataxis.html">parataxis</a></tt>]–&gt; ADJ</tt> (23; 96%).</p> </div> <!-- support for embedded visualizations --> <script type="text/javascript"> var root = '../../'; // filled in by jekyll head.js( // We assume that external libraries such as jquery.min.js have already been loaded outside! // (See _layouts/base.html.) // brat helper modules root + 'lib/brat/configuration.js', root + 'lib/brat/util.js', root + 'lib/brat/annotation_log.js', root + 'lib/ext/webfont.js', // brat modules root + 'lib/brat/dispatcher.js', root + 'lib/brat/url_monitor.js', root + 'lib/brat/visualizer.js', // embedding configuration root + 'lib/local/config.js', // project-specific collection data root + 'lib/local/collections.js', // Annodoc root + 'lib/annodoc/annodoc.js', // NOTE: non-local libraries 'https://spyysalo.github.io/conllu.js/conllu.js' ); var webFontURLs = [ // root + 'static/fonts/Astloch-Bold.ttf', root + 'static/fonts/PT_Sans-Caption-Web-Regular.ttf', root + 'static/fonts/Liberation_Sans-Regular.ttf' ]; var setupTimeago = function() { jQuery("time.timeago").timeago(); }; head.ready(function() { setupTimeago(); // mark current collection (filled in by Jekyll) Collections.listing['_current'] = ''; // perform all embedding and support functions Annodoc.activate(Config.bratCollData, Collections.listing); }); </script> <!-- google analytics --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-55233688-1', 'auto'); ga('send', 'pageview'); </script> <div id="footer"> <p class="footer-text">&copy; 2014–2021 <a href="http://universaldependencies.org/introduction.html#contributors" style="color:gray">Universal Dependencies contributors</a>. Site powered by <a href="http://spyysalo.github.io/annodoc" style="color:gray">Annodoc</a> and <a href="http://brat.nlplab.org/" style="color:gray">brat</a></p>. </div> </div> </body> </html>
Java
require "decoplan/algorithm" require "decoplan/dive_profile" module Decoplan class Algorithm class Buhlmann < Algorithm attr_accessor :lo attr_accessor :hi attr_accessor :compartments N2_HALF = [ 4.0, 5.0, 8.0, 12.5, 18.5, 27.0, 38.3, 54.3, 77.0, 109.0, 146.0, 187.0, 239.0, 305.0, 390.0, 498.0, 635.0 ] N2_A = [ 1.2599, 1.2599, 1.0000, 0.8618, 0.7562, 0.6667, 0.5600, 0.4947, 0.4500, 0.4187, 0.3798, 0.3497, 0.3223, 0.2971, 0.2737, 0.2523, 0.2327 ] N2_B = [ 0.5050, 0.5050, 0.6514, 0.7222, 0.7725, 0.8125, 0.8434, 0.8693, 0.8910, 0.9092, 0.9222, 0.9319, 0.9403, 0.9477, 0.9544, 0.9602, 0.9653 ] HE_HALF = [ 1.51, 1.88, 3.02, 4.72, 6.99, 10.21, 14.48, 20.53, 29.11, 41.20, 55.19, 70.69, 90.34, 115.29, 147.42, 188.24, 240.03 ] HE_A = [ 1.7424, 1.6189, 1.3830, 1.1919, 1.0458, 0.9220, 0.8205, 0.7305, 0.6502, 0.5950, 0.5545, 0.5333, 0.5189, 0.5181, 0.5176, 0.5172, 0.5119 ] HE_B = [ 0.4245, 0.4770, 0.5747, 0.6527, 0.7223, 0.7582, 0.7957, 0.8279, 0.8553, 0.8757, 0.8903, 0.8997, 0.9073, 0.9122, 0.9171, 0.9217, 0.9267 ] name :buhlmann, :zhl16b def initialize(profile, lo: 100, hi: 100) super @lo = lo @hi = hi end def compute reset_compartments! deco_profile = DiveProfile.new apply_profile(deco_profile) compute_deco(deco_profile) deco_profile end def reset_compartments! @compartments = (0..15).map { { n2: 0.79, he: 0.0 } } end private def apply_profile(deco_profile) profile.levels.each do |level| deco_profile.level level haldane_step(level) end end def haldane_step(level) @compartments = compartments.map.with_index do |p_inert, i| # FIXME: alveolar pressure { n2: haldane_equation(p_inert[:n2], level.depth * (1.0 - level.he - level.o2), N2_HALF[i], level.time), he: haldane_equation(p_inert[:he], level.depth * level.he, HE_HALF[i], level.time), } end end def compute_deco(deco_profile) deco_profile end end end end
Java
#!/usr/bin/python3 from colorama import Fore, Back class frets: tuning = list() max_string_name_len = 0; frets_count = 0; strings = dict() NOTES = ('E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B', 'C', 'C#', 'D', 'D#') def __init__(self, tuning=('E', 'A', 'D', 'G'), frets_count=24): self.tuning = tuning self.frets_count = frets_count for string in tuning: if len(string) > self.max_string_name_len: self.max_string_name_len = len(string) padding_count = 0; padding = '' self.strings[string] = list() starting_note = self.NOTES.index(string) + 1 for i in range(frets_count): padding = '^' * int(((starting_note + i) / len(self.NOTES))) self.strings[string].append(self.NOTES[(starting_note + i) % len(self.NOTES)] + padding) #print('{}{} ({}) = {}'.format(string, # i, # int(((starting_note + i) / len(self.NOTES))), # self.NOTES[(starting_note + i) % len(self.NOTES)] + padding)) def debug_strings(self): print(self.strings) def show_me_plz(self, seek_note=None, seek_string=None): if (seek_string): seek_note = self.strings[seek_string[0]][int(seek_string[1]) - 1] upper_seek_note = None lower_seek_note = None if seek_note and seek_note.endswith('^'): lower_seek_note = seek_note[0:-1] if seek_note: upper_seek_note = seek_note + '^' upper_found_position = list() found_position = list() lower_found_position = list() print(Fore.WHITE + \ ' ' * (self.max_string_name_len + 2), end='') for fret_nr in range(1, self.frets_count + 1): print(Fore.WHITE + \ (' ' * (4 - len(str(fret_nr)))) + str(fret_nr), end='') print(Fore.YELLOW + '|', end='') print('') for string in reversed(self.tuning): color = Fore.WHITE + Back.BLACK if string == seek_note: color = Fore.WHITE + Back.RED found_position.append(string + "0") elif string == upper_seek_note: color = Fore.WHITE + Back.CYAN upper_found_position.append(string + "0") elif string == lower_seek_note: color = Fore.WHITE + Back.MAGENTA lower_found_position.append(string + "0") print(color + \ (' ' * (self.max_string_name_len - len(string))) + \ string, end='') print(Fore.YELLOW + '||', end='') fret_nr = 1 for note in self.strings[string]: color = Fore.WHITE + Back.BLACK if note == seek_note: color = Fore.WHITE + Back.RED found_position.append(string + str(fret_nr)) elif note == upper_seek_note: color = Fore.WHITE + Back.CYAN upper_found_position.append(string + str(fret_nr)) elif note == lower_seek_note: color = Fore.WHITE + Back.MAGENTA lower_found_position.append(string + str(fret_nr)) print(color + \ note[0:4] + \ '-' * (4 - len(note)), end='') print(Fore.YELLOW + Back.BLACK + '|', end='') fret_nr += 1 print(Fore.WHITE + Back.BLACK + '') print(Fore.WHITE + '\n') print(Back.CYAN + ' ' + Back.BLACK + \ ' Found octave-higher note {} on: {}'.format(upper_seek_note, upper_found_position)) print(Back.RED + ' ' + Back.BLACK + \ ' Found note {} on: {}'.format(seek_note, found_position)) print(Fore.WHITE + \ Back.MAGENTA + ' ' + Back.BLACK + \ ' Found octave-lower note {} on: {}'.format(lower_seek_note, lower_found_position))
Java
/* * PartitioningOperators.java Feb 3 2014, 03:44 * * Copyright 2014 Drunken Dev. * * 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.drunkendev.lambdas; import com.drunkendev.lambdas.domain.DomainService; import com.drunkendev.lambdas.domain.Order; import com.drunkendev.lambdas.helper.IndexHolder; import com.drunkendev.lambdas.helper.MutableBoolean; import java.util.ArrayList; import java.util.Arrays; /** * * @author Brett Ryan */ public class PartitioningOperators { private final DomainService ds; /** * Creates a new {@code PartitioningOperators} instance. */ public PartitioningOperators() { this.ds = new DomainService(); } public static void main(String[] args) { PartitioningOperators po = new PartitioningOperators(); po.lambda20(); po.lambda21(); po.lambda22(); po.lambda23(); po.lambda24(); po.lambda25(); po.lambda26(); po.lambda27(); } public void lambda20() { System.out.println("\nFirst 3 numbers:"); int[] numbers = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0}; Arrays.stream(numbers) .limit(3) .forEach(System.out::println); } public void lambda21() { System.out.println("\nFirst 3 orders in WA:"); ds.getCustomerList().stream() .filter(c -> "WA".equalsIgnoreCase(c.getRegion())) .flatMap(c -> c.getOrders().stream() .map(n -> new CustOrder(c.getCustomerId(), n)) ).limit(3) .forEach(System.out::println); } public void lambda22() { System.out.println("\nAll but first 4 numbers:"); int[] numbers = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0}; Arrays.stream(numbers) .skip(4) .forEach(System.out::println); } public void lambda23() { System.out.println("\nAll but first 2 orders in WA:"); ds.getCustomerList().stream() .filter(c -> "WA".equalsIgnoreCase(c.getRegion())) .flatMap(c -> c.getOrders().stream() .map(n -> new CustOrder(c.getCustomerId(), n)) ).skip(2) .forEach(System.out::println); } /** * Unfortunately this method will not short circuit and will continue to * iterate until the end of the stream. I need to figure out a better way to * handle this. */ public void lambda24() { System.out.println("\nFirst numbers less than 6:"); int[] numbers = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0}; MutableBoolean mb = new MutableBoolean(true); Arrays.stream(numbers) .collect(ArrayList<Integer>::new, (output, v) -> { if (mb.isTrue()) { if (v < 6) { output.add(v); } else { mb.flip(); } } }, (c1, c2) -> c1.addAll(c2)) .forEach(System.out::println); } public void lambda25() { System.out.println("\nFirst numbers not less than their position:"); int[] numbers = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0}; IndexHolder i = new IndexHolder(); MutableBoolean mb = new MutableBoolean(true); Arrays.stream(numbers) .collect(ArrayList<Integer>::new, (output, v) -> { if (mb.isTrue()) { if (v > i.postIncrement()) { output.add(v); } else { mb.flip(); } } }, (c1, c2) -> c1.addAll(c2)) .forEach(System.out::println); } public void lambda26() { System.out.println("\nAll elements starting from first element divisible by 3:"); int[] numbers = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0}; MutableBoolean mb = new MutableBoolean(false); Arrays.stream(numbers) .collect(ArrayList<Integer>::new, (output, v) -> { if (mb.isTrue()) { output.add(v); } else if (v % 3 == 0) { output.add(v); mb.flip(); } }, (c1, c2) -> c1.addAll(c2)) .forEach(System.out::println); } public void lambda27() { System.out.println("\nAll elements starting from first element less than its position:"); int[] numbers = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0}; IndexHolder i = new IndexHolder(); MutableBoolean mb = new MutableBoolean(false); Arrays.stream(numbers) .collect(ArrayList<Integer>::new, (output, v) -> { if (mb.isTrue()) { output.add(v); } else if (v < i.postIncrement()) { output.add(v); mb.flip(); } }, (c1, c2) -> c1.addAll(c2) ) .forEach(System.out::println); } private static class CustOrder { private final String customerId; private final Order order; public CustOrder(String customerId, Order order) { this.customerId = customerId; this.order = order; } public String getCustomerId() { return customerId; } public Order getOrder() { return order; } @Override public String toString() { return String.format("CustOrder[customerId=%s,orderId=%d,orderDate=%s]", customerId, order.getOrderId(), order.getOrderDate()); } } }
Java
package com.esri.mapred; import com.esri.io.PointFeatureWritable; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.mapred.InputSplit; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.RecordReader; import org.apache.hadoop.mapred.Reporter; import java.io.IOException; /** */ public class PointFeatureInputFormat extends AbstractInputFormat<PointFeatureWritable> { private final class PointFeatureReader extends AbstractFeatureReader<PointFeatureWritable> { private final PointFeatureWritable m_pointFeatureWritable = new PointFeatureWritable(); public PointFeatureReader( final InputSplit inputSplit, final JobConf jobConf) throws IOException { super(inputSplit, jobConf); } @Override public PointFeatureWritable createValue() { return m_pointFeatureWritable; } @Override protected void next() throws IOException { m_shpReader.queryPoint(m_pointFeatureWritable.point); putAttributes(m_pointFeatureWritable.attributes); } } @Override public RecordReader<LongWritable, PointFeatureWritable> getRecordReader( final InputSplit inputSplit, final JobConf jobConf, final Reporter reporter) throws IOException { return new PointFeatureReader(inputSplit, jobConf); } }
Java
## Ghost.org ##### Downloading & Using Theme ```bash apt-get update && apt-get install git-core -y # needed to clone theme git clone https://github.com/polygonix/N-Coded.git /var/www/ghost/content/themes/ # clone theme # Login to admin and go this url to change it /ghost/settings/general/ ```
Java
// ----------------------------------------------------------------------------------------- // <copyright file="TableSasUnitTests.cs" company="Microsoft"> // Copyright 2013 Microsoft Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </copyright> // ----------------------------------------------------------------------------------------- using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage.Auth; using Microsoft.WindowsAzure.Storage.Shared.Protocol; using Microsoft.WindowsAzure.Storage.Table.Entities; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Threading; using System.Xml.Linq; namespace Microsoft.WindowsAzure.Storage.Table { #pragma warning disable 0618 [TestClass] public class TableSasUnitTests : TableTestBase { #region Locals + Ctors public TableSasUnitTests() { } private TestContext testContextInstance; /// <summary> ///Gets or sets the test context which provides ///information about and functionality for the current test run. ///</summary> public TestContext TestContext { get { return testContextInstance; } set { testContextInstance = value; } } #endregion #region Additional test attributes // // You can use the following additional attributes as you write your tests: // // Use ClassInitialize to run code before running the first test in the class // [ClassInitialize()] // public static void MyClassInitialize(TestContext testContext) { } // // Use ClassCleanup to run code after all tests in a class have run // [ClassCleanup()] // public static void MyClassCleanup() { } // // Use TestInitialize to run code before running each test // // // Use TestInitialize to run code before running each test [TestInitialize()] public void MyTestInitialize() { if (TestBase.TableBufferManager != null) { TestBase.TableBufferManager.OutstandingBufferCount = 0; } } // // Use TestCleanup to run code after each test has run [TestCleanup()] public void MyTestCleanup() { if (TestBase.TableBufferManager != null) { Assert.AreEqual(0, TestBase.TableBufferManager.OutstandingBufferCount); } } #endregion #region Constructor Tests [TestMethod] [Description("Test TableSas via various constructors")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void TableSASConstructors() { CloudTableClient tableClient = GenerateCloudTableClient(); CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N")); try { table.Create(); table.Execute(TableOperation.Insert(new BaseEntity("PK", "RK"))); // Prepare SAS authentication with full permissions string sasToken = table.GetSharedAccessSignature( new SharedAccessTablePolicy { Permissions = SharedAccessTablePermissions.Add | SharedAccessTablePermissions.Delete | SharedAccessTablePermissions.Query, SharedAccessExpiryTime = DateTimeOffset.Now.AddMinutes(30) }, null /* accessPolicyIdentifier */, null /* startPk */, null /* startRk */, null /* endPk */, null /* endRk */); CloudStorageAccount sasAccount; StorageCredentials sasCreds; CloudTableClient sasClient; CloudTable sasTable; Uri baseUri = new Uri(TestBase.TargetTenantConfig.TableServiceEndpoint); // SAS via connection string parse sasAccount = CloudStorageAccount.Parse(string.Format("TableEndpoint={0};SharedAccessSignature={1}", baseUri.AbsoluteUri, sasToken)); sasClient = sasAccount.CreateCloudTableClient(); sasTable = sasClient.GetTableReference(table.Name); Assert.AreEqual(1, sasTable.ExecuteQuery(new TableQuery<BaseEntity>()).Count()); // SAS via account constructor sasCreds = new StorageCredentials(sasToken); sasAccount = new CloudStorageAccount(sasCreds, null, null, baseUri, null); sasClient = sasAccount.CreateCloudTableClient(); sasTable = sasClient.GetTableReference(table.Name); Assert.AreEqual(1, sasTable.ExecuteQuery(new TableQuery<BaseEntity>()).Count()); // SAS via client constructor URI + Creds sasCreds = new StorageCredentials(sasToken); sasClient = new CloudTableClient(baseUri, sasCreds); sasTable = sasClient.GetTableReference(table.Name); Assert.AreEqual(1, sasTable.ExecuteQuery(new TableQuery<BaseEntity>()).Count()); // SAS via CloudTable constructor Uri + Client sasCreds = new StorageCredentials(sasToken); sasTable = new CloudTable(table.Uri, tableClient.Credentials); sasClient = sasTable.ServiceClient; Assert.AreEqual(1, sasTable.ExecuteQuery(new TableQuery<BaseEntity>()).Count()); } finally { table.DeleteIfExists(); } } #endregion #region Permissions [TestMethod] [Description("Tests setting and getting table permissions")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void TableSetGetPermissions() { CloudTableClient tableClient = GenerateCloudTableClient(); CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N")); try { table.Create(); table.Execute(TableOperation.Insert(new BaseEntity("PK", "RK"))); TablePermissions expectedPermissions = new TablePermissions(); TablePermissions testPermissions = table.GetPermissions(); AssertPermissionsEqual(expectedPermissions, testPermissions); // Add a policy, check setting and getting. expectedPermissions.SharedAccessPolicies.Add(Guid.NewGuid().ToString(), new SharedAccessTablePolicy { Permissions = SharedAccessTablePermissions.Query, SharedAccessStartTime = DateTimeOffset.Now - TimeSpan.FromHours(1), SharedAccessExpiryTime = DateTimeOffset.Now + TimeSpan.FromHours(1) }); table.SetPermissions(expectedPermissions); Thread.Sleep(30 * 1000); testPermissions = table.GetPermissions(); AssertPermissionsEqual(expectedPermissions, testPermissions); } finally { table.DeleteIfExists(); } } [TestMethod] [Description("Tests Null Access Policy")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void TableSASNullAccessPolicy() { CloudTableClient tableClient = GenerateCloudTableClient(); CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N")); try { table.Create(); table.Execute(TableOperation.Insert(new BaseEntity("PK", "RK"))); TablePermissions expectedPermissions = new TablePermissions(); // Add a policy expectedPermissions.SharedAccessPolicies.Add(Guid.NewGuid().ToString(), new SharedAccessTablePolicy { Permissions = SharedAccessTablePermissions.Query | SharedAccessTablePermissions.Add, SharedAccessStartTime = DateTimeOffset.Now - TimeSpan.FromHours(1), SharedAccessExpiryTime = DateTimeOffset.Now + TimeSpan.FromHours(1) }); table.SetPermissions(expectedPermissions); Thread.Sleep(30 * 1000); // Generate the sasToken the user should use string sasToken = table.GetSharedAccessSignature(null, expectedPermissions.SharedAccessPolicies.First().Key, "AAAA", null, "AAAA", null); CloudTable sasTable = new CloudTable(table.Uri, new StorageCredentials(sasToken)); sasTable.Execute(TableOperation.Insert(new DynamicTableEntity("AAAA", "foo"))); TableResult result = sasTable.Execute(TableOperation.Retrieve("AAAA", "foo")); Assert.IsNotNull(result.Result); // revoke table permissions table.SetPermissions(new TablePermissions()); Thread.Sleep(30 * 1000); OperationContext opContext = new OperationContext(); try { sasTable.Execute(TableOperation.Insert(new DynamicTableEntity("AAAA", "foo2")), null, opContext); Assert.Fail(); } catch (Exception) { Assert.AreEqual(opContext.LastResult.HttpStatusCode, (int)HttpStatusCode.Forbidden); } opContext = new OperationContext(); try { result = sasTable.Execute(TableOperation.Retrieve("AAAA", "foo"), null, opContext); Assert.Fail(); } catch (Exception) { Assert.AreEqual(opContext.LastResult.HttpStatusCode, (int)HttpStatusCode.Forbidden); } } finally { table.DeleteIfExists(); } } #endregion #region SAS Operations [TestMethod] [Description("Tests table SAS with query permissions.")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void TableSasQueryTestSync() { TestTableSas(SharedAccessTablePermissions.Query); } [TestMethod] [Description("Tests table SAS with delete permissions.")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void TableSasDeleteTestSync() { TestTableSas(SharedAccessTablePermissions.Delete); } [TestMethod] [Description("Tests table SAS with process and update permissions.")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void TableSasUpdateTestSync() { TestTableSas(SharedAccessTablePermissions.Update); } [TestMethod] [Description("Tests table SAS with add permissions.")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void TableSasAddTestSync() { TestTableSas(SharedAccessTablePermissions.Add); } [TestMethod] [Description("Tests table SAS with full permissions.")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void TableSasFullTestSync() { TestTableSas(SharedAccessTablePermissions.Query | SharedAccessTablePermissions.Delete | SharedAccessTablePermissions.Update | SharedAccessTablePermissions.Add); } /// <summary> /// Tests table access permissions with SAS, using a stored policy and using permissions on the URI. /// Various table range constraints are tested. /// </summary> /// <param name="accessPermissions">The permissions to test.</param> internal void TestTableSas(SharedAccessTablePermissions accessPermissions) { string startPk = "M"; string startRk = "F"; string endPk = "S"; string endRk = "T"; // No ranges specified TestTableSasWithRange(accessPermissions, null, null, null, null); // All ranges specified TestTableSasWithRange(accessPermissions, startPk, startRk, endPk, endRk); // StartPk & StartRK specified TestTableSasWithRange(accessPermissions, startPk, startRk, null, null); // StartPk specified TestTableSasWithRange(accessPermissions, startPk, null, null, null); // EndPk & EndRK specified TestTableSasWithRange(accessPermissions, null, null, endPk, endRk); // EndPk specified TestTableSasWithRange(accessPermissions, null, null, endPk, null); // StartPk and EndPk specified TestTableSasWithRange(accessPermissions, startPk, null, endPk, null); // StartRk and StartRK and EndPk specified TestTableSasWithRange(accessPermissions, startPk, startRk, endPk, null); // StartRk and EndPK and EndPk specified TestTableSasWithRange(accessPermissions, startPk, null, endPk, endRk); } /// <summary> /// Tests table access permissions with SAS, using a stored policy and using permissions on the URI. /// </summary> /// <param name="accessPermissions">The permissions to test.</param> /// <param name="startPk">The start partition key range.</param> /// <param name="startRk">The start row key range.</param> /// <param name="endPk">The end partition key range.</param> /// <param name="endRk">The end row key range.</param> internal void TestTableSasWithRange( SharedAccessTablePermissions accessPermissions, string startPk, string startRk, string endPk, string endRk) { CloudTableClient tableClient = GenerateCloudTableClient(); CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N")); try { table.Create(); // Set up a policy string identifier = Guid.NewGuid().ToString(); TablePermissions permissions = new TablePermissions(); permissions.SharedAccessPolicies.Add(identifier, new SharedAccessTablePolicy { Permissions = accessPermissions, SharedAccessExpiryTime = DateTimeOffset.Now.AddDays(1) }); table.SetPermissions(permissions); Thread.Sleep(30 * 1000); // Prepare SAS authentication using access identifier string sasString = table.GetSharedAccessSignature(new SharedAccessTablePolicy(), identifier, startPk, startRk, endPk, endRk); CloudTableClient identifierSasClient = new CloudTableClient(tableClient.BaseUri, new StorageCredentials(sasString)); // Prepare SAS authentication using explicit policy sasString = table.GetSharedAccessSignature( new SharedAccessTablePolicy { Permissions = accessPermissions, SharedAccessExpiryTime = DateTimeOffset.Now.AddMinutes(30) }, null, startPk, startRk, endPk, endRk); CloudTableClient explicitSasClient = new CloudTableClient(tableClient.BaseUri, new StorageCredentials(sasString)); // Point query TestPointQuery(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk); TestPointQuery(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk); // Add row TestAdd(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk); TestAdd(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk); // Update row (merge) TestUpdateMerge(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk); TestUpdateMerge(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk); // Update row (replace) TestUpdateReplace(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk); TestUpdateReplace(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk); // Delete row TestDelete(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk); TestDelete(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk); // Upsert row (merge) TestUpsertMerge(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk); TestUpsertMerge(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk); // Upsert row (replace) TestUpsertReplace(identifierSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk); TestUpsertReplace(explicitSasClient, table.Name, accessPermissions, startPk, startRk, endPk, endRk); } finally { table.DeleteIfExists(); } } /// <summary> /// Test point queries entities inside and outside the given range. /// </summary> /// <param name="testClient">The table client to test.</param> /// <param name="tableName">The name of the table to test.</param> /// <param name="accessPermissions">The access permissions of the table client.</param> /// <param name="startPk">The start partition key range.</param> /// <param name="startRk">The start row key range.</param> /// <param name="endPk">The end partition key range.</param> /// <param name="endRk">The end row key range.</param> private void TestPointQuery( CloudTableClient testClient, string tableName, SharedAccessTablePermissions accessPermissions, string startPk, string startRk, string endPk, string endRk) { bool expectSuccess = ((accessPermissions & SharedAccessTablePermissions.Query) != 0); Action<BaseEntity, OperationContext> queryDelegate = (tableEntity, ctx) => { TableResult retrieveResult = testClient.GetTableReference(tableName).Execute(TableOperation.Retrieve<BaseEntity>(tableEntity.PartitionKey, tableEntity.RowKey), null, ctx); if (expectSuccess) { Assert.IsNotNull(retrieveResult.Result); } else { Assert.AreEqual(ctx.LastResult.HttpStatusCode, (int)HttpStatusCode.OK); } }; // Perform test TestOperationWithRange( tableName, startPk, startRk, endPk, endRk, queryDelegate, "point query", expectSuccess, expectSuccess ? HttpStatusCode.OK : HttpStatusCode.NotFound, false, expectSuccess); } /// <summary> /// Test update (merge) on entities inside and outside the given range. /// </summary> /// <param name="testClient">The table client to test.</param> /// <param name="tableName">The name of the table to test.</param> /// <param name="accessPermissions">The access permissions of the table client.</param> /// <param name="startPk">The start partition key range.</param> /// <param name="startRk">The start row key range.</param> /// <param name="endPk">The end partition key range.</param> /// <param name="endRk">The end row key range.</param> private void TestUpdateMerge( CloudTableClient testClient, string tableName, SharedAccessTablePermissions accessPermissions, string startPk, string startRk, string endPk, string endRk) { Action<BaseEntity, OperationContext> updateDelegate = (tableEntity, ctx) => { // Merge entity tableEntity.A = "10"; tableEntity.ETag = "*"; testClient.GetTableReference(tableName).Execute(TableOperation.Merge(tableEntity), null, ctx); }; bool expectSuccess = (accessPermissions & SharedAccessTablePermissions.Update) != 0; // Perform test TestOperationWithRange( tableName, startPk, startRk, endPk, endRk, updateDelegate, "update merge", expectSuccess, expectSuccess ? HttpStatusCode.NoContent : HttpStatusCode.Forbidden); } /// <summary> /// Test update (replace) on entities inside and outside the given range. /// </summary> /// <param name="testClient">The table client to test.</param> /// <param name="tableName">The name of the table to test.</param> /// <param name="accessPermissions">The access permissions of the table client.</param> /// <param name="startPk">The start partition key range.</param> /// <param name="startRk">The start row key range.</param> /// <param name="endPk">The end partition key range.</param> /// <param name="endRk">The end row key range.</param> private void TestUpdateReplace( CloudTableClient testClient, string tableName, SharedAccessTablePermissions accessPermissions, string startPk, string startRk, string endPk, string endRk) { Action<BaseEntity, OperationContext> updateDelegate = (tableEntity, ctx) => { // replace entity tableEntity.A = "20"; tableEntity.ETag = "*"; testClient.GetTableReference(tableName).Execute(TableOperation.Replace(tableEntity), null, ctx); }; bool expectSuccess = (accessPermissions & SharedAccessTablePermissions.Update) != 0; // Perform test TestOperationWithRange( tableName, startPk, startRk, endPk, endRk, updateDelegate, "update replace", expectSuccess, expectSuccess ? HttpStatusCode.NoContent : HttpStatusCode.Forbidden); } /// <summary> /// Test adding entities inside and outside the given range. /// </summary> /// <param name="testClient">The table client to test.</param> /// <param name="tableName">The name of the table to test.</param> /// <param name="accessPermissions">The access permissions of the table client.</param> /// <param name="startPk">The start partition key range.</param> /// <param name="startRk">The start row key range.</param> /// <param name="endPk">The end partition key range.</param> /// <param name="endRk">The end row key range.</param> private void TestAdd( CloudTableClient testClient, string tableName, SharedAccessTablePermissions accessPermissions, string startPk, string startRk, string endPk, string endRk) { Action<BaseEntity, OperationContext> addDelegate = (tableEntity, ctx) => { // insert entity tableEntity.A = "10"; testClient.GetTableReference(tableName).Execute(TableOperation.Insert(tableEntity), null, ctx); }; bool expectSuccess = (accessPermissions & SharedAccessTablePermissions.Add) != 0; // Perform test TestOperationWithRange( tableName, startPk, startRk, endPk, endRk, addDelegate, "add", expectSuccess, expectSuccess ? HttpStatusCode.Created : HttpStatusCode.Forbidden); } /// <summary> /// Test deleting entities inside and outside the given range. /// </summary> /// <param name="testClient">The table client to test.</param> /// <param name="tableName">The name of the table to test.</param> /// <param name="accessPermissions">The access permissions of the table client.</param> /// <param name="startPk">The start partition key range.</param> /// <param name="startRk">The start row key range.</param> /// <param name="endPk">The end partition key range.</param> /// <param name="endRk">The end row key range.</param> private void TestDelete( CloudTableClient testClient, string tableName, SharedAccessTablePermissions accessPermissions, string startPk, string startRk, string endPk, string endRk) { Action<BaseEntity, OperationContext> deleteDelegate = (tableEntity, ctx) => { // delete entity tableEntity.A = "10"; tableEntity.ETag = "*"; testClient.GetTableReference(tableName).Execute(TableOperation.Delete(tableEntity), null, ctx); }; bool expectSuccess = (accessPermissions & SharedAccessTablePermissions.Delete) != 0; // Perform test TestOperationWithRange( tableName, startPk, startRk, endPk, endRk, deleteDelegate, "delete", expectSuccess, expectSuccess ? HttpStatusCode.NoContent : HttpStatusCode.Forbidden); } /// <summary> /// Test upsert (insert or merge) on entities inside and outside the given range. /// </summary> /// <param name="testClient">The table client to test.</param> /// <param name="tableName">The name of the table to test.</param> /// <param name="accessPermissions">The access permissions of the table client.</param> /// <param name="startPk">The start partition key range.</param> /// <param name="startRk">The start row key range.</param> /// <param name="endPk">The end partition key range.</param> /// <param name="endRk">The end row key range.</param> private void TestUpsertMerge( CloudTableClient testClient, string tableName, SharedAccessTablePermissions accessPermissions, string startPk, string startRk, string endPk, string endRk) { Action<BaseEntity, OperationContext> upsertDelegate = (tableEntity, ctx) => { // insert or merge entity tableEntity.A = "10"; testClient.GetTableReference(tableName).Execute(TableOperation.InsertOrMerge(tableEntity), null, ctx); }; SharedAccessTablePermissions upsertPermissions = (SharedAccessTablePermissions.Update | SharedAccessTablePermissions.Add); bool expectSuccess = (accessPermissions & upsertPermissions) == upsertPermissions; // Perform test TestOperationWithRange( tableName, startPk, startRk, endPk, endRk, upsertDelegate, "upsert merge", expectSuccess, expectSuccess ? HttpStatusCode.NoContent : HttpStatusCode.Forbidden); } /// <summary> /// Test upsert (insert or replace) on entities inside and outside the given range. /// </summary> /// <param name="testClient">The table client to test.</param> /// <param name="tableName">The name of the table to test.</param> /// <param name="accessPermissions">The access permissions of the table client.</param> /// <param name="startPk">The start partition key range.</param> /// <param name="startRk">The start row key range.</param> /// <param name="endPk">The end partition key range.</param> /// <param name="endRk">The end row key range.</param> private void TestUpsertReplace( CloudTableClient testClient, string tableName, SharedAccessTablePermissions accessPermissions, string startPk, string startRk, string endPk, string endRk) { Action<BaseEntity, OperationContext> upsertDelegate = (tableEntity, ctx) => { // insert or replace entity tableEntity.A = "10"; testClient.GetTableReference(tableName).Execute(TableOperation.InsertOrReplace(tableEntity), null, ctx); }; SharedAccessTablePermissions upsertPermissions = (SharedAccessTablePermissions.Update | SharedAccessTablePermissions.Add); bool expectSuccess = (accessPermissions & upsertPermissions) == upsertPermissions; // Perform test TestOperationWithRange( tableName, startPk, startRk, endPk, endRk, upsertDelegate, "upsert replace", expectSuccess, expectSuccess ? HttpStatusCode.NoContent : HttpStatusCode.Forbidden); } /// <summary> /// Test a table operation on entities inside and outside the given range. /// </summary> /// <param name="tableName">The name of the table to test.</param> /// <param name="startPk">The start partition key range.</param> /// <param name="startRk">The start row key range.</param> /// <param name="endPk">The end partition key range.</param> /// <param name="endRk">The end row key range.</param> /// <param name="runOperationDelegate">A delegate with the table operation to test.</param> /// <param name="opName">The name of the operation being tested.</param> /// <param name="expectSuccess">Whether the operation should succeed on entities within the range.</param> private void TestOperationWithRange( string tableName, string startPk, string startRk, string endPk, string endRk, Action<BaseEntity, OperationContext> runOperationDelegate, string opName, bool expectSuccess, HttpStatusCode expectedStatusCode) { TestOperationWithRange( tableName, startPk, startRk, endPk, endRk, runOperationDelegate, opName, expectSuccess, expectedStatusCode, false /* isRangeQuery */); } /// <summary> /// Test a table operation on entities inside and outside the given range. /// </summary> /// <param name="tableName">The name of the table to test.</param> /// <param name="startPk">The start partition key range.</param> /// <param name="startRk">The start row key range.</param> /// <param name="endPk">The end partition key range.</param> /// <param name="endRk">The end row key range.</param> /// <param name="runOperationDelegate">A delegate with the table operation to test.</param> /// <param name="opName">The name of the operation being tested.</param> /// <param name="expectSuccess">Whether the operation should succeed on entities within the range.</param> /// <param name="expectedStatusCode">The status code expected for the response.</param> /// <param name="isRangeQuery">Specifies if the operation is a range query.</param> private void TestOperationWithRange( string tableName, string startPk, string startRk, string endPk, string endRk, Action<BaseEntity, OperationContext> runOperationDelegate, string opName, bool expectSuccess, HttpStatusCode expectedStatusCode, bool isRangeQuery) { TestOperationWithRange( tableName, startPk, startRk, endPk, endRk, runOperationDelegate, opName, expectSuccess, expectedStatusCode, isRangeQuery, false /* isPointQuery */); } /// <summary> /// Test a table operation on entities inside and outside the given range. /// </summary> /// <param name="tableName">The name of the table to test.</param> /// <param name="startPk">The start partition key range.</param> /// <param name="startRk">The start row key range.</param> /// <param name="endPk">The end partition key range.</param> /// <param name="endRk">The end row key range.</param> /// <param name="runOperationDelegate">A delegate with the table operation to test.</param> /// <param name="opName">The name of the operation being tested.</param> /// <param name="expectSuccess">Whether the operation should succeed on entities within the range.</param> /// <param name="expectedStatusCode">The status code expected for the response.</param> /// <param name="isRangeQuery">Specifies if the operation is a range query.</param> /// <param name="isPointQuery">Specifies if the operation is a point query.</param> private void TestOperationWithRange( string tableName, string startPk, string startRk, string endPk, string endRk, Action<BaseEntity, OperationContext> runOperationDelegate, string opName, bool expectSuccess, HttpStatusCode expectedStatusCode, bool isRangeQuery, bool isPointQuery) { CloudTableClient referenceClient = GenerateCloudTableClient(); string partitionKey = startPk ?? endPk ?? "M"; string rowKey = startRk ?? endRk ?? "S"; // if we expect a success for creation - avoid inserting duplicate entities BaseEntity tableEntity = new BaseEntity(partitionKey, rowKey); if (expectedStatusCode == HttpStatusCode.Created) { try { tableEntity.ETag = "*"; referenceClient.GetTableReference(tableName).Execute(TableOperation.Delete(tableEntity)); } catch (Exception) { } } else { // only for add we should not be adding the entity referenceClient.GetTableReference(tableName).Execute(TableOperation.InsertOrReplace(tableEntity)); } if (expectSuccess) { runOperationDelegate(tableEntity, null); } else { TestHelper.ExpectedException( (ctx) => runOperationDelegate(tableEntity, ctx), string.Format("{0} without appropriate permission.", opName), (int)HttpStatusCode.Forbidden); } if (startPk != null) { tableEntity.PartitionKey = "A"; if (startPk.CompareTo(tableEntity.PartitionKey) <= 0) { Assert.Inconclusive("Test error: partition key for this test must not be less than or equal to \"A\""); } TestHelper.ExpectedException( (ctx) => runOperationDelegate(tableEntity, ctx), string.Format("{0} before allowed partition key range", opName), (int)(isPointQuery ? HttpStatusCode.NotFound : HttpStatusCode.Forbidden)); tableEntity.PartitionKey = partitionKey; } if (endPk != null) { tableEntity.PartitionKey = "Z"; if (endPk.CompareTo(tableEntity.PartitionKey) >= 0) { Assert.Inconclusive("Test error: partition key for this test must not be greater than or equal to \"Z\""); } TestHelper.ExpectedException( (ctx) => runOperationDelegate(tableEntity, ctx), string.Format("{0} after allowed partition key range", opName), (int)(isPointQuery ? HttpStatusCode.NotFound : HttpStatusCode.Forbidden)); tableEntity.PartitionKey = partitionKey; } if (startRk != null) { if (isRangeQuery || startPk != null) { tableEntity.PartitionKey = startPk; tableEntity.RowKey = "A"; if (startRk.CompareTo(tableEntity.RowKey) <= 0) { Assert.Inconclusive("Test error: row key for this test must not be less than or equal to \"A\""); } TestHelper.ExpectedException( (ctx) => runOperationDelegate(tableEntity, ctx), string.Format("{0} before allowed row key range", opName), (int)(isPointQuery ? HttpStatusCode.NotFound : HttpStatusCode.Forbidden)); tableEntity.RowKey = rowKey; } } if (endRk != null) { if (isRangeQuery || endPk != null) { tableEntity.PartitionKey = endPk; tableEntity.RowKey = "Z"; if (endRk.CompareTo(tableEntity.RowKey) >= 0) { Assert.Inconclusive("Test error: row key for this test must not be greater than or equal to \"Z\""); } TestHelper.ExpectedException( (ctx) => runOperationDelegate(tableEntity, ctx), string.Format("{0} after allowed row key range", opName), (int)(isPointQuery ? HttpStatusCode.NotFound : HttpStatusCode.Forbidden)); tableEntity.RowKey = rowKey; } } } #endregion #region SAS Error Conditions //[TestMethod] // Disabled until service bug is fixed [Description("Attempt to use SAS to authenticate table operations that must not work with SAS.")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void TableSasInvalidOperations() { CloudTableClient tableClient = GenerateCloudTableClient(); CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N")); try { table.Create(); // Prepare SAS authentication with full permissions string sasString = table.GetSharedAccessSignature( new SharedAccessTablePolicy { Permissions = SharedAccessTablePermissions.Delete, SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30) }, null, null, null, null, null); CloudTableClient sasClient = new CloudTableClient(tableClient.BaseUri, new StorageCredentials(sasString)); // Construct a valid set of service properties to upload. ServiceProperties properties = new ServiceProperties(); properties.Logging.Version = Constants.AnalyticsConstants.LoggingVersionV1; properties.HourMetrics.Version = Constants.AnalyticsConstants.MetricsVersionV1; properties.Logging.RetentionDays = 9; sasClient.GetServiceProperties(); sasClient.SetServiceProperties(properties); // Test invalid client operations // BUGBUG: ListTables hides the exception. We should fix this // TestHelpers.ExpectedException(() => sasClient.ListTablesSegmented(), "List tables with SAS", HttpStatusCode.Forbidden); TestHelper.ExpectedException((ctx) => sasClient.GetServiceProperties(), "Get service properties with SAS", (int)HttpStatusCode.Forbidden); TestHelper.ExpectedException((ctx) => sasClient.SetServiceProperties(properties), "Set service properties with SAS", (int)HttpStatusCode.Forbidden); CloudTable sasTable = sasClient.GetTableReference(table.Name); // Verify that creation fails with SAS TestHelper.ExpectedException((ctx) => sasTable.Create(null, ctx), "Create a table with SAS", (int)HttpStatusCode.Forbidden); // Create the table. table.Create(); // Test invalid table operations TestHelper.ExpectedException((ctx) => sasTable.Delete(null, ctx), "Delete a table with SAS", (int)HttpStatusCode.Forbidden); TestHelper.ExpectedException((ctx) => sasTable.GetPermissions(null, ctx), "Get ACL with SAS", (int)HttpStatusCode.Forbidden); TestHelper.ExpectedException((ctx) => sasTable.SetPermissions(new TablePermissions(), null, ctx), "Set ACL with SAS", (int)HttpStatusCode.Forbidden); } finally { table.DeleteIfExists(); } } #endregion #region Update SAS token [TestMethod] [Description("Update table SAS.")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void TableUpdateSasTestSync() { CloudTableClient tableClient = GenerateCloudTableClient(); CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N")); try { table.Create(); BaseEntity entity = new BaseEntity("PK", "RK"); table.Execute(TableOperation.Insert(entity)); SharedAccessTablePolicy policy = new SharedAccessTablePolicy() { SharedAccessStartTime = DateTimeOffset.UtcNow.AddMinutes(-5), SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30), Permissions = SharedAccessTablePermissions.Delete, }; string sasToken = table.GetSharedAccessSignature(policy); StorageCredentials creds = new StorageCredentials(sasToken); CloudTable sasTable = new CloudTable(table.Uri, creds); TestHelper.ExpectedException( () => sasTable.Execute(TableOperation.Insert(new BaseEntity("PK", "RK2"))), "Try to insert an entity when SAS doesn't allow inserts", HttpStatusCode.Forbidden); sasTable.Execute(TableOperation.Delete(entity)); SharedAccessTablePolicy policy2 = new SharedAccessTablePolicy() { SharedAccessStartTime = DateTimeOffset.UtcNow.AddMinutes(-5), SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30), Permissions = SharedAccessTablePermissions.Delete | SharedAccessTablePermissions.Add, }; string sasToken2 = table.GetSharedAccessSignature(policy2); creds.UpdateSASToken(sasToken2); sasTable = new CloudTable(table.Uri, creds); sasTable.Execute(TableOperation.Insert(new BaseEntity("PK", "RK2"))); } finally { table.DeleteIfExists(); } } #endregion #region SasUri [TestMethod] [Description("Use table SasUri.")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void TableSasUriTestSync() { CloudTableClient tableClient = GenerateCloudTableClient(); CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N")); try { table.Create(); BaseEntity entity = new BaseEntity("PK", "RK"); BaseEntity entity1 = new BaseEntity("PK", "RK1"); table.Execute(TableOperation.Insert(entity)); table.Execute(TableOperation.Insert(entity1)); SharedAccessTablePolicy policy = new SharedAccessTablePolicy() { SharedAccessStartTime = DateTimeOffset.UtcNow.AddMinutes(-5), SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30), Permissions = SharedAccessTablePermissions.Delete, }; string sasToken = table.GetSharedAccessSignature(policy); StorageCredentials creds = new StorageCredentials(sasToken); CloudStorageAccount sasAcc = new CloudStorageAccount(creds, null /* blobEndpoint */, null /* queueEndpoint */, new Uri(TestBase.TargetTenantConfig.TableServiceEndpoint), null /* fileEndpoint */); CloudTableClient client = sasAcc.CreateCloudTableClient(); CloudTable sasTable = new CloudTable(client.Credentials.TransformUri(table.Uri)); sasTable.Execute(TableOperation.Delete(entity)); CloudTable sasTable2 = new CloudTable(new Uri(table.Uri.ToString() + sasToken)); sasTable2.Execute(TableOperation.Delete(entity1)); } finally { table.DeleteIfExists(); } } [TestMethod] [Description("Use table SasUri.")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void TableSasUriPkRkTestSync() { CloudTableClient tableClient = GenerateCloudTableClient(); CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N")); try { table.Create(); SharedAccessTablePolicy policy = new SharedAccessTablePolicy() { SharedAccessStartTime = DateTimeOffset.UtcNow.AddMinutes(-5), SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30), Permissions = SharedAccessTablePermissions.Add, }; string sasTokenPkRk = table.GetSharedAccessSignature(policy, null, "tables_batch_0", "00", "tables_batch_1", "04"); StorageCredentials credsPkRk = new StorageCredentials(sasTokenPkRk); // transform uri from credentials CloudTable sasTableTransformed = new CloudTable(credsPkRk.TransformUri(table.Uri)); // create uri by appending sas CloudTable sasTableDirect = new CloudTable(new Uri(table.Uri.ToString() + sasTokenPkRk)); BaseEntity pkrkEnt = new BaseEntity("tables_batch_0", "00"); sasTableTransformed.Execute(TableOperation.Insert(pkrkEnt)); pkrkEnt = new BaseEntity("tables_batch_0", "01"); sasTableDirect.Execute(TableOperation.Insert(pkrkEnt)); Action<BaseEntity, CloudTable, OperationContext> insertDelegate = (tableEntity, sasTable1, ctx) => { sasTable1.Execute(TableOperation.Insert(tableEntity), null, ctx); }; pkrkEnt = new BaseEntity("tables_batch_2", "00"); TestHelper.ExpectedException( (ctx) => insertDelegate(pkrkEnt, sasTableTransformed, ctx), string.Format("Inserted entity without appropriate SAS permissions."), (int)HttpStatusCode.Forbidden); TestHelper.ExpectedException( (ctx) => insertDelegate(pkrkEnt, sasTableDirect, ctx), string.Format("Inserted entity without appropriate SAS permissions."), (int)HttpStatusCode.Forbidden); pkrkEnt = new BaseEntity("tables_batch_1", "05"); TestHelper.ExpectedException( (ctx) => insertDelegate(pkrkEnt, sasTableTransformed, ctx), string.Format("Inserted entity without appropriate SAS permissions."), (int)HttpStatusCode.Forbidden); TestHelper.ExpectedException( (ctx) => insertDelegate(pkrkEnt, sasTableDirect, ctx), string.Format("Inserted entity without appropriate SAS permissions."), (int)HttpStatusCode.Forbidden); } finally { table.DeleteIfExists(); } } #endregion #region SASIPAddressTests /// <summary> /// Helper function for testing the IPAddressOrRange funcitonality for tables /// </summary> /// <param name="generateInitialIPAddressOrRange">Function that generates an initial IPAddressOrRange object to use. This is expected to fail on the service.</param> /// <param name="generateFinalIPAddressOrRange">Function that takes in the correct IP address (according to the service) and returns the IPAddressOrRange object /// that should be accepted by the service</param> public void CloudTableSASIPAddressHelper(Func<IPAddressOrRange> generateInitialIPAddressOrRange, Func<IPAddress, IPAddressOrRange> generateFinalIPAddressOrRange) { CloudTableClient tableClient = GenerateCloudTableClient(); CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N")); try { table.Create(); SharedAccessTablePolicy policy = new SharedAccessTablePolicy() { Permissions = SharedAccessTablePermissions.Query, SharedAccessStartTime = DateTimeOffset.UtcNow.AddMinutes(-5), SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30), }; DynamicTableEntity entity = new DynamicTableEntity("PK", "RK", null, new Dictionary<string, EntityProperty>() {{"prop", new EntityProperty(4)}}); table.Execute(new TableOperation(entity, TableOperationType.Insert)); // The plan then is to use an incorrect IP address to make a call to the service // ensure that we get an error message // parse the error message to get my actual IP (as far as the service sees) // then finally test the success case to ensure we can actually make requests IPAddressOrRange ipAddressOrRange = generateInitialIPAddressOrRange(); string tableToken = table.GetSharedAccessSignature(policy, null, null, null, null, null, null, ipAddressOrRange); StorageCredentials tableSAS = new StorageCredentials(tableToken); Uri tableSASUri = tableSAS.TransformUri(table.Uri); StorageUri tableSASStorageUri = tableSAS.TransformUri(table.StorageUri); CloudTable tableWithSAS = new CloudTable(tableSASUri); OperationContext opContext = new OperationContext(); IPAddress actualIP = null; bool exceptionThrown = false; TableResult result = null; DynamicTableEntity resultEntity = new DynamicTableEntity(); TableOperation retrieveOp = new TableOperation(resultEntity, TableOperationType.Retrieve); retrieveOp.RetrievePartitionKey = entity.PartitionKey; retrieveOp.RetrieveRowKey = entity.RowKey; try { result = tableWithSAS.Execute(retrieveOp, null, opContext); } catch (StorageException e) { string[] parts = e.RequestInformation.HttpStatusMessage.Split(' '); actualIP = IPAddress.Parse(parts[parts.Length - 1].Trim('.')); exceptionThrown = true; Assert.IsNotNull(actualIP); } Assert.IsTrue(exceptionThrown); ipAddressOrRange = generateFinalIPAddressOrRange(actualIP); tableToken = table.GetSharedAccessSignature(policy, null, null, null, null, null, null, ipAddressOrRange); tableSAS = new StorageCredentials(tableToken); tableSASUri = tableSAS.TransformUri(table.Uri); tableSASStorageUri = tableSAS.TransformUri(table.StorageUri); tableWithSAS = new CloudTable(tableSASUri); resultEntity = new DynamicTableEntity(); retrieveOp = new TableOperation(resultEntity, TableOperationType.Retrieve); retrieveOp.RetrievePartitionKey = entity.PartitionKey; retrieveOp.RetrieveRowKey = entity.RowKey; resultEntity = (DynamicTableEntity)tableWithSAS.Execute(retrieveOp).Result; Assert.AreEqual(entity.Properties["prop"].PropertyType, resultEntity.Properties["prop"].PropertyType); Assert.AreEqual(entity.Properties["prop"].Int32Value.Value, resultEntity.Properties["prop"].Int32Value.Value); Assert.IsTrue(table.StorageUri.PrimaryUri.Equals(tableWithSAS.Uri)); Assert.IsNull(tableWithSAS.StorageUri.SecondaryUri); tableWithSAS = new CloudTable(tableSASStorageUri, null); resultEntity = new DynamicTableEntity(); retrieveOp = new TableOperation(resultEntity, TableOperationType.Retrieve); retrieveOp.RetrievePartitionKey = entity.PartitionKey; retrieveOp.RetrieveRowKey = entity.RowKey; resultEntity = (DynamicTableEntity)tableWithSAS.Execute(retrieveOp).Result; Assert.AreEqual(entity.Properties["prop"].PropertyType, resultEntity.Properties["prop"].PropertyType); Assert.AreEqual(entity.Properties["prop"].Int32Value.Value, resultEntity.Properties["prop"].Int32Value.Value); Assert.IsTrue(table.StorageUri.Equals(tableWithSAS.StorageUri)); } finally { table.DeleteIfExists(); } } [TestMethod] [Description("Perform a SAS request specifying an IP address or range and ensure that everything works properly.")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevStore), TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void CloudTableSASIPAddressQueryParam() { CloudTableSASIPAddressHelper(() => { // We need an IP address that will never be a valid source IPAddress invalidIP = IPAddress.Parse("255.255.255.255"); return new IPAddressOrRange(invalidIP.ToString()); }, (IPAddress actualIP) => { return new IPAddressOrRange(actualIP.ToString()); }); } [TestMethod] [Description("Perform a SAS request specifying an IP address or range and ensure that everything works properly.")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevStore), TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void CloudTableSASIPRangeQueryParam() { CloudTableSASIPAddressHelper(() => { // We need an IP address that will never be a valid source IPAddress invalidIPBegin = IPAddress.Parse("255.255.255.0"); IPAddress invalidIPEnd = IPAddress.Parse("255.255.255.255"); return new IPAddressOrRange(invalidIPBegin.ToString(), invalidIPEnd.ToString()); }, (IPAddress actualIP) => { byte[] actualAddressBytes = actualIP.GetAddressBytes(); byte[] initialAddressBytes = actualAddressBytes.ToArray(); initialAddressBytes[0]--; byte[] finalAddressBytes = actualAddressBytes.ToArray(); finalAddressBytes[0]++; return new IPAddressOrRange(new IPAddress(initialAddressBytes).ToString(), new IPAddress(finalAddressBytes).ToString()); }); } #endregion #region SASHttpsTests [TestMethod] [Description("Perform a SAS request specifying a shared protocol and ensure that everything works properly.")] [TestCategory(ComponentCategory.Table)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void CloudTableSASSharedProtocolsQueryParam() { CloudTableClient tableClient = GenerateCloudTableClient(); CloudTable table = tableClient.GetTableReference("T" + Guid.NewGuid().ToString("N")); try { table.Create(); SharedAccessTablePolicy policy = new SharedAccessTablePolicy() { Permissions = SharedAccessTablePermissions.Query, SharedAccessStartTime = DateTimeOffset.UtcNow.AddMinutes(-5), SharedAccessExpiryTime = DateTimeOffset.UtcNow.AddMinutes(30), }; DynamicTableEntity entity = new DynamicTableEntity("PK", "RK", null, new Dictionary<string, EntityProperty>() { { "prop", new EntityProperty(4) } }); table.Execute(new TableOperation(entity, TableOperationType.Insert)); foreach (SharedAccessProtocol? protocol in new SharedAccessProtocol?[] { null, SharedAccessProtocol.HttpsOrHttp, SharedAccessProtocol.HttpsOnly }) { string tableToken = table.GetSharedAccessSignature(policy, null, null, null, null, null, protocol, null); StorageCredentials tableSAS = new StorageCredentials(tableToken); Uri tableSASUri = new Uri(table.Uri + tableSAS.SASToken); StorageUri tableSASStorageUri = new StorageUri(new Uri(table.StorageUri.PrimaryUri + tableSAS.SASToken), new Uri(table.StorageUri.SecondaryUri + tableSAS.SASToken)); int httpPort = tableSASUri.Port; int securePort = 443; if (!string.IsNullOrEmpty(TestBase.TargetTenantConfig.TableSecurePortOverride)) { securePort = Int32.Parse(TestBase.TargetTenantConfig.TableSecurePortOverride); } var schemesAndPorts = new[] { new { scheme = Uri.UriSchemeHttp, port = httpPort}, new { scheme = Uri.UriSchemeHttps, port = securePort} }; CloudTable tableWithSAS = null; TableOperation retrieveOp = TableOperation.Retrieve(entity.PartitionKey, entity.RowKey); foreach (var item in schemesAndPorts) { tableSASUri = TransformSchemeAndPort(tableSASUri, item.scheme, item.port); tableSASStorageUri = new StorageUri(TransformSchemeAndPort(tableSASStorageUri.PrimaryUri, item.scheme, item.port), TransformSchemeAndPort(tableSASStorageUri.SecondaryUri, item.scheme, item.port)); if (protocol.HasValue && protocol.Value == SharedAccessProtocol.HttpsOnly && string.CompareOrdinal(item.scheme, Uri.UriSchemeHttp) == 0) { tableWithSAS = new CloudTable(tableSASUri); TestHelper.ExpectedException(() => tableWithSAS.Execute(retrieveOp), "Access a table using SAS with a shared protocols that does not match", HttpStatusCode.Unused); tableWithSAS = new CloudTable(tableSASStorageUri, null); TestHelper.ExpectedException(() => tableWithSAS.Execute(retrieveOp), "Access a table using SAS with a shared protocols that does not match", HttpStatusCode.Unused); } else { tableWithSAS = new CloudTable(tableSASUri); TableResult result = tableWithSAS.Execute(retrieveOp); Assert.AreEqual(entity.Properties["prop"], ((DynamicTableEntity)result.Result).Properties["prop"]); tableWithSAS = new CloudTable(tableSASStorageUri, null); result = tableWithSAS.Execute(retrieveOp); Assert.AreEqual(entity.Properties["prop"], ((DynamicTableEntity)result.Result).Properties["prop"]); } } } } finally { table.DeleteIfExists(); } } private static Uri TransformSchemeAndPort(Uri input, string scheme, int port) { UriBuilder builder = new UriBuilder(input); builder.Scheme = scheme; builder.Port = port; return builder.Uri; } #endregion #region Test Helpers internal static void AssertPermissionsEqual(TablePermissions permissions1, TablePermissions permissions2) { Assert.AreEqual(permissions1.SharedAccessPolicies.Count, permissions2.SharedAccessPolicies.Count); foreach (KeyValuePair<string, SharedAccessTablePolicy> pair in permissions1.SharedAccessPolicies) { SharedAccessTablePolicy policy1 = pair.Value; SharedAccessTablePolicy policy2 = permissions2.SharedAccessPolicies[pair.Key]; Assert.IsNotNull(policy1); Assert.IsNotNull(policy2); Assert.AreEqual(policy1.Permissions, policy2.Permissions); if (policy1.SharedAccessStartTime != null) { Assert.IsTrue(Math.Floor((policy1.SharedAccessStartTime.Value - policy2.SharedAccessStartTime.Value).TotalSeconds) == 0); } if (policy1.SharedAccessExpiryTime != null) { Assert.IsTrue(Math.Floor((policy1.SharedAccessExpiryTime.Value - policy2.SharedAccessExpiryTime.Value).TotalSeconds) == 0); } } } #endregion } #pragma warning restore 0618 }
Java
/* Copyright 2018 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. */ package com.google.swarm.sqlserver.migration.common; import java.util.HashMap; public enum SqlDataType { VARCHAR(0), NVARCHAR(1), CHAR(2), NCHAR(3), TEXT(4), NTEXT(5), BIGINT(6), INT(7), TINYINT(8), SMALLINT(9), NUMERIC(10), DECIMAL(11), MONEY(12), SMALLMONEY(13), FLOAT(14), REAL(15), BIT(16), DATE(17), TIME(18), DATETIME(19), DATETIME2(20), DATETIMEOFFSET(21), SMALLDATETIME(22), BINARY(23), IMAGE(24), VARBINARY(25), UNIQUEIDENTIFIER(26), TIMESTAMP(27); private int codeValue; private static HashMap<Integer, SqlDataType> codeValueMap = new HashMap<Integer, SqlDataType>(); private SqlDataType(int codeValue) { this.codeValue = codeValue; } static { for (SqlDataType type : SqlDataType.values()) { codeValueMap.put(type.codeValue, type); } } public static SqlDataType getInstanceFromCodeValue(int codeValue) { return codeValueMap.get(codeValue); } public int getCodeValue() { return codeValue; } }
Java
using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; using Microsoft.Xna.Framework.Net; using Microsoft.Xna.Framework.Storage; using AODGameLibrary.GamePlay; using AODGameLibrary.Weapons; using AODGameLibrary.AODObjects; using AODGameLibrary.Gamehelpers; using AODGameLibrary.Effects; using AODGameLibrary.Units; using AODGameLibrary.Effects.ParticleShapes; using AODGameLibrary.CollisionChecking; namespace CombatLibrary.Spells { /// <summary> /// 空间炸弹,造成范围伤害并炸飞,大地无敌-范若余于2010年6月6日从Skill类中移出 /// </summary> public class SpaceBomb : Skill { /// <summary> /// 判断是否符合施放条件 /// </summary> /// <returns></returns> public override bool ConditionCheck() { if (true) { return true; } else return false; } /// <summary> /// 技能行为发生时的动作 /// </summary> public override void SkillAction() { List<VioableUnit> dn = GameWorld.GameItemManager.ItemInRange(MargedUnit.Position, FloatValues[1]); foreach (VioableUnit u in dn) { if (u.UnitState == UnitState.alive && u.Group != MargedUnit.Group && u.Heavy == false) { u.GetDamage(Damage); if (u.Position != MargedUnit.Position) { u.GetImpulse(FloatValues[0] * Vector3.Normalize(u.Position - MargedUnit.Position));//造成冲量,弹飞 } else u.GetImpulse(FloatValues[0] * Vector3.Up); } } GameWorld.ScreenEffectManager.Blink(); } /// <summary> /// Update时的动作 /// </summary> public override void UpdateAction(GameTime gameTime) { } /// <summary> /// 被中断时的动作 /// </summary> public override void InterruptAction() { } /// <summary> /// 开始准备施放的动作 /// </summary> public override void StartCastingAction() { } /// <summary> /// 开始通道施放的动作 /// </summary> public override void StartChannellingAction() { } } }
Java
/** * echarts组件:孤岛数据 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * */ define(function (require) { /** * 构造函数 * @param {Object} messageCenter echart消息中心 * @param {ZRender} zr zrender实例 * @param {Object} option 图表选项 */ function Island(messageCenter, zr) { // 基类装饰 var ComponentBase = require('../component/base'); ComponentBase.call(this, zr); // 可计算特性装饰 var CalculableBase = require('./calculableBase'); CalculableBase.call(this, zr); var ecConfig = require('../config'); var ecData = require('../util/ecData'); var zrEvent = require('zrender/tool/event'); var self = this; self.type = ecConfig.CHART_TYPE_ISLAND; var option; var _zlevelBase = self.getZlevelBase(); var _nameConnector; var _valueConnector; var _zrHeight = zr.getHeight(); var _zrWidth = zr.getWidth(); /** * 孤岛合并 * * @param {string} tarShapeIndex 目标索引 * @param {Object} srcShape 源目标,合入目标后删除 */ function _combine(tarShape, srcShape) { var zrColor = require('zrender/tool/color'); var value = ecData.get(tarShape, 'value') + ecData.get(srcShape, 'value'); var name = ecData.get(tarShape, 'name') + _nameConnector + ecData.get(srcShape, 'name'); tarShape.style.text = name + _valueConnector + value; ecData.set(tarShape, 'value', value); ecData.set(tarShape, 'name', name); tarShape.style.r = option.island.r; tarShape.style.color = zrColor.mix( tarShape.style.color, srcShape.style.color ); } /** * 刷新 */ function refresh(newOption) { if (newOption) { newOption.island = self.reformOption(newOption.island); option = newOption; _nameConnector = option.nameConnector; _valueConnector = option.valueConnector; } } function render(newOption) { refresh(newOption); for (var i = 0, l = self.shapeList.length; i < l; i++) { zr.addShape(self.shapeList[i]); } } function getOption() { return option; } function resize() { var newWidth = zr.getWidth(); var newHieght = zr.getHeight(); var xScale = newWidth / (_zrWidth || newWidth); var yScale = newHieght / (_zrHeight || newHieght); if (xScale == 1 && yScale == 1) { return; } _zrWidth = newWidth; _zrHeight = newHieght; for (var i = 0, l = self.shapeList.length; i < l; i++) { zr.modShape( self.shapeList[i].id, { style: { x: Math.round(self.shapeList[i].style.x * xScale), y: Math.round(self.shapeList[i].style.y * yScale) } } ); } } function add(shape) { var name = ecData.get(shape, 'name'); var value = ecData.get(shape, 'value'); var seriesName = typeof ecData.get(shape, 'series') != 'undefined' ? ecData.get(shape, 'series').name : ''; var font = self.getFont(option.island.textStyle); var islandShape = { shape : 'circle', id : zr.newShapeId(self.type), zlevel : _zlevelBase, style : { x : shape.style.x, y : shape.style.y, r : option.island.r, color : shape.style.color || shape.style.strokeColor, text : name + _valueConnector + value, textFont : font }, draggable : true, hoverable : true, onmousewheel : self.shapeHandler.onmousewheel, _type : 'island' }; if (islandShape.style.color == '#fff') { islandShape.style.color = shape.style.strokeColor; } self.setCalculable(islandShape); ecData.pack( islandShape, {name:seriesName}, -1, value, -1, name ); self.shapeList.push(islandShape); zr.addShape(islandShape); } function del(shape) { zr.delShape(shape.id); var newShapeList = []; for (var i = 0, l = self.shapeList.length; i < l; i++) { if (self.shapeList[i].id != shape.id) { newShapeList.push(self.shapeList[i]); } } self.shapeList = newShapeList; } /** * 数据项被拖拽进来, 重载基类方法 */ function ondrop(param, status) { if (!self.isDrop || !param.target) { // 没有在当前实例上发生拖拽行为则直接返回 return; } // 拖拽产生孤岛数据合并 var target = param.target; // 拖拽安放目标 var dragged = param.dragged; // 当前被拖拽的图形对象 _combine(target, dragged); zr.modShape(target.id, target); status.dragIn = true; // 处理完拖拽事件后复位 self.isDrop = false; return; } /** * 数据项被拖拽出去, 重载基类方法 */ function ondragend(param, status) { var target = param.target; // 拖拽安放目标 if (!self.isDragend) { // 拖拽的不是孤岛数据,如果没有图表接受孤岛数据,需要新增孤岛数据 if (!status.dragIn) { target.style.x = zrEvent.getX(param.event); target.style.y = zrEvent.getY(param.event); add(target); status.needRefresh = true; } } else { // 拖拽的是孤岛数据,如果有图表接受了孤岛数据,需要删除孤岛数据 if (status.dragIn) { del(target); status.needRefresh = true; } } // 处理完拖拽事件后复位 self.isDragend = false; return; } /** * 滚轮改变孤岛数据值 */ self.shapeHandler.onmousewheel = function(param) { var shape = param.target; var event = param.event; var delta = zrEvent.getDelta(event); delta = delta > 0 ? (-1) : 1; shape.style.r -= delta; shape.style.r = shape.style.r < 5 ? 5 : shape.style.r; var value = ecData.get(shape, 'value'); var dvalue = value * option.island.calculateStep; if (dvalue > 1) { value = Math.round(value - dvalue * delta); } else { value = (value - dvalue * delta).toFixed(2) - 0; } var name = ecData.get(shape, 'name'); shape.style.text = name + ':' + value; ecData.set(shape, 'value', value); ecData.set(shape, 'name', name); zr.modShape(shape.id, shape); zr.refresh(); zrEvent.stop(event); }; self.refresh = refresh; self.render = render; self.resize = resize; self.getOption = getOption; self.add = add; self.del = del; self.ondrop = ondrop; self.ondragend = ondragend; } // 图表注册 require('../chart').define('island', Island); return Island; });
Java
/* * Copyright 2004-2013 the Seasar Foundation and the Others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.docksidestage.mysql.dbflute.bsentity; import java.util.List; import java.util.ArrayList; import org.dbflute.dbmeta.DBMeta; import org.dbflute.dbmeta.AbstractEntity; import org.dbflute.dbmeta.accessory.DomainEntity; import org.docksidestage.mysql.dbflute.allcommon.DBMetaInstanceHandler; import org.docksidestage.mysql.dbflute.exentity.*; /** * The entity of WHITE_IMPLICIT_REVERSE_FK_REF as TABLE. <br> * <pre> * [primary-key] * WHITE_IMPLICIT_REVERSE_FK_REF_ID * * [column] * WHITE_IMPLICIT_REVERSE_FK_REF_ID, WHITE_IMPLICIT_REVERSE_FK_ID, VALID_BEGIN_DATE, VALID_END_DATE * * [sequence] * * * [identity] * WHITE_IMPLICIT_REVERSE_FK_REF_ID * * [version-no] * * * [foreign table] * * * [referrer table] * * * [foreign property] * * * [referrer property] * * * [get/set template] * /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * Integer whiteImplicitReverseFkRefId = entity.getWhiteImplicitReverseFkRefId(); * Integer whiteImplicitReverseFkId = entity.getWhiteImplicitReverseFkId(); * java.time.LocalDate validBeginDate = entity.getValidBeginDate(); * java.time.LocalDate validEndDate = entity.getValidEndDate(); * entity.setWhiteImplicitReverseFkRefId(whiteImplicitReverseFkRefId); * entity.setWhiteImplicitReverseFkId(whiteImplicitReverseFkId); * entity.setValidBeginDate(validBeginDate); * entity.setValidEndDate(validEndDate); * = = = = = = = = = =/ * </pre> * @author DBFlute(AutoGenerator) */ public abstract class BsWhiteImplicitReverseFkRef extends AbstractEntity implements DomainEntity { // =================================================================================== // Definition // ========== /** The serial version UID for object serialization. (Default) */ private static final long serialVersionUID = 1L; // =================================================================================== // Attribute // ========= /** WHITE_IMPLICIT_REVERSE_FK_REF_ID: {PK, ID, NotNull, INT(10)} */ protected Integer _whiteImplicitReverseFkRefId; /** WHITE_IMPLICIT_REVERSE_FK_ID: {UQ+, NotNull, INT(10)} */ protected Integer _whiteImplicitReverseFkId; /** VALID_BEGIN_DATE: {+UQ, NotNull, DATE(10)} */ protected java.time.LocalDate _validBeginDate; /** VALID_END_DATE: {NotNull, DATE(10)} */ protected java.time.LocalDate _validEndDate; // =================================================================================== // DB Meta // ======= /** {@inheritDoc} */ public DBMeta asDBMeta() { return DBMetaInstanceHandler.findDBMeta(asTableDbName()); } /** {@inheritDoc} */ public String asTableDbName() { return "white_implicit_reverse_fk_ref"; } // =================================================================================== // Key Handling // ============ /** {@inheritDoc} */ public boolean hasPrimaryKeyValue() { if (_whiteImplicitReverseFkRefId == null) { return false; } return true; } /** * To be unique by the unique column. <br> * You can update the entity by the key when entity update (NOT batch update). * @param whiteImplicitReverseFkId : UQ+, NotNull, INT(10). (NotNull) * @param validBeginDate : +UQ, NotNull, DATE(10). (NotNull) */ public void uniqueBy(Integer whiteImplicitReverseFkId, java.time.LocalDate validBeginDate) { __uniqueDrivenProperties.clear(); __uniqueDrivenProperties.addPropertyName("whiteImplicitReverseFkId"); __uniqueDrivenProperties.addPropertyName("validBeginDate"); setWhiteImplicitReverseFkId(whiteImplicitReverseFkId);setValidBeginDate(validBeginDate); } // =================================================================================== // Foreign Property // ================ // =================================================================================== // Referrer Property // ================= protected <ELEMENT> List<ELEMENT> newReferrerList() { // overriding to import return new ArrayList<ELEMENT>(); } // =================================================================================== // Basic Override // ============== @Override protected boolean doEquals(Object obj) { if (obj instanceof BsWhiteImplicitReverseFkRef) { BsWhiteImplicitReverseFkRef other = (BsWhiteImplicitReverseFkRef)obj; if (!xSV(_whiteImplicitReverseFkRefId, other._whiteImplicitReverseFkRefId)) { return false; } return true; } else { return false; } } @Override protected int doHashCode(int initial) { int hs = initial; hs = xCH(hs, asTableDbName()); hs = xCH(hs, _whiteImplicitReverseFkRefId); return hs; } @Override protected String doBuildStringWithRelation(String li) { return ""; } @Override protected String doBuildColumnString(String dm) { StringBuilder sb = new StringBuilder(); sb.append(dm).append(xfND(_whiteImplicitReverseFkRefId)); sb.append(dm).append(xfND(_whiteImplicitReverseFkId)); sb.append(dm).append(xfND(_validBeginDate)); sb.append(dm).append(xfND(_validEndDate)); if (sb.length() > dm.length()) { sb.delete(0, dm.length()); } sb.insert(0, "{").append("}"); return sb.toString(); } @Override protected String doBuildRelationString(String dm) { return ""; } @Override public WhiteImplicitReverseFkRef clone() { return (WhiteImplicitReverseFkRef)super.clone(); } // =================================================================================== // Accessor // ======== /** * [get] WHITE_IMPLICIT_REVERSE_FK_REF_ID: {PK, ID, NotNull, INT(10)} <br> * @return The value of the column 'WHITE_IMPLICIT_REVERSE_FK_REF_ID'. (basically NotNull if selected: for the constraint) */ public Integer getWhiteImplicitReverseFkRefId() { checkSpecifiedProperty("whiteImplicitReverseFkRefId"); return _whiteImplicitReverseFkRefId; } /** * [set] WHITE_IMPLICIT_REVERSE_FK_REF_ID: {PK, ID, NotNull, INT(10)} <br> * @param whiteImplicitReverseFkRefId The value of the column 'WHITE_IMPLICIT_REVERSE_FK_REF_ID'. (basically NotNull if update: for the constraint) */ public void setWhiteImplicitReverseFkRefId(Integer whiteImplicitReverseFkRefId) { registerModifiedProperty("whiteImplicitReverseFkRefId"); _whiteImplicitReverseFkRefId = whiteImplicitReverseFkRefId; } /** * [get] WHITE_IMPLICIT_REVERSE_FK_ID: {UQ+, NotNull, INT(10)} <br> * @return The value of the column 'WHITE_IMPLICIT_REVERSE_FK_ID'. (basically NotNull if selected: for the constraint) */ public Integer getWhiteImplicitReverseFkId() { checkSpecifiedProperty("whiteImplicitReverseFkId"); return _whiteImplicitReverseFkId; } /** * [set] WHITE_IMPLICIT_REVERSE_FK_ID: {UQ+, NotNull, INT(10)} <br> * @param whiteImplicitReverseFkId The value of the column 'WHITE_IMPLICIT_REVERSE_FK_ID'. (basically NotNull if update: for the constraint) */ public void setWhiteImplicitReverseFkId(Integer whiteImplicitReverseFkId) { registerModifiedProperty("whiteImplicitReverseFkId"); _whiteImplicitReverseFkId = whiteImplicitReverseFkId; } /** * [get] VALID_BEGIN_DATE: {+UQ, NotNull, DATE(10)} <br> * @return The value of the column 'VALID_BEGIN_DATE'. (basically NotNull if selected: for the constraint) */ public java.time.LocalDate getValidBeginDate() { checkSpecifiedProperty("validBeginDate"); return _validBeginDate; } /** * [set] VALID_BEGIN_DATE: {+UQ, NotNull, DATE(10)} <br> * @param validBeginDate The value of the column 'VALID_BEGIN_DATE'. (basically NotNull if update: for the constraint) */ public void setValidBeginDate(java.time.LocalDate validBeginDate) { registerModifiedProperty("validBeginDate"); _validBeginDate = validBeginDate; } /** * [get] VALID_END_DATE: {NotNull, DATE(10)} <br> * @return The value of the column 'VALID_END_DATE'. (basically NotNull if selected: for the constraint) */ public java.time.LocalDate getValidEndDate() { checkSpecifiedProperty("validEndDate"); return _validEndDate; } /** * [set] VALID_END_DATE: {NotNull, DATE(10)} <br> * @param validEndDate The value of the column 'VALID_END_DATE'. (basically NotNull if update: for the constraint) */ public void setValidEndDate(java.time.LocalDate validEndDate) { registerModifiedProperty("validEndDate"); _validEndDate = validEndDate; } }
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.6.0_27) on Wed Mar 18 13:57:07 CET 2015 --> <title>Uses of Class com.tailf.maapi.MaapiSchemas.ListRestrictionTypeMethodsImpl (CONF API Version 5.4)</title> <meta name="date" content="2015-03-18"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.tailf.maapi.MaapiSchemas.ListRestrictionTypeMethodsImpl (CONF API Version 5.4)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../com/tailf/maapi/MaapiSchemas.ListRestrictionTypeMethodsImpl.html" title="class in com.tailf.maapi">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/tailf/maapi//class-useMaapiSchemas.ListRestrictionTypeMethodsImpl.html" target="_top">Frames</a></li> <li><a href="MaapiSchemas.ListRestrictionTypeMethodsImpl.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class com.tailf.maapi.MaapiSchemas.ListRestrictionTypeMethodsImpl" class="title">Uses of Class<br>com.tailf.maapi.MaapiSchemas.ListRestrictionTypeMethodsImpl</h2> </div> <div class="classUseContainer">No usage of com.tailf.maapi.MaapiSchemas.ListRestrictionTypeMethodsImpl</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../com/tailf/maapi/MaapiSchemas.ListRestrictionTypeMethodsImpl.html" title="class in com.tailf.maapi">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/tailf/maapi//class-useMaapiSchemas.ListRestrictionTypeMethodsImpl.html" target="_top">Frames</a></li> <li><a href="MaapiSchemas.ListRestrictionTypeMethodsImpl.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
Java
## 重要提示: > 请点击以下链接查看最新[YMP v2](https://gitee.com/suninformation/ymate-platform-v2)版本仓库: > > - [码云:https://gitee.com/suninformation/ymate-platform-v2](https://gitee.com/suninformation/ymate-platform-v2) > - [GitHub:https://github.com/suninformation/ymate-platform-v2](https://github.com/suninformation/ymate-platform-v2) > > 当前代码库为旧版本,已停止更新:p!! ### **One More Thing**: YMP不仅提供便捷的Web及其它Java项目的快速开发体验,也将不断提供更多丰富的项目实践经验。 感兴趣的小伙伴儿们可以加入 官方QQ群480374360,一起交流学习,帮助YMP成长! 了解更多有关YMP框架的内容,请访问官网:http://www.ymate.net/
Java
# Myrica vidaliana Rolfe SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
Java
class Addon < ActiveRecord::Base has_many :server_addons has_many :servers, through: :server_addons scope :available, -> { where(hidden: false).order(:created_at) } end
Java
/** * Copyright (c) 2016 Lemur Consulting Ltd. * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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 uk.co.flax.biosolr.elasticsearch; import org.apache.commons.lang3.StringUtils; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.threadpool.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import uk.co.flax.biosolr.elasticsearch.mapper.ontology.ElasticOntologyHelperFactory; import uk.co.flax.biosolr.elasticsearch.mapper.ontology.OntologySettings; import uk.co.flax.biosolr.ontology.core.OntologyHelper; import uk.co.flax.biosolr.ontology.core.OntologyHelperException; import java.io.Closeable; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; /** * Created by mlp on 09/02/16. * @author mlp */ public class OntologyHelperBuilder implements Closeable { private static final Logger LOGGER = LoggerFactory.getLogger(OntologyHelperBuilder.class); private ThreadPool threadPool; private static OntologyHelperBuilder instance; private Map<String, OntologyHelper> helpers = new ConcurrentHashMap<>(); @Inject public OntologyHelperBuilder(ThreadPool threadPool) { this.threadPool = threadPool; setInstance(this); } private static void setInstance(OntologyHelperBuilder odb) { instance = odb; } public static OntologyHelperBuilder getInstance() { return instance; } private OntologyHelper getHelper(OntologySettings settings) throws OntologyHelperException { String helperKey = buildHelperKey(settings); OntologyHelper helper = helpers.get(helperKey); if (helper == null) { helper = new ElasticOntologyHelperFactory(settings).buildOntologyHelper(); OntologyCheckRunnable checker = new OntologyCheckRunnable(helperKey, settings.getThreadCheckMs()); threadPool.scheduleWithFixedDelay(checker, TimeValue.timeValueMillis(settings.getThreadCheckMs())); helpers.put(helperKey, helper); helper.updateLastCallTime(); } return helper; } public static OntologyHelper getOntologyHelper(OntologySettings settings) throws OntologyHelperException { OntologyHelperBuilder builder = getInstance(); return builder.getHelper(settings); } @Override public void close() { // Explicitly dispose of any remaining helpers for (Map.Entry<String, OntologyHelper> helperEntry : helpers.entrySet()) { if (helperEntry.getValue() != null) { LOGGER.info("Disposing of helper for {}", helperEntry.getKey()); helperEntry.getValue().dispose(); } } } private static String buildHelperKey(OntologySettings settings) { String key; if (StringUtils.isNotBlank(settings.getOntologyUri())) { key = settings.getOntologyUri(); } else { if (StringUtils.isNotBlank(settings.getOlsOntology())) { key = settings.getOlsBaseUrl() + "_" + settings.getOlsOntology(); } else { key = settings.getOlsBaseUrl(); } } return key; } private final class OntologyCheckRunnable implements Runnable { final String threadKey; final long deleteCheckMs; public OntologyCheckRunnable(String threadKey, long deleteCheckMs) { this.threadKey = threadKey; this.deleteCheckMs = deleteCheckMs; } @Override public void run() { OntologyHelper helper = helpers.get(threadKey); if (helper != null) { // Check if the last call time was longer ago than the maximum if (System.currentTimeMillis() - deleteCheckMs > helper.getLastCallTime()) { // Assume helper is out of use - dispose of it to allow memory to be freed helper.dispose(); helpers.remove(threadKey); } } } } }
Java
'use strict'; /** * @ngdoc function * @name freshcardUiApp.controller:TemplatesCtrl * @description * # TemplatesCtrl * Controller of the freshcardUiApp */ angular.module('freshcardUiApp') .controller('TemplatesCtrl', function ( $scope, $rootScope, $localStorage, $filter, $timeout, FileUploader, OrganizationService, configuration ) { $scope.templateLayoutSaved = false; $scope.templateLayoutError = false; $scope.templateLayoutPublished = false; $scope.templateLayoutPublishError = false; $scope.templateImagePath = $rootScope.currentOrganizationTemplate; $scope.fields = [ false, false, false, false, false, false, false ]; $scope.fieldNames = [ 'NAME', 'EMAIL_ADDRESS', 'STREET_ADDRESS', 'POSTAL_CODE', 'CITY', 'PHONE_NUMBER', 'WEBSITE' ]; $scope.fieldMappings = [ $filter('translate')('NAME'), $filter('translate')('EMAIL_ADDRESS'), $filter('translate')('STREET_ADDRESS'), $filter('translate')('POSTAL_CODE'), $filter('translate')('CITY'), $filter('translate')('PHONE_NUMBER'), $filter('translate')('WEBSITE') ]; $scope.showGrid = false; $scope.snapToGrid = false; $scope.fonts = [ 'Helvetica Neue', 'Open Sans', 'Helvetica', 'Arial', 'Times New Roman' ]; $scope.fontSizes = [ 14, 16, 18, 20, 24, 28 ]; $scope.selectedFont = $scope.fonts[0]; $scope.selectedFontSize = $scope.fontSizes[3]; $scope.templateLayout = { fields: { }, font: $scope.selectedFont, fontSize: $scope.selectedFontSize, showGrid: $scope.showGrid, snapToGrid: $scope.snapToGrid }; OrganizationService.get( { organizationId: $rootScope.user.currentOrganizationId }, function(organization) { if (organization.templateLayout) { $scope.templateLayout = JSON.parse(organization.templateLayout); $scope.selectedFont = $scope.templateLayout.font; $scope.selectedFontSize = $scope.templateLayout.fontSize; $scope.fields = [ false, false, false, false, false, false, false ]; for (var field in $scope.templateLayout.fields) { for (var i = 0; i < $scope.fieldMappings.length; i++) { if ($scope.fieldMappings[i] === $filter('translate')(field)) { $scope.fields[i] = true; } } } } } ); var imageUploader = $scope.imageUploader = new FileUploader( { url: configuration.apiRootURL + 'api/v1/organizations/uploadTemplateImage/' + $rootScope.user.currentOrganizationId, headers: { 'X-Auth-Token': $rootScope.authToken } } ); imageUploader.onAfterAddingFile = function() { $scope.imageUploadCompleted = false; }; imageUploader.onCompleteItem = function(fileItem, response) { if (response.imagePath !== null && response.imagePath !== undefined) { $scope.templateImagePath = $localStorage.currentOrganizationTemplate = $rootScope.currentOrganizationTemplate = response.imagePath; $scope.imageUploadCompleted = true; } }; $scope.saveTemplate = function() { $scope.templateLayout.font = $scope.selectedFont; $scope.templateLayout.fontSize = $scope.selectedFontSize; var svgResult = $scope.canvas.toSVG(); for (var i = 0; i < $scope.fieldMappings.length; i++) { svgResult = svgResult.replace($scope.fieldMappings[i], $scope.fieldNames[i]); } OrganizationService.update( { id: $rootScope.user.currentOrganizationId, templateLayout: JSON.stringify($scope.templateLayout), templateAsSVG: svgResult }, function() { $scope.templateLayoutPublished = false; $scope.templateLayoutPublishError = false; $scope.templateLayoutSaved = true; $scope.templateLayoutError = false; $timeout( function() { $scope.templateLayoutSaved = false; }, 5000 ); }, function() { $scope.templateLayoutPublished = false; $scope.templateLayoutPublishError = false; $scope.templateLayoutSaved = false; $scope.templateLayoutError = true; } ); }; $scope.publishTemplate = function() { OrganizationService.publishTemplate( { id: $rootScope.user.currentOrganizationId }, function() { $scope.templateLayoutPublished = true; $scope.templateLayoutPublishError = false; $scope.templateLayoutSaved = false; $scope.templateLayoutError = false; $timeout( function() { $scope.templateLayoutPublished = false; }, 5000 ); }, function() { $scope.templateLayoutPublished = false; $scope.templateLayoutPublishError = true; $scope.templateLayoutSaved = false; $scope.templateLayoutError = false; } ); }; });
Java
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import os_resource_classes as orc import os_traits import six from nova import context as nova_context from nova import exception from nova import objects from nova.tests.functional.api import client as api_client from nova.tests.functional import integrated_helpers from nova import utils class TestServicesAPI(integrated_helpers.ProviderUsageBaseTestCase): compute_driver = 'fake.SmallFakeDriver' def test_compute_service_delete_ensure_related_cleanup(self): """Tests deleting a compute service and the related cleanup associated with that like the compute_nodes table entry, removing the host from any aggregates, the host mapping in the API DB and the associated resource provider in Placement. """ compute = self._start_compute('host1') # Make sure our compute host is represented as expected. services = self.admin_api.get_services(binary='nova-compute') self.assertEqual(1, len(services)) service = services[0] # Now create a host aggregate and add our host to it. aggregate = self.admin_api.post_aggregate( {'aggregate': {'name': 'agg1'}}) self.admin_api.add_host_to_aggregate(aggregate['id'], service['host']) # Make sure the host is in the aggregate. aggregate = self.admin_api.api_get( '/os-aggregates/%s' % aggregate['id']).body['aggregate'] self.assertEqual([service['host']], aggregate['hosts']) rp_uuid = self._get_provider_uuid_by_host(service['host']) # We'll know there is a host mapping implicitly if os-hypervisors # returned something in _get_provider_uuid_by_host, but let's also # make sure the host mapping is there like we expect. ctxt = nova_context.get_admin_context() objects.HostMapping.get_by_host(ctxt, service['host']) # Make sure there is a resource provider for that compute node based # on the uuid. resp = self.placement_api.get('/resource_providers/%s' % rp_uuid) self.assertEqual(200, resp.status) # Make sure the resource provider has inventory. inventories = self._get_provider_inventory(rp_uuid) # Expect a minimal set of inventory for the fake virt driver. for resource_class in [orc.VCPU, orc.MEMORY_MB, orc.DISK_GB]: self.assertIn(resource_class, inventories) # Now create a server so that the resource provider has some allocation # records. flavor = self.api.get_flavors()[0] server = self._boot_and_check_allocations(flavor, service['host']) # Now the fun part, delete the compute service and make sure related # resources are cleaned up, like the compute node, host mapping, and # resource provider. We have to first stop the compute service so # it doesn't recreate the compute node during the # update_available_resource periodic task. self.admin_api.put_service(service['id'], {'forced_down': True}) compute.stop() # The first attempt should fail since there is an instance on the # compute host. ex = self.assertRaises(api_client.OpenStackApiException, self.admin_api.api_delete, '/os-services/%s' % service['id']) self.assertIn('Unable to delete compute service that is hosting ' 'instances.', six.text_type(ex)) self.assertEqual(409, ex.response.status_code) # Now delete the instance and wait for it to be gone. self._delete_and_check_allocations(server) # Now we can delete the service. self.admin_api.api_delete('/os-services/%s' % service['id']) # Make sure the service is deleted. services = self.admin_api.get_services(binary='nova-compute') self.assertEqual(0, len(services)) # Make sure the host was removed from the aggregate. aggregate = self.admin_api.api_get( '/os-aggregates/%s' % aggregate['id']).body['aggregate'] self.assertEqual([], aggregate['hosts']) # Trying to get the hypervisor should result in a 404. self.admin_api.api_get( 'os-hypervisors?hypervisor_hostname_pattern=%s' % service['host'], check_response_status=[404]) # The host mapping should also be gone. self.assertRaises(exception.HostMappingNotFound, objects.HostMapping.get_by_host, ctxt, service['host']) # And finally, the resource provider should also be gone. The API # will perform a cascading delete of the resource provider inventory # and allocation information. resp = self.placement_api.get('/resource_providers/%s' % rp_uuid) self.assertEqual(404, resp.status) def test_evacuate_then_delete_compute_service(self): """Tests a scenario where a server is created on a host, the host goes down, the server is evacuated to another host, and then the source host compute service is deleted. After that the deleted compute service is restarted. Related placement resources are checked throughout. """ # Create our source host that we will evacuate *from* later. host1 = self._start_compute('host1') # Create a server which will go on host1 since it is the only host. flavor = self.api.get_flavors()[0] server = self._boot_and_check_allocations(flavor, 'host1') # Get the compute service record for host1 so we can manage it. service = self.admin_api.get_services( binary='nova-compute', host='host1')[0] # Get the corresponding resource provider uuid for host1. rp_uuid = self._get_provider_uuid_by_host(service['host']) # Make sure there is a resource provider for that compute node based # on the uuid. resp = self.placement_api.get('/resource_providers/%s' % rp_uuid) self.assertEqual(200, resp.status) # Down the compute service for host1 so we can evacuate from it. self.admin_api.put_service(service['id'], {'forced_down': True}) host1.stop() # Start another host and trigger the server evacuate to that host. self._start_compute('host2') self.admin_api.post_server_action(server['id'], {'evacuate': {}}) # The host does not change until after the status is changed to ACTIVE # so wait for both parameters. self._wait_for_server_parameter(server, { 'status': 'ACTIVE', 'OS-EXT-SRV-ATTR:host': 'host2'}) # Delete the compute service for host1 and check the related # placement resources for that host. self.admin_api.api_delete('/os-services/%s' % service['id']) # Make sure the service is gone. services = self.admin_api.get_services( binary='nova-compute', host='host1') self.assertEqual(0, len(services), services) # FIXME(mriedem): This is bug 1829479 where the compute service is # deleted but the resource provider is not because there are still # allocations against the provider from the evacuated server. resp = self.placement_api.get('/resource_providers/%s' % rp_uuid) self.assertEqual(200, resp.status) self.assertFlavorMatchesUsage(rp_uuid, flavor) # Try to restart the host1 compute service to create a new resource # provider. self.restart_compute_service(host1) # FIXME(mriedem): This is bug 1817833 where restarting the now-deleted # compute service attempts to create a new resource provider with a # new uuid but the same name which results in a conflict. The service # does not die, however, because _update_available_resource_for_node # catches and logs but does not re-raise the error. log_output = self.stdlog.logger.output self.assertIn('Error updating resources for node host1.', log_output) self.assertIn('Failed to create resource provider host1', log_output) def test_migrate_confirm_after_deleted_source_compute(self): """Tests a scenario where a server is cold migrated and while in VERIFY_RESIZE status the admin attempts to delete the source compute and then the user tries to confirm the resize. """ # Start a compute service and create a server there. self._start_compute('host1') host1_rp_uuid = self._get_provider_uuid_by_host('host1') flavor = self.api.get_flavors()[0] server = self._boot_and_check_allocations(flavor, 'host1') # Start a second compute service so we can cold migrate there. self._start_compute('host2') host2_rp_uuid = self._get_provider_uuid_by_host('host2') # Cold migrate the server to host2. self._migrate_and_check_allocations( server, flavor, host1_rp_uuid, host2_rp_uuid) # Delete the source compute service. service = self.admin_api.get_services( binary='nova-compute', host='host1')[0] # We expect the delete request to fail with a 409 error because of the # instance in VERIFY_RESIZE status even though that instance is marked # as being on host2 now. ex = self.assertRaises(api_client.OpenStackApiException, self.admin_api.api_delete, '/os-services/%s' % service['id']) self.assertEqual(409, ex.response.status_code) self.assertIn('Unable to delete compute service that has in-progress ' 'migrations', six.text_type(ex)) self.assertIn('There are 1 in-progress migrations involving the host', self.stdlog.logger.output) # The provider is still around because we did not delete the service. resp = self.placement_api.get('/resource_providers/%s' % host1_rp_uuid) self.assertEqual(200, resp.status) self.assertFlavorMatchesUsage(host1_rp_uuid, flavor) # Now try to confirm the migration. self._confirm_resize(server) # Delete the host1 service since the migration is confirmed and the # server is on host2. self.admin_api.api_delete('/os-services/%s' % service['id']) # The host1 resource provider should be gone. resp = self.placement_api.get('/resource_providers/%s' % host1_rp_uuid) self.assertEqual(404, resp.status) def test_resize_revert_after_deleted_source_compute(self): """Tests a scenario where a server is resized and while in VERIFY_RESIZE status the admin attempts to delete the source compute and then the user tries to revert the resize. """ # Start a compute service and create a server there. self._start_compute('host1') host1_rp_uuid = self._get_provider_uuid_by_host('host1') flavors = self.api.get_flavors() flavor1 = flavors[0] flavor2 = flavors[1] server = self._boot_and_check_allocations(flavor1, 'host1') # Start a second compute service so we can resize there. self._start_compute('host2') host2_rp_uuid = self._get_provider_uuid_by_host('host2') # Resize the server to host2. self._resize_and_check_allocations( server, flavor1, flavor2, host1_rp_uuid, host2_rp_uuid) # Delete the source compute service. service = self.admin_api.get_services( binary='nova-compute', host='host1')[0] # We expect the delete request to fail with a 409 error because of the # instance in VERIFY_RESIZE status even though that instance is marked # as being on host2 now. ex = self.assertRaises(api_client.OpenStackApiException, self.admin_api.api_delete, '/os-services/%s' % service['id']) self.assertEqual(409, ex.response.status_code) self.assertIn('Unable to delete compute service that has in-progress ' 'migrations', six.text_type(ex)) self.assertIn('There are 1 in-progress migrations involving the host', self.stdlog.logger.output) # The provider is still around because we did not delete the service. resp = self.placement_api.get('/resource_providers/%s' % host1_rp_uuid) self.assertEqual(200, resp.status) self.assertFlavorMatchesUsage(host1_rp_uuid, flavor1) # Now revert the resize. self._revert_resize(server) self.assertFlavorMatchesUsage(host1_rp_uuid, flavor1) zero_flavor = {'vcpus': 0, 'ram': 0, 'disk': 0, 'extra_specs': {}} self.assertFlavorMatchesUsage(host2_rp_uuid, zero_flavor) # Delete the host2 service since the migration is reverted and the # server is on host1 again. service2 = self.admin_api.get_services( binary='nova-compute', host='host2')[0] self.admin_api.api_delete('/os-services/%s' % service2['id']) # The host2 resource provider should be gone. resp = self.placement_api.get('/resource_providers/%s' % host2_rp_uuid) self.assertEqual(404, resp.status) class ComputeStatusFilterTest(integrated_helpers.ProviderUsageBaseTestCase): """Tests the API, compute service and Placement interaction with the COMPUTE_STATUS_DISABLED trait when a compute service is enable/disabled. This version of the test uses the 2.latest microversion for testing the 2.53+ behavior of the PUT /os-services/{service_id} API. """ compute_driver = 'fake.SmallFakeDriver' def _update_service(self, service, disabled, forced_down=None): """Update the service using the 2.53 request schema. :param service: dict representing the service resource in the API :param disabled: True if the service should be disabled, False if the service should be enabled :param forced_down: Optionally change the forced_down value. """ status = 'disabled' if disabled else 'enabled' req = {'status': status} if forced_down is not None: req['forced_down'] = forced_down self.admin_api.put_service(service['id'], req) def test_compute_status_filter(self): """Tests the compute_status_filter placement request filter""" # Start a compute service so a compute node and resource provider is # created. compute = self._start_compute('host1') # Get the UUID of the resource provider that was created. rp_uuid = self._get_provider_uuid_by_host('host1') # Get the service from the compute API. services = self.admin_api.get_services(binary='nova-compute', host='host1') self.assertEqual(1, len(services)) service = services[0] # At this point, the service should be enabled and the # COMPUTE_STATUS_DISABLED trait should not be set on the # resource provider in placement. self.assertEqual('enabled', service['status']) rp_traits = self._get_provider_traits(rp_uuid) trait = os_traits.COMPUTE_STATUS_DISABLED self.assertNotIn(trait, rp_traits) # Now disable the compute service via the API. self._update_service(service, disabled=True) # The update to placement should be synchronous so check the provider # traits and COMPUTE_STATUS_DISABLED should be set. rp_traits = self._get_provider_traits(rp_uuid) self.assertIn(trait, rp_traits) # Try creating a server which should fail because nothing is available. networks = [{'port': self.neutron.port_1['id']}] server_req = self._build_server(networks=networks) server = self.api.post_server({'server': server_req}) server = self._wait_for_state_change(server, 'ERROR') # There should be a NoValidHost fault recorded. self.assertIn('fault', server) self.assertIn('No valid host', server['fault']['message']) # Now enable the service and the trait should be gone. self._update_service(service, disabled=False) rp_traits = self._get_provider_traits(rp_uuid) self.assertNotIn(trait, rp_traits) # Try creating another server and it should be OK. server = self.api.post_server({'server': server_req}) self._wait_for_state_change(server, 'ACTIVE') # Stop, force-down and disable the service so the API cannot call # the compute service to sync the trait. compute.stop() self._update_service(service, disabled=True, forced_down=True) # The API should have logged a message about the service being down. self.assertIn('Compute service on host host1 is down. The ' 'COMPUTE_STATUS_DISABLED trait will be synchronized ' 'when the service is restarted.', self.stdlog.logger.output) # The trait should not be on the provider even though the node is # disabled. rp_traits = self._get_provider_traits(rp_uuid) self.assertNotIn(trait, rp_traits) # Restart the compute service which should sync and set the trait on # the provider in placement. self.restart_compute_service(compute) rp_traits = self._get_provider_traits(rp_uuid) self.assertIn(trait, rp_traits) class ComputeStatusFilterTest211(ComputeStatusFilterTest): """Extends ComputeStatusFilterTest and uses the 2.11 API for the legacy os-services disable/enable/force-down API behavior """ microversion = '2.11' def _update_service(self, service, disabled, forced_down=None): """Update the service using the 2.11 request schema. :param service: dict representing the service resource in the API :param disabled: True if the service should be disabled, False if the service should be enabled :param forced_down: Optionally change the forced_down value. """ # Before 2.53 the service is uniquely identified by host and binary. body = { 'host': service['host'], 'binary': service['binary'] } # Handle forced_down first if provided since the enable/disable # behavior in the API depends on it. if forced_down is not None: body['forced_down'] = forced_down self.admin_api.api_put('/os-services/force-down', body) if disabled: self.admin_api.api_put('/os-services/disable', body) else: self.admin_api.api_put('/os-services/enable', body) def _get_provider_uuid_by_host(self, host): # We have to temporarily mutate to 2.53 to get the hypervisor UUID. with utils.temporary_mutation(self.admin_api, microversion='2.53'): return super(ComputeStatusFilterTest211, self)._get_provider_uuid_by_host(host)
Java
/* * Copyright 2004-2013 the Seasar Foundation and the Others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.docksidestage.mysql.dbflute.immuhama.bsbhv.loader; import java.util.List; import org.dbflute.bhv.*; import org.docksidestage.mysql.dbflute.immuhama.exbhv.*; import org.docksidestage.mysql.dbflute.immuhama.exentity.*; /** * The referrer loader of (会員ログイン情報)MEMBER_LOGIN as TABLE. <br> * <pre> * [primary key] * MEMBER_LOGIN_ID * * [column] * MEMBER_LOGIN_ID, MEMBER_ID, LOGIN_DATETIME, MOBILE_LOGIN_FLG, LOGIN_MEMBER_STATUS_CODE * * [sequence] * * * [identity] * MEMBER_LOGIN_ID * * [version-no] * * * [foreign table] * MEMBER_STATUS, MEMBER * * [referrer table] * * * [foreign property] * memberStatus, member * * [referrer property] * * </pre> * @author DBFlute(AutoGenerator) */ public class ImmuLoaderOfMemberLogin { // =================================================================================== // Attribute // ========= protected List<ImmuMemberLogin> _selectedList; protected BehaviorSelector _selector; protected ImmuMemberLoginBhv _myBhv; // lazy-loaded // =================================================================================== // Ready for Loading // ================= public ImmuLoaderOfMemberLogin ready(List<ImmuMemberLogin> selectedList, BehaviorSelector selector) { _selectedList = selectedList; _selector = selector; return this; } protected ImmuMemberLoginBhv myBhv() { if (_myBhv != null) { return _myBhv; } else { _myBhv = _selector.select(ImmuMemberLoginBhv.class); return _myBhv; } } // =================================================================================== // Pull out Foreign // ================ protected ImmuLoaderOfMemberStatus _foreignMemberStatusLoader; public ImmuLoaderOfMemberStatus pulloutMemberStatus() { if (_foreignMemberStatusLoader == null) { _foreignMemberStatusLoader = new ImmuLoaderOfMemberStatus().ready(myBhv().pulloutMemberStatus(_selectedList), _selector); } return _foreignMemberStatusLoader; } protected ImmuLoaderOfMember _foreignMemberLoader; public ImmuLoaderOfMember pulloutMember() { if (_foreignMemberLoader == null) { _foreignMemberLoader = new ImmuLoaderOfMember().ready(myBhv().pulloutMember(_selectedList), _selector); } return _foreignMemberLoader; } // =================================================================================== // Accessor // ======== public List<ImmuMemberLogin> getSelectedList() { return _selectedList; } public BehaviorSelector getSelector() { return _selector; } }
Java
/* * * Copyright 2015 Netflix, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ using System; using System.Data; using Fido_Main.Fido_Support.ErrorHandling; namespace Fido_Main.Fido_Support.Objects.Fido { public class Object_Fido_ConfigClass { internal class ParseConfigs { internal int Primkey { get; set; } internal string DetectorType { get; set; } internal string Detector { get; set; } internal string Vendor { get; set; } internal string Server { get; set; } internal string Folder { get; set; } internal string FolderTest { get; set; } internal string File { get; set; } internal string EmailFrom { get; set; } internal string Lastevent { get; set; } internal string UserID { get; set; } internal string Pwd { get; set; } internal string Acek { get; set; } internal string DB { get; set; } internal string ConnString { get; set; } internal string Query { get; set; } internal string Query3 { get; set; } internal string Query2 { get; set; } internal string APIKey { get; set; } } internal static ParseConfigs FormatParse(DataTable dbReturn) { try { var reformat = new ParseConfigs { DetectorType = Convert.ToString(dbReturn.Rows[0].ItemArray[1]), Detector = Convert.ToString(dbReturn.Rows[0].ItemArray[2]), Vendor = Convert.ToString(dbReturn.Rows[0].ItemArray[3]), Server = Convert.ToString(dbReturn.Rows[0].ItemArray[4]), Folder = Convert.ToString(dbReturn.Rows[0].ItemArray[5]), FolderTest = Convert.ToString(dbReturn.Rows[0].ItemArray[6]), File = Convert.ToString(dbReturn.Rows[0].ItemArray[7]), EmailFrom = Convert.ToString(dbReturn.Rows[0].ItemArray[8]), Lastevent = Convert.ToString(dbReturn.Rows[0].ItemArray[9]), UserID = Convert.ToString(dbReturn.Rows[0].ItemArray[10]), Pwd = Convert.ToString(dbReturn.Rows[0].ItemArray[11]), Acek = Convert.ToString(dbReturn.Rows[0].ItemArray[12]), DB = Convert.ToString(dbReturn.Rows[0].ItemArray[13]), ConnString = Convert.ToString(dbReturn.Rows[0].ItemArray[14]), Query = Convert.ToString(dbReturn.Rows[0].ItemArray[15]), Query2 = Convert.ToString(dbReturn.Rows[0].ItemArray[16]), Query3 = Convert.ToString(dbReturn.Rows[0].ItemArray[17]), APIKey = Convert.ToString(dbReturn.Rows[0].ItemArray[18]) }; return reformat; } catch (Exception e) { Fido_EventHandler.SendEmail("Fido Error", "Fido Failed: {0} Unable to format datatable return." + e); } return null; } } }
Java
export const VERSION = 1; /** Same as DexieExportJsonStructure but without the data.data array */ export interface DexieExportJsonMeta { formatName: 'dexie'; formatVersion: typeof VERSION; data: { databaseName: string; databaseVersion: number; tables: Array<{ name: string; schema: string; rowCount: number; }>; } } export interface DexieExportJsonStructure extends DexieExportJsonMeta { formatName: 'dexie'; formatVersion: typeof VERSION; data: { databaseName: string; databaseVersion: number; tables: Array<{ name: string; schema: string; rowCount: number; }>; data: Array<{ tableName: string; inbound: boolean; rows: any[]; }>; } } export type DexieExportedDatabase = DexieExportJsonStructure["data"]; export type DexieExportedTable = DexieExportedDatabase["data"][number];
Java
/* * Copyright © 2009 HotPads (admin@hotpads.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.datarouter.webappinstance.storage.webappinstancelog; import java.util.List; import javax.inject.Inject; import javax.inject.Singleton; import io.datarouter.model.databean.FieldlessIndexEntry; import io.datarouter.scanner.Scanner; import io.datarouter.storage.Datarouter; import io.datarouter.storage.client.ClientId; import io.datarouter.storage.dao.BaseDao; import io.datarouter.storage.dao.BaseRedundantDaoParams; import io.datarouter.storage.node.factory.IndexingNodeFactory; import io.datarouter.storage.node.factory.NodeFactory; import io.datarouter.storage.node.op.combo.IndexedSortedMapStorage.IndexedSortedMapStorageNode; import io.datarouter.storage.node.op.index.IndexReader; import io.datarouter.storage.tag.Tag; import io.datarouter.util.tuple.Range; import io.datarouter.virtualnode.redundant.RedundantIndexedSortedMapStorageNode; import io.datarouter.webappinstance.storage.webappinstancelog.WebappInstanceLog.WebappInstanceLogFielder; @Singleton public class DatarouterWebappInstanceLogDao extends BaseDao{ public static class DatarouterWebappInstanceLogDaoParams extends BaseRedundantDaoParams{ public DatarouterWebappInstanceLogDaoParams(List<ClientId> clientIds){ super(clientIds); } } private final IndexedSortedMapStorageNode<WebappInstanceLogKey,WebappInstanceLog,WebappInstanceLogFielder> node; private final IndexReader<WebappInstanceLogKey,WebappInstanceLog,WebappInstanceLogByBuildInstantKey, FieldlessIndexEntry<WebappInstanceLogByBuildInstantKey,WebappInstanceLogKey,WebappInstanceLog>> byBuildInstant; @Inject public DatarouterWebappInstanceLogDao( Datarouter datarouter, NodeFactory nodeFactory, IndexingNodeFactory indexingNodeFactory, DatarouterWebappInstanceLogDaoParams params){ super(datarouter); node = Scanner.of(params.clientIds) .map(clientId -> { IndexedSortedMapStorageNode<WebappInstanceLogKey,WebappInstanceLog,WebappInstanceLogFielder> node = nodeFactory.create(clientId, WebappInstanceLog::new, WebappInstanceLogFielder::new) .withTag(Tag.DATAROUTER) .build(); return node; }) .listTo(RedundantIndexedSortedMapStorageNode::makeIfMulti); byBuildInstant = indexingNodeFactory.createKeyOnlyManagedIndex(WebappInstanceLogByBuildInstantKey::new, node) .build(); datarouter.register(node); } public void put(WebappInstanceLog log){ node.put(log); } public Scanner<WebappInstanceLog> scan(){ return node.scan(); } public Scanner<WebappInstanceLog> scanWithPrefix(WebappInstanceLogKey key){ return node.scanWithPrefix(key); } public Scanner<WebappInstanceLog> scanDatabeans(Range<WebappInstanceLogByBuildInstantKey> range){ return byBuildInstant.scanDatabeans(range); } }
Java
package nl.galesloot_ict.efjenergy.MeterReading; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.util.ArrayList; /** * Created by FlorisJan on 23-11-2014. */ public class MeterReadingsList extends ArrayList<MeterReading> { @JsonCreator public static MeterReadingsList Create(String jsonString) throws JsonParseException, JsonMappingException, IOException { ObjectMapper mapper = new ObjectMapper(); MeterReadingsList meterReading = null; meterReading = mapper.readValue(jsonString, MeterReadingsList.class); return meterReading; } }
Java
@route += '/' + ARGV[0] + '/' + ARGV[1] + '/'+ ARGV[2] + '/' + ARGV[3] @route += '/' + ARGV[4] if ARGV.count == 5 perform_get
Java
# AUTOGENERATED FILE FROM balenalib/odroid-ux3-alpine:3.10-run ENV GO_VERSION 1.16.3 # set up nsswitch.conf for Go's "netgo" implementation # - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275 # - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf # gcc for cgo RUN apk add --no-cache git gcc ca-certificates RUN fetchDeps='curl' \ && set -x \ && apk add --no-cache $fetchDeps \ && mkdir -p /usr/local/go \ && curl -SLO "http://resin-packages.s3.amazonaws.com/golang/v$GO_VERSION/go$GO_VERSION.linux-alpine-armv7hf.tar.gz" \ && echo "82d3d01d1f341b3afb21b1c650fe7edc6b1b4757bfef78a46a39faa4ee411b8d go$GO_VERSION.linux-alpine-armv7hf.tar.gz" | sha256sum -c - \ && tar -xzf "go$GO_VERSION.linux-alpine-armv7hf.tar.gz" -C /usr/local/go --strip-components=1 \ && rm -f go$GO_VERSION.linux-alpine-armv7hf.tar.gz ENV GOROOT /usr/local/go ENV GOPATH /go ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" WORKDIR $GOPATH CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@golang.sh" \ && echo "Running test-stack@golang" \ && chmod +x test-stack@golang.sh \ && bash test-stack@golang.sh \ && rm -rf test-stack@golang.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Alpine Linux 3.10 \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nGo v1.16.3 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo $'#!/bin/bash\nbalena-info\nbusybox ln -sf /bin/busybox /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && ln -f /bin/sh /bin/sh.real \ && ln -f /bin/sh-shim /bin/sh
Java
package com.walmart.labs.pcs.normalize.MongoDB.SpringBoot.service; import com.walmart.labs.pcs.normalize.MongoDB.SpringBoot.entity.Person; import com.walmart.labs.pcs.normalize.MongoDB.SpringBoot.repository.PersonRepository; import com.walmart.labs.pcs.normalize.MongoDB.SpringBoot.repository.PersonRepositoryImp; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; /** * Created by pzhong1 on 1/23/15. */ public class PersonService { @Autowired private PersonRepository personRepository; public List<Person> getAllPersons(){ return personRepository.findAll(); } public Person searchPerson(String id){ return personRepository.findOne(id); } public void insertPersonWithNameJohnAndRandomAge(Person person){ personRepository.save(person); } public void dropPersonCollection() { personRepository.deleteAll(); } }
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>WPILIB: Class Members</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.8 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main&nbsp;Page</span></a></li> <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File&nbsp;List</span></a></li> <li class="current"><a href="globals.html"><span>File&nbsp;Members</span></a></li> </ul> </div> <div class="tabs"> <ul> <li class="current"><a href="globals.html"><span>All</span></a></li> <li><a href="globals_func.html"><span>Functions</span></a></li> <li><a href="globals_vars.html"><span>Variables</span></a></li> <li><a href="globals_type.html"><span>Typedefs</span></a></li> <li><a href="globals_enum.html"><span>Enumerations</span></a></li> <li><a href="globals_eval.html"><span>Enumerator</span></a></li> <li><a href="globals_defs.html"><span>Defines</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="globals.html#index__"><span>_</span></a></li> <li><a href="globals_0x61.html#index_a"><span>a</span></a></li> <li><a href="globals_0x62.html#index_b"><span>b</span></a></li> <li><a href="globals_0x63.html#index_c"><span>c</span></a></li> <li><a href="globals_0x64.html#index_d"><span>d</span></a></li> <li><a href="globals_0x65.html#index_e"><span>e</span></a></li> <li><a href="globals_0x66.html#index_f"><span>f</span></a></li> <li><a href="globals_0x67.html#index_g"><span>g</span></a></li> <li><a href="globals_0x68.html#index_h"><span>h</span></a></li> <li><a href="globals_0x69.html#index_i"><span>i</span></a></li> <li><a href="globals_0x6a.html#index_j"><span>j</span></a></li> <li><a href="globals_0x6b.html#index_k"><span>k</span></a></li> <li class="current"><a href="globals_0x6c.html#index_l"><span>l</span></a></li> <li><a href="globals_0x6d.html#index_m"><span>m</span></a></li> <li><a href="globals_0x6e.html#index_n"><span>n</span></a></li> <li><a href="globals_0x6f.html#index_o"><span>o</span></a></li> <li><a href="globals_0x70.html#index_p"><span>p</span></a></li> <li><a href="globals_0x71.html#index_q"><span>q</span></a></li> <li><a href="globals_0x72.html#index_r"><span>r</span></a></li> <li><a href="globals_0x73.html#index_s"><span>s</span></a></li> <li><a href="globals_0x74.html#index_t"><span>t</span></a></li> <li><a href="globals_0x75.html#index_u"><span>u</span></a></li> <li><a href="globals_0x76.html#index_v"><span>v</span></a></li> <li><a href="globals_0x77.html#index_w"><span>w</span></a></li> </ul> </div> </div> <div class="contents"> Here is a list of all file members with links to the files they belong to: <p> <h3><a class="anchor" name="index_l">- l -</a></h3><ul> <li>LCDOptions : <a class="el" href="nivision_8h.html#aa3ce0a2ba425c09e16683eb9a65b858">nivision.h</a> <li>LCDReport : <a class="el" href="nivision_8h.html#8bec28eeb0437e0fc40177923e57c92d">nivision.h</a> <li>LCDSegments : <a class="el" href="nivision_8h.html#52dc96535da0eb8768fb45d97e481ad1">nivision.h</a> <li>LearnCalibrationOptions : <a class="el" href="nivision_8h.html#fac80df95a4b166758af8e68c78a427a">nivision.h</a> <li>LearnColorPatternOptions : <a class="el" href="nivision_8h.html#6ca40662dca8edd71e633aba67db706d">nivision.h</a> <li>LearnGeometricPatternAdvancedOptions : <a class="el" href="nivision_8h.html#394286c01394588a3ac0ac1d49b7b82a">nivision.h</a> <li>LearningMode : <a class="el" href="nivision_8h.html#0645ec2a0d2f9d7ff7772e91ec92cb5a">nivision.h</a> <li>LearningMode_enum : <a class="el" href="nivision_8h.html#d516a13e50020a4fadba800dd7fb1efe">nivision.h</a> <li>LearnPatternAdvancedOptions : <a class="el" href="nivision_8h.html#4ecb2f6fb10aa389f78cccda126a7c4a">nivision.h</a> <li>LearnPatternAdvancedRotationOptions : <a class="el" href="nivision_8h.html#11d6cec781d3da21a5c2797139d61ff0">nivision.h</a> <li>LearnPatternAdvancedShiftOptions : <a class="el" href="nivision_8h.html#f1e1e438fdba54eaa804b3495361c864">nivision.h</a> <li>LedInput() : <a class="el" href="Utility_8cpp.html#ba092a586de5e741805be93e8b2338dc">Utility.cpp</a> <li>LedOutput() : <a class="el" href="Utility_8cpp.html#d3dca96687fcaabf6873aeb98ee01766">Utility.cpp</a> <li>LegFeature : <a class="el" href="nivision_8h.html#1ab9e288ad849c08a4172a372e48e44c">nivision.h</a> <li>LevelType : <a class="el" href="nivision_8h.html#e4b077296d11f290ca4997af72e6906b">nivision.h</a> <li>LevelType_enum : <a class="el" href="nivision_8h.html#31c3c8095f1ccdb7a0df899a4ee2c6d5">nivision.h</a> <li>Line : <a class="el" href="nivision_8h.html#38131fb0373f08bcee39a79665b990a1">nivision.h</a> <li>LinearAverages : <a class="el" href="nivision_8h.html#f41b7cd85e84c90cec588c9dd19457dd">nivision.h</a> <li>LinearAveragesMode : <a class="el" href="nivision_8h.html#29f01f91fa394a77ddca33c7b3fec682">nivision.h</a> <li>LinearAveragesMode_enum : <a class="el" href="nivision_8h.html#11081b729bd1b2111a26381525144b76">nivision.h</a> <li>LineDescriptor : <a class="el" href="nivision_8h.html#fbe78ced018bd1dcb9eb8ae1bb86c619">nivision.h</a> <li>LineEquation : <a class="el" href="nivision_8h.html#14ffe21d2c9c3e6fa21e8841fbf73165">nivision.h</a> <li>LineFeature : <a class="el" href="nivision_8h.html#a5f4503a8b633f2ff5049b64ec91cf32">nivision.h</a> <li>LineFloat : <a class="el" href="nivision_8h.html#386678d12111381a5f8220f39a4aeb61">nivision.h</a> <li>LineGaugeMethod : <a class="el" href="nivision_8h.html#ed2eeb32b069e1c23184fb464eb9fcfd">nivision.h</a> <li>LineGaugeMethod_enum : <a class="el" href="nivision_8h.html#67ea655dd9037ccbfa88b7282b3b2588">nivision.h</a> <li>LineMatch : <a class="el" href="nivision_8h.html#6d079e6cb43690dc1331cbbb73538048">nivision.h</a> <li>LineProfile : <a class="el" href="nivision_8h.html#5ea6683e1dd20d41f78fa80bb2a41651">nivision.h</a> <li>LocalThresholdMethod : <a class="el" href="nivision_8h.html#19de5df1d763d70207d53e2457e926ce">nivision.h</a> <li>LocalThresholdMethod_enum : <a class="el" href="nivision_8h.html#9bd1bfbdbb8f4977a139e3ed06d5be07">nivision.h</a> </ul> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Feb 9 11:20:56 2011 for WPILIB by&nbsp; <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> </body> </html>
Java
package edu.wsu.weather.agweathernet.helpers; import java.io.Serializable; public class StationModel implements Serializable { private static final long serialVersionUID = 1L; private String unitId; private String name; private String county; private String city; private String state; private String installationDate; private String distance; private boolean isFavourite; // stations details data private String airTemp; private String relHumid; private String windSpeed; private String precip; public StationModel() { } public StationModel(String unitId, String name, String county, String installationDate) { this.setUnitId(unitId); this.setName(name); this.setCounty(county); this.setInstallationDate(installationDate); } public String getUnitId() { return unitId; } public void setUnitId(String unitId) { this.unitId = unitId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCounty() { return county; } public void setCounty(String county) { this.county = county; } public String getInstallationDate() { return installationDate; } public void setInstallationDate(String installationDate) { this.installationDate = installationDate; } @Override public String toString() { return this.name + " " + this.county; } public boolean isFavourite() { return isFavourite; } public void setFavourite(boolean isFavourite) { this.isFavourite = isFavourite; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getDistance() { return distance; } public void setDistance(String distance) { this.distance = distance; } public String getAirTemp() { return airTemp; } public void setAirTemp(String airTemp) { this.airTemp = airTemp; } public String getWindSpeed() { return windSpeed; } public void setWindSpeed(String windSpeed) { this.windSpeed = windSpeed; } public String getPrecip() { return precip; } public void setPrecip(String precip) { this.precip = precip; } public String getRelHumid() { return relHumid; } public void setRelHumid(String relHumid) { this.relHumid = relHumid; } }
Java
# Burmeistera matthaei (DC.) Hook.f. & B.D.Jacks. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
Java
module Bosh module Director end end require 'digest/sha1' require 'erb' require 'fileutils' require 'forwardable' require 'logger' require 'logging' require 'monitor' require 'optparse' require 'ostruct' require 'pathname' require 'pp' require 'tmpdir' require 'yaml' require 'time' require 'zlib' require 'ipaddr' require 'common/exec' require 'bosh/template/evaluation_context' require 'common/version/release_version_list' require 'bcrypt' require 'eventmachine' require 'netaddr' require 'delayed_job' require 'sequel' require 'sinatra/base' require 'securerandom' require 'nats/client' require 'securerandom' require 'delayed_job_sequel' require 'common/thread_formatter' require 'bosh/director/cloud_factory' require 'bosh/director/az_cloud_factory.rb' require 'bosh/director/api' require 'bosh/director/dns/local_dns_repo' require 'bosh/director/dns/blobstore_dns_publisher' require 'bosh/director/dns/canonicalizer' require 'bosh/director/dns/dns_name_generator' require 'bosh/director/dns/director_dns_state_updater' require 'bosh/director/dns/dns_version_converger' require 'bosh/director/dns/dns_encoder' require 'bosh/director/dns/local_dns_encoder_manager' require 'bosh/director/dns/local_dns_manager' require 'bosh/director/dns/power_dns_manager' require 'bosh/director/dns/dns_records' require 'bosh/director/errors' require 'bosh/director/ext' require 'bosh/director/ip_util' require 'bosh/director/cidr_range_combiner' require 'bosh/director/lock_helper' require 'bosh/director/validation_helper' require 'bosh/director/download_helper' require 'bosh/director/formatter_helper' require 'bosh/director/tagged_logger' require 'bosh/director/legacy_deployment_helper' require 'bosh/director/duplicate_detector' require 'bosh/director/version' require 'bosh/director/config' require 'bosh/director/event_log' require 'bosh/director/task_db_writer' require 'bosh/director/task_appender' require 'bosh/director/blob_util' require 'bosh/director/digest/bosh_digest' require 'bosh/director/agent_client' require 'cloud' require 'cloud/external_cpi' require 'cloud/errors' require 'bosh/director/compile_task' require 'bosh/director/key_generator' require 'bosh/director/package_dependencies_manager' require 'bosh/director/job_renderer' require 'bosh/director/rendered_templates_persister' require 'bosh/director/audit_logger' require 'bosh/director/cycle_helper' require 'bosh/director/worker' require 'bosh/director/password_helper' require 'bosh/director/vm_creator' require 'bosh/director/vm_deleter' require 'bosh/director/orphaned_vm_deleter' require 'bosh/director/metadata_updater' require 'bosh/director/instance_reuser' require 'bosh/director/deployment_plan' require 'bosh/director/deployment_plan/variables_parser' require 'bosh/director/deployment_plan/variables' require 'bosh/director/deployment_plan/deployment_features_parser' require 'bosh/director/deployment_plan/deployment_features' require 'bosh/director/runtime_config' require 'bosh/director/cloud_config' require 'bosh/director/cpi_config' require 'bosh/director/compiled_release' require 'bosh/director/errand' require 'bosh/director/duration' require 'bosh/director/hash_string_vals' require 'bosh/director/instance_deleter' require 'bosh/director/instance_updater' require 'bosh/director/instance_updater/instance_state' require 'bosh/director/instance_updater/recreate_handler' require 'bosh/director/instance_updater/state_applier' require 'bosh/director/instance_updater/update_procedure' require 'bosh/director/disk_manager' require 'bosh/director/orphan_disk_manager' require 'bosh/director/stopper' require 'bosh/director/job_runner' require 'bosh/director/instance_group_updater' require 'bosh/director/instance_group_updater_factory' require 'bosh/director/job_queue' require 'bosh/director/lock' require 'bosh/director/nats_rpc' require 'bosh/director/network_reservation' require 'bosh/director/problem_scanner/scanner' require 'bosh/director/problem_resolver' require 'bosh/director/post_deployment_script_runner' require 'bosh/director/error_ignorer' require 'bosh/director/deployment_deleter' require 'bosh/director/permission_authorizer' require 'bosh/director/transactor' require 'bosh/director/sequel' require 'bosh/director/agent_broadcaster' require 'bosh/director/timeout' require 'bosh/director/nats_client_cert_generator' require 'common/thread_pool' require 'bosh/director/config_server/deep_hash_replacement' require 'bosh/director/config_server/uaa_auth_provider' require 'bosh/director/config_server/auth_http_client' require 'bosh/director/config_server/retryable_http_client' require 'bosh/director/config_server/config_server_http_client' require 'bosh/director/config_server/client' require 'bosh/director/config_server/client_factory' require 'bosh/director/config_server/variables_interpolator' require 'bosh/director/config_server/config_server_helper' require 'bosh/director/links/links_manager' require 'bosh/director/links/links_error_builder' require 'bosh/director/links/links_parser' require 'bosh/director/disk/persistent_disk_comparators' require 'bosh/director/manifest/manifest' require 'bosh/director/manifest/changeset' require 'bosh/director/manifest/redactor' require 'bosh/director/manifest/diff_lines' require 'bosh/director/log_bundles_cleaner' require 'bosh/director/logs_fetcher' require 'bosh/director/cloudcheck_helper' require 'bosh/director/problem_handlers/base' require 'bosh/director/problem_handlers/invalid_problem' require 'bosh/director/problem_handlers/inactive_disk' require 'bosh/director/problem_handlers/missing_disk' require 'bosh/director/problem_handlers/unresponsive_agent' require 'bosh/director/problem_handlers/mount_info_mismatch' require 'bosh/director/problem_handlers/missing_vm' require 'bosh/director/jobs/base_job' require 'bosh/director/jobs/backup' require 'bosh/director/jobs/scheduled_backup' require 'bosh/director/jobs/scheduled_orphaned_disk_cleanup' require 'bosh/director/jobs/scheduled_orphaned_vm_cleanup' require 'bosh/director/jobs/scheduled_events_cleanup' require 'bosh/director/jobs/scheduled_dns_blobs_cleanup' require 'bosh/director/jobs/create_snapshot' require 'bosh/director/jobs/snapshot_deployment' require 'bosh/director/jobs/snapshot_deployments' require 'bosh/director/jobs/snapshot_self' require 'bosh/director/jobs/delete_deployment' require 'bosh/director/jobs/delete_deployment_snapshots' require 'bosh/director/jobs/delete_release' require 'bosh/director/jobs/delete_snapshots' require 'bosh/director/jobs/delete_orphan_disks' require 'bosh/director/jobs/delete_stemcell' require 'bosh/director/jobs/cleanup_artifacts' require 'bosh/director/jobs/export_release' require 'bosh/director/jobs/update_deployment' require 'bosh/director/jobs/update_release' require 'bosh/director/jobs/update_stemcell' require 'bosh/director/jobs/fetch_logs' require 'bosh/director/jobs/vm_state' require 'bosh/director/jobs/run_errand' require 'bosh/director/jobs/cloud_check/scan' require 'bosh/director/jobs/cloud_check/scan_and_fix' require 'bosh/director/jobs/cloud_check/apply_resolutions' require 'bosh/director/jobs/release/release_job' require 'bosh/director/jobs/ssh' require 'bosh/director/jobs/attach_disk' require 'bosh/director/jobs/delete_vm' require 'bosh/director/jobs/helpers' require 'bosh/director/jobs/db_job' require 'bosh/director/jobs/orphan_disk' require 'bosh/director/models/helpers/model_helper' require 'bosh/director/db_backup' require 'bosh/director/blobstores' require 'bosh/director/api/director_uuid_provider' require 'bosh/director/api/local_identity_provider' require 'bosh/director/api/uaa_identity_provider' require 'bosh/director/api/event_manager' require 'bosh/director/app' module Bosh::Director autoload :Models, 'bosh/director/models' # Defining model classes relies on a database connection end require 'bosh/director/thread_pool' require 'bosh/director/api/extensions/scoping' require 'bosh/director/api/extensions/request_logger' require 'bosh/director/api/controllers/backups_controller' require 'bosh/director/api/controllers/cleanup_controller' require 'bosh/director/api/controllers/deployments_controller' require 'bosh/director/api/controllers/disks_controller' require 'bosh/director/api/controllers/orphan_disks_controller' require 'bosh/director/api/controllers/orphaned_vms_controller' require 'bosh/director/api/controllers/packages_controller' require 'bosh/director/api/controllers/info_controller' require 'bosh/director/api/controllers/jobs_controller' require 'bosh/director/api/controllers/releases_controller' require 'bosh/director/api/controllers/resources_controller' require 'bosh/director/api/controllers/resurrection_controller' require 'bosh/director/api/controllers/stemcells_controller' require 'bosh/director/api/controllers/stemcell_uploads_controller' require 'bosh/director/api/controllers/tasks_controller' require 'bosh/director/api/controllers/task_controller' require 'bosh/director/api/controllers/configs_controller' require 'bosh/director/api/controllers/deployment_configs_controller' require 'bosh/director/api/controllers/cloud_configs_controller' require 'bosh/director/api/controllers/runtime_configs_controller' require 'bosh/director/api/controllers/cpi_configs_controller' require 'bosh/director/api/controllers/locks_controller' require 'bosh/director/api/controllers/restore_controller' require 'bosh/director/api/controllers/events_controller' require 'bosh/director/api/controllers/vms_controller' require 'bosh/director/api/controllers/link_providers_controller' require 'bosh/director/api/controllers/link_consumers_controller' require 'bosh/director/api/controllers/links_controller' require 'bosh/director/api/controllers/link_address_controller' require 'bosh/director/api/route_configuration' require 'bosh/director/step_executor' require 'common/common' require 'bosh/blobstore_client/errors' require 'bosh/blobstore_client/client' Bosh::Blobstore.autoload(:BaseClient, 'bosh/blobstore_client/base') require 'bosh/blobstore_client/retryable_blobstore_client' require 'bosh/blobstore_client/sha1_verifiable_blobstore_client' Bosh::Blobstore.autoload(:SimpleBlobstoreClient, 'bosh/blobstore_client/simple_blobstore_client') Bosh::Blobstore.autoload(:LocalClient, 'bosh/blobstore_client/local_client') Bosh::Blobstore.autoload(:DavcliBlobstoreClient, 'bosh/blobstore_client/davcli_blobstore_client') Bosh::Blobstore.autoload(:S3cliBlobstoreClient, 'bosh/blobstore_client/s3cli_blobstore_client') Bosh::Blobstore.autoload(:GcscliBlobstoreClient, 'bosh/blobstore_client/gcscli_blobstore_client')
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html lang='en'> <head> <meta name="generator" content="AWStats 6.7 (build 1.892) from config file awstats.2818332.conf (http://awstats.sourceforge.net)"> <meta name="robots" content="noindex,nofollow"> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <meta http-equiv="description" content="Awstats - Advanced Web Statistics for 0340a95.netsolhost.com (2013-09)"> <title>Statistics for 0340a95.netsolhost.com (2013-09)</title> <style type="text/css"> <!-- body { font: 11px verdana, arial, helvetica, sans-serif; background-color: #FFFFFF; margin-top: 0; margin-bottom: 0; } .aws_bodyl { } .aws_border { border-collapse: collapse; background-color: #CCCCDD; padding: 1px 1px 1px 1px; margin-top: 0px; margin-bottom: 0px; } .aws_title { font: 13px verdana, arial, helvetica, sans-serif; font-weight: bold; background-color: #CCCCDD; text-align: center; margin-top: 0; margin-bottom: 0; padding: 1px 1px 1px 1px; color: #000000; } .aws_blank { font: 13px verdana, arial, helvetica, sans-serif; background-color: #FFFFFF; text-align: center; margin-bottom: 0; padding: 1px 1px 1px 1px; } .aws_data { background-color: #FFFFFF; border-top-width: 1px; border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; } .aws_formfield { font: 13px verdana, arial, helvetica; } .aws_button { font-family: arial,verdana,helvetica, sans-serif; font-size: 12px; border: 1px solid #ccd7e0; background-image : url(/awstats/icon/other/button.gif); } th { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 1px; padding: 1px 2px 1px 1px; font: 11px verdana, arial, helvetica, sans-serif; text-align:center; color: #000000; } th.aws { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 1px; padding: 1px 2px 1px 1px; font-size: 13px; font-weight: bold; } td { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 1px; font: 11px verdana, arial, helvetica, sans-serif; text-align:center; color: #000000; } td.aws { border-color: #ECECEC; border-left-width: 0px; border-right-width: 1px; border-top-width: 0px; border-bottom-width: 1px; font: 11px verdana, arial, helvetica, sans-serif; text-align:left; color: #000000; padding: 0px;} td.awsm { border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; font: 11px verdana, arial, helvetica, sans-serif; text-align:left; color: #000000; padding: 0px; } b { font-weight: bold; } a { font: 11px verdana, arial, helvetica, sans-serif; } a:link { color: #0011BB; text-decoration: none; } a:visited { color: #0011BB; text-decoration: none; } a:hover { color: #605040; text-decoration: underline; } .currentday { font-weight: bold; } //--> </style> </head> <body style="margin-top: 0px"> <a name="top">&nbsp;</a> <a name="menu">&nbsp;</a> <form name="FormDateFilter" action="/cgi-bin/awstats.pl?config=2818332.1309&amp;configdir=/data/22/2/81/47/2570699/meta/2818332/config&amp;output=urldetail" style="padding: 0px 0px 0px 0px; margin-top: 0"> <table class="aws_border" border="0" cellpadding="2" cellspacing="0" width="100%"> <tr><td> <table class="aws_data" border="0" cellpadding="1" cellspacing="0" width="100%"> <tr><td class="aws" valign="middle"><b>Statistics for:</b>&nbsp;</td><td class="aws" valign="middle"><span style="font-size: 14px;">0340a95.netsolhost.com</span></td><td align="right" rowspan="3"><a href="http://awstats.sourceforge.net" target="awstatshome"><img src="/awstats/icon/other/awstats_logo6.png" border="0" alt='Awstats Web Site' title='Awstats Web Site' /></a></td></tr> <tr valign="middle"><td class="aws" valign="middle" width="150"><b>Last Update:</b>&nbsp;</td><td class="aws" valign="middle"><span style="font-size: 12px;">01 Oct 2013 - 01:49</span></td></tr> <tr><td class="aws" valign="middle"><b>Reported period:</b></td><td class="aws" valign="middle"><span style="font-size: 14px;">Month Sep 2013</span></td></tr> </table> </td></tr></table> </form> <table> <tr><td class="aws"><a href="javascript:parent.window.close();">Close window</a></td></tr> </table> <a name="urls">&nbsp;</a><br /> <table class="aws_border" border="0" cellpadding="2" cellspacing="0" width="100%"> <tr><td class="aws_title" width="70%">Pages-URL </td><td class="aws_blank">&nbsp;</td></tr> <tr><td colspan="2"> <table class="aws_data" border="1" cellpadding="2" cellspacing="0" width="100%"> <tr bgcolor="#ECECEC"><th>Total: 12 different pages-url</th><th bgcolor="#4477DD" width="80">Viewed</th><th bgcolor="#2EA495" width="80">Average size</th><th bgcolor="#CEC2E8" width="80">Entry</th><th bgcolor="#C1B2E2" width="80">Exit</th><th>&nbsp;</th></tr> <tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/bibliography.shtml" target="url">/cd-risc/bibliography.shtml</a></td><td>1293</td><td>55.78 KB</td><td>367</td><td>391</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="261" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="105" height="4" /><br /><img src="/awstats/icon/other/he.png" width="74" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="79" height="4" /></td></tr> <tr><td class="aws"><a href="http://0340a95.netsolhost.com/" target="url">/</a></td><td>1202</td><td>7.66 KB</td><td>904</td><td>527</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="242" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="15" height="4" /><br /><img src="/awstats/icon/other/he.png" width="182" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="106" height="4" /></td></tr> <tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/userguide.shtml" target="url">/cd-risc/userguide.shtml</a></td><td>479</td><td>103.47 KB</td><td>77</td><td>122</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="97" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="194" height="4" /><br /><img src="/awstats/icon/other/he.png" width="16" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="25" height="4" /></td></tr> <tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/requestform.shtml" target="url">/cd-risc/requestform.shtml</a></td><td>361</td><td>12.43 KB</td><td>73</td><td>112</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="73" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="24" height="4" /><br /><img src="/awstats/icon/other/he.png" width="15" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="23" height="4" /></td></tr> <tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/faq.shtml" target="url">/cd-risc/faq.shtml</a></td><td>308</td><td>9.20 KB</td><td>55</td><td>127</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="62" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="18" height="4" /><br /><img src="/awstats/icon/other/he.png" width="12" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="26" height="4" /></td></tr> <tr><td class="aws"><a href="http://0340a95.netsolhost.com/index.shtml" target="url">/index.shtml</a></td><td>297</td><td>7.64 KB</td><td>27</td><td>112</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="60" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="15" height="4" /><br /><img src="/awstats/icon/other/he.png" width="6" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="23" height="4" /></td></tr> <tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/translations.shtml" target="url">/cd-risc/translations.shtml</a></td><td>274</td><td>4.43 KB</td><td>33</td><td>59</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="56" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="9" height="4" /><br /><img src="/awstats/icon/other/he.png" width="7" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="12" height="4" /></td></tr> <tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/request-form.pdf" target="url">/cd-risc/request-form.pdf</a></td><td>176</td><td>138.91 KB</td><td>28</td><td>81</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="36" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="261" height="4" /><br /><img src="/awstats/icon/other/he.png" width="6" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="17" height="4" /></td></tr> <tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/requestform.php" target="url">/cd-risc/requestform.php</a></td><td>158</td><td>170 Bytes</td><td>12</td><td>32</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="32" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="2" height="4" /><br /><img src="/awstats/icon/other/he.png" width="3" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="7" height="4" /></td></tr> <tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/termsofservice.shtml" target="url">/cd-risc/termsofservice.shtml</a></td><td>132</td><td>21.02 KB</td><td>45</td><td>45</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="27" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="40" height="4" /><br /><img src="/awstats/icon/other/he.png" width="10" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="10" height="4" /></td></tr> <tr><td class="aws"><a href="http://0340a95.netsolhost.com/cd-risc/privacypolicy.shtml" target="url">/cd-risc/privacypolicy.shtml</a></td><td>84</td><td>11.77 KB</td><td>7</td><td>18</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="17" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="23" height="4" /><br /><img src="/awstats/icon/other/he.png" width="2" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="4" height="4" /></td></tr> <tr><td class="aws"><a href="http://0340a95.netsolhost.com/BingSiteAuth.xml" target="url">/BingSiteAuth.xml</a></td><td>3</td><td>85 Bytes</td><td>3</td><td>3</td><td class="aws"><img src="/awstats/icon/other/hp.png" width="2" height="4" /><br /><img src="/awstats/icon/other/hk.png" width="2" height="4" /><br /><img src="/awstats/icon/other/he.png" width="2" height="4" /><br /><img src="/awstats/icon/other/hx.png" width="2" height="4" /></td></tr> </table></td></tr></table><br /> <br /><br /> <span dir="ltr" style="font: 11px verdana, arial, helvetica; color: #000000;"><b>Advanced Web Statistics 6.7 (build 1.892)</b> - <a href="http://awstats.sourceforge.net" target="awstatshome">Created by awstats</a></span><br /> <br /> </body> </html>
Java
#!/usr/bin/env python # SIM-CITY client # # Copyright 2015 Netherlands eScience Center <info@esciencecenter.nl> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import tarfile class load_data: ''' class to load txt data ''' def __init__(self, filename): self.filename = filename tfile, members = self.get_archive_object_tar() self.read_files(tfile, members) def get_archive_object_tar(self): ''' return tarfile object and its members ''' tfile = tarfile.open(name=self.filename) members = tfile.getnames() return tfile, members def read_files(self, tfile, members): ''' array with txt data from tarfile object ''' self.data = [tfile.extractfile(member).read() for member in members if tfile.extractfile(member) is not None] def main(): load_data('enron_mail_clean.tar.gz') import pdb pdb.set_trace() if __name__ == "__main__": main()
Java
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Question_04_09_BSTSequences")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Question_04_09_BSTSequences")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("c2609554-6dab-48f4-862f-3d82a62b7a99")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
Java
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> <meta content="2013-12-25 10:18:47 -0700" http-equiv="change-date" /> <title>EX 32</title> <script src='../js/jquery-3.1.1.min.js' type='text/javascript' charset='utf-8'></script> <script src='../js/bpi.js' type="text/javascript" charset="utf-8"></script> <link rel="stylesheet" href='../css/bpi.css' > </head> <body> <div class="header"><h1 id="titulo">Êxodo 32<span id="trecho"></span></h1></div> <div id="passagem"> <div class="bible1 verses"> <p class="verse" verse="1"><sup>1</sup>Mas o povo, vendo que Moisés tardava em descer do monte, acercou-se de Arão, e lhe disse: Levanta-te, faze-nos um deus que vá adiante de nós; porque, quanto a esse Moisés, o homem que nos tirou da terra do Egito, não sabemos o que lhe aconteceu.</p> <p class="verse" verse="2"><sup>2</sup>E Arão lhes disse: Tirai os pendentes de ouro que estão nas orelhas de vossas mulheres, de vossos filhos e de vossas filhas, e trazei-mos.</p> <p class="verse" verse="3"><sup>3</sup>Então todo o povo, tirando os pendentes de ouro que estavam nas suas orelhas, os trouxe a Arão;</p> <p class="verse" verse="4"><sup>4</sup>ele os recebeu de suas mãos, e com um buril deu forma ao ouro, e dele fez um bezerro de fundição. Então eles exclamaram: Eis aqui, ó Israel, o teu deus, que te tirou da terra do Egito.</p> <p class="verse" verse="5"><sup>5</sup>E Arão, vendo isto, edificou um altar diante do bezerro e, fazendo uma proclamação, disse: Amanhã haverá festa ao Senhor.</p> <p class="verse" verse="6"><sup>6</sup>No dia seguinte levantaram-se cedo, ofereceram holocaustos, e trouxeram ofertas pacíficas; e o povo sentou-se a comer e a beber; depois levantou-se para folgar.</p> <p class="verse" verse="7"><sup>7</sup>Então disse o Senhor a Moisés: Vai, desce; porque o teu povo, que fizeste subir da terra do Egito, se corrompeu;</p> <p class="verse" verse="8"><sup>8</sup>depressa se desviou do caminho que eu lhe ordenei; eles fizeram para si um bezerro de fundição, e adoraram-no, e lhe ofereceram sacrifícios, e disseram: Eis aqui, ó Israel, o teu deus, que te tirou da terra do Egito.</p> <p class="verse" verse="9"><sup>9</sup>Disse mais o Senhor a Moisés: Tenho observado este povo, e eis que é povo de dura cerviz.</p> <p class="verse" verse="10"><sup>10</sup>Agora, pois, deixa-me, para que a minha ira se acenda contra eles, e eu os consuma; e eu farei de ti uma grande nação.</p> <p class="verse" verse="11"><sup>11</sup>Moisés, porém, suplicou ao Senhor seu Deus, e disse: Ó Senhor, por que se acende a tua ira contra o teu povo, que tiraste da terra do Egito com grande força e com forte mão?</p> <p class="verse" verse="12"><sup>12</sup>Por que hão de falar os egípcios, dizendo: Para mal os tirou, para matá-los nos montes, e para destruí-los da face da terra?. Torna-te da tua ardente ira, e arrepende-te deste mal contra o teu povo.</p> <p class="verse" verse="13"><sup>13</sup>Lembra-te de Abraão, de Isaque, e de Israel, teus servos, aos quais por ti mesmo juraste, e lhes disseste: Multiplicarei os vossos descendentes como as estrelas do céu, e lhes darei toda esta terra de que tenho falado, e eles a possuirão por herança para sempre.</p> <p class="verse" verse="14"><sup>14</sup>Então o Senhor se arrependeu do mal que dissera que havia de fazer ao seu povo.</p> <p class="verse" verse="15"><sup>15</sup>E virou-se Moisés, e desceu do monte com as duas tábuas do testemunho na mão, tábuas escritas de ambos os lados; de um e de outro lado estavam escritas.</p> <p class="verse" verse="16"><sup>16</sup>E aquelas tábuas eram obra de Deus; também a escritura era a mesma escritura de Deus, esculpida nas tábuas.</p> <p class="verse" verse="17"><sup>17</sup>Ora, ouvindo Josué a voz do povo que jubilava, disse a Moisés: Alarido de guerra há no arraial.</p> <p class="verse" verse="18"><sup>18</sup>Respondeu-lhe Moisés: Não é alarido dos vitoriosos, nem alarido dos vencidos, mas é a voz dos que cantam que eu ouço.</p> <p class="verse" verse="19"><sup>19</sup>Chegando ele ao arraial e vendo o bezerro e as danças, acendeu-se-lhe a ira, e ele arremessou das mãos as tábuas, e as despedaçou ao pé do monte.</p> <p class="verse" verse="20"><sup>20</sup>Então tomou o bezerro que tinham feito, e queimou-o no fogo; e, moendo-o até que se tornou em pó, o espargiu sobre a água, e deu-o a beber aos filhos de Israel.</p> <p class="verse" verse="21"><sup>21</sup>E perguntou Moisés a Arão: Que te fez este povo, que sobre ele trouxeste tamanho pecado?.</p> <p class="verse" verse="22"><sup>22</sup>Ao que respondeu Arão: Não se acenda a ira do meu senhor; tu conheces o povo, como ele é inclinado ao mal.</p> <p class="verse" verse="23"><sup>23</sup>Pois eles me disseram: Faze-nos um deus que vá adiante de nós; porque, quanto a esse Moisés, o homem que nos tirou da terra do Egito, não sabemos o que lhe aconteceu.</p> <p class="verse" verse="24"><sup>24</sup>Então eu lhes disse: Quem tem ouro, arranque-o. Assim mo deram; e eu o lancei no fogo, e saiu este bezerro.</p> <p class="verse" verse="25"><sup>25</sup>Quando, pois, Moisés viu que o povo estava desenfreado {porque Arão o havia desenfreado, para escárnio entre os seus inimigos},</p> <p class="verse" verse="26"><sup>26</sup>pôs-se em pé à entrada do arraial, e disse: Quem está ao lado do Senhor, venha a mim. Ao que se ajuntaram a ele todos os filhos de Levi.</p> <p class="verse" verse="27"><sup>27</sup>Então ele lhes disse: Assim diz o Senhor, o Deus de Israel: Cada um ponha a sua espada sobre a coxa; e passai e tornai pelo arraial de porta em porta, e mate cada um a seu irmão, e cada um a seu amigo, e cada um a seu vizinho.</p> <p class="verse" verse="28"><sup>28</sup>E os filhos de Levi fizeram conforme a palavra de Moisés; e caíram do povo naquele dia cerca de três mil homens.</p> <p class="verse" verse="29"><sup>29</sup>Porquanto Moisés tinha dito: Consagrai-vos hoje ao Senhor; porque cada um será contra o seu filho, e contra o seu irmão; para que o Senhor vos conceda hoje uma bênção.</p> <p class="verse" verse="30"><sup>30</sup>No dia seguinte disse Moisés ao povo Vós tendes cometido grande pecado; agora porém subirei ao Senhor; porventura farei expiação por vosso pecado.</p> <p class="verse" verse="31"><sup>31</sup>Assim tornou Moisés ao Senhor, e disse: Oh! este povo cometeu um grande pecado, fazendo para si um deus de ouro.</p> <p class="verse" verse="32"><sup>32</sup>Agora, pois, perdoa o seu pecado; ou se não, risca-me do teu livro, que tens escrito.</p> <p class="verse" verse="33"><sup>33</sup>Então disse o Senhor a Moisés: Aquele que tiver pecado contra mim, a este riscarei do meu livro.</p> <p class="verse" verse="34"><sup>34</sup>Vai pois agora, conduze este povo para o lugar de que te hei dito; eis que o meu anjo irá adiante de ti; porém no dia da minha visitação, sobre eles visitarei o seu pecado.</p> <p class="verse" verse="35"><sup>35</sup>Feriu, pois, o Senhor ao povo, por ter feito o bezerro que Arão formara.</p> </div> </div> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <p class="copyright">Almeida Revista e Atualizada© Copyright © 1993 Sociedade Bíblica do Brasil. Todos os direitos reservados. Texto bíblico utilizado com autorização. Saiba mais sobre a Sociedade Bíblica do Brasil. A Sociedade Bíblica do Brasil trabalha para que a Bíblia esteja, efetivamente, ao alcance de todos e seja lida por todos. A SBB é uma entidade sem fins lucrativos, dedicada a promover o desenvolvimento integral do ser humano.</p> <br/> <br/> <br/> <br/></body> </html>
Java
package ca.uhn.fhir.jpa.term; /* * #%L * HAPI FHIR JPA Server * %% * Copyright (C) 2014 - 2016 University Health Network * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ public class VersionIndependentConcept { private String mySystem; private String myCode; public VersionIndependentConcept(String theSystem, String theCode) { setSystem(theSystem); setCode(theCode); } public String getSystem() { return mySystem; } public void setSystem(String theSystem) { mySystem = theSystem; } public String getCode() { return myCode; } public void setCode(String theCode) { myCode = theCode; } }
Java
/* * Copyright 2016 Dennis Vriend * * 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.github.dnvriend.streams.stage.simple import akka.stream.testkit.scaladsl.TestSink import com.github.dnvriend.streams.TestSpec class DropWhileStageTest extends TestSpec { /** * Discard elements at the beginning of the stream while predicate is true. * All elements will be taken after predicate returns false first time. * * - Emits when: predicate returned false and for all following stream elements * - Backpressures when: predicate returned false and downstream backpressures * - Completes when: upstream completes * - Cancels when: downstream cancels */ "DropWhile" should "discard elements while the predicate is true, else it emits elements" in { withIterator() { src ⇒ src.take(10) .dropWhile(_ < 5) .runWith(TestSink.probe[Int]) .request(Integer.MAX_VALUE) .expectNext(5, 6, 7, 8, 9) .expectComplete() } } }
Java
# Hedyotis pterospora F.Muell. SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
Java
# Eleocharis caribaea var. dispar VARIETY #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
Java
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/states/model/Tag.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace SFN { namespace Model { Tag::Tag() : m_keyHasBeenSet(false), m_valueHasBeenSet(false) { } Tag::Tag(JsonView jsonValue) : m_keyHasBeenSet(false), m_valueHasBeenSet(false) { *this = jsonValue; } Tag& Tag::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("key")) { m_key = jsonValue.GetString("key"); m_keyHasBeenSet = true; } if(jsonValue.ValueExists("value")) { m_value = jsonValue.GetString("value"); m_valueHasBeenSet = true; } return *this; } JsonValue Tag::Jsonize() const { JsonValue payload; if(m_keyHasBeenSet) { payload.WithString("key", m_key); } if(m_valueHasBeenSet) { payload.WithString("value", m_value); } return payload; } } // namespace Model } // namespace SFN } // namespace Aws
Java
/** * Copyright 2015-2017 The OpenZipkin Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package zipkin.benchmarks; import java.util.List; import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Measurement; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.OutputTimeUnit; import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Threads; import org.openjdk.jmh.annotations.Warmup; import org.openjdk.jmh.runner.Runner; import org.openjdk.jmh.runner.RunnerException; import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; import zipkin.Annotation; import zipkin.BinaryAnnotation; import zipkin.Constants; import zipkin.Endpoint; import zipkin.TraceKeys; import zipkin2.Span; import zipkin.internal.V2SpanConverter; import zipkin.internal.Util; @Measurement(iterations = 5, time = 1) @Warmup(iterations = 10, time = 1) @Fork(3) @BenchmarkMode(Mode.Throughput) @OutputTimeUnit(TimeUnit.MICROSECONDS) @State(Scope.Thread) @Threads(1) public class Span2ConverterBenchmarks { Endpoint frontend = Endpoint.create("frontend", 127 << 24 | 1); Endpoint backend = Endpoint.builder() .serviceName("backend") .ipv4(192 << 24 | 168 << 16 | 99 << 8 | 101) .port(9000) .build(); zipkin.Span shared = zipkin.Span.builder() .traceIdHigh(Util.lowerHexToUnsignedLong("7180c278b62e8f6a")) .traceId(Util.lowerHexToUnsignedLong("216a2aea45d08fc9")) .parentId(Util.lowerHexToUnsignedLong("6b221d5bc9e6496c")) .id(Util.lowerHexToUnsignedLong("5b4185666d50f68b")) .name("get") .timestamp(1472470996199000L) .duration(207000L) .addAnnotation(Annotation.create(1472470996199000L, Constants.CLIENT_SEND, frontend)) .addAnnotation(Annotation.create(1472470996238000L, Constants.WIRE_SEND, frontend)) .addAnnotation(Annotation.create(1472470996250000L, Constants.SERVER_RECV, backend)) .addAnnotation(Annotation.create(1472470996350000L, Constants.SERVER_SEND, backend)) .addAnnotation(Annotation.create(1472470996403000L, Constants.WIRE_RECV, frontend)) .addAnnotation(Annotation.create(1472470996406000L, Constants.CLIENT_RECV, frontend)) .addBinaryAnnotation(BinaryAnnotation.create(TraceKeys.HTTP_PATH, "/api", frontend)) .addBinaryAnnotation(BinaryAnnotation.create(TraceKeys.HTTP_PATH, "/backend", backend)) .addBinaryAnnotation(BinaryAnnotation.create("clnt/finagle.version", "6.45.0", frontend)) .addBinaryAnnotation(BinaryAnnotation.create("srv/finagle.version", "6.44.0", backend)) .addBinaryAnnotation(BinaryAnnotation.address(Constants.CLIENT_ADDR, frontend)) .addBinaryAnnotation(BinaryAnnotation.address(Constants.SERVER_ADDR, backend)) .build(); zipkin.Span server = zipkin.Span.builder() .traceIdHigh(Util.lowerHexToUnsignedLong("7180c278b62e8f6a")) .traceId(Util.lowerHexToUnsignedLong("216a2aea45d08fc9")) .parentId(Util.lowerHexToUnsignedLong("6b221d5bc9e6496c")) .id(Util.lowerHexToUnsignedLong("5b4185666d50f68b")) .name("get") .addAnnotation(Annotation.create(1472470996250000L, Constants.SERVER_RECV, backend)) .addAnnotation(Annotation.create(1472470996350000L, Constants.SERVER_SEND, backend)) .addBinaryAnnotation(BinaryAnnotation.create(TraceKeys.HTTP_PATH, "/backend", backend)) .addBinaryAnnotation(BinaryAnnotation.create("srv/finagle.version", "6.44.0", backend)) .addBinaryAnnotation(BinaryAnnotation.address(Constants.CLIENT_ADDR, frontend)) .build(); Span server2 = Span.newBuilder() .traceId("7180c278b62e8f6a216a2aea45d08fc9") .parentId("6b221d5bc9e6496c") .id("5b4185666d50f68b") .name("get") .kind(Span.Kind.SERVER) .shared(true) .localEndpoint(backend.toV2()) .remoteEndpoint(frontend.toV2()) .timestamp(1472470996250000L) .duration(100000L) .putTag(TraceKeys.HTTP_PATH, "/backend") .putTag("srv/finagle.version", "6.44.0") .build(); @Benchmark public List<Span> fromSpan_splitShared() { return V2SpanConverter.fromSpan(shared); } @Benchmark public List<Span> fromSpan() { return V2SpanConverter.fromSpan(server); } @Benchmark public zipkin.Span toSpan() { return V2SpanConverter.toSpan(server2); } // Convenience main entry-point public static void main(String[] args) throws RunnerException { Options opt = new OptionsBuilder() .include(".*" + Span2ConverterBenchmarks.class.getSimpleName() + ".*") .build(); new Runner(opt).run(); } }
Java
zhangyu
Java
/* * Copyright 2014 Technische Universität Darmstadt * * 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. */ using KaVE.Commons.Model.Naming; using KaVE.Commons.Model.Naming.CodeElements; using KaVE.Commons.Model.TypeShapes; namespace KaVE.Commons.Tests.Model.TypeShapes { internal class PropertyHierarchyTest : MemberHierarchyTestBase<IPropertyName> { protected override IMemberHierarchy<IPropertyName> CreateSut() { return new PropertyHierarchy(); } protected override IMemberHierarchy<IPropertyName> CreateSut(IPropertyName n) { return new PropertyHierarchy(n); } protected override IPropertyName Get(int num = 0) { return num == 0 ? Names.UnknownProperty : Names.Property(string.Format("get set [T1,P1] [T2,P2].P{0}()", num)); } } }
Java
// NOTE: this file should only be included when embedding the inspector - no other files should be included (this will do everything) // If gliEmbedDebug == true, split files will be used, otherwise the cat'ed scripts will be inserted (function() { var pathRoot = ""; var useDebug = window["gliEmbedDebug"]; // Find self in the <script> tags var scripts = document.head.getElementsByTagName("script"); for (var n = 0; n < scripts.length; n++) { var scriptTag = scripts[n]; var src = scriptTag.src.toLowerCase(); if (/core\/embed.js$/.test(src)) { // Found ourself - strip our name and set the root var index = src.lastIndexOf("embed.js"); pathRoot = scriptTag.src.substring(0, index); break; } } function insertHeaderNode(node) { var targets = [ document.body, document.head, document.documentElement ]; for (var n = 0; n < targets.length; n++) { var target = targets[n]; if (target) { if (target.firstElementChild) { target.insertBefore(node, target.firstElementChild); } else { target.appendChild(node); } break; } } } ; function insertStylesheet(url) { var link = document.createElement("link"); link.rel = "stylesheet"; link.href = url; insertHeaderNode(link); return link; } ; function insertScript(url) { var script = document.createElement("script"); script.type = "text/javascript"; script.src = url; insertHeaderNode(script); return script; } ; if (useDebug) { // Fall through below and use the loader to get things } else { var jsurl = pathRoot + "lib/gli.all.js"; var cssurl = pathRoot + "lib/gli.all.css"; window.gliCssUrl = cssurl; insertStylesheet(cssurl); insertScript(jsurl); } // Always load the loader if (useDebug) { var script = insertScript(pathRoot + "loader.js"); function scriptLoaded() { gliloader.pathRoot = pathRoot; if (useDebug) { // In debug mode load all the scripts gliloader.load([ "host", "replay", "ui" ]); } } ; script.onreadystatechange = function() { if (("loaded" === script.readyState || "complete" === script.readyState) && !script.loadCalled) { this.loadCalled = true; scriptLoaded(); } }; script.onload = function() { if (!script.loadCalled) { this.loadCalled = true; scriptLoaded(); } }; } // Hook canvas.getContext var originalGetContext = HTMLCanvasElement.prototype.getContext; if (!HTMLCanvasElement.prototype.getContextRaw) { HTMLCanvasElement.prototype.getContextRaw = originalGetContext; } HTMLCanvasElement.prototype.getContext = function() { var ignoreCanvas = this.internalInspectorSurface; if (ignoreCanvas) { return originalGetContext.apply(this, arguments); } var contextNames = [ "moz-webgl", "webkit-3d", "experimental-webgl", "webgl" ]; var requestingWebGL = contextNames.indexOf(arguments[0]) != -1; if (requestingWebGL) { // Page is requesting a WebGL context! // TODO: something } var result = originalGetContext.apply(this, arguments); if (result == null) { return null; } if (requestingWebGL) { // TODO: pull options from somewhere? result = gli.host.inspectContext(this, result); var hostUI = new gli.host.HostUI(result); result.hostUI = hostUI; // just so we can access it later for // debugging } return result; }; })();
Java
[![buildstatus](https://travis-ci.org/holdenk/spark-testing-base.svg?branch=master)](https://travis-ci.org/holdenk/spark-testing-base) # spark-testing-base Base classes to use when writing tests with Spark. # Why? You've written an awesome program in Spark and now its time to write some tests. Only you find yourself writing the code to setup and tear down local mode Spark in between each suite and you say to your self: This is not my beautiful code. So you include com.holdenkarau.spark-testing-base [spark_version]_0.0.5 and extend one of the classes and write some simple tests instead. For example to include this in a project using Spark 1.3.0: "com.holdenkarau" % "spark-testing-base" %% "1.3.0_0.0.5" Note that new versions (0.0.8+) are built against Spark 1.3.0+ for simplicity, but if you need an old version file an issue and I will re-enable cross-builds for older versions. This package is also cross compiled against scala 2.10.4 and 2.11.6 in the traditional manner. # Where is this from? This code is a stripped down version of the test suite bases that are in Apache Spark but are not accessiable.
Java
/* * * (c) Copyright Ascensio System Limited 2010-2021 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ namespace ASC.Mail.Net.IMAP.Server { /// <summary> /// Provides data for IMAP events. /// </summary> public class Mailbox_EventArgs { #region Members private readonly string m_Folder = ""; private readonly string m_NewFolder = ""; #endregion #region Properties /// <summary> /// Gets folder. /// </summary> public string Folder { get { return m_Folder; } } /// <summary> /// Gets new folder name, this is available for rename only. /// </summary> public string NewFolder { get { return m_NewFolder; } } /// <summary> /// Gets or sets custom error text, which is returned to client. /// </summary> public string ErrorText { get; set; } #endregion #region Constructor /// <summary> /// Default constructor. /// </summary> /// <param name="folder"></param> public Mailbox_EventArgs(string folder) { m_Folder = folder; } /// <summary> /// Folder rename constructor. /// </summary> /// <param name="folder"></param> /// <param name="newFolder"></param> public Mailbox_EventArgs(string folder, string newFolder) { m_Folder = folder; m_NewFolder = newFolder; } #endregion } }
Java
<?php require_once('auth.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <?php include '../connect.php'; $result = $db->prepare("SELECT * FROM products where qty < level ORDER BY product_id DESC"); $result->execute(); $rowcount123 = $result->rowcount(); ?> <html> <head> <!-- js --> <link href="src/facebox.css" media="screen" rel="stylesheet" type="text/css" /> <script src="lib/jquery.js" type="text/javascript"></script> <script src="src/facebox.js" type="text/javascript"></script> <script type="text/javascript"> jQuery(document).ready(function($) { $('a[rel*=facebox]').facebox({ loadingImage : 'src/loading.gif', closeImage : 'src/closelabel.png' }) }) </script> <title> stock take </title> <link href="vendors/uniform.default.css" rel="stylesheet" media="screen"> <link href="css/bootstrap.css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="css/DT_bootstrap.css"> <link rel="stylesheet" href="css/font-awesome.min.css"> <style type="text/css"> body { padding-top: 60px; padding-bottom: 40px; } .sidebar-nav { padding: 9px 0; } </style> <link href="css/bootstrap-responsive.css" rel="stylesheet"> <script src="vendors/jquery-1.7.2.min.js"></script> <script src="vendors/bootstrap.js"></script> <link href="../style.css" media="screen" rel="stylesheet" type="text/css" /> </head> <?php function createRandomPassword() { $chars = "003232303232023232023456789"; srand((double) microtime() * 1000000); $i = 0; $pass = ''; while ($i <= 7) { $num = rand() % 33; $tmp = substr($chars, $num, 1); $pass = $pass . $tmp; $i++; } return $pass; } $finalcode = 'INV-' . createRandomPassword(); ?> <body> <?php include 'navfixed.php';?> <?php $position = $_SESSION['SESS_LAST_NAME']; if ($position == 'cashier') { ?> <a href="sales.php?id=cash&invoice=<?php echo $finalcode ?>">Cash</a> <a href="../index.php">Logout</a> <?php } if ($position == 'admin' || 'cashier') { ?> <?php }?> </div><!--/.well --> </div> <div class="container"> <div class="contentheader"> <i class="icon-money"></i> stock take </div> <ul class="breadcrumb"> <a href="../main/index.php"><li>Dashboard</li></a> / <li class="active">stock take</li> </ul> <div style="margin-top: -19px; margin-bottom: 21px;"> <a href="../main/index.php"><button class="btn btn-success btn-large" style="float: none;" ><i class="icon icon-circle-arrow-left icon-large"></i> Back</button></a> </div> <div style="text-align:center;"> <font style="color:rgb(255, 95, 66);; font:bold 22px 'Aleo';"><?php echo $rowcount123; ?></font><a rel="facebox" href="level.php"> <button class="btn btn-primary">Low running products</button></a> </div> </div> <div class="container"> <form action="incoming.php" method="post" > <input type="hidden" name="pt" value="<?php echo $_GET['id']; ?>" /> <input type="hidden" name="invoice" value="<?php echo $_GET['invoice']; ?>" /> <select autofocus name="product" style="width:430px;font-size:0.8em;" class="chzn-select" id="mySelect"> <option></option> <?php include '../connect.php'; $result = $db->prepare("SELECT* FROM products RIGHT OUTER JOIN batch ON batch.product_id=products.product_id ORDER BY expirydate ASC"); $result->execute(); ?> <?php for ($i = 0; $row = $result->fetch(); $i++): ?> <option value="<?php echo $row['product_id']; ?>" data-qty="<?=$row['quantity'];?>" data-pr="<?=$row['o_price']*$row['markup'];?>" data-exp="<?=$row['expirydate'];?>" data-batch="<?=$row['batch_no'];?>" data-maxdisc="<?=$row['maxdiscre'];?>" data-maxdiscpc="<?=$row['maxdiscpr'];?>"> <?=$row['gen_name'];?> - <?=$row['product_code'];?> </option> <?php endfor;?> </select> <span id="price" contenteditable="true" name="price"></span> <script> $('#mySelect').on('change', function (event) { var selectedOptionIndex = event.currentTarget.options.selectedIndex; var price = event.currentTarget.value; var quantity = event.currentTarget.options[selectedOptionIndex].dataset.qty; var price = event.currentTarget.options[selectedOptionIndex].dataset.pr; var exp = event.currentTarget.options[selectedOptionIndex].dataset.exp; var batch = event.currentTarget.options[selectedOptionIndex].dataset.batch; var discountmax = event.currentTarget.options[selectedOptionIndex].dataset.maxdiscpc; var minprice = event.currentTarget.options[selectedOptionIndex].dataset.maxdisc; var myinput= document.getElementById('myqty'); var deviate= quantity-myinput; $('[name=qty]').val(quantity); $('[name=pr]').val(price); $('[name=exp]').val(exp); $('[name=batch]').val(batch); $('[name=deviate]').val(deviate); document.getElementById('deviate').value; }); </script> <script type="text/javascript"> </script> <input type="text" name="batch" placeholder="batch" autocomplete="off" style="width: 68px; height:30px; padding-top:6px; padding-bottom: 4px; margin-right: 4px; font-size:15px;"> <input name="qty" min="1" placeholder="in stock" autocomplete="off" id="deviatee" style="width: 68px; height:30px; padding-top:6px; padding-bottom: 4px; margin-right: 4px; font-size:15px;" readonly /> <input type="number" name="quantity" min="1" max="" placeholder="qty" id="myqty" style="width: 68px; height:30px; padding-top:6px; padding-bottom: 4px; margin-right: 4px; font-size:15px;" required> <input type="text" name="deviate" placeholder="deviation" id="deviate" style="width: 68px; height:30px; padding-top:6px; padding-bottom: 4px; margin-right: 4px; font-size:15px;" value="" readonly> <input name="exp" placeholder="expiry" autocomplete="off" style="width: 68px; height:30px; padding-top:6px; padding-bottom: 4px; margin-right: 4px; font-size:15px;" readonly /> <input type="hidden" name="pr" min="1" placeholder="price" id="fpr" step=".00001" style="width: 68px; height:30px; padding-top:6px; padding-bottom: 4px; margin-right: 4px; font-size:15px;"> <input type="hidden" name="pc" max="" placeholder="disc" id="disc" style="width: 68px; height:30px; padding-top:6px; padding-bottom: 4px; margin-right: 4px; font-size:15px;" /> <input type="hidden" name="date" value="<?php $date = date('Y-m-d'); $d11 = strtotime ( $date ) ; $d11 = date ('Y-m-d' , $d11); echo $d11; ?>" /> <Button type="submit" class="btn btn-info" style="width: 123px; height:35px; margin-top:-5px;" /><i class="icon-plus-sign icon-large" ></i> Add</button> </form> <table class="table table-bordered" id="resultTable" data-responsive="table"> <thead> <tr> <th> Product Name </th> <th> Generic Name </th> <th> Category / Description </th> <th> Qty </th> <th> deviation </th> <th> Action </th> </tr> </thead> <tbody> <?php $id = $_GET['invoice']; include '../connect.php'; $result = $db->prepare("SELECT * FROM sales_order sales_order RIGHT OUTER JOIN products ON products.product_id=sales_order.product WHERE invoice= :userid AND quantity!= ''"); $result->bindParam(':userid', $id); $result->execute(); for ($i = 1; $row = $result->fetch(); $i++) { ?> <tr class="record"> <td hidden><?php echo $row['product']; ?></td> <td><?php echo $row['product_code']; ?></td> <td><?php echo $row['gen_name']; ?></td> <td><?php echo $row['product_name']; ?></td> <td><?php echo $row['quantity']; ?></td> <td> <?php $dfdf = $row['quantity']-$row['balance']; echo $dfdf; ?> </td> <td width="90"><a rel="facebox" href="editsales.php?id=<?php echo $row['transaction_id']; ?>"><button class="btn btn-mini btn-warning"><i class="icon icon-edit"></i> edit </button></a> <a href="delete.php?id=<?php echo $row['transaction_id']; ?>&invoice=<?php echo $_GET['invoice']; ?>&dle=<?php echo $_GET['id']; ?>&qty=<?php echo $row['qty']; ?>&code=<?php echo $row['product']; ?>"><button class="btn btn-mini btn-warning"><i class="icon icon-remove"></i> Cancel </button></a> </tr> <?php } ?> </tbody> </table><br> <a rel="facebox" href="checkout.php?pt=<?php echo $_GET['id'] ?>&invoice=<?php echo $_GET['invoice'] ?>&total=<?php echo $fgfg ?>&totalprof=<?php echo $asd ?>&cashier=<?php echo $_SESSION['SESS_FIRST_NAME'] ?>"><button class="btn btn-success btn-large btn-block" accesskey="s"><i class="icon icon-save icon-large" accesskey="s"></i> SAVE</button></a> <div class="clearfix"></div> </div> </div> </body> <?php include 'footer.php';?> </html>
Java
// <copyright file="CommandInfoRepository.cs" company="WebDriver Committers"> // Copyright 2007-2011 WebDriver committers // Copyright 2007-2011 Google Inc. // Portions copyright 2011 Software Freedom Conservancy // // 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. // </copyright> using System; using System.Collections.Generic; using System.Text; namespace OpenQA.Selenium.Remote { /// <summary> /// Holds the information about all commands specified by the JSON wire protocol. /// </summary> public class CommandInfoRepository { #region Private members private static object lockObject = new object(); private static CommandInfoRepository collectionInstance; private Dictionary<string, CommandInfo> commandDictionary; #endregion #region Constructor /// <summary> /// Prevents a default instance of the <see cref="CommandInfoRepository"/> class from being created. /// </summary> private CommandInfoRepository() { this.commandDictionary = new Dictionary<string, CommandInfo>(); this.InitializeCommandDictionary(); } #endregion #region Public properties /// <summary> /// Gets the singleton instance of the <see cref="CommandInfoRepository"/>. /// </summary> public static CommandInfoRepository Instance { get { lock (lockObject) { if (collectionInstance == null) { collectionInstance = new CommandInfoRepository(); } } return collectionInstance; } } #endregion #region Public methods /// <summary> /// Gets the <see cref="CommandInfo"/> for a <see cref="DriverCommand"/>. /// </summary> /// <param name="commandName">The <see cref="DriverCommand"/> for which to get the information.</param> /// <returns>The <see cref="CommandInfo"/> for the specified command.</returns> public CommandInfo GetCommandInfo(string commandName) { CommandInfo toReturn = null; if (this.commandDictionary.ContainsKey(commandName)) { toReturn = this.commandDictionary[commandName]; } return toReturn; } #endregion #region Private support methods private void InitializeCommandDictionary() { this.commandDictionary.Add(DriverCommand.DefineDriverMapping, new CommandInfo(CommandInfo.PostCommand, "/config/drivers")); this.commandDictionary.Add(DriverCommand.Status, new CommandInfo(CommandInfo.GetCommand, "/status")); this.commandDictionary.Add(DriverCommand.NewSession, new CommandInfo(CommandInfo.PostCommand, "/session")); this.commandDictionary.Add(DriverCommand.GetSessionList, new CommandInfo(CommandInfo.GetCommand, "/sessions")); this.commandDictionary.Add(DriverCommand.GetSessionCapabilities, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}")); this.commandDictionary.Add(DriverCommand.Quit, new CommandInfo(CommandInfo.DeleteCommand, "/session/{sessionId}")); this.commandDictionary.Add(DriverCommand.GetCurrentWindowHandle, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/window_handle")); this.commandDictionary.Add(DriverCommand.GetWindowHandles, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/window_handles")); this.commandDictionary.Add(DriverCommand.GetCurrentUrl, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/url")); this.commandDictionary.Add(DriverCommand.Get, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/url")); this.commandDictionary.Add(DriverCommand.GoForward, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/forward")); this.commandDictionary.Add(DriverCommand.GoBack, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/back")); this.commandDictionary.Add(DriverCommand.Refresh, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/refresh")); this.commandDictionary.Add(DriverCommand.ExecuteScript, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/execute")); this.commandDictionary.Add(DriverCommand.ExecuteAsyncScript, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/execute_async")); this.commandDictionary.Add(DriverCommand.Screenshot, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/screenshot")); this.commandDictionary.Add(DriverCommand.SwitchToFrame, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/frame")); this.commandDictionary.Add(DriverCommand.SwitchToWindow, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/window")); this.commandDictionary.Add(DriverCommand.GetAllCookies, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/cookie")); this.commandDictionary.Add(DriverCommand.AddCookie, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/cookie")); this.commandDictionary.Add(DriverCommand.DeleteAllCookies, new CommandInfo(CommandInfo.DeleteCommand, "/session/{sessionId}/cookie")); this.commandDictionary.Add(DriverCommand.DeleteCookie, new CommandInfo(CommandInfo.DeleteCommand, "/session/{sessionId}/cookie/{name}")); this.commandDictionary.Add(DriverCommand.GetPageSource, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/source")); this.commandDictionary.Add(DriverCommand.GetTitle, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/title")); this.commandDictionary.Add(DriverCommand.FindElement, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/element")); this.commandDictionary.Add(DriverCommand.FindElements, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/elements")); this.commandDictionary.Add(DriverCommand.GetActiveElement, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/element/active")); this.commandDictionary.Add(DriverCommand.FindChildElement, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/element/{id}/element")); this.commandDictionary.Add(DriverCommand.FindChildElements, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/element/{id}/elements")); this.commandDictionary.Add(DriverCommand.DescribeElement, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}")); this.commandDictionary.Add(DriverCommand.ClickElement, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/element/{id}/click")); this.commandDictionary.Add(DriverCommand.GetElementText, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}/text")); this.commandDictionary.Add(DriverCommand.SubmitElement, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/element/{id}/submit")); this.commandDictionary.Add(DriverCommand.SendKeysToElement, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/element/{id}/value")); this.commandDictionary.Add(DriverCommand.GetElementTagName, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}/name")); this.commandDictionary.Add(DriverCommand.ClearElement, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/element/{id}/clear")); this.commandDictionary.Add(DriverCommand.IsElementSelected, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}/selected")); this.commandDictionary.Add(DriverCommand.IsElementEnabled, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}/enabled")); this.commandDictionary.Add(DriverCommand.IsElementDisplayed, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}/displayed")); this.commandDictionary.Add(DriverCommand.GetElementLocation, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}/location")); this.commandDictionary.Add(DriverCommand.GetElementLocationOnceScrolledIntoView, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}/location_in_view")); this.commandDictionary.Add(DriverCommand.GetElementSize, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}/size")); this.commandDictionary.Add(DriverCommand.GetElementValueOfCssProperty, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}/css/{propertyName}")); this.commandDictionary.Add(DriverCommand.GetElementAttribute, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}/attribute/{name}")); this.commandDictionary.Add(DriverCommand.ElementEquals, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}/equals/{other}")); this.commandDictionary.Add(DriverCommand.Close, new CommandInfo(CommandInfo.DeleteCommand, "/session/{sessionId}/window")); this.commandDictionary.Add(DriverCommand.GetWindowSize, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/window/{windowHandle}/size")); this.commandDictionary.Add(DriverCommand.SetWindowSize, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/window/{windowHandle}/size")); this.commandDictionary.Add(DriverCommand.GetWindowPosition, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/window/{windowHandle}/position")); this.commandDictionary.Add(DriverCommand.SetWindowPosition, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/window/{windowHandle}/position")); this.commandDictionary.Add(DriverCommand.MaximizeWindow, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/window/{windowHandle}/maximize")); this.commandDictionary.Add(DriverCommand.GetOrientation, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/orientation")); this.commandDictionary.Add(DriverCommand.SetOrientation, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/orientation")); this.commandDictionary.Add(DriverCommand.DismissAlert, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/dismiss_alert")); this.commandDictionary.Add(DriverCommand.AcceptAlert, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/accept_alert")); this.commandDictionary.Add(DriverCommand.GetAlertText, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/alert_text")); this.commandDictionary.Add(DriverCommand.SetAlertValue, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/alert_text")); this.commandDictionary.Add(DriverCommand.SetTimeout, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/timeouts")); this.commandDictionary.Add(DriverCommand.ImplicitlyWait, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/timeouts/implicit_wait")); this.commandDictionary.Add(DriverCommand.SetAsyncScriptTimeout, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/timeouts/async_script")); // Advanced interactions commands this.commandDictionary.Add(DriverCommand.MouseClick, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/click")); this.commandDictionary.Add(DriverCommand.MouseDoubleClick, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/doubleclick")); this.commandDictionary.Add(DriverCommand.MouseDown, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/buttondown")); this.commandDictionary.Add(DriverCommand.MouseUp, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/buttonup")); this.commandDictionary.Add(DriverCommand.MouseMoveTo, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/moveto")); this.commandDictionary.Add(DriverCommand.SendKeysToActiveElement, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/keys")); this.commandDictionary.Add(DriverCommand.UploadFile, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/file")); } #endregion } }
Java
SELECT * FROM USER_ALIAS WHERE AUTH_KEY = ? AND USER_ID = ? AND DELETE_FLAG = 0;
Java
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/ec2/EC2_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSStreamFwd.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/ec2/model/Phase1EncryptionAlgorithmsRequestListValue.h> #include <aws/ec2/model/Phase2EncryptionAlgorithmsRequestListValue.h> #include <aws/ec2/model/Phase1IntegrityAlgorithmsRequestListValue.h> #include <aws/ec2/model/Phase2IntegrityAlgorithmsRequestListValue.h> #include <aws/ec2/model/Phase1DHGroupNumbersRequestListValue.h> #include <aws/ec2/model/Phase2DHGroupNumbersRequestListValue.h> #include <aws/ec2/model/IKEVersionsRequestListValue.h> #include <utility> namespace Aws { namespace Utils { namespace Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace EC2 { namespace Model { /** * <p>The Amazon Web Services Site-to-Site VPN tunnel options to * modify.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnTunnelOptionsSpecification">AWS * API Reference</a></p> */ class AWS_EC2_API ModifyVpnTunnelOptionsSpecification { public: ModifyVpnTunnelOptionsSpecification(); ModifyVpnTunnelOptionsSpecification(const Aws::Utils::Xml::XmlNode& xmlNode); ModifyVpnTunnelOptionsSpecification& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; void OutputToStream(Aws::OStream& oStream, const char* location) const; /** * <p>The range of inside IPv4 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same virtual private * gateway. </p> <p>Constraints: A size /30 CIDR block from the * <code>169.254.0.0/16</code> range. The following CIDR blocks are reserved and * cannot be used:</p> <ul> <li> <p> <code>169.254.0.0/30</code> </p> </li> <li> * <p> <code>169.254.1.0/30</code> </p> </li> <li> <p> <code>169.254.2.0/30</code> * </p> </li> <li> <p> <code>169.254.3.0/30</code> </p> </li> <li> <p> * <code>169.254.4.0/30</code> </p> </li> <li> <p> <code>169.254.5.0/30</code> </p> * </li> <li> <p> <code>169.254.169.252/30</code> </p> </li> </ul> */ inline const Aws::String& GetTunnelInsideCidr() const{ return m_tunnelInsideCidr; } /** * <p>The range of inside IPv4 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same virtual private * gateway. </p> <p>Constraints: A size /30 CIDR block from the * <code>169.254.0.0/16</code> range. The following CIDR blocks are reserved and * cannot be used:</p> <ul> <li> <p> <code>169.254.0.0/30</code> </p> </li> <li> * <p> <code>169.254.1.0/30</code> </p> </li> <li> <p> <code>169.254.2.0/30</code> * </p> </li> <li> <p> <code>169.254.3.0/30</code> </p> </li> <li> <p> * <code>169.254.4.0/30</code> </p> </li> <li> <p> <code>169.254.5.0/30</code> </p> * </li> <li> <p> <code>169.254.169.252/30</code> </p> </li> </ul> */ inline bool TunnelInsideCidrHasBeenSet() const { return m_tunnelInsideCidrHasBeenSet; } /** * <p>The range of inside IPv4 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same virtual private * gateway. </p> <p>Constraints: A size /30 CIDR block from the * <code>169.254.0.0/16</code> range. The following CIDR blocks are reserved and * cannot be used:</p> <ul> <li> <p> <code>169.254.0.0/30</code> </p> </li> <li> * <p> <code>169.254.1.0/30</code> </p> </li> <li> <p> <code>169.254.2.0/30</code> * </p> </li> <li> <p> <code>169.254.3.0/30</code> </p> </li> <li> <p> * <code>169.254.4.0/30</code> </p> </li> <li> <p> <code>169.254.5.0/30</code> </p> * </li> <li> <p> <code>169.254.169.252/30</code> </p> </li> </ul> */ inline void SetTunnelInsideCidr(const Aws::String& value) { m_tunnelInsideCidrHasBeenSet = true; m_tunnelInsideCidr = value; } /** * <p>The range of inside IPv4 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same virtual private * gateway. </p> <p>Constraints: A size /30 CIDR block from the * <code>169.254.0.0/16</code> range. The following CIDR blocks are reserved and * cannot be used:</p> <ul> <li> <p> <code>169.254.0.0/30</code> </p> </li> <li> * <p> <code>169.254.1.0/30</code> </p> </li> <li> <p> <code>169.254.2.0/30</code> * </p> </li> <li> <p> <code>169.254.3.0/30</code> </p> </li> <li> <p> * <code>169.254.4.0/30</code> </p> </li> <li> <p> <code>169.254.5.0/30</code> </p> * </li> <li> <p> <code>169.254.169.252/30</code> </p> </li> </ul> */ inline void SetTunnelInsideCidr(Aws::String&& value) { m_tunnelInsideCidrHasBeenSet = true; m_tunnelInsideCidr = std::move(value); } /** * <p>The range of inside IPv4 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same virtual private * gateway. </p> <p>Constraints: A size /30 CIDR block from the * <code>169.254.0.0/16</code> range. The following CIDR blocks are reserved and * cannot be used:</p> <ul> <li> <p> <code>169.254.0.0/30</code> </p> </li> <li> * <p> <code>169.254.1.0/30</code> </p> </li> <li> <p> <code>169.254.2.0/30</code> * </p> </li> <li> <p> <code>169.254.3.0/30</code> </p> </li> <li> <p> * <code>169.254.4.0/30</code> </p> </li> <li> <p> <code>169.254.5.0/30</code> </p> * </li> <li> <p> <code>169.254.169.252/30</code> </p> </li> </ul> */ inline void SetTunnelInsideCidr(const char* value) { m_tunnelInsideCidrHasBeenSet = true; m_tunnelInsideCidr.assign(value); } /** * <p>The range of inside IPv4 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same virtual private * gateway. </p> <p>Constraints: A size /30 CIDR block from the * <code>169.254.0.0/16</code> range. The following CIDR blocks are reserved and * cannot be used:</p> <ul> <li> <p> <code>169.254.0.0/30</code> </p> </li> <li> * <p> <code>169.254.1.0/30</code> </p> </li> <li> <p> <code>169.254.2.0/30</code> * </p> </li> <li> <p> <code>169.254.3.0/30</code> </p> </li> <li> <p> * <code>169.254.4.0/30</code> </p> </li> <li> <p> <code>169.254.5.0/30</code> </p> * </li> <li> <p> <code>169.254.169.252/30</code> </p> </li> </ul> */ inline ModifyVpnTunnelOptionsSpecification& WithTunnelInsideCidr(const Aws::String& value) { SetTunnelInsideCidr(value); return *this;} /** * <p>The range of inside IPv4 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same virtual private * gateway. </p> <p>Constraints: A size /30 CIDR block from the * <code>169.254.0.0/16</code> range. The following CIDR blocks are reserved and * cannot be used:</p> <ul> <li> <p> <code>169.254.0.0/30</code> </p> </li> <li> * <p> <code>169.254.1.0/30</code> </p> </li> <li> <p> <code>169.254.2.0/30</code> * </p> </li> <li> <p> <code>169.254.3.0/30</code> </p> </li> <li> <p> * <code>169.254.4.0/30</code> </p> </li> <li> <p> <code>169.254.5.0/30</code> </p> * </li> <li> <p> <code>169.254.169.252/30</code> </p> </li> </ul> */ inline ModifyVpnTunnelOptionsSpecification& WithTunnelInsideCidr(Aws::String&& value) { SetTunnelInsideCidr(std::move(value)); return *this;} /** * <p>The range of inside IPv4 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same virtual private * gateway. </p> <p>Constraints: A size /30 CIDR block from the * <code>169.254.0.0/16</code> range. The following CIDR blocks are reserved and * cannot be used:</p> <ul> <li> <p> <code>169.254.0.0/30</code> </p> </li> <li> * <p> <code>169.254.1.0/30</code> </p> </li> <li> <p> <code>169.254.2.0/30</code> * </p> </li> <li> <p> <code>169.254.3.0/30</code> </p> </li> <li> <p> * <code>169.254.4.0/30</code> </p> </li> <li> <p> <code>169.254.5.0/30</code> </p> * </li> <li> <p> <code>169.254.169.252/30</code> </p> </li> </ul> */ inline ModifyVpnTunnelOptionsSpecification& WithTunnelInsideCidr(const char* value) { SetTunnelInsideCidr(value); return *this;} /** * <p>The range of inside IPv6 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same transit gateway.</p> * <p>Constraints: A size /126 CIDR block from the local <code>fd00::/8</code> * range.</p> */ inline const Aws::String& GetTunnelInsideIpv6Cidr() const{ return m_tunnelInsideIpv6Cidr; } /** * <p>The range of inside IPv6 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same transit gateway.</p> * <p>Constraints: A size /126 CIDR block from the local <code>fd00::/8</code> * range.</p> */ inline bool TunnelInsideIpv6CidrHasBeenSet() const { return m_tunnelInsideIpv6CidrHasBeenSet; } /** * <p>The range of inside IPv6 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same transit gateway.</p> * <p>Constraints: A size /126 CIDR block from the local <code>fd00::/8</code> * range.</p> */ inline void SetTunnelInsideIpv6Cidr(const Aws::String& value) { m_tunnelInsideIpv6CidrHasBeenSet = true; m_tunnelInsideIpv6Cidr = value; } /** * <p>The range of inside IPv6 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same transit gateway.</p> * <p>Constraints: A size /126 CIDR block from the local <code>fd00::/8</code> * range.</p> */ inline void SetTunnelInsideIpv6Cidr(Aws::String&& value) { m_tunnelInsideIpv6CidrHasBeenSet = true; m_tunnelInsideIpv6Cidr = std::move(value); } /** * <p>The range of inside IPv6 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same transit gateway.</p> * <p>Constraints: A size /126 CIDR block from the local <code>fd00::/8</code> * range.</p> */ inline void SetTunnelInsideIpv6Cidr(const char* value) { m_tunnelInsideIpv6CidrHasBeenSet = true; m_tunnelInsideIpv6Cidr.assign(value); } /** * <p>The range of inside IPv6 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same transit gateway.</p> * <p>Constraints: A size /126 CIDR block from the local <code>fd00::/8</code> * range.</p> */ inline ModifyVpnTunnelOptionsSpecification& WithTunnelInsideIpv6Cidr(const Aws::String& value) { SetTunnelInsideIpv6Cidr(value); return *this;} /** * <p>The range of inside IPv6 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same transit gateway.</p> * <p>Constraints: A size /126 CIDR block from the local <code>fd00::/8</code> * range.</p> */ inline ModifyVpnTunnelOptionsSpecification& WithTunnelInsideIpv6Cidr(Aws::String&& value) { SetTunnelInsideIpv6Cidr(std::move(value)); return *this;} /** * <p>The range of inside IPv6 addresses for the tunnel. Any specified CIDR blocks * must be unique across all VPN connections that use the same transit gateway.</p> * <p>Constraints: A size /126 CIDR block from the local <code>fd00::/8</code> * range.</p> */ inline ModifyVpnTunnelOptionsSpecification& WithTunnelInsideIpv6Cidr(const char* value) { SetTunnelInsideIpv6Cidr(value); return *this;} /** * <p>The pre-shared key (PSK) to establish initial authentication between the * virtual private gateway and the customer gateway.</p> <p>Constraints: Allowed * characters are alphanumeric characters, periods (.), and underscores (_). Must * be between 8 and 64 characters in length and cannot start with zero (0).</p> */ inline const Aws::String& GetPreSharedKey() const{ return m_preSharedKey; } /** * <p>The pre-shared key (PSK) to establish initial authentication between the * virtual private gateway and the customer gateway.</p> <p>Constraints: Allowed * characters are alphanumeric characters, periods (.), and underscores (_). Must * be between 8 and 64 characters in length and cannot start with zero (0).</p> */ inline bool PreSharedKeyHasBeenSet() const { return m_preSharedKeyHasBeenSet; } /** * <p>The pre-shared key (PSK) to establish initial authentication between the * virtual private gateway and the customer gateway.</p> <p>Constraints: Allowed * characters are alphanumeric characters, periods (.), and underscores (_). Must * be between 8 and 64 characters in length and cannot start with zero (0).</p> */ inline void SetPreSharedKey(const Aws::String& value) { m_preSharedKeyHasBeenSet = true; m_preSharedKey = value; } /** * <p>The pre-shared key (PSK) to establish initial authentication between the * virtual private gateway and the customer gateway.</p> <p>Constraints: Allowed * characters are alphanumeric characters, periods (.), and underscores (_). Must * be between 8 and 64 characters in length and cannot start with zero (0).</p> */ inline void SetPreSharedKey(Aws::String&& value) { m_preSharedKeyHasBeenSet = true; m_preSharedKey = std::move(value); } /** * <p>The pre-shared key (PSK) to establish initial authentication between the * virtual private gateway and the customer gateway.</p> <p>Constraints: Allowed * characters are alphanumeric characters, periods (.), and underscores (_). Must * be between 8 and 64 characters in length and cannot start with zero (0).</p> */ inline void SetPreSharedKey(const char* value) { m_preSharedKeyHasBeenSet = true; m_preSharedKey.assign(value); } /** * <p>The pre-shared key (PSK) to establish initial authentication between the * virtual private gateway and the customer gateway.</p> <p>Constraints: Allowed * characters are alphanumeric characters, periods (.), and underscores (_). Must * be between 8 and 64 characters in length and cannot start with zero (0).</p> */ inline ModifyVpnTunnelOptionsSpecification& WithPreSharedKey(const Aws::String& value) { SetPreSharedKey(value); return *this;} /** * <p>The pre-shared key (PSK) to establish initial authentication between the * virtual private gateway and the customer gateway.</p> <p>Constraints: Allowed * characters are alphanumeric characters, periods (.), and underscores (_). Must * be between 8 and 64 characters in length and cannot start with zero (0).</p> */ inline ModifyVpnTunnelOptionsSpecification& WithPreSharedKey(Aws::String&& value) { SetPreSharedKey(std::move(value)); return *this;} /** * <p>The pre-shared key (PSK) to establish initial authentication between the * virtual private gateway and the customer gateway.</p> <p>Constraints: Allowed * characters are alphanumeric characters, periods (.), and underscores (_). Must * be between 8 and 64 characters in length and cannot start with zero (0).</p> */ inline ModifyVpnTunnelOptionsSpecification& WithPreSharedKey(const char* value) { SetPreSharedKey(value); return *this;} /** * <p>The lifetime for phase 1 of the IKE negotiation, in seconds.</p> * <p>Constraints: A value between 900 and 28,800.</p> <p>Default: * <code>28800</code> </p> */ inline int GetPhase1LifetimeSeconds() const{ return m_phase1LifetimeSeconds; } /** * <p>The lifetime for phase 1 of the IKE negotiation, in seconds.</p> * <p>Constraints: A value between 900 and 28,800.</p> <p>Default: * <code>28800</code> </p> */ inline bool Phase1LifetimeSecondsHasBeenSet() const { return m_phase1LifetimeSecondsHasBeenSet; } /** * <p>The lifetime for phase 1 of the IKE negotiation, in seconds.</p> * <p>Constraints: A value between 900 and 28,800.</p> <p>Default: * <code>28800</code> </p> */ inline void SetPhase1LifetimeSeconds(int value) { m_phase1LifetimeSecondsHasBeenSet = true; m_phase1LifetimeSeconds = value; } /** * <p>The lifetime for phase 1 of the IKE negotiation, in seconds.</p> * <p>Constraints: A value between 900 and 28,800.</p> <p>Default: * <code>28800</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithPhase1LifetimeSeconds(int value) { SetPhase1LifetimeSeconds(value); return *this;} /** * <p>The lifetime for phase 2 of the IKE negotiation, in seconds.</p> * <p>Constraints: A value between 900 and 3,600. The value must be less than the * value for <code>Phase1LifetimeSeconds</code>.</p> <p>Default: <code>3600</code> * </p> */ inline int GetPhase2LifetimeSeconds() const{ return m_phase2LifetimeSeconds; } /** * <p>The lifetime for phase 2 of the IKE negotiation, in seconds.</p> * <p>Constraints: A value between 900 and 3,600. The value must be less than the * value for <code>Phase1LifetimeSeconds</code>.</p> <p>Default: <code>3600</code> * </p> */ inline bool Phase2LifetimeSecondsHasBeenSet() const { return m_phase2LifetimeSecondsHasBeenSet; } /** * <p>The lifetime for phase 2 of the IKE negotiation, in seconds.</p> * <p>Constraints: A value between 900 and 3,600. The value must be less than the * value for <code>Phase1LifetimeSeconds</code>.</p> <p>Default: <code>3600</code> * </p> */ inline void SetPhase2LifetimeSeconds(int value) { m_phase2LifetimeSecondsHasBeenSet = true; m_phase2LifetimeSeconds = value; } /** * <p>The lifetime for phase 2 of the IKE negotiation, in seconds.</p> * <p>Constraints: A value between 900 and 3,600. The value must be less than the * value for <code>Phase1LifetimeSeconds</code>.</p> <p>Default: <code>3600</code> * </p> */ inline ModifyVpnTunnelOptionsSpecification& WithPhase2LifetimeSeconds(int value) { SetPhase2LifetimeSeconds(value); return *this;} /** * <p>The margin time, in seconds, before the phase 2 lifetime expires, during * which the Amazon Web Services side of the VPN connection performs an IKE rekey. * The exact time of the rekey is randomly selected based on the value for * <code>RekeyFuzzPercentage</code>.</p> <p>Constraints: A value between 60 and * half of <code>Phase2LifetimeSeconds</code>.</p> <p>Default: <code>540</code> * </p> */ inline int GetRekeyMarginTimeSeconds() const{ return m_rekeyMarginTimeSeconds; } /** * <p>The margin time, in seconds, before the phase 2 lifetime expires, during * which the Amazon Web Services side of the VPN connection performs an IKE rekey. * The exact time of the rekey is randomly selected based on the value for * <code>RekeyFuzzPercentage</code>.</p> <p>Constraints: A value between 60 and * half of <code>Phase2LifetimeSeconds</code>.</p> <p>Default: <code>540</code> * </p> */ inline bool RekeyMarginTimeSecondsHasBeenSet() const { return m_rekeyMarginTimeSecondsHasBeenSet; } /** * <p>The margin time, in seconds, before the phase 2 lifetime expires, during * which the Amazon Web Services side of the VPN connection performs an IKE rekey. * The exact time of the rekey is randomly selected based on the value for * <code>RekeyFuzzPercentage</code>.</p> <p>Constraints: A value between 60 and * half of <code>Phase2LifetimeSeconds</code>.</p> <p>Default: <code>540</code> * </p> */ inline void SetRekeyMarginTimeSeconds(int value) { m_rekeyMarginTimeSecondsHasBeenSet = true; m_rekeyMarginTimeSeconds = value; } /** * <p>The margin time, in seconds, before the phase 2 lifetime expires, during * which the Amazon Web Services side of the VPN connection performs an IKE rekey. * The exact time of the rekey is randomly selected based on the value for * <code>RekeyFuzzPercentage</code>.</p> <p>Constraints: A value between 60 and * half of <code>Phase2LifetimeSeconds</code>.</p> <p>Default: <code>540</code> * </p> */ inline ModifyVpnTunnelOptionsSpecification& WithRekeyMarginTimeSeconds(int value) { SetRekeyMarginTimeSeconds(value); return *this;} /** * <p>The percentage of the rekey window (determined by * <code>RekeyMarginTimeSeconds</code>) during which the rekey time is randomly * selected.</p> <p>Constraints: A value between 0 and 100.</p> <p>Default: * <code>100</code> </p> */ inline int GetRekeyFuzzPercentage() const{ return m_rekeyFuzzPercentage; } /** * <p>The percentage of the rekey window (determined by * <code>RekeyMarginTimeSeconds</code>) during which the rekey time is randomly * selected.</p> <p>Constraints: A value between 0 and 100.</p> <p>Default: * <code>100</code> </p> */ inline bool RekeyFuzzPercentageHasBeenSet() const { return m_rekeyFuzzPercentageHasBeenSet; } /** * <p>The percentage of the rekey window (determined by * <code>RekeyMarginTimeSeconds</code>) during which the rekey time is randomly * selected.</p> <p>Constraints: A value between 0 and 100.</p> <p>Default: * <code>100</code> </p> */ inline void SetRekeyFuzzPercentage(int value) { m_rekeyFuzzPercentageHasBeenSet = true; m_rekeyFuzzPercentage = value; } /** * <p>The percentage of the rekey window (determined by * <code>RekeyMarginTimeSeconds</code>) during which the rekey time is randomly * selected.</p> <p>Constraints: A value between 0 and 100.</p> <p>Default: * <code>100</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithRekeyFuzzPercentage(int value) { SetRekeyFuzzPercentage(value); return *this;} /** * <p>The number of packets in an IKE replay window.</p> <p>Constraints: A value * between 64 and 2048.</p> <p>Default: <code>1024</code> </p> */ inline int GetReplayWindowSize() const{ return m_replayWindowSize; } /** * <p>The number of packets in an IKE replay window.</p> <p>Constraints: A value * between 64 and 2048.</p> <p>Default: <code>1024</code> </p> */ inline bool ReplayWindowSizeHasBeenSet() const { return m_replayWindowSizeHasBeenSet; } /** * <p>The number of packets in an IKE replay window.</p> <p>Constraints: A value * between 64 and 2048.</p> <p>Default: <code>1024</code> </p> */ inline void SetReplayWindowSize(int value) { m_replayWindowSizeHasBeenSet = true; m_replayWindowSize = value; } /** * <p>The number of packets in an IKE replay window.</p> <p>Constraints: A value * between 64 and 2048.</p> <p>Default: <code>1024</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithReplayWindowSize(int value) { SetReplayWindowSize(value); return *this;} /** * <p>The number of seconds after which a DPD timeout occurs.</p> <p>Constraints: A * value greater than or equal to 30.</p> <p>Default: <code>30</code> </p> */ inline int GetDPDTimeoutSeconds() const{ return m_dPDTimeoutSeconds; } /** * <p>The number of seconds after which a DPD timeout occurs.</p> <p>Constraints: A * value greater than or equal to 30.</p> <p>Default: <code>30</code> </p> */ inline bool DPDTimeoutSecondsHasBeenSet() const { return m_dPDTimeoutSecondsHasBeenSet; } /** * <p>The number of seconds after which a DPD timeout occurs.</p> <p>Constraints: A * value greater than or equal to 30.</p> <p>Default: <code>30</code> </p> */ inline void SetDPDTimeoutSeconds(int value) { m_dPDTimeoutSecondsHasBeenSet = true; m_dPDTimeoutSeconds = value; } /** * <p>The number of seconds after which a DPD timeout occurs.</p> <p>Constraints: A * value greater than or equal to 30.</p> <p>Default: <code>30</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithDPDTimeoutSeconds(int value) { SetDPDTimeoutSeconds(value); return *this;} /** * <p>The action to take after DPD timeout occurs. Specify <code>restart</code> to * restart the IKE initiation. Specify <code>clear</code> to end the IKE * session.</p> <p>Valid Values: <code>clear</code> | <code>none</code> | * <code>restart</code> </p> <p>Default: <code>clear</code> </p> */ inline const Aws::String& GetDPDTimeoutAction() const{ return m_dPDTimeoutAction; } /** * <p>The action to take after DPD timeout occurs. Specify <code>restart</code> to * restart the IKE initiation. Specify <code>clear</code> to end the IKE * session.</p> <p>Valid Values: <code>clear</code> | <code>none</code> | * <code>restart</code> </p> <p>Default: <code>clear</code> </p> */ inline bool DPDTimeoutActionHasBeenSet() const { return m_dPDTimeoutActionHasBeenSet; } /** * <p>The action to take after DPD timeout occurs. Specify <code>restart</code> to * restart the IKE initiation. Specify <code>clear</code> to end the IKE * session.</p> <p>Valid Values: <code>clear</code> | <code>none</code> | * <code>restart</code> </p> <p>Default: <code>clear</code> </p> */ inline void SetDPDTimeoutAction(const Aws::String& value) { m_dPDTimeoutActionHasBeenSet = true; m_dPDTimeoutAction = value; } /** * <p>The action to take after DPD timeout occurs. Specify <code>restart</code> to * restart the IKE initiation. Specify <code>clear</code> to end the IKE * session.</p> <p>Valid Values: <code>clear</code> | <code>none</code> | * <code>restart</code> </p> <p>Default: <code>clear</code> </p> */ inline void SetDPDTimeoutAction(Aws::String&& value) { m_dPDTimeoutActionHasBeenSet = true; m_dPDTimeoutAction = std::move(value); } /** * <p>The action to take after DPD timeout occurs. Specify <code>restart</code> to * restart the IKE initiation. Specify <code>clear</code> to end the IKE * session.</p> <p>Valid Values: <code>clear</code> | <code>none</code> | * <code>restart</code> </p> <p>Default: <code>clear</code> </p> */ inline void SetDPDTimeoutAction(const char* value) { m_dPDTimeoutActionHasBeenSet = true; m_dPDTimeoutAction.assign(value); } /** * <p>The action to take after DPD timeout occurs. Specify <code>restart</code> to * restart the IKE initiation. Specify <code>clear</code> to end the IKE * session.</p> <p>Valid Values: <code>clear</code> | <code>none</code> | * <code>restart</code> </p> <p>Default: <code>clear</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithDPDTimeoutAction(const Aws::String& value) { SetDPDTimeoutAction(value); return *this;} /** * <p>The action to take after DPD timeout occurs. Specify <code>restart</code> to * restart the IKE initiation. Specify <code>clear</code> to end the IKE * session.</p> <p>Valid Values: <code>clear</code> | <code>none</code> | * <code>restart</code> </p> <p>Default: <code>clear</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithDPDTimeoutAction(Aws::String&& value) { SetDPDTimeoutAction(std::move(value)); return *this;} /** * <p>The action to take after DPD timeout occurs. Specify <code>restart</code> to * restart the IKE initiation. Specify <code>clear</code> to end the IKE * session.</p> <p>Valid Values: <code>clear</code> | <code>none</code> | * <code>restart</code> </p> <p>Default: <code>clear</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithDPDTimeoutAction(const char* value) { SetDPDTimeoutAction(value); return *this;} /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline const Aws::Vector<Phase1EncryptionAlgorithmsRequestListValue>& GetPhase1EncryptionAlgorithms() const{ return m_phase1EncryptionAlgorithms; } /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline bool Phase1EncryptionAlgorithmsHasBeenSet() const { return m_phase1EncryptionAlgorithmsHasBeenSet; } /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline void SetPhase1EncryptionAlgorithms(const Aws::Vector<Phase1EncryptionAlgorithmsRequestListValue>& value) { m_phase1EncryptionAlgorithmsHasBeenSet = true; m_phase1EncryptionAlgorithms = value; } /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline void SetPhase1EncryptionAlgorithms(Aws::Vector<Phase1EncryptionAlgorithmsRequestListValue>&& value) { m_phase1EncryptionAlgorithmsHasBeenSet = true; m_phase1EncryptionAlgorithms = std::move(value); } /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline ModifyVpnTunnelOptionsSpecification& WithPhase1EncryptionAlgorithms(const Aws::Vector<Phase1EncryptionAlgorithmsRequestListValue>& value) { SetPhase1EncryptionAlgorithms(value); return *this;} /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline ModifyVpnTunnelOptionsSpecification& WithPhase1EncryptionAlgorithms(Aws::Vector<Phase1EncryptionAlgorithmsRequestListValue>&& value) { SetPhase1EncryptionAlgorithms(std::move(value)); return *this;} /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline ModifyVpnTunnelOptionsSpecification& AddPhase1EncryptionAlgorithms(const Phase1EncryptionAlgorithmsRequestListValue& value) { m_phase1EncryptionAlgorithmsHasBeenSet = true; m_phase1EncryptionAlgorithms.push_back(value); return *this; } /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline ModifyVpnTunnelOptionsSpecification& AddPhase1EncryptionAlgorithms(Phase1EncryptionAlgorithmsRequestListValue&& value) { m_phase1EncryptionAlgorithmsHasBeenSet = true; m_phase1EncryptionAlgorithms.push_back(std::move(value)); return *this; } /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline const Aws::Vector<Phase2EncryptionAlgorithmsRequestListValue>& GetPhase2EncryptionAlgorithms() const{ return m_phase2EncryptionAlgorithms; } /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline bool Phase2EncryptionAlgorithmsHasBeenSet() const { return m_phase2EncryptionAlgorithmsHasBeenSet; } /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline void SetPhase2EncryptionAlgorithms(const Aws::Vector<Phase2EncryptionAlgorithmsRequestListValue>& value) { m_phase2EncryptionAlgorithmsHasBeenSet = true; m_phase2EncryptionAlgorithms = value; } /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline void SetPhase2EncryptionAlgorithms(Aws::Vector<Phase2EncryptionAlgorithmsRequestListValue>&& value) { m_phase2EncryptionAlgorithmsHasBeenSet = true; m_phase2EncryptionAlgorithms = std::move(value); } /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline ModifyVpnTunnelOptionsSpecification& WithPhase2EncryptionAlgorithms(const Aws::Vector<Phase2EncryptionAlgorithmsRequestListValue>& value) { SetPhase2EncryptionAlgorithms(value); return *this;} /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline ModifyVpnTunnelOptionsSpecification& WithPhase2EncryptionAlgorithms(Aws::Vector<Phase2EncryptionAlgorithmsRequestListValue>&& value) { SetPhase2EncryptionAlgorithms(std::move(value)); return *this;} /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline ModifyVpnTunnelOptionsSpecification& AddPhase2EncryptionAlgorithms(const Phase2EncryptionAlgorithmsRequestListValue& value) { m_phase2EncryptionAlgorithmsHasBeenSet = true; m_phase2EncryptionAlgorithms.push_back(value); return *this; } /** * <p>One or more encryption algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>AES128</code> | * <code>AES256</code> | <code>AES128-GCM-16</code> | <code>AES256-GCM-16</code> * </p> */ inline ModifyVpnTunnelOptionsSpecification& AddPhase2EncryptionAlgorithms(Phase2EncryptionAlgorithmsRequestListValue&& value) { m_phase2EncryptionAlgorithmsHasBeenSet = true; m_phase2EncryptionAlgorithms.push_back(std::move(value)); return *this; } /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline const Aws::Vector<Phase1IntegrityAlgorithmsRequestListValue>& GetPhase1IntegrityAlgorithms() const{ return m_phase1IntegrityAlgorithms; } /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline bool Phase1IntegrityAlgorithmsHasBeenSet() const { return m_phase1IntegrityAlgorithmsHasBeenSet; } /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline void SetPhase1IntegrityAlgorithms(const Aws::Vector<Phase1IntegrityAlgorithmsRequestListValue>& value) { m_phase1IntegrityAlgorithmsHasBeenSet = true; m_phase1IntegrityAlgorithms = value; } /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline void SetPhase1IntegrityAlgorithms(Aws::Vector<Phase1IntegrityAlgorithmsRequestListValue>&& value) { m_phase1IntegrityAlgorithmsHasBeenSet = true; m_phase1IntegrityAlgorithms = std::move(value); } /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithPhase1IntegrityAlgorithms(const Aws::Vector<Phase1IntegrityAlgorithmsRequestListValue>& value) { SetPhase1IntegrityAlgorithms(value); return *this;} /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithPhase1IntegrityAlgorithms(Aws::Vector<Phase1IntegrityAlgorithmsRequestListValue>&& value) { SetPhase1IntegrityAlgorithms(std::move(value)); return *this;} /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& AddPhase1IntegrityAlgorithms(const Phase1IntegrityAlgorithmsRequestListValue& value) { m_phase1IntegrityAlgorithmsHasBeenSet = true; m_phase1IntegrityAlgorithms.push_back(value); return *this; } /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 1 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& AddPhase1IntegrityAlgorithms(Phase1IntegrityAlgorithmsRequestListValue&& value) { m_phase1IntegrityAlgorithmsHasBeenSet = true; m_phase1IntegrityAlgorithms.push_back(std::move(value)); return *this; } /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline const Aws::Vector<Phase2IntegrityAlgorithmsRequestListValue>& GetPhase2IntegrityAlgorithms() const{ return m_phase2IntegrityAlgorithms; } /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline bool Phase2IntegrityAlgorithmsHasBeenSet() const { return m_phase2IntegrityAlgorithmsHasBeenSet; } /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline void SetPhase2IntegrityAlgorithms(const Aws::Vector<Phase2IntegrityAlgorithmsRequestListValue>& value) { m_phase2IntegrityAlgorithmsHasBeenSet = true; m_phase2IntegrityAlgorithms = value; } /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline void SetPhase2IntegrityAlgorithms(Aws::Vector<Phase2IntegrityAlgorithmsRequestListValue>&& value) { m_phase2IntegrityAlgorithmsHasBeenSet = true; m_phase2IntegrityAlgorithms = std::move(value); } /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithPhase2IntegrityAlgorithms(const Aws::Vector<Phase2IntegrityAlgorithmsRequestListValue>& value) { SetPhase2IntegrityAlgorithms(value); return *this;} /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithPhase2IntegrityAlgorithms(Aws::Vector<Phase2IntegrityAlgorithmsRequestListValue>&& value) { SetPhase2IntegrityAlgorithms(std::move(value)); return *this;} /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& AddPhase2IntegrityAlgorithms(const Phase2IntegrityAlgorithmsRequestListValue& value) { m_phase2IntegrityAlgorithmsHasBeenSet = true; m_phase2IntegrityAlgorithms.push_back(value); return *this; } /** * <p>One or more integrity algorithms that are permitted for the VPN tunnel for * phase 2 IKE negotiations.</p> <p>Valid values: <code>SHA1</code> | * <code>SHA2-256</code> | <code>SHA2-384</code> | <code>SHA2-512</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& AddPhase2IntegrityAlgorithms(Phase2IntegrityAlgorithmsRequestListValue&& value) { m_phase2IntegrityAlgorithmsHasBeenSet = true; m_phase2IntegrityAlgorithms.push_back(std::move(value)); return *this; } /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 1 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>14</code> | <code>15</code> | <code>16</code> | <code>17</code> | * <code>18</code> | <code>19</code> | <code>20</code> | <code>21</code> | * <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline const Aws::Vector<Phase1DHGroupNumbersRequestListValue>& GetPhase1DHGroupNumbers() const{ return m_phase1DHGroupNumbers; } /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 1 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>14</code> | <code>15</code> | <code>16</code> | <code>17</code> | * <code>18</code> | <code>19</code> | <code>20</code> | <code>21</code> | * <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline bool Phase1DHGroupNumbersHasBeenSet() const { return m_phase1DHGroupNumbersHasBeenSet; } /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 1 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>14</code> | <code>15</code> | <code>16</code> | <code>17</code> | * <code>18</code> | <code>19</code> | <code>20</code> | <code>21</code> | * <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline void SetPhase1DHGroupNumbers(const Aws::Vector<Phase1DHGroupNumbersRequestListValue>& value) { m_phase1DHGroupNumbersHasBeenSet = true; m_phase1DHGroupNumbers = value; } /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 1 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>14</code> | <code>15</code> | <code>16</code> | <code>17</code> | * <code>18</code> | <code>19</code> | <code>20</code> | <code>21</code> | * <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline void SetPhase1DHGroupNumbers(Aws::Vector<Phase1DHGroupNumbersRequestListValue>&& value) { m_phase1DHGroupNumbersHasBeenSet = true; m_phase1DHGroupNumbers = std::move(value); } /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 1 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>14</code> | <code>15</code> | <code>16</code> | <code>17</code> | * <code>18</code> | <code>19</code> | <code>20</code> | <code>21</code> | * <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithPhase1DHGroupNumbers(const Aws::Vector<Phase1DHGroupNumbersRequestListValue>& value) { SetPhase1DHGroupNumbers(value); return *this;} /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 1 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>14</code> | <code>15</code> | <code>16</code> | <code>17</code> | * <code>18</code> | <code>19</code> | <code>20</code> | <code>21</code> | * <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithPhase1DHGroupNumbers(Aws::Vector<Phase1DHGroupNumbersRequestListValue>&& value) { SetPhase1DHGroupNumbers(std::move(value)); return *this;} /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 1 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>14</code> | <code>15</code> | <code>16</code> | <code>17</code> | * <code>18</code> | <code>19</code> | <code>20</code> | <code>21</code> | * <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& AddPhase1DHGroupNumbers(const Phase1DHGroupNumbersRequestListValue& value) { m_phase1DHGroupNumbersHasBeenSet = true; m_phase1DHGroupNumbers.push_back(value); return *this; } /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 1 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>14</code> | <code>15</code> | <code>16</code> | <code>17</code> | * <code>18</code> | <code>19</code> | <code>20</code> | <code>21</code> | * <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& AddPhase1DHGroupNumbers(Phase1DHGroupNumbersRequestListValue&& value) { m_phase1DHGroupNumbersHasBeenSet = true; m_phase1DHGroupNumbers.push_back(std::move(value)); return *this; } /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 2 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>5</code> | <code>14</code> | <code>15</code> | <code>16</code> | * <code>17</code> | <code>18</code> | <code>19</code> | <code>20</code> | * <code>21</code> | <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline const Aws::Vector<Phase2DHGroupNumbersRequestListValue>& GetPhase2DHGroupNumbers() const{ return m_phase2DHGroupNumbers; } /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 2 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>5</code> | <code>14</code> | <code>15</code> | <code>16</code> | * <code>17</code> | <code>18</code> | <code>19</code> | <code>20</code> | * <code>21</code> | <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline bool Phase2DHGroupNumbersHasBeenSet() const { return m_phase2DHGroupNumbersHasBeenSet; } /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 2 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>5</code> | <code>14</code> | <code>15</code> | <code>16</code> | * <code>17</code> | <code>18</code> | <code>19</code> | <code>20</code> | * <code>21</code> | <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline void SetPhase2DHGroupNumbers(const Aws::Vector<Phase2DHGroupNumbersRequestListValue>& value) { m_phase2DHGroupNumbersHasBeenSet = true; m_phase2DHGroupNumbers = value; } /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 2 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>5</code> | <code>14</code> | <code>15</code> | <code>16</code> | * <code>17</code> | <code>18</code> | <code>19</code> | <code>20</code> | * <code>21</code> | <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline void SetPhase2DHGroupNumbers(Aws::Vector<Phase2DHGroupNumbersRequestListValue>&& value) { m_phase2DHGroupNumbersHasBeenSet = true; m_phase2DHGroupNumbers = std::move(value); } /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 2 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>5</code> | <code>14</code> | <code>15</code> | <code>16</code> | * <code>17</code> | <code>18</code> | <code>19</code> | <code>20</code> | * <code>21</code> | <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithPhase2DHGroupNumbers(const Aws::Vector<Phase2DHGroupNumbersRequestListValue>& value) { SetPhase2DHGroupNumbers(value); return *this;} /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 2 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>5</code> | <code>14</code> | <code>15</code> | <code>16</code> | * <code>17</code> | <code>18</code> | <code>19</code> | <code>20</code> | * <code>21</code> | <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithPhase2DHGroupNumbers(Aws::Vector<Phase2DHGroupNumbersRequestListValue>&& value) { SetPhase2DHGroupNumbers(std::move(value)); return *this;} /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 2 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>5</code> | <code>14</code> | <code>15</code> | <code>16</code> | * <code>17</code> | <code>18</code> | <code>19</code> | <code>20</code> | * <code>21</code> | <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& AddPhase2DHGroupNumbers(const Phase2DHGroupNumbersRequestListValue& value) { m_phase2DHGroupNumbersHasBeenSet = true; m_phase2DHGroupNumbers.push_back(value); return *this; } /** * <p>One or more Diffie-Hellman group numbers that are permitted for the VPN * tunnel for phase 2 IKE negotiations.</p> <p>Valid values: <code>2</code> | * <code>5</code> | <code>14</code> | <code>15</code> | <code>16</code> | * <code>17</code> | <code>18</code> | <code>19</code> | <code>20</code> | * <code>21</code> | <code>22</code> | <code>23</code> | <code>24</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& AddPhase2DHGroupNumbers(Phase2DHGroupNumbersRequestListValue&& value) { m_phase2DHGroupNumbersHasBeenSet = true; m_phase2DHGroupNumbers.push_back(std::move(value)); return *this; } /** * <p>The IKE versions that are permitted for the VPN tunnel.</p> <p>Valid values: * <code>ikev1</code> | <code>ikev2</code> </p> */ inline const Aws::Vector<IKEVersionsRequestListValue>& GetIKEVersions() const{ return m_iKEVersions; } /** * <p>The IKE versions that are permitted for the VPN tunnel.</p> <p>Valid values: * <code>ikev1</code> | <code>ikev2</code> </p> */ inline bool IKEVersionsHasBeenSet() const { return m_iKEVersionsHasBeenSet; } /** * <p>The IKE versions that are permitted for the VPN tunnel.</p> <p>Valid values: * <code>ikev1</code> | <code>ikev2</code> </p> */ inline void SetIKEVersions(const Aws::Vector<IKEVersionsRequestListValue>& value) { m_iKEVersionsHasBeenSet = true; m_iKEVersions = value; } /** * <p>The IKE versions that are permitted for the VPN tunnel.</p> <p>Valid values: * <code>ikev1</code> | <code>ikev2</code> </p> */ inline void SetIKEVersions(Aws::Vector<IKEVersionsRequestListValue>&& value) { m_iKEVersionsHasBeenSet = true; m_iKEVersions = std::move(value); } /** * <p>The IKE versions that are permitted for the VPN tunnel.</p> <p>Valid values: * <code>ikev1</code> | <code>ikev2</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithIKEVersions(const Aws::Vector<IKEVersionsRequestListValue>& value) { SetIKEVersions(value); return *this;} /** * <p>The IKE versions that are permitted for the VPN tunnel.</p> <p>Valid values: * <code>ikev1</code> | <code>ikev2</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithIKEVersions(Aws::Vector<IKEVersionsRequestListValue>&& value) { SetIKEVersions(std::move(value)); return *this;} /** * <p>The IKE versions that are permitted for the VPN tunnel.</p> <p>Valid values: * <code>ikev1</code> | <code>ikev2</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& AddIKEVersions(const IKEVersionsRequestListValue& value) { m_iKEVersionsHasBeenSet = true; m_iKEVersions.push_back(value); return *this; } /** * <p>The IKE versions that are permitted for the VPN tunnel.</p> <p>Valid values: * <code>ikev1</code> | <code>ikev2</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& AddIKEVersions(IKEVersionsRequestListValue&& value) { m_iKEVersionsHasBeenSet = true; m_iKEVersions.push_back(std::move(value)); return *this; } /** * <p>The action to take when the establishing the tunnel for the VPN connection. * By default, your customer gateway device must initiate the IKE negotiation and * bring up the tunnel. Specify <code>start</code> for Amazon Web Services to * initiate the IKE negotiation.</p> <p>Valid Values: <code>add</code> | * <code>start</code> </p> <p>Default: <code>add</code> </p> */ inline const Aws::String& GetStartupAction() const{ return m_startupAction; } /** * <p>The action to take when the establishing the tunnel for the VPN connection. * By default, your customer gateway device must initiate the IKE negotiation and * bring up the tunnel. Specify <code>start</code> for Amazon Web Services to * initiate the IKE negotiation.</p> <p>Valid Values: <code>add</code> | * <code>start</code> </p> <p>Default: <code>add</code> </p> */ inline bool StartupActionHasBeenSet() const { return m_startupActionHasBeenSet; } /** * <p>The action to take when the establishing the tunnel for the VPN connection. * By default, your customer gateway device must initiate the IKE negotiation and * bring up the tunnel. Specify <code>start</code> for Amazon Web Services to * initiate the IKE negotiation.</p> <p>Valid Values: <code>add</code> | * <code>start</code> </p> <p>Default: <code>add</code> </p> */ inline void SetStartupAction(const Aws::String& value) { m_startupActionHasBeenSet = true; m_startupAction = value; } /** * <p>The action to take when the establishing the tunnel for the VPN connection. * By default, your customer gateway device must initiate the IKE negotiation and * bring up the tunnel. Specify <code>start</code> for Amazon Web Services to * initiate the IKE negotiation.</p> <p>Valid Values: <code>add</code> | * <code>start</code> </p> <p>Default: <code>add</code> </p> */ inline void SetStartupAction(Aws::String&& value) { m_startupActionHasBeenSet = true; m_startupAction = std::move(value); } /** * <p>The action to take when the establishing the tunnel for the VPN connection. * By default, your customer gateway device must initiate the IKE negotiation and * bring up the tunnel. Specify <code>start</code> for Amazon Web Services to * initiate the IKE negotiation.</p> <p>Valid Values: <code>add</code> | * <code>start</code> </p> <p>Default: <code>add</code> </p> */ inline void SetStartupAction(const char* value) { m_startupActionHasBeenSet = true; m_startupAction.assign(value); } /** * <p>The action to take when the establishing the tunnel for the VPN connection. * By default, your customer gateway device must initiate the IKE negotiation and * bring up the tunnel. Specify <code>start</code> for Amazon Web Services to * initiate the IKE negotiation.</p> <p>Valid Values: <code>add</code> | * <code>start</code> </p> <p>Default: <code>add</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithStartupAction(const Aws::String& value) { SetStartupAction(value); return *this;} /** * <p>The action to take when the establishing the tunnel for the VPN connection. * By default, your customer gateway device must initiate the IKE negotiation and * bring up the tunnel. Specify <code>start</code> for Amazon Web Services to * initiate the IKE negotiation.</p> <p>Valid Values: <code>add</code> | * <code>start</code> </p> <p>Default: <code>add</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithStartupAction(Aws::String&& value) { SetStartupAction(std::move(value)); return *this;} /** * <p>The action to take when the establishing the tunnel for the VPN connection. * By default, your customer gateway device must initiate the IKE negotiation and * bring up the tunnel. Specify <code>start</code> for Amazon Web Services to * initiate the IKE negotiation.</p> <p>Valid Values: <code>add</code> | * <code>start</code> </p> <p>Default: <code>add</code> </p> */ inline ModifyVpnTunnelOptionsSpecification& WithStartupAction(const char* value) { SetStartupAction(value); return *this;} private: Aws::String m_tunnelInsideCidr; bool m_tunnelInsideCidrHasBeenSet; Aws::String m_tunnelInsideIpv6Cidr; bool m_tunnelInsideIpv6CidrHasBeenSet; Aws::String m_preSharedKey; bool m_preSharedKeyHasBeenSet; int m_phase1LifetimeSeconds; bool m_phase1LifetimeSecondsHasBeenSet; int m_phase2LifetimeSeconds; bool m_phase2LifetimeSecondsHasBeenSet; int m_rekeyMarginTimeSeconds; bool m_rekeyMarginTimeSecondsHasBeenSet; int m_rekeyFuzzPercentage; bool m_rekeyFuzzPercentageHasBeenSet; int m_replayWindowSize; bool m_replayWindowSizeHasBeenSet; int m_dPDTimeoutSeconds; bool m_dPDTimeoutSecondsHasBeenSet; Aws::String m_dPDTimeoutAction; bool m_dPDTimeoutActionHasBeenSet; Aws::Vector<Phase1EncryptionAlgorithmsRequestListValue> m_phase1EncryptionAlgorithms; bool m_phase1EncryptionAlgorithmsHasBeenSet; Aws::Vector<Phase2EncryptionAlgorithmsRequestListValue> m_phase2EncryptionAlgorithms; bool m_phase2EncryptionAlgorithmsHasBeenSet; Aws::Vector<Phase1IntegrityAlgorithmsRequestListValue> m_phase1IntegrityAlgorithms; bool m_phase1IntegrityAlgorithmsHasBeenSet; Aws::Vector<Phase2IntegrityAlgorithmsRequestListValue> m_phase2IntegrityAlgorithms; bool m_phase2IntegrityAlgorithmsHasBeenSet; Aws::Vector<Phase1DHGroupNumbersRequestListValue> m_phase1DHGroupNumbers; bool m_phase1DHGroupNumbersHasBeenSet; Aws::Vector<Phase2DHGroupNumbersRequestListValue> m_phase2DHGroupNumbers; bool m_phase2DHGroupNumbersHasBeenSet; Aws::Vector<IKEVersionsRequestListValue> m_iKEVersions; bool m_iKEVersionsHasBeenSet; Aws::String m_startupAction; bool m_startupActionHasBeenSet; }; } // namespace Model } // namespace EC2 } // namespace Aws
Java
/* * Copyright 2015 Adobe Systems Incorporated * * 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 ${package}.core.servlets; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.SlingHttpServletResponse; import org.apache.sling.api.resource.Resource; import org.apache.sling.api.servlets.HttpConstants; import org.apache.sling.api.servlets.SlingAllMethodsServlet; import org.apache.sling.api.servlets.SlingSafeMethodsServlet; import org.apache.sling.api.resource.ValueMap; import org.osgi.framework.Constants; import org.osgi.service.component.annotations.Component; import javax.servlet.Servlet; import javax.servlet.ServletException; import java.io.IOException; /** * Servlet that writes some sample content into the response. It is mounted for * all resources of a specific Sling resource type. The * {@link SlingSafeMethodsServlet} shall be used for HTTP methods that are * idempotent. For write operations use the {@link SlingAllMethodsServlet}. */ @Component(service=Servlet.class, property={ Constants.SERVICE_DESCRIPTION + "=Simple Demo Servlet", "sling.servlet.methods=" + HttpConstants.METHOD_GET, "sling.servlet.resourceTypes="+ "${appsFolderName}/components/structure/page", "sling.servlet.extensions=" + "txt" }) public class SimpleServlet extends SlingSafeMethodsServlet { private static final long serialVersionUid = 1L; @Override protected void doGet(final SlingHttpServletRequest req, final SlingHttpServletResponse resp) throws ServletException, IOException { final Resource resource = req.getResource(); resp.setContentType("text/plain"); resp.getWriter().write("Title = " + resource.adaptTo(ValueMap.class).get("jcr:title")); } }
Java
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "\u04d5\u043c\u0431\u0438\u0441\u0431\u043e\u043d\u044b \u0440\u0430\u0437\u043c\u04d5", "\u04d5\u043c\u0431\u0438\u0441\u0431\u043e\u043d\u044b \u0444\u04d5\u0441\u0442\u04d5" ], "DAY": [ "\u0445\u0443\u044b\u0446\u0430\u0443\u0431\u043e\u043d", "\u043a\u044a\u0443\u044b\u0440\u0438\u0441\u04d5\u0440", "\u0434\u044b\u0446\u0446\u04d5\u0433", "\u04d5\u0440\u0442\u044b\u0446\u0446\u04d5\u0433", "\u0446\u044b\u043f\u043f\u04d5\u0440\u04d5\u043c", "\u043c\u0430\u0439\u0440\u04d5\u043c\u0431\u043e\u043d", "\u0441\u0430\u0431\u0430\u0442" ], "ERANAMES": [ "\u043d.\u0434.\u0430.", "\u043d.\u0434." ], "ERAS": [ "\u043d.\u0434.\u0430.", "\u043d.\u0434." ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "\u044f\u043d\u0432\u0430\u0440\u044b", "\u0444\u0435\u0432\u0440\u0430\u043b\u044b", "\u043c\u0430\u0440\u0442\u044a\u0438\u0439\u044b", "\u0430\u043f\u0440\u0435\u043b\u044b", "\u043c\u0430\u0439\u044b", "\u0438\u044e\u043d\u044b", "\u0438\u044e\u043b\u044b", "\u0430\u0432\u0433\u0443\u0441\u0442\u044b", "\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044b", "\u043e\u043a\u0442\u044f\u0431\u0440\u044b", "\u043d\u043e\u044f\u0431\u0440\u044b", "\u0434\u0435\u043a\u0430\u0431\u0440\u044b" ], "SHORTDAY": [ "\u0445\u0446\u0431", "\u043a\u0440\u0441", "\u0434\u0446\u0433", "\u04d5\u0440\u0442", "\u0446\u043f\u0440", "\u043c\u0440\u0431", "\u0441\u0431\u0442" ], "SHORTMONTH": [ "\u044f\u043d\u0432.", "\u0444\u0435\u0432.", "\u043c\u0430\u0440.", "\u0430\u043f\u0440.", "\u043c\u0430\u044f", "\u0438\u044e\u043d\u044b", "\u0438\u044e\u043b\u044b", "\u0430\u0432\u0433.", "\u0441\u0435\u043d.", "\u043e\u043a\u0442.", "\u043d\u043e\u044f.", "\u0434\u0435\u043a." ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, d MMMM, y '\u0430\u0437'", "longDate": "d MMMM, y '\u0430\u0437'", "medium": "dd MMM y '\u0430\u0437' HH:mm:ss", "mediumDate": "dd MMM y '\u0430\u0437'", "mediumTime": "HH:mm:ss", "short": "dd.MM.yy HH:mm", "shortDate": "dd.MM.yy", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "GEL", "DECIMAL_SEP": ",", "GROUP_SEP": "\u00a0", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-\u00a4\u00a0", "negSuf": "", "posPre": "\u00a4\u00a0", "posSuf": "" } ] }, "id": "os", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
Java
package com.comp.ninti.sportsmanager; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.MenuItem; import android.widget.ListView; import com.comp.ninti.adapter.LeaderBoardAdapter; import com.comp.ninti.database.DbHandler; import com.comp.ninti.general.core.Event; public class LeaderBoard extends AppCompatActivity { private Event event; private DbHandler dbHandler; private LeaderBoardAdapter leaderBoardAdapter; private ListView listView; @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == android.R.id.home) { super.onBackPressed(); return true; } return super.onOptionsItemSelected(item); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); event = getIntent().getExtras().getParcelable("com.comp.ninti.general.core.Event"); Intent intent = new Intent(); intent.putExtra("com.comp.ninti.general.core.Event", event); setResult(RESULT_CANCELED, intent); setContentView(R.layout.activity_leader_board); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); listView = (ListView) findViewById(R.id.lvLeaderBoard); listView.setTextFilterEnabled(true); displayItems(); } private void displayItems() { dbHandler = new DbHandler(LeaderBoard.this, "", null, 1); new Handler().post(new Runnable() { @Override public void run() { leaderBoardAdapter = new LeaderBoardAdapter( LeaderBoard.this, dbHandler.getLeaderBoard(event.getId()), 0); listView.setAdapter(leaderBoardAdapter); } }); dbHandler.close(); } @Override protected void onResume() { super.onResume(); displayItems(); } }
Java
/** * www.bplow.com */ package com.bplow.netconn.systemmng.domain; /** * @desc 角色 * @author wangxiaolei * @date 2016年5月8日 下午4:30:39 */ public class RoleDomain { private String roleId; private String userId; private String roleName; private String roleDesc; public String getRoleId() { return roleId; } public void setRoleId(String roleId) { this.roleId = roleId; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getRoleName() { return roleName; } public void setRoleName(String roleName) { this.roleName = roleName; } public String getRoleDesc() { return roleDesc; } public void setRoleDesc(String roleDesc) { this.roleDesc = roleDesc; } }
Java
package it.breex.bus.impl.jms; import it.breex.bus.event.AbstractResponseEvent; import it.breex.bus.event.EventData; import it.breex.bus.event.EventHandler; import it.breex.bus.event.RequestEvent; import it.breex.bus.impl.AbstractEventManager; import java.util.UUID; import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.Destination; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageConsumer; import javax.jms.MessageListener; import javax.jms.MessageProducer; import javax.jms.ObjectMessage; import javax.jms.Queue; import javax.jms.Session; public class JmsEventManager extends AbstractEventManager { private final static String DEFAULT_REQUEST_QUEUE = "breexDefaulRequestQueue"; private final String nodeId = UUID.randomUUID().toString(); private final boolean transacted = false; private final int acknowledgeMode = Session.AUTO_ACKNOWLEDGE; private final Connection jmsConnection; private final Session session; private final Queue requestQueue; private final MessageProducer requestMessageProducer; private final Queue responseQueue; private final MessageProducer responseMessageProducer; public JmsEventManager(ConnectionFactory jmsConnectionFactory) { try { jmsConnection = jmsConnectionFactory.createConnection(); jmsConnection.start(); session = jmsConnection.createSession(transacted, acknowledgeMode); requestQueue = session.createQueue(DEFAULT_REQUEST_QUEUE); requestMessageProducer = session.createProducer(requestQueue); responseQueue = session.createTemporaryQueue(); responseMessageProducer = session.createProducer(null); session.createConsumer(responseQueue).setMessageListener(new MessageListener() { @Override public void onMessage(Message message) { try { EventData<?> eventData = (EventData<?>) ((ObjectMessage) message).getObject(); getLogger().debug("Event Response received. Event name: [{}], sender id: [{}]", eventData.getName(), eventData.getSenderId()); //logger.debug("Event Response received. Event name: [{}], sender id: [{}]", eventData.eventId.eventName, eventData.eventId.nodeId); AbstractResponseEvent responseEvent = new AbstractResponseEvent(eventData) { }; processResponse(responseEvent, getResponseHandlers().remove(eventData.getId())); } catch (JMSException e) { new RuntimeException(e); } } }); } catch (JMSException e) { throw new RuntimeException(e); } } @Override public String getLocalNodeId() { return nodeId; } @Override protected <I, O> void prepareResponse(EventData<I> requestEventData, EventData<O> responseEventData) { try { Message responseMessage = session.createObjectMessage(responseEventData); responseMessageProducer.send((Destination) requestEventData.getTransportData(), responseMessage); } catch (JMSException e) { new RuntimeException(e); } } @Override protected <I, O> void registerCallback(String eventName, EventHandler<RequestEvent<I, O>> eventHandler) { getLogger().debug("Registering event. Event name: [{}]", eventName); MessageConsumer eventConsumer; try { eventConsumer = session.createConsumer(requestQueue, "JMSCorrelationID='" + eventName + "'"); eventConsumer.setMessageListener(new MessageListener() { @Override public void onMessage(Message message) { EventData<I> requestEventData; try { requestEventData = (EventData<I>) ((ObjectMessage) message).getObject(); getLogger().debug("Received event. Event name: [{}] CorrelationID: [{}]", requestEventData.getName(), message.getJMSCorrelationID()); processRequest(requestEventData); } catch (JMSException e) { new RuntimeException(e); } } }); } catch (JMSException e) { new RuntimeException(e); } } @Override protected <I> void prepareRequest(EventData<I> eventData) { try { eventData.setTransportData(responseQueue); ObjectMessage message = session.createObjectMessage(eventData); message.setJMSCorrelationID(eventData.getName()); message.setJMSReplyTo(responseQueue); requestMessageProducer.send(message); } catch (JMSException e) { new RuntimeException(e); } } }
Java
from .fetch import FetchParser from .json_ld import JsonLdParser from .lom import LomParser from .lrmi import LrmiParser from .nsdl_dc import NsdlDcParser __all__ = [ 'FetchParser', 'JsonLdParser', 'LomParser', 'LrmiParser', 'NsdlDcParser', ]
Java
/* Copyright 2014 Maciej Chałapuk 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 restful import ( "net/http" "net/http/httptest" "testing" "strings" "fmt" ) type testIndexer struct { TimesCalled int ReturnedMap map[string]interface{} } func NewTestIndexer() *testIndexer { return &testIndexer{ 0, make(map[string]interface{}) } } func (indexer *testIndexer) Index() map[string]interface{} { indexer.TimesCalled += 1 return indexer.ReturnedMap } func TestAllMethodCalled(t *testing.T) { fakeController := NewTestIndexer() router, w := NewRouter(), httptest.NewRecorder() createResourceAndServeARequest(router, "/test", "/", fakeController, w) if fakeController.TimesCalled != 1 { t.Errorf("Expected 1 call, got %v.", fakeController.TimesCalled) } } func TestJsonResponseAfterReturningEmptyMapFromAll(t *testing.T) { fakeController := NewTestIndexer() router, w := NewRouter(), httptest.NewRecorder() createResourceAndServeARequest(router, "/test", "/", fakeController, w) expectedJson := "{}" actualJson := strings.TrimSpace(string(w.Body.Bytes())) if expectedJson != actualJson { t.Errorf("Expected response '%v', got '%v'.", expectedJson, actualJson) } } func TestJsonResponseAfterReturningEmptyMapWithOneString(t *testing.T) { fakeController := NewTestIndexer() id0 := "test" fakeController.ReturnedMap[id0] = id0 router, w := NewRouter(), httptest.NewRecorder() createResourceAndServeARequest(router, "/test", "/", fakeController, w) expectedJson := fmt.Sprintf("{\"%v\":\"%v\"}", id0, id0) actualJson := strings.TrimSpace(string(w.Body.Bytes())) if expectedJson != actualJson { t.Errorf("Expected response '%v', got '%v'.", expectedJson, actualJson) } } type testStruct struct { Test string `json:"test"` } func TestJsonResponseAfterReturningEmptyMapWithTwoStructs(t *testing.T) { fakeController := NewTestIndexer() id0, id1 := "0", "1" fakeController.ReturnedMap[id0] = testStruct{id0} fakeController.ReturnedMap[id1] = testStruct{id1} router, w := NewRouter(), httptest.NewRecorder() createResourceAndServeARequest(router, "/test", "/", fakeController, w) expectedJson := fmt.Sprintf("{\"%v\":{\"test\":\"%v\"},\"%v\":{\"test\":\"%v\"}}", id0, id0, id1, id1) actualJson := strings.TrimSpace(string(w.Body.Bytes())) if expectedJson != actualJson { t.Errorf("Expected response '%v', got '%v'.", expectedJson, actualJson) } } func TestPanicWhenReturningNilMapFromIndexer(t *testing.T) { fakeController := new(testIndexer) // ReturnedMap is nil router, w := NewRouter(), httptest.NewRecorder() defer func() { if err := recover(); err == nil { t.Error("Should panic when returned map is nil, but didnt.") } }() createResourceAndServeARequest(router, "/test", "/", fakeController, w) } func createResourceAndServeARequest(router *Router, resource string, request string, controller interface{}, out http.ResponseWriter) { router.HandleResource(resource, controller) url := "http://www.domain.com"+ resource + request req, _ := http.NewRequest("GET", url, nil) router.ServeHTTP(out, req) }
Java
using System.Collections.Generic; using System.Linq; using CoolNameGenerator.GA.Chromosomes; using CoolNameGenerator.GA.Crossovers; using NUnit.Framework; using Rhino.Mocks; using TestSharp; namespace Test.GA.Crossovers { [TestFixture] [Category("Crossovers")] public class OrderedCrossoverTest { [Test] public void Cross_ParentWithNoOrderedGenes_Exception() { var target = new OrderedCrossover(); var chromosome1 = MockRepository.GenerateStub<ChromosomeBase>(10); chromosome1.ReplaceGenes(0, new Gene[] { new Gene(8), new Gene(4), new Gene(7), new Gene(3), new Gene(6), new Gene(2), new Gene(5), new Gene(1), new Gene(9), new Gene(0) }); chromosome1.Expect(c => c.CreateNew()).Return(MockRepository.GenerateStub<ChromosomeBase>(10)); var chromosome2 = MockRepository.GenerateStub<ChromosomeBase>(10); chromosome2.ReplaceGenes(0, new Gene[] { new Gene(0), new Gene(1), new Gene(2), new Gene(3), new Gene(5), new Gene(5), new Gene(6), new Gene(7), new Gene(8), new Gene(9), }); chromosome2.Expect(c => c.CreateNew()).Return(MockRepository.GenerateStub<ChromosomeBase>(10)); ExceptionAssert.IsThrowing(new CrossoverException(target, "The Ordered Crossover (OX1) can be only used with ordered chromosomes. The specified chromosome has repeated genes."), () => { target.Cross(new List<IChromosome>() { chromosome1, chromosome2 }); }); } [Test] public void Cross_ParentsWith10Genes_Cross() { var target = new OrderedCrossover(); // 8 4 7 3 6 2 5 1 9 0 var chromosome1 = MockRepository.GenerateStub<ChromosomeBase>(10); chromosome1.ReplaceGenes(0, new Gene[] { new Gene(8), new Gene(4), new Gene(7), new Gene(3), new Gene(6), new Gene(2), new Gene(5), new Gene(1), new Gene(9), new Gene(0) }); chromosome1.Expect(c => c.CreateNew()).Return(MockRepository.GenerateStub<ChromosomeBase>(10)); // 0 1 2 3 4 5 6 7 8 9 var chromosome2 = MockRepository.GenerateStub<ChromosomeBase>(10); chromosome2.ReplaceGenes(0, new Gene[] { new Gene(0), new Gene(1), new Gene(2), new Gene(3), new Gene(4), new Gene(5), new Gene(6), new Gene(7), new Gene(8), new Gene(9), }); chromosome2.Expect(c => c.CreateNew()).Return(MockRepository.GenerateStub<ChromosomeBase>(10)); // Child one: 0 4 7 3 6 2 5 1 8 9 // Child two: 8 2 1 3 4 5 6 7 9 0 IList<IChromosome> actual = null; ; TimeAssert.LessThan(40, () => { actual = target.Cross(new List<IChromosome>() { chromosome1, chromosome2 }); }); Assert.AreEqual(2, actual.Count); Assert.AreEqual(10, actual[0].Length); Assert.AreEqual(10, actual[1].Length); Assert.AreEqual(10, actual[0].GetGenes().Distinct().Count()); Assert.AreEqual(10, actual[1].GetGenes().Distinct().Count()); Assert.AreEqual(0, actual[0].GetGene(0).Value); Assert.AreEqual(4, actual[0].GetGene(1).Value); Assert.AreEqual(7, actual[0].GetGene(2).Value); Assert.AreEqual(3, actual[0].GetGene(3).Value); Assert.AreEqual(6, actual[0].GetGene(4).Value); Assert.AreEqual(2, actual[0].GetGene(5).Value); Assert.AreEqual(5, actual[0].GetGene(6).Value); Assert.AreEqual(1, actual[0].GetGene(7).Value); Assert.AreEqual(8, actual[0].GetGene(8).Value); Assert.AreEqual(9, actual[0].GetGene(9).Value); Assert.AreEqual(8, actual[1].GetGene(0).Value); Assert.AreEqual(2, actual[1].GetGene(1).Value); Assert.AreEqual(1, actual[1].GetGene(2).Value); Assert.AreEqual(3, actual[1].GetGene(3).Value); Assert.AreEqual(4, actual[1].GetGene(4).Value); Assert.AreEqual(5, actual[1].GetGene(5).Value); Assert.AreEqual(6, actual[1].GetGene(6).Value); Assert.AreEqual(7, actual[1].GetGene(7).Value); Assert.AreEqual(9, actual[1].GetGene(8).Value); Assert.AreEqual(0, actual[1].GetGene(9).Value); } } }
Java
/* * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef FocusController_h #define FocusController_h #include "core/page/FocusDirection.h" #include "core/platform/graphics/LayoutRect.h" #include "wtf/Forward.h" #include "wtf/Noncopyable.h" #include "wtf/RefPtr.h" namespace WebCore { struct FocusCandidate; class Document; class Element; class Frame; class HTMLFrameOwnerElement; class IntRect; class KeyboardEvent; class Node; class Page; class TreeScope; class FocusNavigationScope { public: Node* rootNode() const; Element* owner() const; static FocusNavigationScope focusNavigationScopeOf(Node*); static FocusNavigationScope focusNavigationScopeOwnedByShadowHost(Node*); static FocusNavigationScope focusNavigationScopeOwnedByIFrame(HTMLFrameOwnerElement*); private: explicit FocusNavigationScope(TreeScope*); TreeScope* m_rootTreeScope; }; class FocusController { WTF_MAKE_NONCOPYABLE(FocusController); WTF_MAKE_FAST_ALLOCATED; public: static PassOwnPtr<FocusController> create(Page*); void setFocusedFrame(PassRefPtr<Frame>); Frame* focusedFrame() const { return m_focusedFrame.get(); } Frame* focusedOrMainFrame() const; bool setInitialFocus(FocusDirection); bool advanceFocus(FocusDirection direction) { return advanceFocus(direction, false); } bool setFocusedElement(Element*, PassRefPtr<Frame>, FocusDirection = FocusDirectionNone); void setActive(bool); bool isActive() const { return m_isActive; } void setFocused(bool); bool isFocused() const { return m_isFocused; } void setContainingWindowIsVisible(bool); bool containingWindowIsVisible() const { return m_containingWindowIsVisible; } private: explicit FocusController(Page*); bool advanceFocus(FocusDirection, bool initialFocus); bool advanceFocusDirectionally(FocusDirection); bool advanceFocusInDocumentOrder(FocusDirection, bool initialFocus); Node* findFocusableNodeAcrossFocusScope(FocusDirection, FocusNavigationScope startScope, Node* start); Node* findFocusableNodeRecursively(FocusDirection, FocusNavigationScope, Node* start); Node* findFocusableNodeDecendingDownIntoFrameDocument(FocusDirection, Node*); // Searches through the given tree scope, starting from start node, for the next/previous selectable element that comes after/before start node. // The order followed is as specified in section 17.11.1 of the HTML4 spec, which is elements with tab indexes // first (from lowest to highest), and then elements without tab indexes (in document order). // // @param start The node from which to start searching. The node after this will be focused. May be null. // // @return The focus node that comes after/before start node. // // See http://www.w3.org/TR/html4/interact/forms.html#h-17.11.1 inline Node* findFocusableNode(FocusDirection, FocusNavigationScope, Node* start); Node* nextFocusableNode(FocusNavigationScope, Node* start); Node* previousFocusableNode(FocusNavigationScope, Node* start); Node* findNodeWithExactTabIndex(Node* start, int tabIndex, FocusDirection); bool advanceFocusDirectionallyInContainer(Node* container, const LayoutRect& startingRect, FocusDirection); void findFocusCandidateInContainer(Node* container, const LayoutRect& startingRect, FocusDirection, FocusCandidate& closest); Page* m_page; RefPtr<Frame> m_focusedFrame; bool m_isActive; bool m_isFocused; bool m_isChangingFocusedFrame; bool m_containingWindowIsVisible; }; } // namespace WebCore #endif // FocusController_h
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Wed Jun 10 10:20:09 MST 2020 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>ServerSupplier (BOM: * : All 2.6.1.Final-SNAPSHOT API)</title> <meta name="date" content="2020-06-10"> <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="ServerSupplier (BOM: * : All 2.6.1.Final-SNAPSHOT API)"; } } catch(err) { } //--> var methods = {"i0":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/ServerSupplier.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 class="aboutLanguage">Thorntail API, 2.6.1.Final-SNAPSHOT</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../../org/wildfly/swarm/config/messaging/activemq/Transaction.html" title="enum in org.wildfly.swarm.config.messaging.activemq"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/messaging/activemq/ServerSupplier.html" target="_top">Frames</a></li> <li><a href="ServerSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.wildfly.swarm.config.messaging.activemq</div> <h2 title="Interface ServerSupplier" class="title">Interface ServerSupplier&lt;T extends <a href="../../../../../../org/wildfly/swarm/config/messaging/activemq/Server.html" title="class in org.wildfly.swarm.config.messaging.activemq">Server</a>&gt;</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Functional Interface:</dt> <dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd> </dl> <hr> <br> <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang">@FunctionalInterface</a> public interface <span class="typeNameLabel">ServerSupplier&lt;T extends <a href="../../../../../../org/wildfly/swarm/config/messaging/activemq/Server.html" title="class in org.wildfly.swarm.config.messaging.activemq">Server</a>&gt;</span></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/wildfly/swarm/config/messaging/activemq/Server.html" title="class in org.wildfly.swarm.config.messaging.activemq">Server</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerSupplier.html#get--">get</a></span>()</code> <div class="block">Constructed instance of Server resource</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="get--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>get</h4> <pre><a href="../../../../../../org/wildfly/swarm/config/messaging/activemq/Server.html" title="class in org.wildfly.swarm.config.messaging.activemq">Server</a>&nbsp;get()</pre> <div class="block">Constructed instance of Server resource</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The instance</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/ServerSupplier.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 class="aboutLanguage">Thorntail API, 2.6.1.Final-SNAPSHOT</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../../org/wildfly/swarm/config/messaging/activemq/Transaction.html" title="enum in org.wildfly.swarm.config.messaging.activemq"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/messaging/activemq/ServerSupplier.html" target="_top">Frames</a></li> <li><a href="ServerSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2020 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Tue Oct 30 00:52:57 MST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>LdapRealmSupplier (BOM: * : All 2.2.1.Final API)</title> <meta name="date" content="2018-10-30"> <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="LdapRealmSupplier (BOM: * : All 2.2.1.Final API)"; } } catch(err) { } //--> var methods = {"i0":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/LdapRealmSupplier.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 class="aboutLanguage">Thorntail API, 2.2.1.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../org/wildfly/swarm/config/elytron/LogicalPermissionMapper.html" title="class in org.wildfly.swarm.config.elytron"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/elytron/LdapRealmSupplier.html" target="_top">Frames</a></li> <li><a href="LdapRealmSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.wildfly.swarm.config.elytron</div> <h2 title="Interface LdapRealmSupplier" class="title">Interface LdapRealmSupplier&lt;T extends <a href="../../../../../org/wildfly/swarm/config/elytron/LdapRealm.html" title="class in org.wildfly.swarm.config.elytron">LdapRealm</a>&gt;</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Functional Interface:</dt> <dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd> </dl> <hr> <br> <pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang">@FunctionalInterface</a> public interface <span class="typeNameLabel">LdapRealmSupplier&lt;T extends <a href="../../../../../org/wildfly/swarm/config/elytron/LdapRealm.html" title="class in org.wildfly.swarm.config.elytron">LdapRealm</a>&gt;</span></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../../../org/wildfly/swarm/config/elytron/LdapRealm.html" title="class in org.wildfly.swarm.config.elytron">LdapRealm</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/config/elytron/LdapRealmSupplier.html#get--">get</a></span>()</code> <div class="block">Constructed instance of LdapRealm resource</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="get--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>get</h4> <pre><a href="../../../../../org/wildfly/swarm/config/elytron/LdapRealm.html" title="class in org.wildfly.swarm.config.elytron">LdapRealm</a>&nbsp;get()</pre> <div class="block">Constructed instance of LdapRealm resource</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The instance</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/LdapRealmSupplier.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 class="aboutLanguage">Thorntail API, 2.2.1.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/elytron/LdapRealmConsumer.html" title="interface in org.wildfly.swarm.config.elytron"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../org/wildfly/swarm/config/elytron/LogicalPermissionMapper.html" title="class in org.wildfly.swarm.config.elytron"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/elytron/LdapRealmSupplier.html" target="_top">Frames</a></li> <li><a href="LdapRealmSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2018 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
Java
/** * Copyright 2013 Oak Ridge National Laboratory * Author: James Horey <horeyjl@ornl.gov> * * 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 gov.ornl.paja.storage; /** * Java libs. **/ import java.util.Iterator; import java.nio.ByteBuffer; /** * A log message is the thing that gets written to the log. */ public class LogMessage { private int logNum; // Current log ID. private byte[] id; // ID of the log message. private byte[] msg; // Actual log message /** * @param logNum Each log message has a unique log number * @param id Application defined identification label * @param msg Actual log message */ public LogMessage(int logNum, byte[] id, byte[] msg) { this.logNum = logNum; this.id = id; this.msg = msg; } /** * Get/set the log message ID. */ public void setID(byte[] id) { this.id = id; } public byte[] getID() { return id; } /** * Get/set the log message. */ public void setMsg(byte[] msg) { this.msg = msg; } public byte[] getMsg() { return msg; } /** * Get/set the log message num. */ public void setNum(int i) { logNum = i; } public int getNum() { return logNum; } }
Java
# SlingQuery SlingQuery is a Sling resource tree traversal tool inspired by the [jQuery](http://api.jquery.com/category/traversing/tree-traversal/). See the full documentation on [Apache Sling website](http://sling.apache.org/documentation/bundles/sling-query.html).
Java
using Newtonsoft.Json; using Newtonsoft.Json.Converters; using SelectelSharp.Headers; using System; using System.IO; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SelectelSharp.Requests.CDN { public class CDNIvalidationRequest : BaseRequest<CDNIvalidationResult> { public CDNIvalidationRequest(Uri[] uri) { if (uri.Length == 0) throw new ArgumentNullException("uri"); this.ContentStream = new MemoryStream(Encoding.UTF8.GetBytes(String.Join("\n", uri.Select(x => x.ToString())))); this.AutoCloseStream = true; this.AutoResetStreamPosition = false; //this.TryAddHeader(HeaderKeys.ContentLenght, this.File.Length); this.TryAddHeader(HeaderKeys.ContentType, "text/plain"); } internal override RequestMethod Method { get { return RequestMethod.PURGE; } } internal override void Parse(System.Collections.Specialized.NameValueCollection headers, object content, System.Net.HttpStatusCode status) { this.Result = JsonConvert.DeserializeObject<CDNIvalidationResult>(content as string); } internal override void ParseError(System.Net.WebException ex, System.Net.HttpStatusCode status) { base.ParseError(ex, status); } protected override string GetUrl(string storageUrl) { return "https://api.selcdn.ru/v1/cdn"; } } }
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Tue Oct 30 00:53:03 MST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.config.UndertowSupplier (BOM: * : All 2.2.1.Final API)</title> <meta name="date" content="2018-10-30"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.wildfly.swarm.config.UndertowSupplier (BOM: * : All 2.2.1.Final API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/wildfly/swarm/config/UndertowSupplier.html" title="interface in org.wildfly.swarm.config">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.2.1.Final</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/class-use/UndertowSupplier.html" target="_top">Frames</a></li> <li><a href="UndertowSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.wildfly.swarm.config.UndertowSupplier" class="title">Uses of Interface<br>org.wildfly.swarm.config.UndertowSupplier</h2> </div> <div class="classUseContainer">No usage of org.wildfly.swarm.config.UndertowSupplier</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/wildfly/swarm/config/UndertowSupplier.html" title="interface in org.wildfly.swarm.config">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.2.1.Final</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/class-use/UndertowSupplier.html" target="_top">Frames</a></li> <li><a href="UndertowSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;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 &#169; 2018 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_60-ea) on Tue Sep 06 12:41:45 EDT 2016 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.config.messaging.activemq.ServerConsumer (Public javadocs 2016.9 API)</title> <meta name="date" content="2016-09-06"> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.wildfly.swarm.config.messaging.activemq.ServerConsumer (Public javadocs 2016.9 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2016.9</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/wildfly/swarm/config/messaging/activemq/class-use/ServerConsumer.html" target="_top">Frames</a></li> <li><a href="ServerConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.wildfly.swarm.config.messaging.activemq.ServerConsumer" class="title">Uses of Interface<br>org.wildfly.swarm.config.messaging.activemq.ServerConsumer</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">ServerConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config">org.wildfly.swarm.config</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.messaging.activemq">org.wildfly.swarm.config.messaging.activemq</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.messaging">org.wildfly.swarm.messaging</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">ServerConsumer</a> in <a href="../../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/package-summary.html">org.wildfly.swarm.config</a> with parameters of type <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">ServerConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/MessagingActiveMQ.html" title="type parameter in MessagingActiveMQ">T</a></code></td> <td class="colLast"><span class="typeNameLabel">MessagingActiveMQ.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/MessagingActiveMQ.html#server-java.lang.String-org.wildfly.swarm.config.messaging.activemq.ServerConsumer-">server</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;childKey, <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">ServerConsumer</a>&nbsp;consumer)</code> <div class="block">Create and configure a Server object to the list of subresources</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.wildfly.swarm.config.messaging.activemq"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">ServerConsumer</a> in <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/package-summary.html">org.wildfly.swarm.config.messaging.activemq</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/package-summary.html">org.wildfly.swarm.config.messaging.activemq</a> that return <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">ServerConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>default <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">ServerConsumer</a>&lt;<a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="type parameter in ServerConsumer">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">ServerConsumer.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html#andThen-org.wildfly.swarm.config.messaging.activemq.ServerConsumer-">andThen</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">ServerConsumer</a>&lt;<a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="type parameter in ServerConsumer">T</a>&gt;&nbsp;after)</code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/package-summary.html">org.wildfly.swarm.config.messaging.activemq</a> with parameters of type <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">ServerConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>default <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">ServerConsumer</a>&lt;<a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="type parameter in ServerConsumer">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">ServerConsumer.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html#andThen-org.wildfly.swarm.config.messaging.activemq.ServerConsumer-">andThen</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">ServerConsumer</a>&lt;<a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="type parameter in ServerConsumer">T</a>&gt;&nbsp;after)</code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.wildfly.swarm.messaging"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">ServerConsumer</a> in <a href="../../../../../../../org/wildfly/swarm/messaging/package-summary.html">org.wildfly.swarm.messaging</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subinterfaces, and an explanation"> <caption><span>Subinterfaces of <a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">ServerConsumer</a> in <a href="../../../../../../../org/wildfly/swarm/messaging/package-summary.html">org.wildfly.swarm.messaging</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Interface and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>interface&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/messaging/EnhancedServerConsumer.html" title="interface in org.wildfly.swarm.messaging">EnhancedServerConsumer</a></span></code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/wildfly/swarm/config/messaging/activemq/ServerConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2016.9</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/wildfly/swarm/config/messaging/activemq/class-use/ServerConsumer.html" target="_top">Frames</a></li> <li><a href="ServerConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;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 &#169; 2016 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
Java
document.write('<div id="terminal" class="terminal-content"></div>'); var session = {}; // return a parameter value from the current URL function getParam(sname) { var params = location.search.substr(location.search.indexOf("?") + 1); var sval = ""; params = params.split("&"); // split param and value into individual pieces for (var i = 0; i < params.length; i++) { temp = params[i].split("="); if ([temp[0]] == sname) { sval = temp[1]; } } return sval; } function getBaseURL() { return location.protocol + "//" + location.hostname + (location.port && ":" + location.port) + location.pathname; } function greetings(term) { term.echo(session.welcomeMessage); term.echo(' '); } function createNewSession(expression, snap) { var newSession = []; newSession.expression = expression; newSession.snap = snap; $.ajax({ type: 'POST', async: false, url: '/create', data: (expression ? "expression=" + expression : "") + "&" + (snap ? "snap=" + snap : "") } ).done(function (data) { newSession.clientId = data.id; newSession.welcomeMessage = data.welcomeMessage }); newSession.requesting = false; session = newSession; } function closeSession() { $.ajax({type: 'POST', async: false, url: '/remove', data: 'id=' + session.clientId}) .fail(function (xhr, textStatus, errorThrown) {/* ignore failure when closing */ }); } function restartSession(term) { term.echo("[[;#CC7832;black]Session terminated. Starting new session...]"); closeSession(); createNewSession(session.expression, session.snap) } function readExpressionLine(line, term) { var expression = null; $.ajax({type: 'POST', async: false, url: '/readExpression', data: {id: session.clientId, line: line}}) .done(function (data) { expression = data.expression; }) .fail(function (xhr, textStatus, errorThrown) { restartSession(term) }); return expression; } function makeSnap(term) { var snapUrl = null; $.ajax({type: 'POST', async: false, url: '/snap', data: 'id=' + session.clientId}) .done(function (data) { snapUrl = getBaseURL() + '?snap=' + data.snap; }).fail(function (xhr, textStatus, errorThrown) { restartSession(term) }); return snapUrl; } function messageStyle(style) { return { finalize: function (div) { div.addClass(style); } } } function layoutCompletions(candidates, widthInChars) { var max = 0; for (var i = 0; i < candidates.length; i++) { max = Math.max(max, candidates[i].length); } max += 2; var n = Math.floor(widthInChars / max); var buffer = ""; var col = 0; for (i = 0; i < candidates.length; i++) { var completion = candidates[i]; buffer += candidates[i]; for (var j = completion.length; j < max; j++) { buffer += " "; } if (++col >= n) { buffer += "\n"; col = 0; } } return buffer; } function echoCompletionCandidates(term, candidates) { term.echo(term.get_prompt() + term.get_command()); term.echo(layoutCompletions(candidates, term.width() / 8)); } function handleTerminalCommand(log, term) { if (log.type == "CONTROL") { switch (log.message) { case "CLEAR_SCREEN": term.clear(); term.echo(session.welcomeMessage); term.echo(' '); break; } return true; } return false; } function handleTerminalMessage(log, term) { if (log.type != "CONTROL") { var style = log.type == "ERROR" ? "terminal-message-error" : "terminal-message-success"; term.echo(log.message, messageStyle(style)) return log.type == "ERROR"; } return false; } $(document).ready(function () { jQuery(function ($, undefined) { createNewSession(getParam("expression"), getParam("snap")); $('#terminal').terminal(function (command, term) { if (command == ":snap") { var snapUri = makeSnap(term); term.echo("Created terminal snapshot [[!;;]" + snapUri + "]", messageStyle("terminal-message-success")); return; } var expression = readExpressionLine(command, term); if (expression) { $.ajax({ type: 'POST', async: false, url: '/execute', data: {id: session.clientId, expression: expression} }).done(function (data) { var hadError = false; for (var i = 0; i < data.logs.length; i++) { var log = data.logs[i]; if (!handleTerminalCommand(log, term)) { hadError = handleTerminalMessage(log, term) || hadError; } } if (!hadError) { _gaq.push(["_trackEvent", "console", "evaluation", "success"]); } else { _gaq.push(["_trackEvent", "console", "evaluation", "error"]); } session.requesting = false; }).fail(function (xhr, textStatus, errorThrown) { restartSession(term) }); } else { term.echo(" "); session.requesting = false; } }, { greetings: null, name: 'js_demo', prompt: '[[;white;black]java> ]', onInit: function (term) { greetings(term); }, keydown: function (event, term) { if (event.keyCode == 9) //Tab { var completionResult = []; $.ajax({ type: 'GET', async: false, cache: false, url: '/completions', data: {id: session.clientId, expression: term.get_command()} }) .done(function (data) { completionResult = data; }); var candidates = _.map(completionResult.candidates, function (cand) { return cand.value; }); var candidatesForms = _.map(completionResult.candidates, function (cand) { return cand.forms; }); var promptText = term.get_command(); if (candidates.length == 0) { term.set_command(promptText); return false; } if (candidates.length == 1) { var uniqueForms = _.filter(_.unique(candidatesForms[0]), function (form) { return form != candidates[0] }); var text = term.get_command().substr(0, parseInt(completionResult.position)) + candidates[0]; term.set_command(text); if (uniqueForms.length > 0) { echoCompletionCandidates(term, candidatesForms[0]); } return false; } echoCompletionCandidates(term, candidates); for (var i = candidates[0].length; i > 0; --i) { var prefixedCandidatesCount = _.filter(candidates, function (cand) { return i > cand.length ? false : cand.substr(0, i) == candidates[0].substr(0, i); }).length; if (prefixedCandidatesCount == candidates.length) { term.set_command(promptText.substr(0, parseInt(completionResult.position)) + candidates[0].substr(0, i)); return false; } } term.set_command(promptText); return false; } } }); }); });
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Tue Aug 14 15:31:43 MST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>ResolvedExposeModelSupplier (BOM: * : All 2.1.0.Final API)</title> <meta name="date" content="2018-08-14"> <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="ResolvedExposeModelSupplier (BOM: * : All 2.1.0.Final API)"; } } catch(err) { } //--> var methods = {"i0":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/ResolvedExposeModelSupplier.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 class="aboutLanguage">Thorntail API, 2.1.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/jmx/ResolvedExposeModelConsumer.html" title="interface in org.wildfly.swarm.config.jmx"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/jmx/ResolvedExposeModelSupplier.html" target="_top">Frames</a></li> <li><a href="ResolvedExposeModelSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.wildfly.swarm.config.jmx</div> <h2 title="Interface ResolvedExposeModelSupplier" class="title">Interface ResolvedExposeModelSupplier&lt;T extends <a href="../../../../../org/wildfly/swarm/config/jmx/ResolvedExposeModel.html" title="class in org.wildfly.swarm.config.jmx">ResolvedExposeModel</a>&gt;</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Functional Interface:</dt> <dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd> </dl> <hr> <br> <pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang">@FunctionalInterface</a> public interface <span class="typeNameLabel">ResolvedExposeModelSupplier&lt;T extends <a href="../../../../../org/wildfly/swarm/config/jmx/ResolvedExposeModel.html" title="class in org.wildfly.swarm.config.jmx">ResolvedExposeModel</a>&gt;</span></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../../../org/wildfly/swarm/config/jmx/ResolvedExposeModel.html" title="class in org.wildfly.swarm.config.jmx">ResolvedExposeModel</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/config/jmx/ResolvedExposeModelSupplier.html#get--">get</a></span>()</code> <div class="block">Constructed instance of ResolvedExposeModel resource</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="get--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>get</h4> <pre><a href="../../../../../org/wildfly/swarm/config/jmx/ResolvedExposeModel.html" title="class in org.wildfly.swarm.config.jmx">ResolvedExposeModel</a>&nbsp;get()</pre> <div class="block">Constructed instance of ResolvedExposeModel resource</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The instance</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/ResolvedExposeModelSupplier.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 class="aboutLanguage">Thorntail API, 2.1.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/jmx/ResolvedExposeModelConsumer.html" title="interface in org.wildfly.swarm.config.jmx"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/jmx/ResolvedExposeModelSupplier.html" target="_top">Frames</a></li> <li><a href="ResolvedExposeModelSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2018 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
Java
# New Relic Events A simple Java library that can be used to submit [custom events](http://newrelic.com/insights/technology/integrations) to [New Relic Insights](http://newrelic.com/insights). This library is useful when you need to send custom events to Insights, but you aren't running New Relic's [APM Java language agent](http://newrelic.com/java) (which has a [built-in capability for sending custom events to Insights](https://docs.newrelic.com/docs/agents/java-agent/custom-instrumentation/java-agent-api#api_methods)) ## Download The NewRelicEvents library is available from [The Central Repository](https://search.maven.org/) groupId: com.notronix artifactId: NewRelicEvents version: 1.1.001 ## Usage Create a custom event object <pre> package mypackage public class MeaninglessEvent extends NewRelicEvent { @Override public String getEventType() { return "Meaningless"; } public void setAttributeOne(String value) throws APIViolationException { addAttribute("attributeOne", value); } } </pre> Then you can add values and submit your event as follows... <pre> ... MeaninglessEvent meaninglessEvent = new MeaninglessEvent(); try { meaninglessEvent.setAttributeOne("some value"); } catch (APIViolationException e) { System.out.println("Uh oh... I have violated the New Relic Insights API."); } NewRelicClient client = new NewRelicClient(); client.setAccountId(0); // this should be your New Relic account ID, which is the 12345 part of your Insights account URL https://insights.newrelic.com/accounts/12345 client.setInsertKey("YOUR KEY HERE"); // this should be your [Insights Insert Key](https://docs.newrelic.com/docs/insights/new-relic-insights/adding-querying-data/inserting-custom-events-via-insights-api#register) try { StatusLine responseStatus = client.submit(meaninglessEvent); System.out.println("New Relic responded with status code: " + responseStatus.getStatusCode()); } catch (APIViolationException e) { System.out.println("This can happen if your event's eventType is invalid according to the New Relic Insights API"); } catch (NewRelicLoggingException e) { System.out.println("This can happen if there is some unexpected failure during the event submission."); } catch (IllegalStateException e) { System.out.println("This will happen if the client is not initialized with an account ID and an insert key."); } ... </pre>
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Fri Jun 22 04:34:22 MST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.config.undertow.server.host.HTTPInvokerSettingSupplier (BOM: * : All 2.0.0.Final API)</title> <meta name="date" content="2018-06-22"> <link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.wildfly.swarm.config.undertow.server.host.HTTPInvokerSettingSupplier (BOM: * : All 2.0.0.Final API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/HTTPInvokerSettingSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.0.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/undertow/server/host/class-use/HTTPInvokerSettingSupplier.html" target="_top">Frames</a></li> <li><a href="HTTPInvokerSettingSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.wildfly.swarm.config.undertow.server.host.HTTPInvokerSettingSupplier" class="title">Uses of Interface<br>org.wildfly.swarm.config.undertow.server.host.HTTPInvokerSettingSupplier</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/HTTPInvokerSettingSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">HTTPInvokerSettingSupplier</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.undertow.server">org.wildfly.swarm.config.undertow.server</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config.undertow.server"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/HTTPInvokerSettingSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">HTTPInvokerSettingSupplier</a> in <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/package-summary.html">org.wildfly.swarm.config.undertow.server</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/package-summary.html">org.wildfly.swarm.config.undertow.server</a> with parameters of type <a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/HTTPInvokerSettingSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">HTTPInvokerSettingSupplier</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/Host.html" title="type parameter in Host">T</a></code></td> <td class="colLast"><span class="typeNameLabel">Host.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/Host.html#httpInvokerSetting-org.wildfly.swarm.config.undertow.server.host.HTTPInvokerSettingSupplier-">httpInvokerSetting</a></span>(<a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/HTTPInvokerSettingSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">HTTPInvokerSettingSupplier</a>&nbsp;supplier)</code> <div class="block">The HTTP invoker services that allows remote HTTP based invocation of services such as EJB and naming</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../../org/wildfly/swarm/config/undertow/server/host/HTTPInvokerSettingSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server.host">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.0.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/undertow/server/host/class-use/HTTPInvokerSettingSupplier.html" target="_top">Frames</a></li> <li><a href="HTTPInvokerSettingSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../../allclasses-noframe.html">All&nbsp;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 &#169; 2018 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
Java
function CreateMessageSenders($amountSenders, $queueName) { for ($i=1; $i -le $amountSenders; $i++) { $sender = New-SBMessageReceiver -QueueName $queueName -ReceiveMode 'ReceiveAndDelete'; } }
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Tue Feb 06 09:38:18 MST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Class org.wildfly.swarm.config.undertow.Server.ServerResources (BOM: * : All 2017.10.2 API)</title> <meta name="date" content="2018-02-06"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.wildfly.swarm.config.undertow.Server.ServerResources (BOM: * : All 2017.10.2 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/wildfly/swarm/config/undertow/Server.ServerResources.html" title="class in org.wildfly.swarm.config.undertow">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2017.10.2</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/undertow/class-use/Server.ServerResources.html" target="_top">Frames</a></li> <li><a href="Server.ServerResources.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.wildfly.swarm.config.undertow.Server.ServerResources" class="title">Uses of Class<br>org.wildfly.swarm.config.undertow.Server.ServerResources</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../org/wildfly/swarm/config/undertow/Server.ServerResources.html" title="class in org.wildfly.swarm.config.undertow">Server.ServerResources</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.undertow">org.wildfly.swarm.config.undertow</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config.undertow"> <!-- --> </a> <h3>Uses of <a href="../../../../../../org/wildfly/swarm/config/undertow/Server.ServerResources.html" title="class in org.wildfly.swarm.config.undertow">Server.ServerResources</a> in <a href="../../../../../../org/wildfly/swarm/config/undertow/package-summary.html">org.wildfly.swarm.config.undertow</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../org/wildfly/swarm/config/undertow/package-summary.html">org.wildfly.swarm.config.undertow</a> that return <a href="../../../../../../org/wildfly/swarm/config/undertow/Server.ServerResources.html" title="class in org.wildfly.swarm.config.undertow">Server.ServerResources</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/wildfly/swarm/config/undertow/Server.ServerResources.html" title="class in org.wildfly.swarm.config.undertow">Server.ServerResources</a></code></td> <td class="colLast"><span class="typeNameLabel">Server.</span><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/undertow/Server.html#subresources--">subresources</a></span>()</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/wildfly/swarm/config/undertow/Server.ServerResources.html" title="class in org.wildfly.swarm.config.undertow">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2017.10.2</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/undertow/class-use/Server.ServerResources.html" target="_top">Frames</a></li> <li><a href="Server.ServerResources.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;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 &#169; 2018 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
Java
.ff0{font-family:sans-serif;visibility:hidden;} @font-face{font-family:ff1;src:url(f1.woff)format("woff");}.ff1{font-family:ff1;line-height:1.589369;font-style:normal;font-weight:normal;visibility:visible;} @font-face{font-family:ff2;src:url(f2.woff)format("woff");}.ff2{font-family:ff2;line-height:1.695312;font-style:normal;font-weight:normal;visibility:visible;} @font-face{font-family:ff3;src:url(f3.woff)format("woff");}.ff3{font-family:ff3;line-height:1.695312;font-style:normal;font-weight:normal;visibility:visible;} .m0{transform:matrix(0.250000,0.000000,0.000000,0.250000,0,0);-ms-transform:matrix(0.250000,0.000000,0.000000,0.250000,0,0);-webkit-transform:matrix(0.250000,0.000000,0.000000,0.250000,0,0);} .m1{transform:none;-ms-transform:none;-webkit-transform:none;} .v0{vertical-align:0.000000px;} .ls0{letter-spacing:0.000000px;} .sc_{text-shadow:none;} .sc0{text-shadow:-0.015em 0 transparent,0 0.015em transparent,0.015em 0 transparent,0 -0.015em transparent;} @media screen and (-webkit-min-device-pixel-ratio:0){ .sc_{-webkit-text-stroke:0px transparent;} .sc0{-webkit-text-stroke:0.015em transparent;text-shadow:none;} } .ws0{word-spacing:0.000000px;} .fc2{color:rgb(33,78,123);} .fc1{color:rgb(255,0,0);} .fc0{color:rgb(0,0,0);} .fs3{font-size:48.000000px;} .fs2{font-size:56.000000px;} .fs1{font-size:60.000000px;} .fs0{font-size:80.000000px;} .y6{bottom:17.000000px;} .y2b{bottom:22.000000px;} .y7{bottom:35.500000px;} .yc7{bottom:52.220000px;} .y6e{bottom:52.730000px;} .y29{bottom:54.000000px;} .y49{bottom:56.130000px;} .y94{bottom:62.000000px;} .ydd{bottom:63.670000px;} .yc6{bottom:68.220000px;} .y6d{bottom:68.730000px;} .y28{bottom:70.000000px;} .y48{bottom:76.130000px;} .y93{bottom:80.000000px;} .ydc{bottom:81.670000px;} .y27{bottom:82.000000px;} .yc5{bottom:84.220000px;} .y6c{bottom:84.730000px;} .ydb{bottom:93.670000px;} .y26{bottom:94.000000px;} .y47{bottom:94.130000px;} .y6b{bottom:96.730000px;} .y92{bottom:100.000000px;} .yc4{bottom:100.220000px;} .yed{bottom:100.780000px;} .yda{bottom:105.670000px;} .y6a{bottom:108.730000px;} .y25{bottom:110.000000px;} .y46{bottom:112.130000px;} .yc3{bottom:116.220000px;} .y91{bottom:118.000000px;} .yec{bottom:118.780000px;} .y10a{bottom:119.110000px;} .y24{bottom:126.000000px;} .y69{bottom:126.730000px;} .yc2{bottom:128.220000px;} .y45{bottom:130.130000px;} .yeb{bottom:130.780000px;} .y109{bottom:131.110000px;} .yac{bottom:131.560000px;} .y90{bottom:136.000000px;} .yc1{bottom:140.220000px;} .y23{bottom:142.000000px;} .y44{bottom:142.130000px;} .yea{bottom:142.780000px;} .y108{bottom:143.110000px;} .yab{bottom:143.560000px;} .y68{bottom:146.730000px;} .y22{bottom:154.000000px;} .yaa{bottom:155.560000px;} .yc0{bottom:156.220000px;} .y43{bottom:158.130000px;} .y107{bottom:161.110000px;} .y67{bottom:164.730000px;} .y8f{bottom:166.000000px;} .ybf{bottom:168.220000px;} .ya9{bottom:173.560000px;} .y42{bottom:174.130000px;} .ybe{bottom:180.220000px;} .y106{bottom:181.110000px;} .y8e{bottom:182.000000px;} .y66{bottom:182.730000px;} .y41{bottom:190.130000px;} .ya8{bottom:193.560000px;} .y8d{bottom:198.000000px;} .ybd{bottom:198.220000px;} .y105{bottom:199.110000px;} .y65{bottom:200.730000px;} .y40{bottom:206.130000px;} .ya7{bottom:211.560000px;} .y64{bottom:212.730000px;} .y8c{bottom:214.000000px;} .y104{bottom:217.110000px;} .ybc{bottom:218.220000px;} .y3f{bottom:222.130000px;} .y63{bottom:228.730000px;} .ya6{bottom:229.560000px;} .y8b{bottom:230.000000px;} .y103{bottom:235.110000px;} .ybb{bottom:236.220000px;} .y3e{bottom:238.130000px;} .y62{bottom:244.730000px;} .y8a{bottom:246.000000px;} .y102{bottom:247.110000px;} .ya5{bottom:247.560000px;} .y3d{bottom:250.130000px;} .yba{bottom:254.220000px;} .y89{bottom:258.000000px;} .ya4{bottom:259.560000px;} .y61{bottom:260.730000px;} .y3c{bottom:262.130000px;} .y101{bottom:263.110000px;} .y88{bottom:270.000000px;} .yb9{bottom:272.220000px;} .ya3{bottom:275.560000px;} .y60{bottom:276.730000px;} .y3b{bottom:278.130000px;} .y100{bottom:279.110000px;} .yb8{bottom:284.220000px;} .y87{bottom:286.000000px;} .ya2{bottom:291.560000px;} .y5f{bottom:292.730000px;} .y3a{bottom:294.130000px;} .yff{bottom:295.110000px;} .yb7{bottom:300.220000px;} .y86{bottom:302.000000px;} .y39{bottom:306.130000px;} .ya1{bottom:307.560000px;} .y5e{bottom:308.730000px;} .yfe{bottom:311.110000px;} .yb6{bottom:316.220000px;} .y85{bottom:318.000000px;} .ya0{bottom:323.560000px;} .y5d{bottom:324.730000px;} .yfd{bottom:327.110000px;} .yb5{bottom:332.220000px;} .y84{bottom:334.000000px;} .y9f{bottom:335.560000px;} .y5c{bottom:336.730000px;} .yfc{bottom:343.110000px;} .yd9{bottom:344.000000px;} .y83{bottom:346.000000px;} .y9e{bottom:347.560000px;} .yb4{bottom:348.220000px;} .y5b{bottom:348.730000px;} .yfb{bottom:355.110000px;} .yd8{bottom:356.000000px;} .y82{bottom:358.000000px;} .y5{bottom:358.500000px;} .yb3{bottom:360.220000px;} .y9d{bottom:363.560000px;} .y5a{bottom:364.730000px;} .yfa{bottom:367.110000px;} .yd7{bottom:368.000000px;} .yb2{bottom:372.220000px;} .ye9{bottom:372.670000px;} .y9c{bottom:375.560000px;} .y81{bottom:376.000000px;} .y59{bottom:380.730000px;} .y4{bottom:381.000000px;} .yf9{bottom:383.110000px;} .ye8{bottom:384.670000px;} .yd6{bottom:386.000000px;} .y9b{bottom:387.560000px;} .yb1{bottom:388.220000px;} .y58{bottom:392.730000px;} .y21{bottom:394.000000px;} .y80{bottom:396.000000px;} .ye7{bottom:396.670000px;} .yf8{bottom:399.110000px;} .y9a{bottom:403.560000px;} .yb0{bottom:404.220000px;} .y20{bottom:406.000000px;} .y3{bottom:411.000000px;} .yf7{bottom:411.110000px;} .y7f{bottom:414.000000px;} .ye6{bottom:414.670000px;} .y1f{bottom:418.000000px;} .y99{bottom:419.560000px;} .yaf{bottom:420.220000px;} .yf6{bottom:423.110000px;} .yd5{bottom:424.000000px;} .y7e{bottom:432.000000px;} .ye5{bottom:434.670000px;} .y98{bottom:435.560000px;} .y1e{bottom:436.000000px;} .yae{bottom:436.220000px;} .yf5{bottom:441.110000px;} .yd4{bottom:448.000000px;} .yad{bottom:448.220000px;} .y7d{bottom:450.000000px;} .y97{bottom:451.560000px;} .y57{bottom:452.000000px;} .ye4{bottom:452.670000px;} .y1d{bottom:456.000000px;} .yd3{bottom:460.000000px;} .yf4{bottom:461.110000px;} .y7c{bottom:462.000000px;} .y56{bottom:464.000000px;} .y96{bottom:467.560000px;} .ye3{bottom:470.670000px;} .y1c{bottom:474.000000px;} .y55{bottom:476.000000px;} .y7b{bottom:478.000000px;} .yf3{bottom:479.110000px;} .y95{bottom:479.560000px;} .ye2{bottom:488.670000px;} .y0{bottom:490.500000px;} .y1b{bottom:492.000000px;} .y54{bottom:494.000000px;} .yf2{bottom:497.110000px;} .ye1{bottom:506.670000px;} .yd2{bottom:508.000000px;} .y1a{bottom:510.000000px;} .y53{bottom:514.000000px;} .yf1{bottom:515.110000px;} .ye0{bottom:524.670000px;} .y7a{bottom:526.000000px;} .y19{bottom:528.000000px;} .y52{bottom:532.000000px;} .yf0{bottom:533.110000px;} .y18{bottom:540.000000px;} .y79{bottom:542.000000px;} .ydf{bottom:542.670000px;} .yd1{bottom:544.000000px;} .y51{bottom:550.000000px;} .yef{bottom:551.110000px;} .y17{bottom:556.000000px;} .y78{bottom:558.000000px;} .yde{bottom:560.670000px;} .yd0{bottom:562.000000px;} .y50{bottom:568.000000px;} .yee{bottom:569.110000px;} .y77{bottom:570.000000px;} .y16{bottom:572.000000px;} .y4f{bottom:580.000000px;} .y38{bottom:582.000000px;} .y15{bottom:588.000000px;} .y37{bottom:594.000000px;} .y4e{bottom:596.000000px;} .y76{bottom:598.000000px;} .y14{bottom:604.000000px;} .y36{bottom:606.000000px;} .y4d{bottom:612.000000px;} .y75{bottom:614.000000px;} .ycf{bottom:616.000000px;} .y13{bottom:620.000000px;} .y35{bottom:624.000000px;} .y74{bottom:626.000000px;} .y4c{bottom:628.000000px;} .y12{bottom:632.000000px;} .yce{bottom:634.000000px;} .y2{bottom:636.000000px;} .y73{bottom:638.000000px;} .y11{bottom:644.000000px;} .ycd{bottom:652.000000px;} .y72{bottom:656.000000px;} .y10{bottom:660.000000px;} .y34{bottom:662.000000px;} .ycc{bottom:670.000000px;} .yf{bottom:672.000000px;} .y4b{bottom:676.000000px;} .y33{bottom:680.000000px;} .ye{bottom:684.000000px;} .y4a{bottom:688.000000px;} .y71{bottom:694.000000px;} .y32{bottom:698.000000px;} .yd{bottom:700.000000px;} .ycb{bottom:706.000000px;} .y31{bottom:710.000000px;} .y70{bottom:712.000000px;} .yc{bottom:716.000000px;} .yca{bottom:724.000000px;} .y30{bottom:726.000000px;} .y6f{bottom:730.000000px;} .yb{bottom:732.000000px;} .y2f{bottom:742.000000px;} .ya{bottom:748.000000px;} .y2e{bottom:758.000000px;} .yc9{bottom:760.000000px;} .y9{bottom:764.000000px;} .y2d{bottom:774.000000px;} .y1{bottom:776.000000px;} .yc8{bottom:778.000000px;} .y8{bottom:788.000000px;} .y2c{bottom:790.000000px;} .y2a{bottom:808.000000px;} .h6{height:56.367840px;} .h7{height:59.156250px;} .h4{height:69.015625px;} .h3{height:70.459800px;} .h2{height:93.946400px;} .h1{height:130.500000px;} .h5{height:770.500000px;} .h0{height:842.000000px;} .w1{width:456.500000px;} .w2{width:523.500000px;} .w0{width:595.000000px;} .x1{left:36.000000px;} .x0{left:69.500000px;} .x2{left:71.340000px;} .x5{left:241.810000px;} .x4{left:245.000000px;} .x3{left:254.980000px;} .x7{left:543.660000px;} .x6{left:550.330000px;} @media print{ .v0{vertical-align:0.000000pt;} .ls0{letter-spacing:0.000000pt;} .ws0{word-spacing:0.000000pt;} .fs3{font-size:64.000000pt;} .fs2{font-size:74.666667pt;} .fs1{font-size:80.000000pt;} .fs0{font-size:106.666667pt;} .y6{bottom:22.666667pt;} .y2b{bottom:29.333333pt;} .y7{bottom:47.333333pt;} .yc7{bottom:69.626667pt;} .y6e{bottom:70.306667pt;} .y29{bottom:72.000000pt;} .y49{bottom:74.840000pt;} .y94{bottom:82.666667pt;} .ydd{bottom:84.893333pt;} .yc6{bottom:90.960000pt;} .y6d{bottom:91.640000pt;} .y28{bottom:93.333333pt;} .y48{bottom:101.506667pt;} .y93{bottom:106.666667pt;} .ydc{bottom:108.893333pt;} .y27{bottom:109.333333pt;} .yc5{bottom:112.293333pt;} .y6c{bottom:112.973333pt;} .ydb{bottom:124.893333pt;} .y26{bottom:125.333333pt;} .y47{bottom:125.506667pt;} .y6b{bottom:128.973333pt;} .y92{bottom:133.333333pt;} .yc4{bottom:133.626667pt;} .yed{bottom:134.373333pt;} .yda{bottom:140.893333pt;} .y6a{bottom:144.973333pt;} .y25{bottom:146.666667pt;} .y46{bottom:149.506667pt;} .yc3{bottom:154.960000pt;} .y91{bottom:157.333333pt;} .yec{bottom:158.373333pt;} .y10a{bottom:158.813333pt;} .y24{bottom:168.000000pt;} .y69{bottom:168.973333pt;} .yc2{bottom:170.960000pt;} .y45{bottom:173.506667pt;} .yeb{bottom:174.373333pt;} .y109{bottom:174.813333pt;} .yac{bottom:175.413333pt;} .y90{bottom:181.333333pt;} .yc1{bottom:186.960000pt;} .y23{bottom:189.333333pt;} .y44{bottom:189.506667pt;} .yea{bottom:190.373333pt;} .y108{bottom:190.813333pt;} .yab{bottom:191.413333pt;} .y68{bottom:195.640000pt;} .y22{bottom:205.333333pt;} .yaa{bottom:207.413333pt;} .yc0{bottom:208.293333pt;} .y43{bottom:210.840000pt;} .y107{bottom:214.813333pt;} .y67{bottom:219.640000pt;} .y8f{bottom:221.333333pt;} .ybf{bottom:224.293333pt;} .ya9{bottom:231.413333pt;} .y42{bottom:232.173333pt;} .ybe{bottom:240.293333pt;} .y106{bottom:241.480000pt;} .y8e{bottom:242.666667pt;} .y66{bottom:243.640000pt;} .y41{bottom:253.506667pt;} .ya8{bottom:258.080000pt;} .y8d{bottom:264.000000pt;} .ybd{bottom:264.293333pt;} .y105{bottom:265.480000pt;} .y65{bottom:267.640000pt;} .y40{bottom:274.840000pt;} .ya7{bottom:282.080000pt;} .y64{bottom:283.640000pt;} .y8c{bottom:285.333333pt;} .y104{bottom:289.480000pt;} .ybc{bottom:290.960000pt;} .y3f{bottom:296.173333pt;} .y63{bottom:304.973333pt;} .ya6{bottom:306.080000pt;} .y8b{bottom:306.666667pt;} .y103{bottom:313.480000pt;} .ybb{bottom:314.960000pt;} .y3e{bottom:317.506667pt;} .y62{bottom:326.306667pt;} .y8a{bottom:328.000000pt;} .y102{bottom:329.480000pt;} .ya5{bottom:330.080000pt;} .y3d{bottom:333.506667pt;} .yba{bottom:338.960000pt;} .y89{bottom:344.000000pt;} .ya4{bottom:346.080000pt;} .y61{bottom:347.640000pt;} .y3c{bottom:349.506667pt;} .y101{bottom:350.813333pt;} .y88{bottom:360.000000pt;} .yb9{bottom:362.960000pt;} .ya3{bottom:367.413333pt;} .y60{bottom:368.973333pt;} .y3b{bottom:370.840000pt;} .y100{bottom:372.146667pt;} .yb8{bottom:378.960000pt;} .y87{bottom:381.333333pt;} .ya2{bottom:388.746667pt;} .y5f{bottom:390.306667pt;} .y3a{bottom:392.173333pt;} .yff{bottom:393.480000pt;} .yb7{bottom:400.293333pt;} .y86{bottom:402.666667pt;} .y39{bottom:408.173333pt;} .ya1{bottom:410.080000pt;} .y5e{bottom:411.640000pt;} .yfe{bottom:414.813333pt;} .yb6{bottom:421.626667pt;} .y85{bottom:424.000000pt;} .ya0{bottom:431.413333pt;} .y5d{bottom:432.973333pt;} .yfd{bottom:436.146667pt;} .yb5{bottom:442.960000pt;} .y84{bottom:445.333333pt;} .y9f{bottom:447.413333pt;} .y5c{bottom:448.973333pt;} .yfc{bottom:457.480000pt;} .yd9{bottom:458.666667pt;} .y83{bottom:461.333333pt;} .y9e{bottom:463.413333pt;} .yb4{bottom:464.293333pt;} .y5b{bottom:464.973333pt;} .yfb{bottom:473.480000pt;} .yd8{bottom:474.666667pt;} .y82{bottom:477.333333pt;} .y5{bottom:478.000000pt;} .yb3{bottom:480.293333pt;} .y9d{bottom:484.746667pt;} .y5a{bottom:486.306667pt;} .yfa{bottom:489.480000pt;} .yd7{bottom:490.666667pt;} .yb2{bottom:496.293333pt;} .ye9{bottom:496.893333pt;} .y9c{bottom:500.746667pt;} .y81{bottom:501.333333pt;} .y59{bottom:507.640000pt;} .y4{bottom:508.000000pt;} .yf9{bottom:510.813333pt;} .ye8{bottom:512.893333pt;} .yd6{bottom:514.666667pt;} .y9b{bottom:516.746667pt;} .yb1{bottom:517.626667pt;} .y58{bottom:523.640000pt;} .y21{bottom:525.333333pt;} .y80{bottom:528.000000pt;} .ye7{bottom:528.893333pt;} .yf8{bottom:532.146667pt;} .y9a{bottom:538.080000pt;} .yb0{bottom:538.960000pt;} .y20{bottom:541.333333pt;} .y3{bottom:548.000000pt;} .yf7{bottom:548.146667pt;} .y7f{bottom:552.000000pt;} .ye6{bottom:552.893333pt;} .y1f{bottom:557.333333pt;} .y99{bottom:559.413333pt;} .yaf{bottom:560.293333pt;} .yf6{bottom:564.146667pt;} .yd5{bottom:565.333333pt;} .y7e{bottom:576.000000pt;} .ye5{bottom:579.560000pt;} .y98{bottom:580.746667pt;} .y1e{bottom:581.333333pt;} .yae{bottom:581.626667pt;} .yf5{bottom:588.146667pt;} .yd4{bottom:597.333333pt;} .yad{bottom:597.626667pt;} .y7d{bottom:600.000000pt;} .y97{bottom:602.080000pt;} .y57{bottom:602.666667pt;} .ye4{bottom:603.560000pt;} .y1d{bottom:608.000000pt;} .yd3{bottom:613.333333pt;} .yf4{bottom:614.813333pt;} .y7c{bottom:616.000000pt;} .y56{bottom:618.666667pt;} .y96{bottom:623.413333pt;} .ye3{bottom:627.560000pt;} .y1c{bottom:632.000000pt;} .y55{bottom:634.666667pt;} .y7b{bottom:637.333333pt;} .yf3{bottom:638.813333pt;} .y95{bottom:639.413333pt;} .ye2{bottom:651.560000pt;} .y0{bottom:654.000000pt;} .y1b{bottom:656.000000pt;} .y54{bottom:658.666667pt;} .yf2{bottom:662.813333pt;} .ye1{bottom:675.560000pt;} .yd2{bottom:677.333333pt;} .y1a{bottom:680.000000pt;} .y53{bottom:685.333333pt;} .yf1{bottom:686.813333pt;} .ye0{bottom:699.560000pt;} .y7a{bottom:701.333333pt;} .y19{bottom:704.000000pt;} .y52{bottom:709.333333pt;} .yf0{bottom:710.813333pt;} .y18{bottom:720.000000pt;} .y79{bottom:722.666667pt;} .ydf{bottom:723.560000pt;} .yd1{bottom:725.333333pt;} .y51{bottom:733.333333pt;} .yef{bottom:734.813333pt;} .y17{bottom:741.333333pt;} .y78{bottom:744.000000pt;} .yde{bottom:747.560000pt;} .yd0{bottom:749.333333pt;} .y50{bottom:757.333333pt;} .yee{bottom:758.813333pt;} .y77{bottom:760.000000pt;} .y16{bottom:762.666667pt;} .y4f{bottom:773.333333pt;} .y38{bottom:776.000000pt;} .y15{bottom:784.000000pt;} .y37{bottom:792.000000pt;} .y4e{bottom:794.666667pt;} .y76{bottom:797.333333pt;} .y14{bottom:805.333333pt;} .y36{bottom:808.000000pt;} .y4d{bottom:816.000000pt;} .y75{bottom:818.666667pt;} .ycf{bottom:821.333333pt;} .y13{bottom:826.666667pt;} .y35{bottom:832.000000pt;} .y74{bottom:834.666667pt;} .y4c{bottom:837.333333pt;} .y12{bottom:842.666667pt;} .yce{bottom:845.333333pt;} .y2{bottom:848.000000pt;} .y73{bottom:850.666667pt;} .y11{bottom:858.666667pt;} .ycd{bottom:869.333333pt;} .y72{bottom:874.666667pt;} .y10{bottom:880.000000pt;} .y34{bottom:882.666667pt;} .ycc{bottom:893.333333pt;} .yf{bottom:896.000000pt;} .y4b{bottom:901.333333pt;} .y33{bottom:906.666667pt;} .ye{bottom:912.000000pt;} .y4a{bottom:917.333333pt;} .y71{bottom:925.333333pt;} .y32{bottom:930.666667pt;} .yd{bottom:933.333333pt;} .ycb{bottom:941.333333pt;} .y31{bottom:946.666667pt;} .y70{bottom:949.333333pt;} .yc{bottom:954.666667pt;} .yca{bottom:965.333333pt;} .y30{bottom:968.000000pt;} .y6f{bottom:973.333333pt;} .yb{bottom:976.000000pt;} .y2f{bottom:989.333333pt;} .ya{bottom:997.333333pt;} .y2e{bottom:1010.666667pt;} .yc9{bottom:1013.333333pt;} .y9{bottom:1018.666667pt;} .y2d{bottom:1032.000000pt;} .y1{bottom:1034.666667pt;} .yc8{bottom:1037.333333pt;} .y8{bottom:1050.666667pt;} .y2c{bottom:1053.333333pt;} .y2a{bottom:1077.333333pt;} .h6{height:75.157120pt;} .h7{height:78.875000pt;} .h4{height:92.020833pt;} .h3{height:93.946400pt;} .h2{height:125.261866pt;} .h1{height:174.000000pt;} .h5{height:1027.333333pt;} .h0{height:1122.666667pt;} .w1{width:608.666667pt;} .w2{width:698.000000pt;} .w0{width:793.333333pt;} .x1{left:48.000000pt;} .x0{left:92.666667pt;} .x2{left:95.120000pt;} .x5{left:322.413333pt;} .x4{left:326.666667pt;} .x3{left:339.973333pt;} .x7{left:724.880000pt;} .x6{left:733.773333pt;} }
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Fri Mar 06 22:11:53 CST 2015 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class org.apache.hadoop.oncrpc.SimpleTcpServer (Apache Hadoop NFS 2.3.0 API) </TITLE> <META NAME="date" CONTENT="2015-03-06"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.hadoop.oncrpc.SimpleTcpServer (Apache Hadoop NFS 2.3.0 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/oncrpc/SimpleTcpServer.html" title="class in org.apache.hadoop.oncrpc"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/oncrpc//class-useSimpleTcpServer.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="SimpleTcpServer.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>org.apache.hadoop.oncrpc.SimpleTcpServer</B></H2> </CENTER> No usage of org.apache.hadoop.oncrpc.SimpleTcpServer <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/oncrpc/SimpleTcpServer.html" title="class in org.apache.hadoop.oncrpc"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/oncrpc//class-useSimpleTcpServer.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="SimpleTcpServer.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2015 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved. </BODY> </HTML>
Java
#ifndef QIGTLIODEVICEWIDGET_H #define QIGTLIODEVICEWIDGET_H #include <QWidget> // igtlio includes #include "igtlioGUIExport.h" #include <vtkSmartPointer.h> #include <vtkObject.h> #include "qIGTLIOVtkConnectionMacro.h" typedef vtkSmartPointer<class igtlioDevice> igtlioDevicePointer; class qIGTLIODeviceWidget; class OPENIGTLINKIO_GUI_EXPORT vtkIGTLIODeviceWidgetCreator : public vtkObject { public: // Create an instance of the specific device widget, with the given device_id virtual qIGTLIODeviceWidget* Create() = 0; // Return the device_type this factory creates device widgets for. virtual std::string GetDeviceType() const = 0; vtkAbstractTypeMacro(vtkIGTLIODeviceWidgetCreator,vtkObject); }; //--------------------------------------------------------------------------- class OPENIGTLINKIO_GUI_EXPORT qIGTLIODeviceWidget : public QWidget { Q_OBJECT IGTLIO_QVTK_OBJECT public: qIGTLIODeviceWidget(QWidget* parent=NULL); virtual void SetDevice(igtlioDevicePointer device); protected: igtlioDevicePointer Device; virtual void setupUi() = 0; protected slots: virtual void onDeviceModified() = 0; }; #endif // QIGTLIODEVICEWIDGET_H
Java
angular.module('ssAuth').factory('SessionService', ['$http', '$cookies', '$q', function($http, $cookies, $q){ var currentUser = {}; var currentFetch; currentUser.isAdmin = function() { return currentUser && currentUser.groups && currentUser.groups['Admins']; }; var getCurrentUser = function(forceUpdate) { var deferred = $q.defer(); if(forceUpdate) { return fetchUpdatedUser(); } if(currentUser.lastUpdated) { var diffMS = (new Date()).getTime() - new Date(currentUser.lastUpdated).getTime(); var diffMin = ((diffMS/60)/60); if(diffMin < 5) { deferred.resolve(currentUser); return deferred.promise; } } return fetchUpdatedUser(); }; var restoreFromCookie = function() { var cookie = $cookies['ag-user']; if(!cookie) return; var user = JSON.parse(cookie); angular.extend(currentUser, user); return currentUser; }; var saveToCookie = function() { $cookies['ag-user'] = JSON.stringify(currentUser); }; var fetchUpdatedUser = function() { //we've already made a call for the current user //just hold your horses if(currentFetch) { return currentFetch; } var deferred = $q.defer(); currentFetch = deferred.promise; $http.get('/session').success(function(user){ angular.extend(currentUser, user); currentUser.lastUpdated = new Date(); saveToCookie(); deferred.resolve(currentUser); currentFetch = undefined; }); return deferred.promise; }; return { getCurrentUser: getCurrentUser, restore: restoreFromCookie, userUpdated: currentUser.lastUpdated }; }]);
Java
/** * @license Copyright 2017 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ 'use strict'; /* eslint-env mocha */ const OptimizedImages = require('../../../../gather/gatherers/dobetterweb/optimized-images'); const assert = require('assert'); let options; let optimizedImages; const fakeImageStats = { jpeg: {base64: 100, binary: 80}, webp: {base64: 80, binary: 60}, }; const traceData = { networkRecords: [ { _url: 'http://google.com/image.jpg', _mimeType: 'image/jpeg', _resourceSize: 10000, _resourceType: {_name: 'image'}, finished: true, }, { _url: 'http://google.com/transparent.png', _mimeType: 'image/png', _resourceSize: 11000, _resourceType: {_name: 'image'}, finished: true, }, { _url: 'http://google.com/image.bmp', _mimeType: 'image/bmp', _resourceSize: 12000, _resourceType: {_name: 'image'}, finished: true, }, { _url: 'http://google.com/image.bmp', _mimeType: 'image/bmp', _resourceSize: 12000, _resourceType: {_name: 'image'}, finished: true, }, { _url: 'http://google.com/vector.svg', _mimeType: 'image/svg+xml', _resourceSize: 13000, _resourceType: {_name: 'image'}, finished: true, }, { _url: 'http://gmail.com/image.jpg', _mimeType: 'image/jpeg', _resourceSize: 15000, _resourceType: {_name: 'image'}, finished: true, }, { _url: 'data: image/jpeg ; base64 ,SgVcAT32587935321...', _mimeType: 'image/jpeg', _resourceType: {_name: 'image'}, _resourceSize: 14000, finished: true, }, { _url: 'http://google.com/big-image.bmp', _mimeType: 'image/bmp', _resourceType: {_name: 'image'}, _resourceSize: 12000, finished: false, // ignore for not finishing }, { _url: 'http://google.com/not-an-image.bmp', _mimeType: 'image/bmp', _resourceType: {_name: 'document'}, // ignore for not really being an image _resourceSize: 12000, finished: true, }, ], }; describe('Optimized images', () => { // Reset the Gatherer before each test. beforeEach(() => { optimizedImages = new OptimizedImages(); options = { url: 'http://google.com/', driver: { evaluateAsync: function() { return Promise.resolve(fakeImageStats); }, sendCommand: function() { return Promise.reject(new Error('wasn\'t found')); }, }, }; }); it('returns all images', () => { return optimizedImages.afterPass(options, traceData).then(artifact => { assert.equal(artifact.length, 4); assert.ok(/image.jpg/.test(artifact[0].url)); assert.ok(/transparent.png/.test(artifact[1].url)); assert.ok(/image.bmp/.test(artifact[2].url)); // skip cross-origin for now // assert.ok(/gmail.*image.jpg/.test(artifact[3].url)); assert.ok(/data: image/.test(artifact[3].url)); }); }); it('computes sizes', () => { const checkSizes = (stat, original, webp, jpeg) => { assert.equal(stat.originalSize, original); assert.equal(stat.webpSize, webp); assert.equal(stat.jpegSize, jpeg); }; return optimizedImages.afterPass(options, traceData).then(artifact => { assert.equal(artifact.length, 4); checkSizes(artifact[0], 10000, 60, 80); checkSizes(artifact[1], 11000, 60, 80); checkSizes(artifact[2], 12000, 60, 80); // skip cross-origin for now // checkSizes(artifact[3], 15000, 60, 80); checkSizes(artifact[3], 20, 80, 100); // uses base64 data }); }); it('handles partial driver failure', () => { let calls = 0; options.driver.evaluateAsync = () => { calls++; if (calls > 2) { return Promise.reject(new Error('whoops driver failed')); } else { return Promise.resolve(fakeImageStats); } }; return optimizedImages.afterPass(options, traceData).then(artifact => { const failed = artifact.find(record => record.failed); assert.equal(artifact.length, 4); assert.ok(failed, 'passed along failure'); assert.ok(/whoops/.test(failed.err.message), 'passed along error message'); }); }); it('supports Audits.getEncodedResponse', () => { options.driver.sendCommand = (method, params) => { const encodedSize = params.encoding === 'webp' ? 60 : 80; return Promise.resolve({encodedSize}); }; return optimizedImages.afterPass(options, traceData).then(artifact => { assert.equal(artifact.length, 5); assert.equal(artifact[0].originalSize, 10000); assert.equal(artifact[0].webpSize, 60); assert.equal(artifact[0].jpegSize, 80); // supports cross-origin assert.ok(/gmail.*image.jpg/.test(artifact[3].url)); }); }); });
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Thu Mar 08 14:17:41 MST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>org.wildfly.swarm.microprofile.health.detect (BOM: * : All 2018.3.3 API)</title> <meta name="date" content="2018-03-08"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <h1 class="bar"><a href="../../../../../../org/wildfly/swarm/microprofile/health/detect/package-summary.html" target="classFrame">org.wildfly.swarm.microprofile.health.detect</a></h1> <div class="indexContainer"> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="HealthPackageDetector.html" title="class in org.wildfly.swarm.microprofile.health.detect" target="classFrame">HealthPackageDetector</a></li> </ul> </div> </body> </html>
Java
<!DOCTYPE html> <meta charset=utf-8> <title>Redirecting...</title> <link rel=canonical href="../泥/index.html"> <meta http-equiv=refresh content="0; url='../泥/index.html'"> <h1>Redirecting...</h1> <a href="../泥/index.html">Click here if you are not redirected.</a> <script>location='../泥/index.html'</script>
Java
#!/bin/bash set -e docker version # Install docker-compose sudo rm -f /usr/local/bin/docker-compose curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /tmp/docker-compose chmod +x /tmp/docker-compose sudo mv /tmp/docker-compose /usr/local/bin docker-compose version
Java
package smartchess object square { type TSquare = Int type TFile = Int type TRank = Int val BOARD_SIZE_SHIFT = 3 val BOARD_SIZE = 1 << BOARD_SIZE_SHIFT val HALF_BOARD_SIZE = BOARD_SIZE / 2 val HALF_BOARD_SIZE_MINUS_ONE = HALF_BOARD_SIZE - 1 val BOARD_AREA_SHIFT = BOARD_SIZE_SHIFT * 2 val BOARD_AREA = BOARD_SIZE * BOARD_SIZE val BOARD_MASK = BOARD_SIZE - 1 val RANK_MASK = BOARD_MASK << BOARD_SIZE_SHIFT val FILE_MASK = BOARD_MASK val NO_SQUARE = 1 << BOARD_AREA_SHIFT val DARK = 0 val LIGHT = 1 def algebFileToFile(c: Char): TFile = c - 'a' def algebRankToRank(c: Char): TRank = '8' - c def fromFileRank(f: TFile, r: TRank): TSquare = { if ((!fileOk(f)) || (!rankOk(r))) return NO_SQUARE f + (r << BOARD_SIZE_SHIFT) } def fromAlgeb(algeb: String): TSquare = { if (algeb.length < 2) return NO_SQUARE val f = algebFileToFile(algeb(0)) val r = algebRankToRank(algeb(1)) if (fileRankOk(f, r)) { f | (r << 3) } else { NO_SQUARE } } def fileOf(s: TSquare): TFile = (s & FILE_MASK) def rankOf(s: TSquare): TRank = (s & RANK_MASK) >> BOARD_SIZE_SHIFT def fileOk(f: TFile): Boolean = (f >= 0) && (f < BOARD_SIZE) def rankOk(r: TRank): Boolean = (r >= 0) && (r < BOARD_SIZE) def fileRankOk(f: TFile, r: TRank): Boolean = fileOk(f) && rankOk(r) def squareOk(s: TSquare): Boolean = { if (s < 0) return false if (s >= BOARD_AREA) return false true } def fileToAlgebFile(f: TFile): Char = ('a'.toInt + f).toChar def rankToAlgebRank(r: TRank): Char = ('8'.toInt - r).toChar def isCentralRank(r: TRank): Boolean = ((r == HALF_BOARD_SIZE) || (r == HALF_BOARD_SIZE_MINUS_ONE)) def isCentralFile(f: TFile): Boolean = ((f == HALF_BOARD_SIZE) || (f == HALF_BOARD_SIZE_MINUS_ONE)) def colorIndexOf(sq: TSquare): Int = (1 - (fileOf(sq) + rankOf(sq)) % 2) def isCentralSquare(sq: TSquare): Boolean = { if (sq == NO_SQUARE) return false return isCentralFile(fileOf(sq)) && isCentralRank(rankOf(sq)) } def toAlgeb(s: TSquare): String = if (s != NO_SQUARE) "" + fileToAlgebFile(fileOf(s)) + rankToAlgebRank(rankOf(s)) else "-" }
Java