code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="ro"> <head> <!-- Generated by javadoc (version 1.7.0_07) on Tue May 27 14:37:24 EEST 2014 --> <title>Uses of Class net.sf.jasperreports.components.list.HorizontalFillList (JasperReports 5.6.0 API)</title> <meta name="date" content="2014-05-27"> <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 net.sf.jasperreports.components.list.HorizontalFillList (JasperReports 5.6.0 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../net/sf/jasperreports/components/list/HorizontalFillList.html" title="class in net.sf.jasperreports.components.list">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?net/sf/jasperreports/components/list/class-use/HorizontalFillList.html" target="_top">Frames</a></li> <li><a href="HorizontalFillList.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 net.sf.jasperreports.components.list.HorizontalFillList" class="title">Uses of Class<br>net.sf.jasperreports.components.list.HorizontalFillList</h2> </div> <div class="classUseContainer">No usage of net.sf.jasperreports.components.list.HorizontalFillList</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="../../../../../../net/sf/jasperreports/components/list/HorizontalFillList.html" title="class in net.sf.jasperreports.components.list">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?net/sf/jasperreports/components/list/class-use/HorizontalFillList.html" target="_top">Frames</a></li> <li><a href="HorizontalFillList.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <span style="font-decoration:none;font-family:Arial,Helvetica,sans-serif;font-size:8pt;font-style:normal;color:#000000;">&copy; 2001-2010 Jaspersoft Corporation <a href="http://www.jaspersoft.com" target="_blank" style="color:#000000;">www.jaspersoft.com</a></span> </small></p> </body> </html>
phurtado1112/cnaemvc
lib/JasperReport__5.6/docs/api/net/sf/jasperreports/components/list/class-use/HorizontalFillList.html
HTML
apache-2.0
4,741
package com.tamirhassan.pdfxtk.comparators; /** * pdfXtk - PDF Extraction Toolkit * Copyright (c) by the authors/contributors. All rights reserved. * This project includes code from PDFBox and TouchGraph. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the names pdfXtk or PDF Extraction Toolkit; nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE REGENTS 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. * * http://pdfxtk.sourceforge.net * */ import java.util.Comparator; import com.tamirhassan.pdfxtk.model.GenericSegment; /** * @author Tamir Hassan, [email protected] * @version PDF Analyser 0.9 * * Sorts on Xmid coordinate ((x1+x2)/2) */ public class XmidComparator implements Comparator<GenericSegment> { public int compare(GenericSegment obj1, GenericSegment obj2) { // sorts in x order double x1 = obj1.getXmid(); double x2 = obj2.getXmid(); // causes a contract violation (rounding?) // return (int) (x1 - x2); if (x2 > x1) return -1; else if (x2 == x1) return 0; else return 1; } public boolean equals(Object obj) { return obj.equals(this); } }
tamirhassan/pdfxtk
src/com/tamirhassan/pdfxtk/comparators/XmidComparator.java
Java
apache-2.0
2,438
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Generated by the Codegen C++ plugin. // If you make any local changes, they will be lost. // source: google/cloud/ids/v1/ids.proto #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_OPTIONS_H #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_OPTIONS_H #include "google/cloud/ids/ids_connection.h" #include "google/cloud/ids/ids_connection_idempotency_policy.h" #include "google/cloud/backoff_policy.h" #include "google/cloud/options.h" #include "google/cloud/version.h" #include <memory> namespace google { namespace cloud { namespace ids { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN /// Option to use with `google::cloud::Options`. struct IDSRetryPolicyOption { using Type = std::shared_ptr<IDSRetryPolicy>; }; /// Option to use with `google::cloud::Options`. struct IDSBackoffPolicyOption { using Type = std::shared_ptr<BackoffPolicy>; }; /// Option to use with `google::cloud::Options`. struct IDSPollingPolicyOption { using Type = std::shared_ptr<PollingPolicy>; }; /// Option to use with `google::cloud::Options`. struct IDSConnectionIdempotencyPolicyOption { using Type = std::shared_ptr<IDSConnectionIdempotencyPolicy>; }; using IDSPolicyOptionList = OptionList<IDSRetryPolicyOption, IDSBackoffPolicyOption, IDSPollingPolicyOption, IDSConnectionIdempotencyPolicyOption>; GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace ids } // namespace cloud } // namespace google #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_IDS_IDS_OPTIONS_H
googleapis/google-cloud-cpp
google/cloud/ids/ids_options.h
C
apache-2.0
2,058
# Bartramia nothostricta Catcheside, 1987 SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Bryophyta/Bryopsida/Bryales/Bartramiaceae/Bartramia/Bartramia nothostricta/README.md
Markdown
apache-2.0
197
/** * Copyright (C) 2015 meltmedia ([email protected]) * * 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.meltmedia.dropwizard.etcd.json; import java.util.concurrent.ScheduledExecutorService; import java.util.function.Function; import java.util.function.Supplier; import com.codahale.metrics.MetricRegistry; import mousio.etcd4j.EtcdClient; import io.dropwizard.Configuration; import io.dropwizard.ConfiguredBundle; import io.dropwizard.setup.Bootstrap; import io.dropwizard.setup.Environment; public class EtcdJsonBundle<C extends Configuration> implements ConfiguredBundle<C> { public static class Builder<C extends Configuration> { private Supplier<EtcdClient> client; private Supplier<ScheduledExecutorService> executor; private Function<C, String> directoryAccessor; public Builder<C> withClient(Supplier<EtcdClient> client) { this.client = client; return this; } public Builder<C> withExecutor(Supplier<ScheduledExecutorService> executor) { this.executor = executor; return this; } public Builder<C> withDirectory(Function<C, String> directoryAccessor) { this.directoryAccessor = directoryAccessor; return this; } public EtcdJsonBundle<C> build() { return new EtcdJsonBundle<C>(client, executor, directoryAccessor); } } public static <C extends Configuration> Builder<C> builder() { return new Builder<C>(); } Supplier<EtcdClient> clientSupplier; EtcdJson factory; private Supplier<ScheduledExecutorService> executor; private Function<C, String> directoryAccessor; public EtcdJsonBundle(Supplier<EtcdClient> client, Supplier<ScheduledExecutorService> executor, Function<C, String> directoryAccessor) { this.clientSupplier = client; this.executor = executor; this.directoryAccessor = directoryAccessor; } @Override public void initialize(Bootstrap<?> bootstrap) { } @Override public void run(C configuration, Environment environment) throws Exception { factory = EtcdJson.builder().withClient(clientSupplier).withExecutor(executor.get()) .withBaseDirectory(directoryAccessor.apply(configuration)) .withMapper(environment.getObjectMapper()) .withMetricRegistry(environment.metrics()).build(); environment.lifecycle().manage(new EtcdJsonManager(factory)); environment.healthChecks().register("etcd-watch", new WatchServiceHealthCheck(factory.getWatchService())); } public EtcdJson getFactory() { return this.factory; } }
meltmedia/dropwizard-etcd
bundle/src/main/java/com/meltmedia/dropwizard/etcd/json/EtcdJsonBundle.java
Java
apache-2.0
3,068
# Cryptococcus cylindricus Á. Fonseca, Scorzetti & Fell SPECIES #### Status ACCEPTED #### According to Index Fungorum #### Published in Can. J. Microbiol. 46(1): 22 (2000) #### Original name Cryptococcus cylindricus Á. Fonseca, Scorzetti & Fell ### Remarks null
mdoering/backbone
life/Fungi/Basidiomycota/Tremellomycetes/Tremellales/Tremellaceae/Cryptococcus/Cryptococcus cylindricus/README.md
Markdown
apache-2.0
268
# BOESG-website Public facing website for British Open Educational Software Group at http://www.boesg.org.uk. ### Note for Contributors Deployment is automated upon merge to the master branch via CI. Please raise PRs against the dev branch.
British-Open-Educational-Software-Group/BOESG-Website
README.md
Markdown
apache-2.0
243
import com.google.common.base.Function; import javax.annotation.Nullable; /** * Created by ckale on 10/29/14. */ public class DateValueSortFunction implements Function<PojoDTO, Long>{ @Nullable @Override public Long apply(@Nullable final PojoDTO input) { return input.getDateTime().getMillis(); } }
chax0r/PlayGround
playGround/src/main/java/DateValueSortFunction.java
Java
apache-2.0
329
package ru.stqa.javacourse.mantis.tests; import org.testng.annotations.Test; import ru.stqa.javacourse.mantis.model.Issue; import ru.stqa.javacourse.mantis.model.Project; import javax.xml.rpc.ServiceException; import java.net.MalformedURLException; import java.rmi.RemoteException; import java.util.Set; import static org.testng.Assert.assertEquals; public class SoapTest extends TestBase { @Test public void testGetProjects() throws MalformedURLException, ServiceException, RemoteException { Set<Project> projects = app.soap().getProjects(); System.out.println(projects.size()); for (Project project : projects) { System.out.println(project.getName()); } } @Test public void testCreateIssue() throws RemoteException, ServiceException, MalformedURLException { Set<Project> projects = app.soap().getProjects(); Issue issue=new Issue().withSummary("test issue") .withDescription("test issue description").withProject(projects.iterator().next()); Issue created = app.soap().addIssue(issue); assertEquals(issue.getSummary(),created.getSummary()); } }
Olbar/courseJava
mantis-tests/src/test/java/ru/stqa/javacourse/mantis/tests/SoapTest.java
Java
apache-2.0
1,172
# Belonidium tremulae var. ulmaceum Velen. VARIETY #### Status ACCEPTED #### According to Index Fungorum #### Published in Monogr. Discom. Bohem. (Prague) 404 (1934) #### Original name Belonidium tremulae var. ulmaceum Velen. ### Remarks null
mdoering/backbone
life/Fungi/Ascomycota/Leotiomycetes/Helotiales/Hyaloscyphaceae/Belonidium/Belonidium tremulae/Belonidium tremulae ulmaceum/README.md
Markdown
apache-2.0
247
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/ads/googleads/v10/services/customer_conversion_goal_service.proto package com.google.ads.googleads.v10.services; /** * <pre> * A single operation (update) on a customer conversion goal. * </pre> * * Protobuf type {@code google.ads.googleads.v10.services.CustomerConversionGoalOperation} */ public final class CustomerConversionGoalOperation extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.ads.googleads.v10.services.CustomerConversionGoalOperation) CustomerConversionGoalOperationOrBuilder { private static final long serialVersionUID = 0L; // Use CustomerConversionGoalOperation.newBuilder() to construct. private CustomerConversionGoalOperation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private CustomerConversionGoalOperation() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new CustomerConversionGoalOperation(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private CustomerConversionGoalOperation( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { com.google.ads.googleads.v10.resources.CustomerConversionGoal.Builder subBuilder = null; if (operationCase_ == 1) { subBuilder = ((com.google.ads.googleads.v10.resources.CustomerConversionGoal) operation_).toBuilder(); } operation_ = input.readMessage(com.google.ads.googleads.v10.resources.CustomerConversionGoal.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((com.google.ads.googleads.v10.resources.CustomerConversionGoal) operation_); operation_ = subBuilder.buildPartial(); } operationCase_ = 1; break; } case 18: { com.google.protobuf.FieldMask.Builder subBuilder = null; if (updateMask_ != null) { subBuilder = updateMask_.toBuilder(); } updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(updateMask_); updateMask_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.ads.googleads.v10.services.CustomerConversionGoalServiceProto.internal_static_google_ads_googleads_v10_services_CustomerConversionGoalOperation_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.ads.googleads.v10.services.CustomerConversionGoalServiceProto.internal_static_google_ads_googleads_v10_services_CustomerConversionGoalOperation_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.ads.googleads.v10.services.CustomerConversionGoalOperation.class, com.google.ads.googleads.v10.services.CustomerConversionGoalOperation.Builder.class); } private int operationCase_ = 0; private java.lang.Object operation_; public enum OperationCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { UPDATE(1), OPERATION_NOT_SET(0); private final int value; private OperationCase(int value) { this.value = value; } /** * @param value The number of the enum to look for. * @return The enum associated with the given number. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static OperationCase valueOf(int value) { return forNumber(value); } public static OperationCase forNumber(int value) { switch (value) { case 1: return UPDATE; case 0: return OPERATION_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public OperationCase getOperationCase() { return OperationCase.forNumber( operationCase_); } public static final int UPDATE_MASK_FIELD_NUMBER = 2; private com.google.protobuf.FieldMask updateMask_; /** * <pre> * FieldMask that determines which resource fields are modified in an update. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 2;</code> * @return Whether the updateMask field is set. */ @java.lang.Override public boolean hasUpdateMask() { return updateMask_ != null; } /** * <pre> * FieldMask that determines which resource fields are modified in an update. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 2;</code> * @return The updateMask. */ @java.lang.Override public com.google.protobuf.FieldMask getUpdateMask() { return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; } /** * <pre> * FieldMask that determines which resource fields are modified in an update. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 2;</code> */ @java.lang.Override public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return getUpdateMask(); } public static final int UPDATE_FIELD_NUMBER = 1; /** * <pre> * Update operation: The customer conversion goal is expected to have a * valid resource name. * </pre> * * <code>.google.ads.googleads.v10.resources.CustomerConversionGoal update = 1;</code> * @return Whether the update field is set. */ @java.lang.Override public boolean hasUpdate() { return operationCase_ == 1; } /** * <pre> * Update operation: The customer conversion goal is expected to have a * valid resource name. * </pre> * * <code>.google.ads.googleads.v10.resources.CustomerConversionGoal update = 1;</code> * @return The update. */ @java.lang.Override public com.google.ads.googleads.v10.resources.CustomerConversionGoal getUpdate() { if (operationCase_ == 1) { return (com.google.ads.googleads.v10.resources.CustomerConversionGoal) operation_; } return com.google.ads.googleads.v10.resources.CustomerConversionGoal.getDefaultInstance(); } /** * <pre> * Update operation: The customer conversion goal is expected to have a * valid resource name. * </pre> * * <code>.google.ads.googleads.v10.resources.CustomerConversionGoal update = 1;</code> */ @java.lang.Override public com.google.ads.googleads.v10.resources.CustomerConversionGoalOrBuilder getUpdateOrBuilder() { if (operationCase_ == 1) { return (com.google.ads.googleads.v10.resources.CustomerConversionGoal) operation_; } return com.google.ads.googleads.v10.resources.CustomerConversionGoal.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (operationCase_ == 1) { output.writeMessage(1, (com.google.ads.googleads.v10.resources.CustomerConversionGoal) operation_); } if (updateMask_ != null) { output.writeMessage(2, getUpdateMask()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (operationCase_ == 1) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, (com.google.ads.googleads.v10.resources.CustomerConversionGoal) operation_); } if (updateMask_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getUpdateMask()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.ads.googleads.v10.services.CustomerConversionGoalOperation)) { return super.equals(obj); } com.google.ads.googleads.v10.services.CustomerConversionGoalOperation other = (com.google.ads.googleads.v10.services.CustomerConversionGoalOperation) obj; if (hasUpdateMask() != other.hasUpdateMask()) return false; if (hasUpdateMask()) { if (!getUpdateMask() .equals(other.getUpdateMask())) return false; } if (!getOperationCase().equals(other.getOperationCase())) return false; switch (operationCase_) { case 1: if (!getUpdate() .equals(other.getUpdate())) return false; break; case 0: default: } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasUpdateMask()) { hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; hash = (53 * hash) + getUpdateMask().hashCode(); } switch (operationCase_) { case 1: hash = (37 * hash) + UPDATE_FIELD_NUMBER; hash = (53 * hash) + getUpdate().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.ads.googleads.v10.services.CustomerConversionGoalOperation parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.ads.googleads.v10.services.CustomerConversionGoalOperation parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.ads.googleads.v10.services.CustomerConversionGoalOperation parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.ads.googleads.v10.services.CustomerConversionGoalOperation parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.ads.googleads.v10.services.CustomerConversionGoalOperation parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.ads.googleads.v10.services.CustomerConversionGoalOperation parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.ads.googleads.v10.services.CustomerConversionGoalOperation parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.ads.googleads.v10.services.CustomerConversionGoalOperation parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.google.ads.googleads.v10.services.CustomerConversionGoalOperation parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.google.ads.googleads.v10.services.CustomerConversionGoalOperation parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.google.ads.googleads.v10.services.CustomerConversionGoalOperation parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.ads.googleads.v10.services.CustomerConversionGoalOperation parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.ads.googleads.v10.services.CustomerConversionGoalOperation prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * A single operation (update) on a customer conversion goal. * </pre> * * Protobuf type {@code google.ads.googleads.v10.services.CustomerConversionGoalOperation} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:google.ads.googleads.v10.services.CustomerConversionGoalOperation) com.google.ads.googleads.v10.services.CustomerConversionGoalOperationOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.ads.googleads.v10.services.CustomerConversionGoalServiceProto.internal_static_google_ads_googleads_v10_services_CustomerConversionGoalOperation_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.ads.googleads.v10.services.CustomerConversionGoalServiceProto.internal_static_google_ads_googleads_v10_services_CustomerConversionGoalOperation_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.ads.googleads.v10.services.CustomerConversionGoalOperation.class, com.google.ads.googleads.v10.services.CustomerConversionGoalOperation.Builder.class); } // Construct using com.google.ads.googleads.v10.services.CustomerConversionGoalOperation.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); if (updateMaskBuilder_ == null) { updateMask_ = null; } else { updateMask_ = null; updateMaskBuilder_ = null; } operationCase_ = 0; operation_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.ads.googleads.v10.services.CustomerConversionGoalServiceProto.internal_static_google_ads_googleads_v10_services_CustomerConversionGoalOperation_descriptor; } @java.lang.Override public com.google.ads.googleads.v10.services.CustomerConversionGoalOperation getDefaultInstanceForType() { return com.google.ads.googleads.v10.services.CustomerConversionGoalOperation.getDefaultInstance(); } @java.lang.Override public com.google.ads.googleads.v10.services.CustomerConversionGoalOperation build() { com.google.ads.googleads.v10.services.CustomerConversionGoalOperation result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.ads.googleads.v10.services.CustomerConversionGoalOperation buildPartial() { com.google.ads.googleads.v10.services.CustomerConversionGoalOperation result = new com.google.ads.googleads.v10.services.CustomerConversionGoalOperation(this); if (updateMaskBuilder_ == null) { result.updateMask_ = updateMask_; } else { result.updateMask_ = updateMaskBuilder_.build(); } if (operationCase_ == 1) { if (updateBuilder_ == null) { result.operation_ = operation_; } else { result.operation_ = updateBuilder_.build(); } } result.operationCase_ = operationCase_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.ads.googleads.v10.services.CustomerConversionGoalOperation) { return mergeFrom((com.google.ads.googleads.v10.services.CustomerConversionGoalOperation)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.ads.googleads.v10.services.CustomerConversionGoalOperation other) { if (other == com.google.ads.googleads.v10.services.CustomerConversionGoalOperation.getDefaultInstance()) return this; if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } switch (other.getOperationCase()) { case UPDATE: { mergeUpdate(other.getUpdate()); break; } case OPERATION_NOT_SET: { break; } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.ads.googleads.v10.services.CustomerConversionGoalOperation parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.ads.googleads.v10.services.CustomerConversionGoalOperation) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int operationCase_ = 0; private java.lang.Object operation_; public OperationCase getOperationCase() { return OperationCase.forNumber( operationCase_); } public Builder clearOperation() { operationCase_ = 0; operation_ = null; onChanged(); return this; } private com.google.protobuf.FieldMask updateMask_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; /** * <pre> * FieldMask that determines which resource fields are modified in an update. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 2;</code> * @return Whether the updateMask field is set. */ public boolean hasUpdateMask() { return updateMaskBuilder_ != null || updateMask_ != null; } /** * <pre> * FieldMask that determines which resource fields are modified in an update. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 2;</code> * @return The updateMask. */ public com.google.protobuf.FieldMask getUpdateMask() { if (updateMaskBuilder_ == null) { return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; } else { return updateMaskBuilder_.getMessage(); } } /** * <pre> * FieldMask that determines which resource fields are modified in an update. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 2;</code> */ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { if (updateMaskBuilder_ == null) { if (value == null) { throw new NullPointerException(); } updateMask_ = value; onChanged(); } else { updateMaskBuilder_.setMessage(value); } return this; } /** * <pre> * FieldMask that determines which resource fields are modified in an update. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 2;</code> */ public Builder setUpdateMask( com.google.protobuf.FieldMask.Builder builderForValue) { if (updateMaskBuilder_ == null) { updateMask_ = builderForValue.build(); onChanged(); } else { updateMaskBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * FieldMask that determines which resource fields are modified in an update. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 2;</code> */ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { if (updateMaskBuilder_ == null) { if (updateMask_ != null) { updateMask_ = com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); } else { updateMask_ = value; } onChanged(); } else { updateMaskBuilder_.mergeFrom(value); } return this; } /** * <pre> * FieldMask that determines which resource fields are modified in an update. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 2;</code> */ public Builder clearUpdateMask() { if (updateMaskBuilder_ == null) { updateMask_ = null; onChanged(); } else { updateMask_ = null; updateMaskBuilder_ = null; } return this; } /** * <pre> * FieldMask that determines which resource fields are modified in an update. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 2;</code> */ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { onChanged(); return getUpdateMaskFieldBuilder().getBuilder(); } /** * <pre> * FieldMask that determines which resource fields are modified in an update. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 2;</code> */ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { if (updateMaskBuilder_ != null) { return updateMaskBuilder_.getMessageOrBuilder(); } else { return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; } } /** * <pre> * FieldMask that determines which resource fields are modified in an update. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> getUpdateMaskFieldBuilder() { if (updateMaskBuilder_ == null) { updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( getUpdateMask(), getParentForChildren(), isClean()); updateMask_ = null; } return updateMaskBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< com.google.ads.googleads.v10.resources.CustomerConversionGoal, com.google.ads.googleads.v10.resources.CustomerConversionGoal.Builder, com.google.ads.googleads.v10.resources.CustomerConversionGoalOrBuilder> updateBuilder_; /** * <pre> * Update operation: The customer conversion goal is expected to have a * valid resource name. * </pre> * * <code>.google.ads.googleads.v10.resources.CustomerConversionGoal update = 1;</code> * @return Whether the update field is set. */ @java.lang.Override public boolean hasUpdate() { return operationCase_ == 1; } /** * <pre> * Update operation: The customer conversion goal is expected to have a * valid resource name. * </pre> * * <code>.google.ads.googleads.v10.resources.CustomerConversionGoal update = 1;</code> * @return The update. */ @java.lang.Override public com.google.ads.googleads.v10.resources.CustomerConversionGoal getUpdate() { if (updateBuilder_ == null) { if (operationCase_ == 1) { return (com.google.ads.googleads.v10.resources.CustomerConversionGoal) operation_; } return com.google.ads.googleads.v10.resources.CustomerConversionGoal.getDefaultInstance(); } else { if (operationCase_ == 1) { return updateBuilder_.getMessage(); } return com.google.ads.googleads.v10.resources.CustomerConversionGoal.getDefaultInstance(); } } /** * <pre> * Update operation: The customer conversion goal is expected to have a * valid resource name. * </pre> * * <code>.google.ads.googleads.v10.resources.CustomerConversionGoal update = 1;</code> */ public Builder setUpdate(com.google.ads.googleads.v10.resources.CustomerConversionGoal value) { if (updateBuilder_ == null) { if (value == null) { throw new NullPointerException(); } operation_ = value; onChanged(); } else { updateBuilder_.setMessage(value); } operationCase_ = 1; return this; } /** * <pre> * Update operation: The customer conversion goal is expected to have a * valid resource name. * </pre> * * <code>.google.ads.googleads.v10.resources.CustomerConversionGoal update = 1;</code> */ public Builder setUpdate( com.google.ads.googleads.v10.resources.CustomerConversionGoal.Builder builderForValue) { if (updateBuilder_ == null) { operation_ = builderForValue.build(); onChanged(); } else { updateBuilder_.setMessage(builderForValue.build()); } operationCase_ = 1; return this; } /** * <pre> * Update operation: The customer conversion goal is expected to have a * valid resource name. * </pre> * * <code>.google.ads.googleads.v10.resources.CustomerConversionGoal update = 1;</code> */ public Builder mergeUpdate(com.google.ads.googleads.v10.resources.CustomerConversionGoal value) { if (updateBuilder_ == null) { if (operationCase_ == 1 && operation_ != com.google.ads.googleads.v10.resources.CustomerConversionGoal.getDefaultInstance()) { operation_ = com.google.ads.googleads.v10.resources.CustomerConversionGoal.newBuilder((com.google.ads.googleads.v10.resources.CustomerConversionGoal) operation_) .mergeFrom(value).buildPartial(); } else { operation_ = value; } onChanged(); } else { if (operationCase_ == 1) { updateBuilder_.mergeFrom(value); } updateBuilder_.setMessage(value); } operationCase_ = 1; return this; } /** * <pre> * Update operation: The customer conversion goal is expected to have a * valid resource name. * </pre> * * <code>.google.ads.googleads.v10.resources.CustomerConversionGoal update = 1;</code> */ public Builder clearUpdate() { if (updateBuilder_ == null) { if (operationCase_ == 1) { operationCase_ = 0; operation_ = null; onChanged(); } } else { if (operationCase_ == 1) { operationCase_ = 0; operation_ = null; } updateBuilder_.clear(); } return this; } /** * <pre> * Update operation: The customer conversion goal is expected to have a * valid resource name. * </pre> * * <code>.google.ads.googleads.v10.resources.CustomerConversionGoal update = 1;</code> */ public com.google.ads.googleads.v10.resources.CustomerConversionGoal.Builder getUpdateBuilder() { return getUpdateFieldBuilder().getBuilder(); } /** * <pre> * Update operation: The customer conversion goal is expected to have a * valid resource name. * </pre> * * <code>.google.ads.googleads.v10.resources.CustomerConversionGoal update = 1;</code> */ @java.lang.Override public com.google.ads.googleads.v10.resources.CustomerConversionGoalOrBuilder getUpdateOrBuilder() { if ((operationCase_ == 1) && (updateBuilder_ != null)) { return updateBuilder_.getMessageOrBuilder(); } else { if (operationCase_ == 1) { return (com.google.ads.googleads.v10.resources.CustomerConversionGoal) operation_; } return com.google.ads.googleads.v10.resources.CustomerConversionGoal.getDefaultInstance(); } } /** * <pre> * Update operation: The customer conversion goal is expected to have a * valid resource name. * </pre> * * <code>.google.ads.googleads.v10.resources.CustomerConversionGoal update = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.ads.googleads.v10.resources.CustomerConversionGoal, com.google.ads.googleads.v10.resources.CustomerConversionGoal.Builder, com.google.ads.googleads.v10.resources.CustomerConversionGoalOrBuilder> getUpdateFieldBuilder() { if (updateBuilder_ == null) { if (!(operationCase_ == 1)) { operation_ = com.google.ads.googleads.v10.resources.CustomerConversionGoal.getDefaultInstance(); } updateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.ads.googleads.v10.resources.CustomerConversionGoal, com.google.ads.googleads.v10.resources.CustomerConversionGoal.Builder, com.google.ads.googleads.v10.resources.CustomerConversionGoalOrBuilder>( (com.google.ads.googleads.v10.resources.CustomerConversionGoal) operation_, getParentForChildren(), isClean()); operation_ = null; } operationCase_ = 1; onChanged();; return updateBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.ads.googleads.v10.services.CustomerConversionGoalOperation) } // @@protoc_insertion_point(class_scope:google.ads.googleads.v10.services.CustomerConversionGoalOperation) private static final com.google.ads.googleads.v10.services.CustomerConversionGoalOperation DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.ads.googleads.v10.services.CustomerConversionGoalOperation(); } public static com.google.ads.googleads.v10.services.CustomerConversionGoalOperation getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<CustomerConversionGoalOperation> PARSER = new com.google.protobuf.AbstractParser<CustomerConversionGoalOperation>() { @java.lang.Override public CustomerConversionGoalOperation parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new CustomerConversionGoalOperation(input, extensionRegistry); } }; public static com.google.protobuf.Parser<CustomerConversionGoalOperation> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<CustomerConversionGoalOperation> getParserForType() { return PARSER; } @java.lang.Override public com.google.ads.googleads.v10.services.CustomerConversionGoalOperation getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
googleads/google-ads-java
google-ads-stubs-v10/src/main/java/com/google/ads/googleads/v10/services/CustomerConversionGoalOperation.java
Java
apache-2.0
36,172
.container { clear: both; } body { font-family: Verdana, Arial, sans-serif; } h3 { font-family: Verdana, Arial, sans-serif; font-size: 18px; line-height: normal; } a.button, span.button { margin-left:10px; height:36px; } #sides{ margin:0; height:144px; width: 100%; } #left{ float:left; width:144px; overflow:hidden; } #right{ float:left; width:50%; overflow:hidden; } #image-data { margin: 20px 0px; width: 300px !important; height: auto; } .inst_table, .inst_table th, .inst_table td { border: 1px solid black; border-collapse: collapse; text-align: center; } .bottom { margin-top: 10px; margin-left: 20px; margin-bottom: 40px; float: left; } label.error { margin-left: 10px; } select.error, textarea.error, input.error { outline-style: solid; outline-width: 2px; outline-color: #FF0000; } .ui-dialog { position: fixed !important; }
coderReview/NTL-ISS-Food-Intake-Tracker
Admin Tool/public/css/style.css
CSS
apache-2.0
960
/* * Copyright 2017-2022 John Snow Labs * * 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.johnsnowlabs.nlp import org.apache.spark.ml.param.BooleanParam trait HasCaseSensitiveProperties extends ParamsAndFeaturesWritable { /** Whether to ignore case in index lookups (Default depends on model) * * @group param */ val caseSensitive = new BooleanParam(this, "caseSensitive", "Whether to ignore case in index lookups") setDefault(caseSensitive, false) /** @group getParam */ def getCaseSensitive: Boolean = $(caseSensitive) /** @group setParam */ def setCaseSensitive(value: Boolean): this.type = set(this.caseSensitive, value) }
JohnSnowLabs/spark-nlp
src/main/scala/com/johnsnowlabs/nlp/HasCaseSensitiveProperties.scala
Scala
apache-2.0
1,182
package org.openjava.upay.web.domain; import java.util.List; public class TablePage<T> { private long start; private int length; private long recordsTotal; private long recordsFiltered; private List<T> data; public TablePage() { } public long getStart() { return start; } public void setStart(long start) { this.start = start; } public int getLength() { return length; } public void setLength(int length) { this.length = length; } public long getRecordsTotal() { return recordsTotal; } public void setRecordsTotal(long recordsTotal) { this.recordsTotal = recordsTotal; } public long getRecordsFiltered() { return recordsFiltered; } public void setRecordsFiltered(long recordsFiltered) { this.recordsFiltered = recordsFiltered; } public List<T> getData() { return data; } public void setData(List<T> data) { this.data = data; } public TablePage wrapData(long total, List<T> data) { this.recordsTotal = total; this.recordsFiltered = total; this.data = data; return this; } }
openjava2017/openjava-upay
upay-server/src/main/java/org/openjava/upay/web/domain/TablePage.java
Java
apache-2.0
1,263
<!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_24) on Tue Apr 26 20:40:28 CST 2011 --> <TITLE> com.numericalmethod.suanshu.optimization.constrained.linearprogramming.simplex.standard (SuanShu 1.3.1 API Documentation) </TITLE> <META NAME="date" CONTENT="2011-04-26"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../stylesheet.css" TITLE="Style"> </HEAD> <BODY BGCOLOR="white"> <FONT size="+1" CLASS="FrameTitleFont"> <A HREF="../../../../../../../../com/numericalmethod/suanshu/optimization/constrained/linearprogramming/simplex/standard/package-summary.html" target="classFrame">com.numericalmethod.suanshu.optimization.constrained.linearprogramming.simplex.standard</A></FONT> <TABLE BORDER="0" WIDTH="100%" SUMMARY=""> <TR> <TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> Classes</FONT>&nbsp; <FONT CLASS="FrameItemFont"> <BR> <A HREF="LpBoundedSolution.html" title="class in com.numericalmethod.suanshu.optimization.constrained.linearprogramming.simplex.standard" target="classFrame">LpBoundedSolution</A> <BR> <A HREF="LpUnboundedSolution.html" title="class in com.numericalmethod.suanshu.optimization.constrained.linearprogramming.simplex.standard" target="classFrame">LpUnboundedSolution</A> <BR> <A HREF="Phase2ByFerrisMangasarianWright.html" title="class in com.numericalmethod.suanshu.optimization.constrained.linearprogramming.simplex.standard" target="classFrame">Phase2ByFerrisMangasarianWright</A> <BR> <A HREF="StandardSimplex.html" title="class in com.numericalmethod.suanshu.optimization.constrained.linearprogramming.simplex.standard" target="classFrame">StandardSimplex</A></FONT></TD> </TR> </TABLE> </BODY> </HTML>
Aliced3645/DataCenterMarketing
suanshu-javadoc-1.3.1/com/numericalmethod/suanshu/optimization/constrained/linearprogramming/simplex/standard/package-frame.html
HTML
apache-2.0
1,831
# Eleocharis submersa Miq. SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Poales/Cyperaceae/Eleocharis/Eleocharis confervoides/ Syn. Eleocharis submersa/README.md
Markdown
apache-2.0
181
// This header file is deprecated in 3ds Max 2011. // Please use header file listed below. #include "..\maxscript\protocols\time.h"
LiangYue1981816/CrossEngine
Tools/MaxExporter/MaxSDKs/2011/include/maxscrpt/timepro.h
C
apache-2.0
132
# 10乡党 我们还有一篇没有讲的第十篇《乡党》。这一篇不补讲了。《乡党》这一篇,以现在观念来说,都是描述孔子的生活形态,以现代新闻报道的方式来看,也可以说是孔子生活的“花絮”,中间提到了孔子办外交的时候什么态度,对人的时候什么态度,上班的时候什么态度,开会的时候什么态度。这篇书过去的读书人看得很严重,现在看来是生活的艺术。孔子的学生们要为孔子立一个塑像,或演一出孔子的戏,就要拿这一篇好好研究了。 孔子于乡党,恂恂如也,似不能言者。其在宗庙朝廷,便便言,唯谨尔。 朝,与下大夫言,侃侃如也。与上大夫言,訚訚如也。君在,踧踖如也,与与如也。 君召使摈,色勃如也,足躩如也。揖所与立,左右手,衣前后,襜如也。趋进,翼如也。宾退,必复命,曰:宾不顾矣。 入公门,鞠躬如也,如不容。立不中门,行不履阈。过位,色勃如也,足躩如也,其言似不足者。摄齐升堂,鞠躬如也,屏气似不息者。出,降一等,逞颜色,怡怡如也。没阶,趋进,翼如也。复其位,踧踖如也。 执圭,鞠躬如也,如不胜,上如楫,下如授,勃如战色。足蹜蹜如有循。享礼,有容色。私觌,愉愉如也。 君子不以绀緅饰,红紫不以为亵服。当暑,袗絺绤,必表而出之。缁衣羔裘,素衣麂裘,黄衣狐裘,亵裘长,短右袂。必有寝衣,长一身有半。狐貉之厚以居。去丧,无所不佩。非惟裳,必杀之。羔裘亥冠,不以吊。吉月,必朝服而朝。 齐必有明衣,布。齐必变食,居必迁坐。 食不厌精,脍不厌细。食饐而餲,鱼馁而肉败,不食。色恶不食,臭恶不食。失饪不食,不时不食。割不正不食。不得其酱不食。肉虽多,不使胜食气。惟酒无量,不及乱。沽酒市脯不食。不撤姜食,不多食。祭于公,不宿肉。祭肉不出三日,出三日,不食之矣。食不语,寝不言。虽疏食菜羹瓜祭,必齐如也。 席不正不坐。 乡人饮酒,杖者出,斯出矣。乡人傩,朝服而立于阼阶。 问人于他邦。再拜而送之。康子馈药,拜而受之。曰:丘未达,不敢尝。 厩焚,子退朝,曰:伤人乎?不问马。 君赐食,必正席先尝之。君赐腥,必熟而荐之。君赐生,必畜之。侍食于君,君祭,先饭。疾,君视之,东首,加朝服拖绅。君命召,不俟驾行矣。 入太庙,每事问。 朋友死,无所归。曰:于我殡。朋友之馈,虽车马,非祭肉,不拜。 寝不尸,居不容。见齐衰者,虽狎必变。见冕者与瞽者,虽亵必以貌。凶服者式之。式负版者。有盛馔,必变色而作。迅雷,风烈必变。 升车,必正立执绥。车中不内顾,不疾言,不亲指。 色斯举矣。翔而后集。曰:山梁雌雉,时哉!时哉!子路共之,三嗅而作。 《乡党》的歇后语 现在讲这一篇书很难讲,要想讲得好,除非由人扮演出一个孔子,拍成电影。但能担任这角色的演员则很难,就像电影上的耶稣,很少出现他的正面,很难传神。有一个笑话,以前有一个老迂夫子,认为一个人只要做到《论语》里面一两句话,就终身受用无穷。当下就有一个年轻人说,我就做到了两句,老夫子马上改容相敬,立刻请教他做到了哪两句,年轻人说“食不厌精,脍不厌细”,我就完全照做了。这只是一个笑话。这些生活上的描写,都放在《乡党》篇中,这是说孔子的生活习惯,代表了他学问的精神,表示他的言行一致,这是《乡党》篇的第一个观念。而第二个观念,在以前看不出这篇的道理,现在我们看到年轻人,穿衣服不会穿,讲话不会讲,吃东西不会吃,走路也不会走,才知道《乡党》这一篇,把孔子的生活形态记下来,的确有道理。还有第三点,我们可以看到的,孔子是讲仁、讲孝、讲忠的,这也就反映出春秋战国时代,社会的人心太坏,不忠不孝,不仁不义的人太多了。同样的一个道理来看《乡党》,为什么把孔子的生活形态,记载得这么多?就是那个时代的青年和现在一样,生活的礼仪不知道,有学问的不一定处得合适,待人处世之间,什么立场应该什么态度?应该怎样说话?都不知道。就是现在,一般人以为美国人生活形态很随便,其实他们的上流社会、领导阶层,还是端端正正的打领带,服装整齐,还是非常讲礼。所以真正的学问,还是要自己用智慧去发掘。《乡党》这一篇,我们就不讨论了,全部《论语》就到此结束。 总之,万事都从作人开始,一个人生,无论做什么事业——做官、经商、做学者、做平民,都是要作人。事业的升沉成败,各有变化不同。但无论如何,总要作人。《乡党》一篇,记载孔子如何作人。后世的人们,敬重他的成就便尊称他所谓“圣人”。人人都可成圣,只看自己如何做到圣地的成就。
cdcdec/Lbooks
sinology/论语别裁/10乡党.md
Markdown
apache-2.0
5,335
package com.jy.controller.workflow.online.apply; import com.jy.common.ajax.AjaxRes; import com.jy.common.utils.DateUtils; import com.jy.common.utils.base.Const; import com.jy.common.utils.security.AccountShiroUtil; import com.jy.controller.base.BaseController; import com.jy.entity.attendance.WorkRecord; import com.jy.entity.oa.overtime.Overtime; import com.jy.entity.oa.patch.Patch; import com.jy.entity.oa.task.TaskInfo; import com.jy.service.oa.activiti.ActivitiDeployService; import com.jy.service.oa.overtime.OvertimeService; import com.jy.service.oa.patch.PatchService; import com.jy.service.oa.task.TaskInfoService; import org.activiti.engine.IdentityService; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; import org.activiti.engine.impl.persistence.entity.ExecutionEntity; import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.task.Task; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; /** * 补卡页面 */ @Controller @RequestMapping(value = "/backstage/workflow/online/patch/") public class PatchController extends BaseController<Object> { private static final String SECURITY_URL = "/backstage/workflow/online/patch/index"; @Autowired private RuntimeService runtimeService; @Autowired private TaskService taskService; @Autowired private TaskInfoService taskInfoService; @Autowired private IdentityService identityService; @Autowired private PatchService patchService; @Autowired private ActivitiDeployService activitiDeployService; /** * 补卡列表 */ @RequestMapping(value = "index") public String index(org.springframework.ui.Model model) { if (doSecurityIntercept(Const.RESOURCES_TYPE_MENU)) { model.addAttribute("permitBtn", getPermitBtn(Const.RESOURCES_TYPE_FUNCTION)); return "/system/workflow/online/apply/patch"; } return Const.NO_AUTHORIZED_URL; } /** * 启动流程 */ @RequestMapping(value = "start", method = RequestMethod.POST) @ResponseBody public AjaxRes startWorkflow(Patch o) { AjaxRes ar = getAjaxRes(); if (ar.setNoAuth(doSecurityIntercept(Const.RESOURCES_TYPE_MENU, SECURITY_URL))) { try { String currentUserId = AccountShiroUtil.getCurrentUser().getAccountId(); String[] approvers = o.getApprover().split(","); Map<String, Object> variables = new HashMap<String, Object>(); for (int i = 0; i < approvers.length; i++) { variables.put("approver" + (i + 1), approvers[i]); } String workflowKey = "patch"; identityService.setAuthenticatedUserId(currentUserId); Date now = new Date(); ProcessInstance processInstance = runtimeService.startProcessInstanceByKeyAndTenantId(workflowKey, variables, getCompany()); String pId = processInstance.getId(); String leaveID = get32UUID(); o.setPid(pId); o.setAccountId(currentUserId); o.setCreatetime(now); o.setIsvalid(0); o.setName(AccountShiroUtil.getCurrentUser().getName()); o.setId(leaveID); patchService.insert(o); Task task = taskService.createTaskQuery().processInstanceId(pId).singleResult(); String processDefinitionName = ((ExecutionEntity) processInstance).getProcessInstance().getProcessDefinition().getName(); String subkect = processDefinitionName + "-" + AccountShiroUtil.getCurrentUser().getName() + "-" + DateUtils.formatDate(now, "yyyy-MM-dd HH:mm"); //开始流程 TaskInfo taskInfo = new TaskInfo(); taskInfo.setId(get32UUID()); taskInfo.setBusinesskey(leaveID); taskInfo.setCode("start"); taskInfo.setName("发起申请"); taskInfo.setStatus(0); taskInfo.setPresentationsubject(subkect); taskInfo.setAttr1(processDefinitionName); taskInfo.setCreatetime(DateUtils.addSeconds(now, -1)); taskInfo.setCompletetime(DateUtils.addSeconds(now, -1)); taskInfo.setCreator(currentUserId); taskInfo.setAssignee(currentUserId); taskInfo.setTaskid("0"); taskInfo.setPkey(workflowKey); taskInfo.setExecutionid("0"); taskInfo.setProcessinstanceid(processInstance.getId()); taskInfo.setProcessdefinitionid(processInstance.getProcessDefinitionId()); taskInfoService.insert(taskInfo); //第一级审批流程 taskInfo.setId(get32UUID()); taskInfo.setCode(processInstance.getActivityId()); taskInfo.setName(task.getName()); taskInfo.setStatus(1); taskInfo.setTaskid(task.getId()); taskInfo.setCreatetime(now); taskInfo.setCompletetime(null); taskInfo.setAssignee(approvers[0]); taskInfoService.insert(taskInfo); ar.setSucceedMsg("发起补卡申请成功!"); } catch (Exception e) { logger.error(e.toString(), e); ar.setFailMsg("启动流程失败"); } finally { identityService.setAuthenticatedUserId(null); } } return ar; } }
futureskywei/whale
src/main/java/com/jy/controller/workflow/online/apply/PatchController.java
Java
apache-2.0
5,402
# grunt-tslint [![NPM version](https://badge.fury.io/js/grunt-tslint.svg)](https://www.npmjs.com/package/grunt-tslint) [![Downloads](http://img.shields.io/npm/dm/grunt-tslint.svg)](https://npmjs.org/package/grunt-tslint) > A grunt plugin for [tslint](https://github.com/palantir/tslint). ## Getting Started This plugin requires [Grunt](http://gruntjs.com/) `~0.4.1` and [tslint](https://github.com/palantir/tslint) `~4.0.0` ``` npm install grunt-tslint --save-dev ``` Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: ``` grunt.loadNpmTasks("grunt-tslint"); ``` ## The "tslint" task ### Overview In your project's `Gruntfile.js`, add a section named `tslint` to the data object passed into `grunt.initConfig()`: ```js grunt.initConfig({ tslint: { options: { // Task-specific options go here. }, your_target: { // Target-specific file lists and/or options go here. }, }, }) ``` ### Options * `options.configuration: Object | string` - A TSLint configuration; can either be a JSON configuration object or a path to a tslint.json config file. * `options.project: string` - `tsconfig.json` file location. If provided type checking will be enabled. * `options.force: boolean` - If `true`, the task will suceed even if lint failures are found. Defaults to `false`. * `options.fix: boolean` - If `true`, fixes linting errors for select rules. This may overwrite linted files. Defaults to `false`. ### Usage Example ```js grunt.initConfig({ tslint: { options: { // can be a configuration object or a filepath to tslint.json configuration: "tslint.json", // If set to true, tslint errors will be reported, but not fail the task // If set to false, tslint errors will be reported, and the task will fail force: false, fix: false }, files: { src: [ "src/file1.ts", "src/file2.ts" ] } } }) ``` ## Contributing In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).
palantir/grunt-tslint
README.md
Markdown
apache-2.0
2,297
<!DOCTYPE html> <html> <head> <title>try chat(JAX-RS)</title> <meta charset="UTF-8"> <link rel="stylesheet" href="../webjars/bootstrap/3.3.1/css/bootstrap.min.css" /> <link rel="stylesheet" href="../resources/css/style.css" /> <script type='text/javascript' src="../webjars/jquery/2.1.1/jquery.min.js"></script> <script type='text/javascript' src="../webjars/bootstrap/3.3.1/js/bootstrap.min.js"></script> <script type='text/javascript' src="../webjars/vue/0.11.0/vue.min.js"></script> <script type='text/javascript' src="../resources/js/common.js"></script> </head> <body> <div class="container"> <div class="jumbotron"> <h1>サンプルチャット JAX-RS</h1> <form id="form" class="login" v-on="submit:join"> <span id="error" >{{error_message}}</span> <div id="nameFg" class="form-group {{name_error_css}}"> <label for="name" class="control-label">名前 <span>{{name_message}}</span></label> <input id="name" name="name" placeholder="表示名を入力" type="text" class="form-control" v-model="name" /> </div> <div id="emailFg" class="form-group {{email_error_css}}"> <label for="email" class="control-label ">Gravatarメールアドレス <span>{{email_message}}</span></label> <input id="email" name="email" placeholder="Gravatarのイメージを使用する場合入力" type="email" class="form-control" v-model="email" /> </div> <input type="submit" value="join" class="btn btn-default" /> </form> <div> <a href="../" class="btn btn-link">JSF版へ</a> </div> </div> </div> <script type='text/javascript' src="../resources/js/vm_index.js"></script> </body> </html>
enterprisegeeks/try_java_ee7
try_java_ee7-web/src/main/webapp/rest/index.html
HTML
apache-2.0
2,108
var searchData= [ ['interactiontype',['InteractionType',['../class_student_record.html#a00e060bc8aa9829e5db087e2cba21009',1,'StudentRecord']]] ];
rstals/Unity-SCORM-Integration-Kit
Documentation/search/enums_2.js
JavaScript
apache-2.0
148
/* * Copyright 2010-2011 Ning, Inc. * * Ning licenses this file to you under the Apache License, version 2.0 * (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.ning.metrics.eventtracker; import com.google.inject.Guice; import com.google.inject.Injector; import com.ning.metrics.serialization.event.ThriftToThriftEnvelopeEvent; import com.ning.metrics.serialization.writer.SyncType; import org.joda.time.DateTime; import org.skife.config.ConfigurationObjectFactory; import org.testng.Assert; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import java.io.File; import java.util.UUID; @Test(enabled = false) public class TestIntegration { private final File tmpDir = new File(System.getProperty("java.io.tmpdir"), "collector"); @SuppressWarnings("unused") @BeforeTest(alwaysRun = true) private void setupTmpDir() { if (!tmpDir.exists() && !tmpDir.mkdirs()) { throw new RuntimeException("Failed to create: " + tmpDir); } if (!tmpDir.isDirectory()) { throw new RuntimeException("Path points to something that's not a directory: " + tmpDir); } } @SuppressWarnings("unused") @AfterTest(alwaysRun = true) private void cleanupTmpDir() { tmpDir.delete(); } @Test(groups = "slow", enabled = false) public void testGuiceThrift() throws Exception { System.setProperty("eventtracker.type", "SCRIBE"); System.setProperty("eventtracker.directory", tmpDir.getAbsolutePath()); System.setProperty("eventtracker.scribe.host", "127.0.0.1"); System.setProperty("eventtracker.scribe.port", "7911"); final Injector injector = Guice.createInjector(new CollectorControllerModule()); final CollectorController controller = injector.getInstance(CollectorController.class); final ScribeSender sender = (ScribeSender) injector.getInstance(EventSender.class); sender.createConnection(); fireThriftEvents(controller); sender.close(); } @Test(groups = "slow", enabled = false) public void testScribeFactory() throws Exception { System.setProperty("eventtracker.type", "COLLECTOR"); System.setProperty("eventtracker.directory", tmpDir.getAbsolutePath()); System.setProperty("eventtracker.collector.host", "127.0.0.1"); System.setProperty("eventtracker.collector.port", "8080"); final EventTrackerConfig config = new ConfigurationObjectFactory(System.getProperties()).build(EventTrackerConfig.class); final CollectorController controller = ScribeCollectorFactory.createScribeController( config.getScribeHost(), config.getScribePort(), config.getScribeRefreshRate(), config.getScribeMaxIdleTimeInMinutes(), config.getSpoolDirectoryName(), config.isFlushEnabled(), config.getFlushIntervalInSeconds(), SyncType.valueOf(config.getSyncType()), config.getSyncBatchSize(), config.getMaxUncommittedWriteCount(), config.getMaxUncommittedPeriodInSeconds() ); fireThriftEvents(controller); } private void fireThriftEvents(final CollectorController controller) throws Exception { controller.offerEvent(ThriftToThriftEnvelopeEvent.extractEvent("thrift", new DateTime(), new Click(UUID.randomUUID().toString(), new DateTime().getMillis(), "user agent"))); Assert.assertEquals(controller.getEventsReceived().get(), 1); Assert.assertEquals(controller.getEventsLost().get(), 0); controller.commit(); controller.flush(); Thread.sleep(5000); } }
pierre/eventtracker
scribe/src/test/java/com/ning/metrics/eventtracker/TestIntegration.java
Java
apache-2.0
4,231
// Copyright (c) 2008, Google 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: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * 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. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER 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. #include <base.h> #include "client/windows/crash_generation/minidump_generator.h" #include <cassert> #include "client/windows/common/auto_critical_section.h" #include "common/windows/guid_string.h" using std::wstring; namespace google_breakpad { MinidumpGenerator::MinidumpGenerator(const wstring& dump_path) : dbghelp_module_(NULL), rpcrt4_module_(NULL), dump_path_(dump_path), write_dump_(NULL), create_uuid_(NULL) { InitializeCriticalSection(&module_load_sync_); InitializeCriticalSection(&get_proc_address_sync_); } MinidumpGenerator::~MinidumpGenerator() { if (dbghelp_module_) { FreeLibrary(dbghelp_module_); } if (rpcrt4_module_) { FreeLibrary(rpcrt4_module_); } DeleteCriticalSection(&get_proc_address_sync_); DeleteCriticalSection(&module_load_sync_); } bool MinidumpGenerator::WriteMinidump(HANDLE process_handle, DWORD process_id, DWORD thread_id, DWORD requesting_thread_id, EXCEPTION_POINTERS* exception_pointers, MDRawAssertionInfo* assert_info, MINIDUMP_TYPE dump_type, bool is_client_pointers, wstring* dump_path) { MiniDumpWriteDumpType write_dump = GetWriteDump(); if (!write_dump) { return false; } wstring dump_file_path; if (!GenerateDumpFilePath(&dump_file_path)) { return false; } // If the client requests a full memory dump, we will write a normal mini // dump and a full memory dump. Both dump files use the same uuid as file // name prefix. bool full_memory_dump = (dump_type & MiniDumpWithFullMemory) != 0; wstring full_dump_file_path; if (full_memory_dump) { full_dump_file_path.assign(dump_file_path); full_dump_file_path.resize(full_dump_file_path.size() - 4); // strip .dmp full_dump_file_path.append(TEXT("-full.dmp")); } HANDLE dump_file = CreateFile(dump_file_path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); if (dump_file == INVALID_HANDLE_VALUE) { return false; } HANDLE full_dump_file = INVALID_HANDLE_VALUE; if (full_memory_dump) { full_dump_file = CreateFile(full_dump_file_path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); if (full_dump_file == INVALID_HANDLE_VALUE) { CloseHandle(dump_file); return false; } } MINIDUMP_EXCEPTION_INFORMATION* dump_exception_pointers = NULL; MINIDUMP_EXCEPTION_INFORMATION dump_exception_info; // Setup the exception information object only if it's a dump // due to an exception. if (exception_pointers) { dump_exception_pointers = &dump_exception_info; dump_exception_info.ThreadId = thread_id; dump_exception_info.ExceptionPointers = exception_pointers; dump_exception_info.ClientPointers = is_client_pointers; } // Add an MDRawBreakpadInfo stream to the minidump, to provide additional // information about the exception handler to the Breakpad processor. // The information will help the processor determine which threads are // relevant. The Breakpad processor does not require this information but // can function better with Breakpad-generated dumps when it is present. // The native debugger is not harmed by the presence of this information. MDRawBreakpadInfo breakpad_info = {0}; if (!is_client_pointers) { // Set the dump thread id and requesting thread id only in case of // in-process dump generation. breakpad_info.validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID | MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID; breakpad_info.dump_thread_id = thread_id; breakpad_info.requesting_thread_id = requesting_thread_id; } // Leave room in user_stream_array for a possible assertion info stream. MINIDUMP_USER_STREAM user_stream_array[2]; user_stream_array[0].Type = MD_BREAKPAD_INFO_STREAM; user_stream_array[0].BufferSize = sizeof(breakpad_info); user_stream_array[0].Buffer = &breakpad_info; MINIDUMP_USER_STREAM_INFORMATION user_streams; user_streams.UserStreamCount = 1; user_streams.UserStreamArray = user_stream_array; MDRawAssertionInfo* actual_assert_info = assert_info; MDRawAssertionInfo client_assert_info = {0}; if (assert_info) { // If the assertion info object lives in the client process, // read the memory of the client process. if (is_client_pointers) { SIZE_T bytes_read = 0; if (!ReadProcessMemory(process_handle, assert_info, &client_assert_info, sizeof(client_assert_info), &bytes_read)) { CloseHandle(dump_file); if (full_dump_file != INVALID_HANDLE_VALUE) CloseHandle(full_dump_file); return false; } if (bytes_read != sizeof(client_assert_info)) { CloseHandle(dump_file); if (full_dump_file != INVALID_HANDLE_VALUE) CloseHandle(full_dump_file); return false; } actual_assert_info = &client_assert_info; } user_stream_array[1].Type = MD_ASSERTION_INFO_STREAM; user_stream_array[1].BufferSize = sizeof(MDRawAssertionInfo); user_stream_array[1].Buffer = actual_assert_info; ++user_streams.UserStreamCount; } bool result_minidump = write_dump( process_handle, process_id, dump_file, static_cast<MINIDUMP_TYPE>((dump_type & (~MiniDumpWithFullMemory)) | MiniDumpNormal), exception_pointers ? &dump_exception_info : NULL, &user_streams, NULL) != FALSE; bool result_full_memory = true; if (full_memory_dump) { result_full_memory = write_dump( process_handle, process_id, full_dump_file, static_cast<MINIDUMP_TYPE>(dump_type & (~MiniDumpNormal)), exception_pointers ? &dump_exception_info : NULL, &user_streams, NULL) != FALSE; } bool result = result_minidump && result_full_memory; CloseHandle(dump_file); if (full_dump_file != INVALID_HANDLE_VALUE) CloseHandle(full_dump_file); // Store the path of the dump file in the out parameter if dump generation // succeeded. if (result && dump_path) { *dump_path = dump_file_path; } return result; } HMODULE MinidumpGenerator::GetDbghelpModule() { AutoCriticalSection lock(&module_load_sync_); if (!dbghelp_module_) { dbghelp_module_ = LoadLibrary(TEXT("dbghelp.dll")); } return dbghelp_module_; } MinidumpGenerator::MiniDumpWriteDumpType MinidumpGenerator::GetWriteDump() { AutoCriticalSection lock(&get_proc_address_sync_); if (!write_dump_) { HMODULE module = GetDbghelpModule(); if (module) { FARPROC proc = GetProcAddress(module, "MiniDumpWriteDump"); write_dump_ = reinterpret_cast<MiniDumpWriteDumpType>(proc); } } return write_dump_; } HMODULE MinidumpGenerator::GetRpcrt4Module() { AutoCriticalSection lock(&module_load_sync_); if (!rpcrt4_module_) { rpcrt4_module_ = LoadLibrary(TEXT("rpcrt4.dll")); } return rpcrt4_module_; } MinidumpGenerator::UuidCreateType MinidumpGenerator::GetCreateUuid() { AutoCriticalSection lock(&module_load_sync_); if (!create_uuid_) { HMODULE module = GetRpcrt4Module(); if (module) { FARPROC proc = GetProcAddress(module, "UuidCreate"); create_uuid_ = reinterpret_cast<UuidCreateType>(proc); } } return create_uuid_; } bool MinidumpGenerator::GenerateDumpFilePath(wstring* file_path) { UUID id = {0}; UuidCreateType create_uuid = GetCreateUuid(); if(!create_uuid) { return false; } create_uuid(&id); wstring id_str = GUIDString::GUIDToWString(&id); *file_path = dump_path_ + TEXT("\\") + id_str + TEXT(".dmp"); return true; } } // namespace google_breakpad
mital/kroll
boot/breakpad/client/windows/crash_generation/minidump_generator.cc
C++
apache-2.0
9,978
package com.nosolojava.fsm.impl.runtime.executable.basic; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import com.nosolojava.fsm.runtime.Context; import com.nosolojava.fsm.runtime.executable.Elif; import com.nosolojava.fsm.runtime.executable.Else; import com.nosolojava.fsm.runtime.executable.Executable; import com.nosolojava.fsm.runtime.executable.If; public class BasicIf extends BasicConditional implements If { private static final long serialVersionUID = -415238773021486012L; private final List<Elif> elifs = new ArrayList<Elif>(); private final Else elseOperation; public BasicIf(String condition) { this(condition, null, null, null); } public BasicIf(String condition, List<Executable> executables) { this(condition, null, null, executables); } public BasicIf(String condition, Else elseOperation, List<Executable> executables) { this(condition, null, elseOperation, executables); } public BasicIf(String condition, List<Elif> elifs, Else elseOperation, List<Executable> executables) { super(condition, executables); if (elifs != null) { this.elifs.addAll(elifs); } this.elseOperation = elseOperation; } @Override public boolean runIf(Context context) { boolean result = false; // if condition fails if (super.runIf(context)) { result = true; } else { // try with elifs boolean enterElif = false; Iterator<Elif> iterElif = elifs.iterator(); Elif elif; while (!enterElif && iterElif.hasNext()) { elif = iterElif.next(); enterElif = elif.runIf(context); } // if no elif and else if (!enterElif && this.elseOperation != null) { elseOperation.run(context); } } return result; } public List<Elif> getElifs() { return this.elifs; } public void addElif(Elif elif) { this.elifs.add(elif); } public void addElifs(List<Elif> elifs) { this.elifs.addAll(elifs); } public void clearAndSetElifs(List<Elif> elifs) { this.elifs.clear(); addElifs(elifs); } }
nosolojava/scxml-java
scxml-java-implementation/src/main/java/com/nosolojava/fsm/impl/runtime/executable/basic/BasicIf.java
Java
apache-2.0
2,082
/** * Copyright 2015 Santhosh Kumar Tekuri * * The JLibs authors license this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package jlibs.wamp4j.spi; import java.io.InputStream; public interface Listener{ public void onMessage(WAMPSocket socket, MessageType type, InputStream is); public void onReadComplete(WAMPSocket socket); public void readyToWrite(WAMPSocket socket); public void onError(WAMPSocket socket, Throwable error); public void onClose(WAMPSocket socket); }
santhosh-tekuri/jlibs
wamp4j-core/src/main/java/jlibs/wamp4j/spi/Listener.java
Java
apache-2.0
1,010
package me.littlepanda.dadbear.core.queue; import java.util.Queue; /** * @author 张静波 [email protected] * */ public interface DistributedQueue<T> extends Queue<T> { /** * <p>如果使用无参构造函数,需要先调用这个方法,队列才能使用</p> * @param queue_name * @param clazz */ abstract public void init(String queue_name, Class<T> clazz); }
myplaylife/dadbear
framework/core/src/main/java/me/littlepanda/dadbear/core/queue/DistributedQueue.java
Java
apache-2.0
402
# Changelog [![GitHub commits since latest release](https://img.shields.io/github/commits-since/ligato/vpp-agent/latest.svg?style=flat-square)](https://github.com/ligato/vpp-agent/compare/v3.2.0...master) ## Release Notes - [v3.2.0](#v3.2.0) - [v3.1.0](#v3.1.0) - [v3.0.0](#v3.0.0) - [v3.0.1](#v3.0.1) - [v2.5.0](#v2.5.0) - [v2.5.1](#v2.5.1) - [v2.4.0](#v2.4.0) - [v2.3.0](#v2.3.0) - [v2.2.0](#v2.2.0) - [v2.2.0-beta](#v2.2.0-beta) - [v2.1.0](#v2.1.0) - [v2.1.1](#v2.1.1) - [v2.0.0](#v2.0.0) - [v2.0.1](#v2.0.1) - [v2.0.2](#v2.0.2) - [v1.8.0](#v1.8.0) - [v1.8.1](#v1.8.1) - [v1.7.0](#v1.7.0) - [v1.6.0](#v1.6.0) - [v1.5.0](#v1.5.0) - [v1.5.1](#v1.5.1) - [v1.5.2](#v1.5.2) - [v1.4.0](#v1.4.0) - [v1.4.1](#v1.4.1) - [v1.3.0](#v1.3.0) - [v1.2.0](#v1.2.0) - [v1.1.0](#v1.1.0) - [v1.0.8](#v1.0.8) - [v1.0.7](#v1.0.7) - [v1.0.6](#v1.0.6) - [v1.0.5](#v1.0.5) - [v1.0.4](#v1.0.4) - [v1.0.3](#v1.0.3) - [v1.0.2](#v1.0.2) <!--- RELEASE CHANGELOG TEMPLATE: <a name="vX.Y.Z"></a> # [X.Y.Z](https://github.com/ligato/vpp-agent/compare/vX-1.Y-1.Z-1...vX.Y.Z) (YYYY-MM-DD) ### COMPATIBILITY ### KNOWN ISSUES ### BREAKING CHANGES ### Bug Fixes ### Features ### Improvements ### Docker Images ### Documentation --> <a name="v3.2.0"></a> # [3.2.0](https://github.com/ligato/vpp-agent/compare/v3.1.0...v3.2.0) (2020-10-XX) ### COMPATIBILITY - VPP 20.09 (compatible) - VPP 20.05 (default) - VPP 20.01 (backwards compatible) - VPP 19.08 (backwards compatible) - ~~VPP 19.04~~ (no longer supported) ### Bug Fixes - Fixes and improvements for agentctl and models [#1643](https://github.com/ligato/vpp-agent/pull/1643) - Fix creation of multiple ipip tunnels [#1650](https://github.com/ligato/vpp-agent/pull/1650) - Fix IPSec tun protect + add IPSec e2e test [#1654](https://github.com/ligato/vpp-agent/pull/1654) - Fix bridge domain dump for VPP 20.05 [#1663](https://github.com/ligato/vpp-agent/pull/1663) - Fix IPSec SA add/del in VPP 20.05 [#1664](https://github.com/ligato/vpp-agent/pull/1664) - Update expected output of agentctl status command [#1673](https://github.com/ligato/vpp-agent/pull/1673) - vpp/ifplugin: Recognize interface name prefix "tun" as TAP [#1674](https://github.com/ligato/vpp-agent/pull/1674) - Fix IPv4 link-local IP address handling [#1715](https://github.com/ligato/vpp-agent/pull/1715) - maps caching prometheus gauges weren't really used [#1741](https://github.com/ligato/vpp-agent/pull/1741) - Permit agent to run even when VPP stats are unavailable [#1712](https://github.com/ligato/vpp-agent/pull/1712) - Fix grpc context timeout for agentctl import command [#1718](https://github.com/ligato/vpp-agent/pull/1718) - Changed nat44 pool key to prevent possible key collisions [#1725](https://github.com/ligato/vpp-agent/pull/1725) - Remove forced delay for linux interface notifications [#1742](https://github.com/ligato/vpp-agent/pull/1742) ### Features - agentctl: Add config get/update commands [#1709](https://github.com/ligato/vpp-agent/pull/1709) - agentctl: Support specific history seq num and improve layout [#1717](https://github.com/ligato/vpp-agent/pull/1717) - agentctl: Add config.resync subcommand (with resync) [#1642](https://github.com/ligato/vpp-agent/pull/1642) - IP Flow Information eXport (IPFIX) plugin [#1649](https://github.com/ligato/vpp-agent/pull/1649) - Add IPIP & IPSec point-to-multipoint support [#1669](https://github.com/ligato/vpp-agent/pull/1669) - Wireguard plugin support [#1731](https://github.com/ligato/vpp-agent/pull/1731) - Add tunnel mode support for VPP TAP interfaces [#1671](https://github.com/ligato/vpp-agent/pull/1671) - New REST endpoint for retrieving version of Agent [#1670](https://github.com/ligato/vpp-agent/pull/1670) - Add support for IPv6 ND address autoconfig [#1676](https://github.com/ligato/vpp-agent/pull/1676) - Add VRF field to proxy ARP range [#1672](https://github.com/ligato/vpp-agent/pull/1672) - Switch to new proto v2 (google.golang.org/protobuf) [#1691](https://github.com/ligato/vpp-agent/pull/1691) - ipsec: allow configuring salt for encryption algorithm [#1698](https://github.com/ligato/vpp-agent/pull/1698) - gtpu: Add RemoteTeid to GTPU interface [#1719](https://github.com/ligato/vpp-agent/pull/1719) - Added support for NAT44 static mapping twice-NAT pool IP address reference [#1728](https://github.com/ligato/vpp-agent/pull/1728) - add IP protocol number to ACL model [#1726](https://github.com/ligato/vpp-agent/pull/1726) - gtpu: Add support for arbitrary DecapNextNode [#1721](https://github.com/ligato/vpp-agent/pull/1721) - configurator: Add support for waiting until config update is done [#1734](https://github.com/ligato/vpp-agent/pull/1734) - telemetry: Add reading VPP threads to the telemetry plugin [#1753](https://github.com/ligato/vpp-agent/pull/1753) - linux: Add support for Linux VRFs [#1744](https://github.com/ligato/vpp-agent/pull/1744) - VRRP support [#1744](https://github.com/ligato/vpp-agent/pull/1744) ### Improvements - perf: Performance enhancement for adding many rules to Linux IP… [#1644](https://github.com/ligato/vpp-agent/pull/1644) - Improve testing process for e2e/integration tests [#1757](https://github.com/ligato/vpp-agent/pull/1757) ### Documentation - docs: Add example for developing agents with custom VPP plugins [#1665](https://github.com/ligato/vpp-agent/pull/1665) ### Other - Delete unused REST handler for VPP commands [#1677](https://github.com/ligato/vpp-agent/pull/1677) - separate model for IPSec Security Policies [#1679](https://github.com/ligato/vpp-agent/pull/1679) - do not mark host_if_name for AF_PACKET as deprecated [#1745](https://github.com/ligato/vpp-agent/pull/1745) - Store interface internal name & dev type as metadata [#1706](https://github.com/ligato/vpp-agent/pull/1706) - Check if HostIfName contains non-printable characters [#1662](https://github.com/ligato/vpp-agent/pull/1662) - Fix error message for duplicate keys [#1659](https://github.com/ligato/vpp-agent/pull/1659) <a name="v3.1.0"></a> # [3.1.0](https://github.com/ligato/vpp-agent/compare/v3.0.0...v3.1.0) (2020-03-13) ### BREAKING CHANGES * Switch cn-infra dependency to using vanity import path [#1620](https://github.com/ligato/vpp-agent/pull/1620) To migrate, replace all cn-infra import paths (`github.com/ligato/cn-infra` -> `go.ligato.io/cn-infra/v2`) To update cn-infra dependency, run `go get -u go.ligato.io/cn-infra/v2@master`. ### Bug Fixes * Add missing models to ConfigData [#1625](https://github.com/ligato/vpp-agent/pull/1625) * Fix watching VPP events [#1640](https://github.com/ligato/vpp-agent/pull/1640) ### Features * Allow customizing polling from stats poller [#1634](https://github.com/ligato/vpp-agent/pull/1634) * IPIP tunnel + IPSec tunnel protection support [#1638](https://github.com/ligato/vpp-agent/pull/1638) * Add prometheus metrics to govppmux [#1626](https://github.com/ligato/vpp-agent/pull/1626) * Add prometheus metrics to kvscheduler [#1630](https://github.com/ligato/vpp-agent/pull/1630) ### Improvements * Improve performance testing suite [#1630](https://github.com/ligato/vpp-agent/pull/1630) <a name="v3.0.1"></a> # [3.0.1](https://github.com/ligato/vpp-agent/compare/v3.0.0...v3.0.1) (2020-02-20) ### Bug Fixes * Add missing models to ConfigData (https://github.com/ligato/vpp-agent/pull/1625) <a name="v3.0.0"></a> # [3.0.0](https://github.com/ligato/vpp-agent/compare/v2.5.0...master) (2020-02-10) ### COMPATIBILITY - **VPP 20.01** (default) - **VPP 19.08.1** (recommended) - **VPP 19.04.4** ### KNOWN ISSUES - VPP L3 plugin: `IPScanNeighbor` was disabled for VPP 20.01 due to VPP API changes (will be implemented later using new model) - VPP NAT plugin: `VirtualReassembly` in `Nat44Global` was disabled for VPP 20.01 due to VPP API changes (will be implemented later in VPP L3 plugin using new model) ### BREAKING CHANGES - migrate from dep to Go modules for dependency management and remove vendor directory [#1599](https://github.com/ligato/vpp-agent/pull/1599) - use vanity import path `go.ligato.io/vpp-agent/v3` in Go files [#1599](https://github.com/ligato/vpp-agent/pull/1599) - move all _.proto_ files into `proto/ligato` directory and add check for breaking changes [#1599](https://github.com/ligato/vpp-agent/pull/1599) ### Bug Fixes - check for duplicate Linux interface IP address [#1586](https://github.com/ligato/vpp-agent/pull/1586) ### New Features - VPP interface plugin: Allow AF-PACKET to reference target Linux interface via logical name [#1616](https://github.com/ligato/vpp-agent/pull/1616) - VPP L3 plugin: add support for L3 cross-connects [#1602](https://github.com/ligato/vpp-agent/pull/1602) - VPP L3 plugin: IP flow hash settings support [#1610](https://github.com/ligato/vpp-agent/pull/1610) - VPP NAT plugin: NAT interface and AddressPool API changes [#1595](https://github.com/ligato/vpp-agent/pull/1595) - VPP plugins: support disabling VPP plugins [#1593](https://github.com/ligato/vpp-agent/pull/1593) - VPP client: add support for govpp proxy [#1593](https://github.com/ligato/vpp-agent/pull/1593) ### Improvements - optimize getting model keys, with up to 20% faster transactions [#1615](https://github.com/ligato/vpp-agent/pull/1615) - agentctl output formatting improvements (#1581, #1582, #1589) - generated VPP binary API now imports common types from `*_types` packages - development docker images now have smaller size (~400MB less) - start using Github Workflows for CI/CD pipeline - add gRPC reflection service <a name="v2.5.1"></a> # [2.5.1](https://github.com/ligato/vpp-agent/compare/v2.5.0...v2.5.1) (2019-12-06) ### COMPATIBILITY - **VPP 20.01-379** (`20.01-rc0~379-ga6b93eac5`) - **VPP 20.01-324** (`20.01-rc0~324-g66a332cf1`) - **VPP 19.08.1** (default) - **VPP 19.04** (backward compatible) - cn-infra v2.2 ### Bug Fixes * Fix linux interface dump ([#1577](https://github.com/ligato/vpp-agent/pull/1577)) * Fix VRF for SR policy ([#1578](https://github.com/ligato/vpp-agent/pull/1578)) <a name="v2.5.0"></a> # [2.5.0](https://github.com/ligato/vpp-agent/compare/v2.4.0...v2.5.0) (2019-11-29) ### Compatibility - **VPP 20.01-379** (`20.01-rc0~379-ga6b93eac5`) - **VPP 20.01-324** (`20.01-rc0~324-g66a332cf1`) - **VPP 19.08.1** (default) - **VPP 19.04** (backward compatible) - cn-infra v2.2 ### New Features * SRv6 global config (encap source address) * Support for Linux configuration dumping ### Bug Fixes * Update GoVPP with fix for stats conversion panic <a name="v2.4.0"></a> # [2.4.0](https://github.com/ligato/vpp-agent/compare/v2.3.0...v2.4.0) (2019-10-21) ### Compatibility - **VPP 20.01-379** (`20.01-rc0~379-ga6b93eac5`) - **VPP 20.01-324** (`20.01-rc0~324-g66a332cf1`) - **VPP 19.08.1** (default) - **VPP 19.04** (backward compatible) - cn-infra v2.2 ### New Features This release introduces compatibility with two different commits of the VPP 20.01. Previously compatible version was updated to commit `324-g66a332cf1`, and support for `379-ga6b93eac5` was added. Other previous versions remained. * [Telemetry][vpp-telemetry] - Added `StatsPoller` service periodically retrieving VPP stats. <a name="v2.3.0"></a> # [2.3.0](https://github.com/ligato/vpp-agent/compare/v2.2.0...v2.3.0) (2019-10-04) ### Compatibility - **VPP 20.01** (`20.01-rc0~161-ge5948fb49~b3570`) - **VPP 19.08.1** (default) - **VPP 19.04** (backward compatible) - cn-infra v2.2 VPP support for version 19.08 was updated to 19.08.1. Support for 19.01 was dropped in this release. ### Bug Fixes * Linux interfaces with 'EXISTING' type should be resynced properly. * Resolved issue with SRv6 removal. * AgentCTL dump command fixed. * ACL ICMP rule is now properly configured and data can be obtained using the ACL dump. * Missing dependency for SRv6 L2 steering fixed. * Fixed issue with possible division by zero and missing interface MTU. * Namespace plugin uses a Docker event listener instead of periodical polling. This should prevent cases where quickly started microservice container was not detected. ### New Features * [netalloc-plugin][netalloc-plugin] - A new plugin called netalloc which allows disassociating topology from addressing in the network configuration. Interfaces, routes and other network objects' addresses can be symbolic references into the pool of allocated addresses known to netalloc plugin. See [model][netalloc-plugin-model] for more information. * [if-plugin][vpp-interface-plugin] - Added support for GRE tunnel interfaces. Choose the `GRE_TUNNEL` interface type with appropriate link data. * [agentctl][agentctl] - Many new features and enhancements added to the AgentCTL: * version is defined as a parameter for root command instead of the separate command * ETCD endpoints can be defined via the `ETCD_ENDPOINTS` environment variable * sub-command `config` supports `get/put/del` commands * `model` sub-commands improved * added VPP command to manage VPP instance Additionally, starting with this release the AgentCTL is a VPP-Agent main control tool and the vpp-agent-ctl was definitely removed. ### Improvements Many end-to-end tests introduced, gradually increasing VPP-Agent stability. * [if-plugin][vpp-interface-plugin] - IP addresses assigned by the DHCP are excluded from the interface address descriptor. - VPP-Agent now processes status change notifications labeled by the VPP as UNKNOWN. * [ns-plugin][linux-ns-plugin] - Dockerclient microservice polling replaced with an event listener. * [sr-plugin][sr-plugin] - SRv6 dynamic proxy routing now can be connected to a non-zero VRF table. <a name="v2.2.0"></a> # [2.2.0](https://github.com/ligato/vpp-agent/compare/v2.2.0-beta...v2.2.0) (2019-08-26) ### Compatibility - **VPP 19.08** (rc1) - **VPP 19.04** (default) - **VPP 19.01** (backward compatible) - cn-infra v2.2 ### Bug Fixes - CN-infra version updated to 2.2 contains a supervisor fix which should prevent the issue where the supervisor logging occasionally caused the agent to crash during large outputs. ### New Features * [if-plugin][vpp-interface-plugin] - Added option to configure SPAN records. Northbound data are formatted by the [SPAN model][span-model]. ### Improvements * [orchestrator][orchestrator-plugin] - Clientv2 is now recognized as separate data source by the orchestrator plugin. This feature allows to use the localclient together with other data sources. ### Documentation - Updated documentation comments in the protobuf API. <a name="v2.2.0-beta"></a> # [2.2.0-beta](https://github.com/ligato/vpp-agent/compare/v2.1.1...v2.2.0-beta) (2019-08-09) ### Compatibility - **VPP 19.08** (rc1) - **VPP 19.04** (default) - **VPP 19.01** (backward compatible) ### Bug Fixes * Fixed SRv6 localsid delete case for non-zero VRF tables. * Fixed interface IPv6 detection in the descriptor. * Various bugs fixed in KV scheduler TXN post-processing. * Interface plugin config names fixed, no stats publishers are now used by default. Instead, datasync is used (by default ETCD, Redis and Consul). * Rx-placement and rx-mode is now correctly dependent on interface link state. * Fixed crash for iptables rulechain with default microservice. * Punt dump fixed in all supported VPP versions. * Removal of registered punt sockets fixed after a resync. * Punt socket paths should no longer be unintentionally recreated. * IP redirect is now correctly dependent on RX interface. * Fixed IPSec security association configuration for tunnel mode. * Fixed URL for VPP metrics in telemetry plugin * Routes are now properly dependent on VRF. ### New Features * Defined new environment variable `DISABLE_INTERFACE_STATS` to generally disable interface plugin stats. * Defined new environment variable `RESYNC_TIMEOU` to override default resync timeout. * Added [ETCD ansible python plugin][ansible] with example playbook. Consult [readme](ansible/README.md) for more information. ### Improvements * [govppmux-plugin][govppmux-plugin] - GoVPPMux stats can be read with rest under path `/govppmux/stats`. - Added disabling of interface stats via the environment variable `DISABLE_INTERFACE_STATS`. - Added disabling of interface status publishing via environment variable `DISABLE_STATUS_PUBLISHING`. * [kv-scheduler][kv-scheduler] - Added some more performance improvements. - The same key can be no more matched by multiple descriptors. * [abf-plugin][vpp-abf-plugin] - ABF plugin was added to config data model and is now initialized in configurator. * [if-plugin][vpp-interface-plugin] - Interface rx-placement and rx-mode was enhanced and now allows per-queue configuration. - Added [examples](examples/kvscheduler/rxplacement) for rx-placement and rx-mode. * [nat-plugin][vpp-nat-plugin] - NAT example updated for VPP 19.04 * [l3-plugin][vpp-l3-plugin] - Route keys were changed to prevent collisions with some types of configuration. Route with outgoing interface now contains the interface name in the key. - Added support for DHCP proxy. A new descriptor allows calling CRUD operations to VPP DHCP proxy servers. * [punt-plugin][vpp-punt-plugin] - Added support for Punt exceptions. - IP redirect dump was implemented for VPP 19.08. * [Telemetry][vpp-telemetry] - Interface metrics added to telemetry plugin. Note that the URL for prometheus export was changed to `/metrics/vpp`. - Plugin configuration file now has an option to skip certain metrics. * [rest-plugin][rest-plugin] - Added support for IPSec plugin - Added support for punt plugin * [agentctl][agentctl] - We continuously update the new CTL tool. Various bugs were fixed some new features added. - Added new command `import` which can import configuration from file. ### Docker Images * The supervisor was replaced with VPP-Agent init plugin. * Images now use pre-built VPP images from [ligato/vpp-base](https://github.com/ligato/vpp-base) <a name="v2.1.1"></a> # [2.1.1](https://github.com/ligato/vpp-agent/compare/v2.1.0...v2.1.1) (2019-04-05) ### Compatibility - **VPP 19.04** (`stable/1904`, recommended) - **VPP 19.01** (backward compatible) ### Bug Fixes * Fixed IPv6 detection for Linux interfaces [#1355](https://github.com/ligato/vpp-agent/pull/1355). * Fixed config file names for ifplugin in VPP & Linux [#1341](https://github.com/ligato/vpp-agent/pull/1341). * Fixed setting status publishers from env var: `VPP_STATUS_PUBLISHERS`. ### Improvements * The start/stop timeouts for agent can be configured using env vars: `START_TIMEOUT=15s` and `STOP_TIMEOUT=5s`, with values parsed as duration. * ABF was added to the `ConfigData` message for VPP [#1356](https://github.com/ligato/vpp-agent/pull/1356). ### Docker Images * Images now install all compiled .deb packages from VPP (including `vpp-plugin-dpdk`). <a name="v2.1.0"></a> # [2.1.0](https://github.com/ligato/vpp-agent/compare/v2.0.2...v2.1.0) (2019-05-09) ### Compatibility - **VPP 19.04** (`stable/1904`, recommended) - **VPP 19.01** (backward compatible) - cn-infra v2.1 - Go 1.11 The VPP 18.10 was deprecated and is no longer compatible. ### BREAKING CHANGES * All non-zero VRF tables now must be explicitly created, providing a VRF proto-modeled data to the VPP-Agent. Otherwise, some configuration items will not be created as before (for example interface IP addresses). ### Bug Fixes * VPP ARP `retrieve` now also returns IPv6 entries. ### New Features * [govppmux-plugin][govppmux-plugin] - The GoVPPMux plugin configuration file contains a new option `ConnectViaShm`, which when set to `true` forces connecting to the VPP via shared memory prefix. This is an alternative to environment variable `GOVPPMUX_NOSOCK`. * [configurator][configurator-plugin] - The configurator plugin now collects statistics which are available via the `GetStats()` function or via REST on URL `/stats/configurator`. * [kv-scheduler][kv-scheduler] - Added transaction statistics. * [abf-plugin][vpp-abf-plugin] - Added new plugin ABF - ACL-based forwarding, providing an option to configure routing based on matching ACL rules. An ABF entry configures interfaces which will be attached, list of forwarding paths and associated access control list. * [if-plugin][vpp-interface-plugin] - Added support for Generic Segmentation Offload (GSO) for TAP interfaces. * [l3-plugin][vpp-l3-plugin] - A new model for VRF tables was introduced. Every VRF is defined by an index and an IP version, a new optional label was added. Configuration types using non-zero VRF now require it to be created, since the VRF is considered a dependency. VRFs with zero-index are present in the VPP by default and do not need to be configured (applies for both, IPv4 and IPv6). * [agentctl][agentctl] - This tool becomes obsolete and was completely replaced with a new implementation. Please note that the development of this tool is in the early stages, and functionality is quite limited now. New and improved functionality is planned for the next couple of releases since our goal is to have a single vpp-agent control utility. Because of this, we have also deprecated the vpp-agent-ctl tool which will be most likely removed in the next release. ### Improvements * [kv-scheduler][kv-scheduler] - The KV Scheduler received another performance improvements. * [if-plugin][vpp-interface-plugin] - Attempt to configure a Bond interface with already existing ID returns a non-retriable error. * [linux-if-plugin][linux-interface-plugin] - Before adding an IPv6 address to the Linux interface, the plugins will use `sysctl` to ensure the IPv6 is enabled in the target OS. ### Docker Images - Supervisord is started as a process with PID 1 ### Documentation - The ligato.io webpage is finally available, check out it [here][ligato.io]! We have also released a [new documentation site][ligato-docs] with a lot of new or updated articles, guides, tutorials and many more. Most of the README.md files scattered across the code were removed or updated and moved to the site. <a name="v2.0.2"></a> # [2.0.2](https://github.com/ligato/vpp-agent/compare/v2.0.1...v2.0.2) (2019-04-19) ### Compatibility - **VPP 19.01** (updated to `v19.01.1-14-g0f36ef60d`) - **VPP 18.10** (backward compatible) - cn-infra v2.0 - Go 1.11 This minor release brought compatibility with updated version of the VPP 19.01. <a name="v2.0.1"></a> # [2.0.1](https://github.com/ligato/vpp-agent/compare/v2.0.0...v2.0.1) (2019-04-05) ### Compatibility - **VPP 19.01** (compatible by default, recommended) - **VPP 18.10** (backward compatible) - cn-infra v2.0 - Go 1.11 ### Bug Fixes * Fixed bug where Linux network namespace was not reverted in some cases. * The VPP socketclient connection checks (and waits) for the socket file in the same manner as for the shared memory, giving the GoVPPMux more time to connect in case the VPP startup is delayed. Also errors occurred during the shm/socket file watch are now properly handled. * Fixed wrong dependency for SRv6 end functions referencing VRF tables (DT6,DT4,T). ### Improvements * [GoVPPMux][govppmux-plugin] - Added option to adjust the number of connection attempts and time delay between them. Seek `retry-connect-count` and `retry-connect-timeout` fields in [govpp.conf][govppmux-conf]. Also keep in mind the total time in which plugins can be initialized when using these fields. * [linux-if-plugin][linux-interface-plugin] - Default loopback MTU was set to 65536. * [ns-plugin][linux-ns-plugin] - Plugin descriptor returns `ErrEscapedNetNs` if Linux namespace was changed but not reverted back before returned to scheduler. ### Docker Images * Supervisord process is now started with PID=1 <a name="v2.0.0"></a> # [2.0.0](https://github.com/ligato/vpp-agent/compare/v1.8...v2.0.0) (2019-04-02) ### Compatibility - **VPP 19.01** (compatible by default, recommended) - **VPP 18.10** (backward compatible) - cn-infra v2.0 - Go 1.11 ### BREAKING CHANGES * All northbound models were re-written and simplified and most of them are no longer compatible with model data from v1. * The `v1` label from all vpp-agent keys was updated to `v2`. * Plugins using some kind of dependency on other VPP/Linux plugin (for example required interface) should be updated and handled by the KVScheduler. ### Bug Fixes * We expect a lot of known and unknown race-condition and plugin dependency related issues to be solved by the KV Scheduler. * MTU is omitted for the sub-interface type. * If linux plugin attempts to switch to non-existing namespace, it prints appropriate log message as warning, and continues with execution instead of interrupt it with error. * Punt socket path string is cleaned from unwanted characters. * Added VPE compatibility check for L3 plugin vppcalls. * The MAC address assigned to an af-packet interface is used from the host only if not provided from the configuration. * Fixed bug causing the agent to crash in an attempt to 'update' rx-placement with empty value. * Switch interface from zero to non-zero VRF causes VPP issues - this limitation was now restricted only to unnumbered interfaces. * IPSec tunnel dump now also retrieves integ/crypto keys. * Errored operation should no more publish to the index mapping. * Some obsolete Retval checks were removed. * Error caused by missing DPDK interface is no longer retryable. * Linux interface IP address without mask is now handled properly. * Fixed bug causing agent to crash when some VPP plugin we support was not loaded. * Fixed metrics retrieval in telemetry plugin. ### Known Issues * The bidirectional forwarding detection (aka BFD plugin) was removed. We plan to add it in one of the future releases. * The L4 plugin (application namespaces) was removed. * We experienced problems with the VPP with some messages while using socket client connection. The issue kind was that the reply message was not returned (GoVPP could not decode it). If you encounter similar error, please try to setup VPP connection using shared memory (see below). ### Features * Performance - The vpp-agent now supports connection via socket client (in addition to shared memory). The socket client connection provides higher performance and message throughput, thus it was set as default connection type. The shared memory is still available via the environment variable `GOVPPMUX_NOSOCK`. - Many other changes, benchmarking and profiling was done to improve vpp-agent experience. * Multi-VPP support - The VPP-agent can connect to multiple versions of the VPP with the same binary file without any additional building or code changes. See compatibility part to know which versions are supported. The list will be extended in the future. * Models - All vpp-agent models were reviewed and cleaned up. Various changes were done, like simple renaming (in order to have more meaningful fields, avoid duplicated names in types, etc.), improved model convenience (interface type-specific fields are now defined as `oneof`, preventing to set multiple or incorrect data) and other. All models were also moved to the common [api][models] folder. * [KVScheduler][kv-scheduler] - Added new component called KVScheduler, as a reaction to various flaws and issues with race conditions between Vpp/Linux plugins, poor readability and poorly readable logging. Also the system of notifications between plugins was unreliable and hard to debug or even understand. Based on this experience, a new framework offers improved generic mechanisms to handle dependencies between configuration items and creates clean and readable transaction-based logging. Since this component significantly changed the way how plugins are defined, we recommend to learn more about it on the [VPP-Agent wiki page][wiki]. * [orchestrator][orchestrator-plugin] - The orchestrator is a new component which long-term added value will be a support for multiple northbound data sources (KVDB, GRPC, ...). The current implementation handles combination of GRPC + KVDB, which includes data changes and resync. In the future, any combination of sources will be supported. * [GoVPPMux][govppmux-plugin] - Added `Ping()` method to the VPE vppcalls usable to test the VPP connection. * [if-plugin][vpp-interface-plugin] - UDP encapsulation can be configured to an IPSec tunnel interface - Support for new Bond-type interfaces. - Support for L2 tag rewrite (currently present in the interface plugin because of the inconsistent VPP API) * [nat-plugin][vpp-nat-plugin] - Added support for session affinity in NAT44 static mapping with load balancer. * [sr-plugin][sr-plugin] - Support for Dynamic segment routing proxy with L2 segment routing unaware services. - Added support for SRv6 end function End.DT4 and End.DT6. * [linux-if-plugin][linux-interface-plugin] - Added support for new Linux interface type - loopback. - Attempt to assign already existing IP address to the interface does not cause an error. * [linux-iptables][linux-iptables-plugin] - Added new linux IP tables plugin able to configure IP tables chain in the specified table, manage chain rules and set default chain policy. ### Improvements * [KVScheduler][kv-scheduler] - Performance improvements related to memory management. * [GoVPPMux][govppmux-plugin] - Need for config file was removed, GoVPP is now set with default values if the startup config is not provided. - `DefaultReplyTimeout` is now configured globally, instead of set for every request separately. - Tolerated default health check timeout is now set to 250ms (up from 100ms). The old value had not provide enough time in some cases. * [acl-plugin][vpp-acl-plugin] - Model moved to the [api/models][models] * [if-plugin][vpp-interface-plugin] - Model reviewed, updated and moved to the [api/models][models]. - Interface plugin now handles IPSec tunnel interfaces (previously done in IPSec plugin). - NAT related configuration was moved to its own plugin. - New interface stats (added in 1.8.1) use new GoVPP API, and publishing frequency was significantly decreased to handle creation of multiple interfaces in short period of time. * [IPSec-plugin][vpp-ipsec-plugin] - Model moved to the [api/models][models] - The IPSec interface is no longer processed by the IPSec plugin (moved to interface plugin). - The ipsec link in interface model now uses the enum definitions from IPSec model. Also some missing crypto algorithms were added. * [l2-plugin][vpp-l2-plugin] - Model moved to the [api/models][models] and split to three separate models for bridge domains, FIBs and cross connects. * [l3-plugin][vpp-l3-plugin] - Model moved to the [api/models][models] and split to three separate models for ARPs, Proxy ARPs including IP neighbor and Routes. * [nat-plugin][vpp-nat-plugin] - Defined new plugin to handle NAT-related configuration and its own [model][nat-proto] (before a part of interface plugin). * [punt-plugin][vpp-punt-plugin] - Model moved to the [api/models][models]. - Added retrieve support for punt socket. The current implementation is not final - plugin uses local cache (it will be enhanced when the appropriate VPP binary API call will be added). * [stn-plugin][vpp-stn-plugin] - Model moved to the [api/models][models]. * [linux-if-plugin][linux-interface-plugin] - Model reviewed, updated and moved to the [api/models][models]. * [linux-l3-plugin][linux-l3-plugin] - Model moved to the [api/models][models] and split to separate models for ARPs and Routes. - Linux routes and ARPs have a new dependency - the target interface is required to contain an IP address. * [ns-plugin][ns-plugin] - New auxiliary plugin to handle linux namespaces and microservices (evolved from ns-handler). Also defines [model][ns-proto] for generic linux namespace definition. ### Docker Images * Configuration file for GoVPP was removed, forcing to use default values (which are the same as they were in the file). * Fixes for installing ARM64 debugger. * Kafka is no longer required in order to run vpp-agent from the image. ### Documentation * Added documentation for the punt plugin, describing main features and usage of the punt plugin. * Added documentation for the [IPSec plugin][vpp-ipsec-plugin], describing main and usage of the IPSec plugin. * Added documentation for the [interface plugin][vpp-interface-plugin]. The document is only available on [wiki page][wiki]. * Description improved in various proto files. * Added a lot of new documentation for the KVScheduler (examples, troubleshooting, debugging guides, diagrams, ...) * Added tutorial for KV Scheduler. * Added many new documentation articles to the [wiki page][wiki]. However, most of is there only temporary since we are preparing new ligato.io website with all the documentation and other information about the Ligato project. Also majority of readme files from the vpp-agent repository will be removed in the future. <a name="v1.8.1"></a> # [1.8.1](https://github.com/ligato/vpp-agent/compare/v1.8..v1.8.1) (2019-03-04) Motive for this minor release was updated VPP with several fixed bugs from the previous version. The VPP version also introduced new interface statistics mechanism, thus the stats processing was updated in the interface plugin. ### Compatibility - v19.01-16~gd30202244 - cn-infra v1.7 - GO 1.11 ### Bug Fixes - VPP bug: fixed crash when attempting to run in kubernetes pod - VPP bug: fixed crash in barrier sync when vlib_worker_threads is zero ### Features - [vpp-ifplugin][vpp-interface-plugin] * Support for new VPP stats (the support for old ones were deprecated by the VPP, thus removed from the vpp-agent as well). <a name="v1.8.0"></a> # [1.8.0](https://github.com/ligato/vpp-agent/compare/v1.7...v1.8) (2018-12-12) ### Compatibility - VPP v19.01-rc0~394-g6b4a32de - cn-infra v1.7 - Go 1.11 ### Bug Fixes * Pre-existing VETH-type interfaces are now read from the default OS namespace during resync if the Linux interfaces were dumped. * The Linux interface dump method does not return an error if some interface namespace becomes suddenly unavailable at the read-time. Instead, this case is logged and all the other interfaces are returned as usual. * The Linux localclient's delete case for Linux interfaces now works properly. * The Linux interface dump now uses OS link name (instead of vpp-agent specific name) to read the interface attributes. This sometimes caused errors where an incorrect or even none interface was read. * Fixed bug where the unsuccessful namespace switch left the namespace file opened. * Fixed crash if the Linux plugin was disabled. * Fixed occasional crash in vpp-agent interface notifications. * Corrected interface counters for TX packets. * Access list with created TCP/UDP/ICMP rule, which remained as empty struct no longer causes vpp-agent to crash ### Features - [vpp-ifplugin][vpp-interface-plugin] * Rx-mode and Rx-placement now support dump via the respective binary API call - vpp-rpc-plugin * GRPC now supports also IPSec configuration. * All currently supported configuration items can be also dumped/read via GRPC (similar to rest) * GRPC now allows to automatically persist configuration to the data store. The desired DB has to be defined in the new GRPC config file (see [readme][readme] for additional information). - [vpp-punt][punt-model] * Added simple new punt plugin. The plugin allows to register/unregister punt to host via Unix domain socket. The new [model][punt-model] was added for this configuration type. Since the VPP API is incomplete, the configuration does not support dump. ### Improvements - [vpp-ifplugin][vpp-interface-plugin] * The VxLAN interface now support IPv4/IPv6 virtual routing and forwarding (VRF tables). * Support for new interface type: VmxNet3. The VmxNet3 virtual network adapter has no physical counterpart since it is optimized for performance in a virtual machine. Because built-in drivers for this card are not provided by default in the OS, the user must install VMware Tools. The interface model was updated for the VmxNet3 specific configuration. - [ipsec-plugin][vpp-ipsec-plugin] * IPSec resync processing for security policy databases (SPD) and security associations (SA) was improved. Data are properly read from northbound and southbound, compared and partially configured/removed, instead of complete cleanup and re-configuration. This does not appeal to IPSec tunnel interfaces. * IPSec tunnel can be now set as an unnumbered interface. - [rest-plugin][rest-plugin] * In case of error, the output returns correct error code with cause (parsed from JSON) instead of an empty body <a name="v1.7.0"></a> # [1.7.0](https://github.com/ligato/vpp-agent/compare/v1.6...v1.7) (2018-10-02) ### Compatibility - VPP 18.10-rc0~505-ge23edac - cn-infra v1.6 - Go 1.11 ### Bug Fixes * Corrected several cases where various errors were silently ignored * GRPC registration is now done in Init() phase, ensuring that it finishes before GRPC server is started * Removed occasional cases where Linux tap interface was not configured correctly * Fixed FIB configuration failures caused by wrong updating of the metadata after several modifications * No additional characters are added to NAT tag and can be now configured with the full length without index out of range errors * Linux interface resync registers all VETH-type interfaces, despite the peer is not known * Status publishing to ETCD/Consul now should work properly * Fixed occasional failure caused by concurrent map access inside Linux plugin interface configurator * VPP route dump now correctly recognizes route type ### Features - [vpp-ifplugin][vpp-interface-plugin] * It is now possible to dump unnumbered interface data * Rx-placement now uses specific binary API to configure instead of generic CLI API - [vpp-l2plugin][vpp-l2-plugin] * Bridge domain ARP termination table can now be dumped - [linux-ifplugin][linux-interface-plugin] * Linux interface watcher was reintroduced. * Linux interfaces can be now dumped. - [linux-l3plugin][linux-l3-plugin] * Linux ARP entries and routes can be dumped. ### Improvements - [vpp-plugins][vpp-plugins] * Improved error propagation in all the VPP plugins. Majority of errors now print the stack trace to the log output allowing better error tracing and debugging. * Stopwatch was removed from all vppcalls - [linux-plugins][linux-plugins] * Improved error propagation in all Linux plugins (same way as for VPP) * Stopwatch was removed from all linuxcalls - [govpp-plugn][govppmux-plugin] * Tracer (introduced in cn-infra 1.6) added to VPP message processing, replacing stopwatch. The measurement should be more precise and logged for all binary API calls. Also the rest plugin now allows showing traced entries. ### Docker Images * The image can now be built on ARM64 platform <a name="v1.6.0"></a> # [1.6.0](https://github.com/ligato/vpp-agent/compare/v1.5.2...v1.6) (2018-08-24) ### Compatibility - VPP 18.10-rc0~169-gb11f903a - cn-infra v1.5 ### BREAKING CHANGES - Flavors were replaced with new way of managing plugins. - REST interface URLs were changed, see [readme][readme] for complete list. ### Bug Fixes * if VPP routes are dumped, all paths are returned * NAT load-balanced static mappings should be resynced correctly * telemetry plugin now correctly parses parentheses for `show node counters` * telemetry plugin will not hide an error caused by value loading if the config file is not present * Linux plugin namespace handler now correctly handles namespace switching for interfaces with IPv6 addresses. Default IPv6 address (link local) will not be moved to the new namespace if there are no more IPv6 addresses configured within the interface. This should prevent failures in some cases where IPv6 is not enabled in the destination namespace. * VxLAN with non-zero VRF can be successfully removed * Lint is now working again * VPP route resync works correctly if next hop IP address is not defined ### Features * Deprecating flavors - CN-infra 1.5 brought new replacement for flavors and it would be a shame not to implement it in the vpp-agent. The old flavors package was removed and replaced with this new concept, visible in app package vpp-agent. - [rest plugin][rest-plugin] * All VPP configuration types are now supported to be dumped using REST. The output consists of two parts; data formatted as NB proto model, and metadata with VPP specific configuration (interface indexes, different counters, etc.). * REST prefix was changed. The new URL now contains API version and purpose (dump, put). The list of all URLs can be found in the [readme][readme] - [ifplugin][vpp-interface-plugin] * Added support for NAT virtual reassembly for both, IPv4 and IPv6. See change in [nat proto file][nat-proto] - [l3plugin][vpp-l3-plugin] * Vpp-agent now knows about DROP-type routes. They can be configured and also dumped. VPP default routes, which are DROP-type is recognized and registered. Currently, resync does not remove or correlate such a route type automatically, so no default routes are unintentionally removed. * New configurator for L3 IP scan neighbor was added, allowing to set/unset IP scan neigh parameters to the VPP. ### Improvements - [vpp plugins][vpp-plugins] * all vppcalls were unified under API defined for every configuration type (e.g. interfaces, l2, l3, ...). Configurators now use special handler object to access vppcalls. This should prevent duplicates and make vppcalls cleaner and more understandable. - [ifplugin][vpp-interface-plugin] * VPP interface DHCP configuration can now be dumped and added to resync processing * Interfaces and also L3 routes can be configured for non-zero VRF table if IPv6 is used. - [examples][examples] * All examples were reworked to use new flavors concept. The purpose was not changed. ### Docker Images - using Ubuntu 18.04 as the base image <a name="v1.5.2"></a> ## [1.5.2](https://github.com/ligato/vpp-agent/compare/v1.5.1...v1.5.2) (2018-07-23) ### Compatibility - VPP 18.07-rc0~358-ga5ee900 - cn-infra v1.4.1 (minor version fixes bug in Consul) ### Bug Fixes - [Telemetry][vpp-telemetry] * Fixed bug where lack of config file could cause continuous polling. The interval now also cannot be changed to a value less than 5 seconds. * Telemetry plugin is now closed properly <a name="v1.5.1"></a> ## 1.5.1 (2018-07-20) ### Compatibility - VPP 18.07-rc0~358-ga5ee900 - cn-infra v1.4 ### Features - [Telemetry][vpp-telemetry] * Default polling interval was raised to 30s. * Added option to use telemetry config file to change polling interval, or turn the polling off, disabling the telemetry plugin. The change was added due to several reports where often polling is suspicious of interrupting VPP worker threads and causing packet drops and/or other negative impacts. More information how to use the config file can be found in the [readme][readme]. <a name="v1.5.0"></a> # [1.5.0](https://github.com/ligato/vpp-agent/compare/v1.4.1...v1.5) (2018-07-16) ### Compatibility - VPP 18.07-rc0~358-ga5ee900 - cn-infra v1.4 ### BREAKING CHANGES - The package `etcdv3` was renamed to `etcd`, along with its flag and configuration file. - The package `defaultplugins` was renamed to `vpp` to make the purpose of the package clear ### Bug Fixes - Fixed a few issues with parsing VPP metrics from CLI for [Telemetry][vpp-telemetry]. - Fixed bug in GoVPP occurring after some request timed out, causing the channel to receive replies from the previous request and always returning an error. - Fixed issue which prevented setting interface to non-existing VRF. - Fixed bug where removal of an af-packet interface caused attached Veth to go DOWN. - Fixed NAT44 address pool resolution which was not correct in some cases. - Fixed bug with adding SR policies causing incomplete configuration. ### Features - [LinuxPlugin][linux-interface-plugin] * Is now optional and can be disabled via configuration file. - [ifplugin][vpp-interface-plugin] * Added support for VxLAN multicast * Rx-placement can be configured on VPP interfaces - [IPsec][vpp-ipsec-plugin] * IPsec UDP encapsulation can now be set (NAT traversal) ### Docker Images - Replace `START_AGENT` with `OMIT_AGENT` to match `RETAIN_SUPERVISOR` and keep both unset by default. - Refactored and cleaned up execute scripts and remove unused scripts. - Fixed some issues with `RETAIN_SUPERVISOR` option. - Location of supervisord pid file is now explicitly set to `/run/supervisord.pid` in *supervisord.conf* file. - The vpp-agent is now started with single flag `--config-dir=/opt/vpp-agent/dev`, and will automatically load all configuration from that directory. <a name="v1.4.1"></a> ## [1.4.1](https://github.com/ligato/vpp-agent/compare/v1.4.0...v1.4.1) (2018-06-11) A minor release using newer VPP v18.04 version. ### Compatibility - VPP v18.04 (2302d0d) - cn-infra v1.3 ### Bug Fixes - VPP submodule was removed from the project. It should prevent various problems with dependency resolution. - Fixed known bug present in the previous version of the VPP, issued as [VPP-1280][vpp-issue-1280]. Current version contains appropriate fix. <a name="v1.4.0"></a> # [1.4.0](https://github.com/ligato/vpp-agent/compare/v1.3...v1.4.0) (2018-05-24) ### Compatibility - VPP v18.04 (ac2b736) - cn-infra v1.3 ### Bug Fixes * Fixed case where the creation of the Linux route with unreachable gateway threw an error. The route is now appropriately cached and created when possible. * Fixed issue with GoVPP channels returning errors after a timeout. * Fixed various issues related to caching and resync in L2 cross-connect * Split horizon group is now correctly assigned if an interface is created after bridge domain * Fixed issue where the creation of FIB while the interface was not a part of the bridge domain returned an error. ### Known issues * VPP crash may occur if there is interface with non-default VRF (>0). There is an [VPP-1280][vpp-issue-1280] issue created with more details ### Features - [Consul][consul] * Consul is now supported as a key-value store alternative to ETCD. More information in the [readme][readme]. - [Telemetry][vpp-telemetry] * New plugin for collecting telemetry data about VPP metrics and serving them via HTTP server for Prometheus. More information in the [readme][readme]. - [Ipsecplugin][vpp-ipsec-plugin] * Now supports tunnel interface for encrypting all the data passing through that interface. - GRPC * Vpp-agent itself can act as a GRPC server (no need for external executable) * All configuration types are supported (incl. Linux interfaces, routes and ARP) * Client can read VPP notifications via vpp-agent. - [SR plugin][sr-plugin] * New plugin with support for Segment Routing. More information in the [readme][readme]. ### Improvements - [ifplugin][vpp-interface-plugin] * Added support for self-twice-NAT - __vpp-agent-grpc__ executable merged with [vpp-agent][vpp-agent] command. - [govppmux][govppmux-plugin] * `configure reply timeout` can be configured. * Support for VPP started with custom shared memory prefix. SHM may be configured via the GoVPP plugin config file. More info in the [readme][readme] * Overall redundancy cleanup and corrected naming for all proto models. * Added more unit tests for increased coverage and code stability. ### Documentation - [localclient_linux][examples-vpp-local] now contains two examples, the old one demonstrating basic plugin functionality was moved to plugin package, and specialised example for [NAT][examples-nat] was added. - [localclient_linux][examples-linux-local] now contains two examples, the old one demonstrating [veth][examples-veth] interface usage was moved to package and new example for linux [tap][examples-tap] was added. <a name="v1.3.0"></a> # [1.3.0](https://github.com/ligato/vpp-agent/compare/v1.2...v1.3) (2018-03-22) The vpp-agent is now using custom VPP branch [stable-1801-contiv][contiv-vpp1810]. ### Compatibility - VPP v18.01-rc0~605-g954d437 - cn-infra v1.2 ### Bug Fixes * Resync of ifplugin in both, VPP and Linux, was improved. Interfaces with the same configuration data are not recreated during resync. * STN does not fail if IP address with a mask is provided. * Fixed ingress/egress interface resolution in ACL. * Linux routes now check network reachability for gateway address before configuration. It should prevent "network unreachable" errors during config. * Corrected bridge domain crash in case non-bvi interface was added to another non-bvi interface. * Fixed several bugs related to VETH and AF-PACKET configuration and resync. ### Features - [ipsecplugin][vpp-ipsec-plugin]: * New plugin for IPSec added. The IPSec is supported for VPP only with Linux set manually for now. IKEv2 is not yet supported. More information in the [readme][readme]. - [nsplugin][linux-ns-plugin] * New namespace plugin added. The configurator handles common namespace and microservice processing and communication with other Linux plugins. - [ifplugin][vpp-interface-plugin] * Added support for Network address translation. NAT plugin supports a configuration of NAT44 interfaces, address pools and DNAT. More information in the [readme][readme]. * DHCP can now be configured for the interface - [l2plugin][vpp-l2-plugin] * Split-horizon group can be configured for bridge domain interface. - [l3plugin][vpp-l3-plugin] * Added support for proxy ARP. For more information and configuration example, please see [readme][readme]. - [linux ifplugin][linux-interface-plugin] * Support for automatic interface configuration (currently only TAP). ### Improvements - [aclplugin][agentctl] * Removed configuration order of interfaces. The access list can be now configured even if interfaces do not exist yet, and add them later. - vpp-agent-ctl * The vpp-agent-ctl was refactored and command info was updated. ### Docker Images * VPP can be built and run in the release or debug mode. Read more information in the [readme][readme]. * Production image is now smaller by roughly 40% (229MB). <a name="v1.2.0"></a> # [1.2.0](https://github.com/ligato/vpp-agent/compare/v1.1...v1.2) (2018-02-07) ### Compatibility - VPP v18.04-rc0~90-gd95c39e - cn-infra v1.1 ### Bug Fixes - Fixed interface assignment in ACLs - Fixed bridge domain BVI modification resolution - vpp-agent-grpc (removed in 1.4 release, since then it is a part of the vpp-agent) now compiles properly together with other commands. ### Known Issues - VPP can occasionally cause a deadlock during checksum calculation (https://jira.fd.io/browse/VPP-1134) - VPP-Agent might not properly handle initialization across plugins (this is not occurring currently, but needs to be tested more) ### Improvements - [aclplugin][vpp-acl-plugin] * Improved resync of ACL entries. Every new ACL entry is correctly configured in the VPP and all obsolete entries are read and removed. - [ifplugin][vpp-interface-plugin] * Improved resync of interfaces, BFD sessions, authentication keys, echo functions and STN. Better resolution of persistence config for interfaces. - [l2plugin][vpp-l2-plugin] * Improved resync of bridge domains, FIB entries, and xConnect pairs. Resync now better correlates configuration present on the VPP with the NB setup. - [linux-ifplugin][linux-interface-plugin] * ARP does not need the interface to be present on the VPP. Configuration is cached and put to the VPP if requirements are fulfilled. - Dependencies * Migrated from glide to dep ### Docker Images * VPP compilation now skips building of Java/C++ APIs, this saves build time and final image size. * Development image now runs VPP in debug mode with various debug options added in [VPP config file][vpp-conf-file]. <a name="v1.1.0"></a> # [1.1.0](https://github.com/ligato/vpp-agent/compare/v1.0.8...v1.1) (2018-01-22) ### Compatibility - VPP version v18.04-rc0~33-gb59bd65 - cn-infra v1.0.8 ### Bug Fixes - fixed skip-resync parameter if vpp-plugin.conf is not provided. - corrected af_packet type interface behavior if veth interface is created/removed. - several fixes related to the af_packet and veth interface type configuration. - microservice and veth-interface related events are synchronized. ### Known Issues - VPP can occasionally cause a deadlock during checksum calculation (https://jira.fd.io/browse/VPP-1134) - VPP-Agent might not properly handle initialization across plugins (this is not occurring currently, but needs to be tested more) ### Features - [ifplugin][vpp-interface-plugin] - added support for un-numbered interfaces. The nterface can be marked as un-numbered with information about another interface containing required IP address. A un-numbered interface does not need to have IP address set. - added support for virtio-based TAPv2 interfaces. - interface status is no longer stored in the ETCD by default and it can be turned on using the appropriate setting in vpp-plugin.conf. See [readme][readme] for more details. - [l2plugin][vpp-l2-plugin] - bridge domain status is no longer stored in the ETCD by default and it can be turned on using the appropriate setting in vpp-plugin.conf. See [readme][readme] for more details. ### Improvements - [ifplugin][vpp-interface-plugin] - default MTU value was removed in order to be able to just pass empty MTU field. MTU now can be set only in interface configuration (preferred) or defined in vpp-plugin.conf. If none of them is set, MTU value will be empty. - interface state data are stored in statuscheck readiness probe - [l3plugin][vpp-l3-plugin] - removed strict configuration order for VPP ARP entries and routes. Both ARP entry or route can be configured without interface already present. - l4plugin (removed in v2.0) - removed strict configuration order for application namespaces. Application namespace can be configured without interface already present. - localclient - added API for ARP entries, L4 features, Application namespaces, and STN rules. - logging - consolidated and improved logging in vpp and Linux plugins. <a name="v1.0.8"></a> ## [1.0.8](https://github.com/ligato/vpp-agent/compare/v1.0.7...v1.0.8) (2017-11-21) ### Compatibility - VPP v18.01-rc0-309-g70bfcaf - cn-infra v1.0.7 ### Features - [ifplugin][vpp-interface-plugin] - ability to configure STN rules. See respective [readme][readme] in interface plugin for more details. - rx-mode settings can be set on interface. Ethernet-type interface can be set to POLLING mode, other types of interfaces supports also INTERRUPT and ADAPTIVE. Fields to set QueueID/QueueIDValid are also available - added possibility to add interface to any VRF table. - added defaultplugins API. - API contains new Method `DisableResync(keyPrefix ...string)`. One or more ETCD key prefixes can be used as a parameter to disable resync for that specific key(s). - l4plugin (removed in v2.0) - added new l4 plugin to the VPP plugins. It can be used to enable/disable L4 features and configure application namespaces. See respective [readme][readme] in L4 plugin for more details. - support for VPP plugins/l3plugin ARP configuration. The configurator can perform the basic CRUD operation with ARP config. - resync - resync error propagation improved. If any resynced configuration fails, rest of the resync completes and will not be interrupted. All errors which appear during resync are logged after. - [linux l3plugin][linux-l3-plugin] - route configuration does not return an error if the required interface is missing. Instead, the route data are internally stored and configured when the interface appears. - GoVPP - delay flag removed from GoVPP plugin ### Improvements - removed dead links from README files ### Documentation - improved in multiple vpp-agent packages <a name="v1.0.7"></a> ## [1.0.7](https://github.com/ligato/vpp-agent/compare/v1.0.6...v1.0.7) (2017-10-30) ### Compatibility - VPP version v18.01-rc0~154-gfc1c612 - cn-infra v1.0.6 ### Features - [Default VPP plugin][vpp-interface-plugin] - added resync strategies. Resync of VPP plugins can be set using defaultpluigns config file; Resync can be set to full (always resync everything) or dependent on VPP configuration (if there is none, skip resync). Resync can be also forced to skip using the parameter. - [Linuxplugins L3Plugin][linux-l3-plugin] - added support for basic CRUD operations with the static Address resolution protocol entries and static Routes. <a name="v1.0.6"></a> ## [1.0.6](https://github.com/ligato/vpp-agent/compare/v1.0.5...v1.0.6) (2017-10-17) ### Compatibility - cn-infra v1.0.5 ### Features - [LinuxPlugin][linux-interface-plugin] - The configuration of vEth interfaces modified. Veth configuration defines two names: symbolic used internally and the one used in host OS. `HostIfName` field is optional. If it is not defined, the name in the host OS will be the same as the symbolic one - defined by `Name` field. <a name="v1.0.5"></a> ## [1.0.5](https://github.com/ligato/vpp-agent/compare/v1.0.4...v1.0.5) (2017-09-26) ### Compatibility - VPP version v17.10-rc0~334-gce41a5c - cn-infra v1.0.4 ### Features - [GoVppMux][govppmux-plugin] - configuration file for govpp added - Kafka Partitions - Changes in offset handling, only automatically partitioned messages (hash, random) have their offset marked. Manually partitioned messages are not marked. - Implemented post-init consumer (for manual partitioner only) which allows starting consuming after kafka-plugin Init() - Minimalistic examples & documentation for Kafka API will be improved in a later release. <a name="v1.0.4"></a> ## [1.0.4](https://github.com/ligato/vpp-agent/compare/v1.0.3...v1.0.4) (2017-09-08) ### Features - Kafka Partitions - Implemented new methods that allow to specify partitions & offset parameters: * publish: Mux.NewSyncPublisherToPartition() & Mux.NewAsyncPublisherToPartition() * watch: ProtoWatcher.WatchPartition() - Minimalistic examples & documentation for Kafka API will be improved in a later release. - Flavors - reduced to only local.FlavorVppLocal & vpp.Flavor - GoVPP - updated version waits until the VPP is ready to accept a new connection <a name="v1.0.3"></a> ## [1.0.3](https://github.com/ligato/vpp-agent/compare/v1.0.2...v1.0.3) (2017-09-05) ### Compatibility - VPP version v17.10-rc0~265-g809bc74 (upgraded because of VPP MEMIF fixes) ### Features Enabled support for wathing data store `OfDifferentAgent()` - see: * examples/idx_iface_cache (removed in v2.0) * examples/examples/idx_bd_cache (removed in v2.0) * examples/idx_veth_cache (removed in v2.0) Preview of new Kafka client API methods that allows to fill also partition and offset argument. New methods implementation ignores these new parameters for now (fallback to existing implementation based on `github.com/bsm/sarama-cluster` and `github.com/Shopify/sarama`). <a name="v1.0.2"></a> ## [1.0.2](https://github.com/ligato/vpp-agent/compare/v1.0.1...v1.0.2) (2017-08-28) ### Compatibility - VPP version v17.10-rc0~203 ### Known Issues A rarely occurring problem during startup with binary API connectivity. VPP rejects binary API connectivity when VPP Agent tries to connect too early (plan fix this behavior in next release). ### Features Algorithms for applying northbound configuration (stored in ETCD key-value data store) to VPP in the proper order of VPP binary API calls implemented in [Default VPP plugin][vpp-interface-plugin]: - network interfaces, especially: - MEMIFs (optimized data plane network interface tailored for a container to container network connectivity) - VETHs (standard Linux Virtual Ethernet network interface) - AF_Packets (for accessing VETHs and similar type of interface) - VXLANs, Physical Network Interfaces, loopbacks ... - L2 BD & X-Connects - L3 IP Routes & VRFs - ACL (Access Control List) Support for Linux VETH northbound configuration implemented in [Linux Plugin][linux-interface-plugin] applied in proper order with VPP AF_Packet configuration. Data Synchronization during startup for network interfaces & L2 BD (support for the situation when ETCD contain configuration before VPP Agent starts). Data replication and events: - Updating operational data in ETCD (VPP indexes such as sw_if_index) and statistics (port counters). - Updating statistics in Redis (optional once redis.conf available - see flags). - Publishing links up/down events to Kafka message bus. - [Examples][examples] - Tools: - [agentctl CLI tool][agentctl] that show state & configuration of VPP agents - [docker][docker]: container-based development environment for the VPP agent - other features inherited from cn-infra: - health: status check & k8s HTTP/REST probes - logging: changing log level at runtime - Ability to extend the behavior of the VPP Agent by creating new plugins on top of VPP Agent flavor (removed with CN-Infra v1.5). New plugins can access API for configured: - VPP Network interfaces, - Bridge domains and VETHs based on [idxvpp][idx-vpp] threadsafe map tailored for VPP data with advanced features (multiple watchers, secondary indexes). - VPP Agent is embeddable in different software projects and with different systems by using Local Flavor (removed with CN-Infra v1.5) to reuse VPP Agent algorithms. For doing this there is VPP Agent client version 1 (removed in v2.0): - local client - for embedded VPP Agent (communication inside one operating system process, VPP Agent effectively used as a library) - remote client - for remote configuration of VPP Agent (while integrating for example with control plane) [agentctl]: cmd/agentctl [ansible]: ansible [configurator-plugin]: plugins/configurator [consul]: https://www.consul.io/ [contiv-vpp1810]: https://github.com/vpp-dev/vpp/tree/stable-1801-contiv [docker]: docker [examples]: examples [examples-linux-local]: examples/localclient_linux [examples-nat]: examples/localclient_vpp/nat [examples-tap]: examples/localclient_linux/tap [examples-veth]: examples/localclient_linux/veth [examples-vpp-local]: examples/localclient_vpp [govppmux-plugin]: plugins/govppmux [govppmux-conf]: plugins/govppmux/govpp.conf [idx-vpp]: pkg/idxvpp [kv-scheduler]: plugins/kvscheduler [ligato.io]: https://ligato.io/ [ligato-docs]: https://docs.ligato.io/en/latest/ [linux-interface-plugin]: plugins/linux/ifplugin [linux-iptables-plugin]: plugins/linux/iptablesplugin [linux-l3-plugin]: plugins/linux/l3plugin [linux-ns-plugin]: plugins/linux/nsplugin [linux-plugins]: plugins/linux [nat-proto]: api/models/vpp/nat/nat.proto [netalloc-plugin]: plugins/netalloc [netalloc-plugin-model]: api/models/netalloc/netalloc.proto [ns-plugin]: plugins/linux/nsplugin [ns-proto]: api/models/linux/namespace/namespace.proto [models]: api/models [orchestrator-plugin]: plugins/orchestrator [punt-model]: api/models/vpp/punt/punt.proto [readme]: README.md [rest-plugin]: plugins/restapi [span-model]: api/models/vpp/interfaces/span.proto [sr-plugin]: plugins/vpp/srplugin [vpp-abf-plugin]: plugins/vpp/abfplugin [vpp-acl-plugin]: plugins/vpp/aclplugin [vpp-agent]: cmd/vpp-agent [vpp-conf-file]: docker/dev/vpp.conf [vpp-interface-plugin]: plugins/vpp/ifplugin [vpp-issue-1280]: https://jira.fd.io/browse/VPP-1280 [vpp-ipsec-plugin]: plugins/vpp/ipsecplugin [vpp-l2-plugin]: plugins/vpp/l2plugin [vpp-l3-plugin]: plugins/vpp/l3plugin [vpp-nat-plugin]: plugins/vpp/natplugin [vpp-plugins]: plugins/vpp [vpp-punt-plugin]: plugins/vpp/puntplugin [vpp-stn-plugin]: plugins/vpp/stnplugin [vpp-telemetry]: plugins/telemetry [wiki]: https://github.com/ligato/vpp-agent/wiki
VladoLavor/vpp-agent
CHANGELOG.md
Markdown
apache-2.0
63,920
<?php require 'common.php'; require Sc::$rootDir.'/driver/file.php'; class Test{ static public $d = NULL; static public function testAdd(){ if(empty(self::$d)){ self::$d = new Sc_Driver_File(); } self::$d->add(array( 'hash'=>'hash1', 'node'=>'192.168.1.1', 'fhash'=>'hashfile1' )); self::$d->add(array( 'hash'=>'hash1', 'node'=>'192.168.1.2', 'fhash'=>'hashfile2' )); } static public function testGet(){ if(empty(self::$d)){ self::$d = new Sc_Driver_File(); } var_dump(self::$d->get('hash1')); } static public function testDel(){ if(empty(self::$d)){ self::$d = new Sc_Driver_File(); } var_dump(self::$d->delete('82341a6c6f03e3af261a95ba81050c0a')); } } //$a = 1/0; Test::testDel();
xiilei/phpsync
tests/test.php
PHP
apache-2.0
942
package debop4s.data.orm.hibernate.repository import com.mysema.query.jpa.hibernate._ import com.mysema.query.types.EntityPath import debop4s.data.orm.ReadOnlyConnection import debop4s.data.orm.model.HConnectPageImpl import org.hibernate.{LockOptions, Session, SessionFactory} import org.slf4j.LoggerFactory import org.springframework.data.domain.PageRequest import scala.annotation.varargs import scala.util.control.NonFatal /** * HibernateQueryDslDao * @author debop created at 2014. 5. 20. */ class HibernateQueryDslDao(val sessionFactory: SessionFactory) { private lazy val log = LoggerFactory.getLogger(getClass) private def session: Session = sessionFactory.getCurrentSession private def sessionStateless = sessionFactory.openStatelessSession() def getQuery: HibernateQuery = new HibernateQuery(session) def from(path: EntityPath[_]): HibernateQuery = getQuery.from(path) @varargs def from(paths: EntityPath[_]*): HibernateQuery = getQuery.from(paths: _*) def deleteFrom(path: EntityPath[_]): HibernateDeleteClause = new HibernateDeleteClause(session, path) def updateFrom(path: EntityPath[_]): HibernateUpdateClause = new HibernateUpdateClause(session, path) def deleteStateless(path: EntityPath[_])(action: HibernateDeleteClause => Unit): Long = { try { val stateless = sessionFactory.openStatelessSession() val deleteClause = new HibernateDeleteClause(stateless, path) action(deleteClause) deleteClause.execute() } catch { case NonFatal(e) => log.error(s"삭제 작업 시 예외가 발생했습니다.", e) -1L } } def updateStateless(path: EntityPath[_])(action: HibernateUpdateClause => Unit): Long = { try { val stateless = sessionFactory.openStatelessSession() val updateStateless = new HibernateUpdateClause(stateless, path) action(updateStateless) updateStateless.execute() } catch { case NonFatal(e) => log.error(s"삭제 작업 시 예외가 발생했습니다.", e) -1L } } @ReadOnlyConnection def load[T](clazz: Class[T], id: java.io.Serializable): T = session.load(clazz, id).asInstanceOf[T] @ReadOnlyConnection def load[T](clazz: Class[T], id: java.io.Serializable, lockOptions: LockOptions) = session.load(clazz, id, lockOptions) @ReadOnlyConnection def get[T](clazz: Class[T], id: java.io.Serializable) = session.get(clazz, id) @ReadOnlyConnection def get[T](clazz: Class[T], id: java.io.Serializable, lockOptions: LockOptions) = session.get(clazz, id, lockOptions) @ReadOnlyConnection def findAll[T](path: EntityPath[T]) = getQuery.from(path).list(path) @ReadOnlyConnection def findAll[T](path: EntityPath[T], query: HibernateQuery, offset: Int, limit: Int) = query.offset(offset).limit(limit).list(path) @ReadOnlyConnection def getPage[T](path: EntityPath[T], query: HibernateQuery, pageNo: Int, pageSize: Int) = { val total = query.count() val offset = (pageNo - 1) * pageSize val limit = pageSize val items = findAll(path, query, offset, limit) new HConnectPageImpl(items, new PageRequest(pageNo, pageSize), total) } }
debop/debop4s
debop4s-data-orm/src/main/scala/debop4s/data/orm/hibernate/repository/HibernateQueryDslDao.scala
Scala
apache-2.0
3,192
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ package jp.eisbahn.oauth2.server.spi.servlet; import static org.easymock.EasyMock.*; import static org.junit.Assert.*; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.junit.Test; public class HttpServletRequestAdapterTest { @Test public void test() { HttpServletRequest request = createMock(HttpServletRequest.class); expect(request.getParameter("name1")).andReturn("value1"); expect(request.getHeader("name2")).andReturn("value2"); @SuppressWarnings("serial") Map<String, String[]> map = new HashMap<String, String[]>() { { put("k1", new String[]{"v1"}); put("k2", new String[]{"v2"}); } }; expect(request.getParameterMap()).andReturn(map); replay(request); HttpServletRequestAdapter target = new HttpServletRequestAdapter(request); assertEquals("value1", target.getParameter("name1")); assertEquals("value2", target.getHeader("name2")); Map<String, String[]> parameterMap = target.getParameterMap(); assertEquals(2, parameterMap.size()); assertEquals("v1", parameterMap.get("k1")[0]); assertEquals("v2", parameterMap.get("k2")[0]); verify(request); } }
morozumi-h/oauth2-server
src/test/java/jp/eisbahn/oauth2/server/spi/servlet/HttpServletRequestAdapterTest.java
Java
apache-2.0
1,972
/** * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package lizard.api.TLZ; @SuppressWarnings("all") @javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2018-06-17") public class TLZ_Patch implements org.apache.thrift.TBase<TLZ_Patch, TLZ_Patch._Fields>, java.io.Serializable, Cloneable, Comparable<TLZ_Patch> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TLZ_Patch"); private static final org.apache.thrift.protocol.TField ENTITIES_FIELD_DESC = new org.apache.thrift.protocol.TField("entities", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TLZ_PatchStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TLZ_PatchTupleSchemeFactory(); public java.util.List<TLZ_PatchEntry> entities; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ENTITIES((short)1, "entities"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // ENTITIES return ENTITIES; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; private final java.lang.String _fieldName; _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.ENTITIES, new org.apache.thrift.meta_data.FieldMetaData("entities", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TLZ_PatchEntry.class)))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TLZ_Patch.class, metaDataMap); } public TLZ_Patch() { } public TLZ_Patch( java.util.List<TLZ_PatchEntry> entities) { this(); this.entities = entities; } /** * Performs a deep copy on <i>other</i>. */ public TLZ_Patch(TLZ_Patch other) { if (other.isSetEntities()) { java.util.List<TLZ_PatchEntry> __this__entities = new java.util.ArrayList<TLZ_PatchEntry>(other.entities.size()); for (TLZ_PatchEntry other_element : other.entities) { __this__entities.add(new TLZ_PatchEntry(other_element)); } this.entities = __this__entities; } } public TLZ_Patch deepCopy() { return new TLZ_Patch(this); } @Override public void clear() { this.entities = null; } public int getEntitiesSize() { return (this.entities == null) ? 0 : this.entities.size(); } public java.util.Iterator<TLZ_PatchEntry> getEntitiesIterator() { return (this.entities == null) ? null : this.entities.iterator(); } public void addToEntities(TLZ_PatchEntry elem) { if (this.entities == null) { this.entities = new java.util.ArrayList<TLZ_PatchEntry>(); } this.entities.add(elem); } public java.util.List<TLZ_PatchEntry> getEntities() { return this.entities; } public TLZ_Patch setEntities(java.util.List<TLZ_PatchEntry> entities) { this.entities = entities; return this; } public void unsetEntities() { this.entities = null; } /** Returns true if field entities is set (has been assigned a value) and false otherwise */ public boolean isSetEntities() { return this.entities != null; } public void setEntitiesIsSet(boolean value) { if (!value) { this.entities = null; } } public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case ENTITIES: if (value == null) { unsetEntities(); } else { setEntities((java.util.List<TLZ_PatchEntry>)value); } break; } } public java.lang.Object getFieldValue(_Fields field) { switch (field) { case ENTITIES: return getEntities(); } throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); } switch (field) { case ENTITIES: return isSetEntities(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TLZ_Patch) return this.equals((TLZ_Patch)that); return false; } public boolean equals(TLZ_Patch that) { if (that == null) return false; if (this == that) return true; boolean this_present_entities = true && this.isSetEntities(); boolean that_present_entities = true && that.isSetEntities(); if (this_present_entities || that_present_entities) { if (!(this_present_entities && that_present_entities)) return false; if (!this.entities.equals(that.entities)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetEntities()) ? 131071 : 524287); if (isSetEntities()) hashCode = hashCode * 8191 + entities.hashCode(); return hashCode; } @Override public int compareTo(TLZ_Patch other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.valueOf(isSetEntities()).compareTo(other.isSetEntities()); if (lastComparison != 0) { return lastComparison; } if (isSetEntities()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entities, other.entities); 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 { scheme(iprot).read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { scheme(oprot).write(oprot, this); } @Override public java.lang.String toString() { java.lang.StringBuilder sb = new java.lang.StringBuilder("TLZ_Patch("); boolean first = true; sb.append("entities:"); if (this.entities == null) { sb.append("null"); } else { sb.append(this.entities); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields if (entities == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'entities' was not present! Struct: " + toString()); } // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class TLZ_PatchStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TLZ_PatchStandardScheme getScheme() { return new TLZ_PatchStandardScheme(); } } private static class TLZ_PatchStandardScheme extends org.apache.thrift.scheme.StandardScheme<TLZ_Patch> { public void read(org.apache.thrift.protocol.TProtocol iprot, TLZ_Patch 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: // ENTITIES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); struct.entities = new java.util.ArrayList<TLZ_PatchEntry>(_list8.size); TLZ_PatchEntry _elem9; for (int _i10 = 0; _i10 < _list8.size; ++_i10) { _elem9 = new TLZ_PatchEntry(); _elem9.read(iprot); struct.entities.add(_elem9); } iprot.readListEnd(); } struct.setEntitiesIsSet(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(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, TLZ_Patch struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.entities != null) { oprot.writeFieldBegin(ENTITIES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.entities.size())); for (TLZ_PatchEntry _iter11 : struct.entities) { _iter11.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TLZ_PatchTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TLZ_PatchTupleScheme getScheme() { return new TLZ_PatchTupleScheme(); } } private static class TLZ_PatchTupleScheme extends org.apache.thrift.scheme.TupleScheme<TLZ_Patch> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TLZ_Patch struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.entities.size()); for (TLZ_PatchEntry _iter12 : struct.entities) { _iter12.write(oprot); } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TLZ_Patch struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.entities = new java.util.ArrayList<TLZ_PatchEntry>(_list13.size); TLZ_PatchEntry _elem14; for (int _i15 = 0; _i15 < _list13.size; ++_i15) { _elem14 = new TLZ_PatchEntry(); _elem14.read(iprot); struct.entities.add(_elem14); } } struct.setEntitiesIsSet(true); } } private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); } }
afs/lizard
lizard-base/src/main/java/lizard/api/TLZ/TLZ_Patch.java
Java
apache-2.0
13,636
/* * Copyright 2013 Gunnar Kappei. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.opengis.gml; /** * An XML MultiSurfaceType(@http://www.opengis.net/gml). * * This is a complex type. */ public interface MultiSurfaceType extends net.opengis.gml.AbstractGeometricAggregateType { public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType) org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(MultiSurfaceType.class.getClassLoader(), "schemaorg_apache_xmlbeans.system.s6E28D279B6C224D74769DB8B98AF1665").resolveHandle("multisurfacetypeb44dtype"); /** * Gets a List of "surfaceMember" elements */ java.util.List<net.opengis.gml.SurfacePropertyType> getSurfaceMemberList(); /** * Gets array of all "surfaceMember" elements * @deprecated */ @Deprecated net.opengis.gml.SurfacePropertyType[] getSurfaceMemberArray(); /** * Gets ith "surfaceMember" element */ net.opengis.gml.SurfacePropertyType getSurfaceMemberArray(int i); /** * Returns number of "surfaceMember" element */ int sizeOfSurfaceMemberArray(); /** * Sets array of all "surfaceMember" element */ void setSurfaceMemberArray(net.opengis.gml.SurfacePropertyType[] surfaceMemberArray); /** * Sets ith "surfaceMember" element */ void setSurfaceMemberArray(int i, net.opengis.gml.SurfacePropertyType surfaceMember); /** * Inserts and returns a new empty value (as xml) as the ith "surfaceMember" element */ net.opengis.gml.SurfacePropertyType insertNewSurfaceMember(int i); /** * Appends and returns a new empty value (as xml) as the last "surfaceMember" element */ net.opengis.gml.SurfacePropertyType addNewSurfaceMember(); /** * Removes the ith "surfaceMember" element */ void removeSurfaceMember(int i); /** * Gets the "surfaceMembers" element */ net.opengis.gml.SurfaceArrayPropertyType getSurfaceMembers(); /** * True if has "surfaceMembers" element */ boolean isSetSurfaceMembers(); /** * Sets the "surfaceMembers" element */ void setSurfaceMembers(net.opengis.gml.SurfaceArrayPropertyType surfaceMembers); /** * Appends and returns a new empty "surfaceMembers" element */ net.opengis.gml.SurfaceArrayPropertyType addNewSurfaceMembers(); /** * Unsets the "surfaceMembers" element */ void unsetSurfaceMembers(); /** * A factory class with static methods for creating instances * of this type. */ public static final class Factory { public static net.opengis.gml.MultiSurfaceType newInstance() { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); } public static net.opengis.gml.MultiSurfaceType newInstance(org.apache.xmlbeans.XmlOptions options) { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); } /** @param xmlAsString the string value to parse */ public static net.opengis.gml.MultiSurfaceType parse(java.lang.String xmlAsString) throws org.apache.xmlbeans.XmlException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, null ); } public static net.opengis.gml.MultiSurfaceType parse(java.lang.String xmlAsString, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, options ); } /** @param file the file from which to load an xml document */ public static net.opengis.gml.MultiSurfaceType parse(java.io.File file) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, null ); } public static net.opengis.gml.MultiSurfaceType parse(java.io.File file, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, options ); } public static net.opengis.gml.MultiSurfaceType parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, null ); } public static net.opengis.gml.MultiSurfaceType parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, options ); } public static net.opengis.gml.MultiSurfaceType parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, null ); } public static net.opengis.gml.MultiSurfaceType parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, options ); } public static net.opengis.gml.MultiSurfaceType parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, null ); } public static net.opengis.gml.MultiSurfaceType parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, options ); } public static net.opengis.gml.MultiSurfaceType parse(javax.xml.stream.XMLStreamReader sr) throws org.apache.xmlbeans.XmlException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, null ); } public static net.opengis.gml.MultiSurfaceType parse(javax.xml.stream.XMLStreamReader sr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, options ); } public static net.opengis.gml.MultiSurfaceType parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, null ); } public static net.opengis.gml.MultiSurfaceType parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, options ); } /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */ @Deprecated public static net.opengis.gml.MultiSurfaceType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, null ); } /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */ @Deprecated public static net.opengis.gml.MultiSurfaceType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException { return (net.opengis.gml.MultiSurfaceType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, options ); } /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */ @Deprecated public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException { return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); } /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */ @Deprecated public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException { return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); } private Factory() { } // No instance of this class allowed } }
moosbusch/xbLIDO
src/net/opengis/gml/MultiSurfaceType.java
Java
apache-2.0
10,068
/* * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.redshift.model.transform; import org.w3c.dom.Node; import javax.annotation.Generated; import com.amazonaws.AmazonServiceException; import com.amazonaws.transform.StandardErrorUnmarshaller; import com.amazonaws.services.redshift.model.AuthenticationProfileNotFoundException; @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AuthenticationProfileNotFoundExceptionUnmarshaller extends StandardErrorUnmarshaller { public AuthenticationProfileNotFoundExceptionUnmarshaller() { super(AuthenticationProfileNotFoundException.class); } @Override public AmazonServiceException unmarshall(Node node) throws Exception { // Bail out if this isn't the right error code that this // marshaller understands String errorCode = parseErrorCode(node); if (errorCode == null || !errorCode.equals("AuthenticationProfileNotFoundFault")) return null; AuthenticationProfileNotFoundException e = (AuthenticationProfileNotFoundException) super.unmarshall(node); return e; } }
aws/aws-sdk-java
aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/transform/AuthenticationProfileNotFoundExceptionUnmarshaller.java
Java
apache-2.0
1,678
package ru.job4j.pro.collections.list; import org.junit.Test; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; /** * NodeListTest class. * * @author Vladimir Ivanov * @version 0.1 * @since 30.08.2017 */ public class NodeListTest { /** * Test list is not cycled. */ @Test public void whenListIsNotCycledThenGetFalse() { Node<Integer> first = new Node<>(1); Node<Integer> two = new Node<>(2); Node<Integer> third = new Node<>(3); Node<Integer> four = new Node<>(4); Node<Integer> five = new Node<>(5); first.next = two; two.next = third; third.next = four; four.next = five; NodeList<Integer> list = new NodeList<>(first); boolean result = list.hasCycle(); assertThat(result, is(false)); } /** * Test list is cycled. */ @Test public void whenListIsCycledThenGetTrue() { Node<Integer> first = new Node<>(1); Node<Integer> two = new Node<>(2); Node<Integer> third = new Node<>(3); Node<Integer> four = new Node<>(4); first.next = two; two.next = third; third.next = four; four.next = first; NodeList<Integer> list = new NodeList<>(first); boolean result = list.hasCycle(); assertThat(result, is(true)); } /** * Test list is cycled. */ @Test public void whenBigListIsCycledThenGetTrue() { Node<Integer> node = new Node<>(0); Node<Integer> cycleFrom = null; Node<Integer> cycleTo = null; NodeList<Integer> list = new NodeList<>(node); for (int value = 1; value < 10000000; value++) { node.next = new Node<>(value); node = node.next; if (value == 900000) { cycleTo = node; } else if (value == 9990000) { cycleFrom = node; } } cycleFrom.next = cycleTo; boolean result = list.hasCycle(); assertThat(result, is(true)); } }
dimir2/vivanov
part2/ch1/src/test/java/ru/job4j/pro/collections/list/NodeListTest.java
Java
apache-2.0
2,090
# Amomum macrospermum Sm. SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Zingiberales/Zingiberaceae/Aframomum/Aframomum alboviolaceum/ Syn. Amomum macrospermum/README.md
Markdown
apache-2.0
180
'use strict'; /** * @ngdoc function * @name lubriApp.controller:MembersCtrl * @description * # MembersCtrl * Controller of the lubriApp */ angular.module('lubriApp') .config(function($stateProvider) { $stateProvider.state('app.members', { abstract: true, url: '/members', templateUrl: 'views/members/main.html', controller: 'MembersCtrl' }) .state('app.members.list', { url: '', templateUrl: 'views/members/list.html', controller: 'MembersCtrl' }) .state('app.members.add', { url: '/add', templateUrl: 'views/members/form.html', controller: 'MembersCtrl' }) .state('app.members.import', { url: '/import', templateUrl: 'views/members/import.html', controller: 'MembersCtrl' }) .state('app.members.edit', { url: '/:id/edit', templateUrl: 'views/members/form.html', controller: 'MembersCtrl' }) .state('app.members.view', { url: '/:id', templateUrl: 'views/members/view.html', controller: 'MembersCtrl' }); }) .controller('MembersCtrl', function($scope, $state, $stateParams, $q, $interval, toasty, Member, SweetAlert, i18nService) { var memberId = $stateParams.id; i18nService.setCurrentLang('zh-cn'); $scope.importData = []; $scope.gridImportOptions = { enableGridMenu: true, importerDataAddCallback: function( grid, newObjects ) { $scope.importData = $scope.importData.concat( newObjects ); }, onRegisterApi: function(gridApi){ $scope.gridImportApi = gridApi; gridApi.rowEdit.on.saveRow($scope, $scope.saveRow); }, data: 'importData' }; $scope.saveRow = function( rowEntity ) { // create a fake promise - normally you'd use the promise returned by $http or $resource var promise = $q.defer(); $scope.gridImportApi.rowEdit.setSavePromise( $scope.gridImportApi.grid, rowEntity, promise.promise ); $interval( function() { promise.resolve(); }, 1000, 1); }; $scope.saveImport = function () { if ($scope.importData.length > 0) { var members = $scope.importData; for (var i=0;i<members.length;i++) { var member = members[i]; member.created = new Date(); delete member.$$hashKey; Member.upsert(member, function() { }, function(err) { console.log(err); }); }; toasty.pop.success({title: '组员导入成功', msg: members.length + '个组员成功导入到系统中!', sound: false}); loadItems(); $state.go('^.list'); }; }; if (memberId) { $scope.member = Member.findById({ id: memberId }, function() {}, function(err) { console.log(err); }); } else { $scope.member = {}; } $scope.gridOptions = { data: 'members', enableFiltering: true, paginationPageSizes: [5, 10, 15], paginationPageSize: 10, headerRowHeight: 39, rowHeight: 39, columnFooterHeight: 39, gridFooterHeight: 39, selectionRowHeaderWidth: 39, columnDefs: [ { name: 'Edit', width: 80, displayName: '编辑', enableSorting: false, enableFiltering: false, cellTemplate: '<a href="" class="ui-state-hover" ui-sref="^.edit({id: row.entity.id})"> <i class="fa fa-pencil fa-lg blue"></i></a> <a href="" class="ui-state-hover" style="margin-left:5px;" ng-click="getExternalScopes().delete({id: row.entity.id})"><i class="fa fa-trash-o fa-lg red"></i></a>' }, { name: 'name', displayName: '全称', cellTemplate: '<div class="ui-grid-cell-contents"><a href="" ui-sref="^.view({id: row.entity.id})"> {{ COL_FIELD }} </a></div>'} ,{ name: 'firstName', displayName: '姓' } ,{ name: 'lastName', displayName: '名' } ,{ name: 'displayName', displayName: '显示名' } ,{ name: 'position', displayName: '职位' } , { name: 'priority', displayName: '排序号' } ], enableGridMenu: true, enableSelectAll: true, exporterCsvFilename: 'members.csv', exporterSuppressColumns: ['Edit'], exporterPdfDefaultStyle: {fontSize: 9}, exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, exporterPdfHeader: { text: "Meeting Member Information", style: 'headerStyle' }, exporterPdfFooter: function ( currentPage, pageCount ) { return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; }, exporterPdfCustomFormatter: function ( docDefinition ) { docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; return docDefinition; }, exporterPdfOrientation: 'portrait', exporterPdfPageSize: 'LETTER', exporterPdfMaxGridWidth: 500, exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")) }; $scope.gridOptions.onRegisterApi = function (gridApi) { $scope.gridApi = gridApi; }; function loadItems() { $scope.members = Member.find(); } loadItems(); $scope.viewActions = { delete : $scope.delete }; $scope.delete = function(id) { SweetAlert.swal({ title: '您确定要删除吗?', type: 'warning', showCancelButton: true, confirmButtonColor: '#DD6B55' }, function(isConfirm){ if (isConfirm) { Member.deleteById(id, function() { toasty.pop.success({title: '组员被删除', msg: '您成功删除了组员!', sound: false}); loadItems(); $state.go($state.current, {}, {reload: true}); //$state.go('app.members.list'); }, function(err) { toasty.pop.error({title: '删除组员出错', msg: '删除组员发生错误:' + err, sound: false}); }); } else { return false; } }); }; $scope.formFields = [{ key: 'name', type: 'text', label: '全名', required: true }, { key: 'firstName', type: 'text', label: '姓', required: true }, { key: 'lastName', type: 'text', label: '名', required: true }, { key: 'displayName', type: 'text', label: '显示名', required: true }, { key: 'position', type: 'text', label: '职位', required: true }, { key: 'priority', type: 'number', label: '排序号', required: true }]; $scope.formOptions = { uniqueFormId: true, hideSubmit: false, submitCopy: '保存' }; $scope.onSubmit = function() { if (($scope.member.created === null) || ($scope.member.created === undefined)){ $scope.member.created = new Date(); }; Member.upsert($scope.member, function() { toasty.pop.success({title: '组员保存成功', msg: '组员已成功保存到系统中!', sound: false}); loadItems(); $state.go('^.list'); }, function(err) { console.log(err); }); }; });
g8te/lubri
client/app/scripts/controllers/members.js
JavaScript
apache-2.0
7,033
package com.intel.media.mts.dao.impl; import org.junit.Assert; import org.junit.Test; import com.intel.media.mts.dao.DaoTestSupport; import com.intel.media.mts.model.Software; public class SoftwareDaoImplTest extends DaoTestSupport { @Test public void test(){ Software s = new Software(); String name = "Ubuntu"; String desc = "OS type 12.04"; s.setName(name); s.setDescription(desc); softwareDao.doSave(s); System.out.println(s); Software s2 = softwareDao.findById(s.getId()); Assert.assertEquals(name, s2.getName()); Assert.assertEquals(desc, s2.getDescription()); } }
zhubinqiang/myTMS
src/test/java/com/intel/media/mts/dao/impl/SoftwareDaoImplTest.java
Java
apache-2.0
598
# Pennisetum aureum Link SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Pennisetum/Pennisetum glaucum/ Syn. Pennisetum aureum/README.md
Markdown
apache-2.0
179
package com.thinkgem.jeesite.modules.purifier.dao; import com.thinkgem.jeesite.common.persistence.CrudDao; import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao; import com.thinkgem.jeesite.modules.purifier.entity.Ware; /** * 仓库管理dao * * @author addison * @since 2017年03月02日 */ @MyBatisDao public interface WareDao extends CrudDao<Ware> { int deleteByWare(Ware ware); }
cuiqunhao/jeesite
src/main/java/com/thinkgem/jeesite/modules/purifier/dao/WareDao.java
Java
apache-2.0
411
<form class="form-horizontal" role="form" name="form" ng-show="model" ng-submit="onFormSubmit()"> <div class="form-custom-alerts"> <alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">{{alert.msg}}</alert> </div> <div ng-form ng-repeat="field in fields" name="innerForm" ng-if="!field.hidden"> <div class="form-group" ng-class="{'has-feedback has-success': isSuccess(innerForm), 'has-feedback has-error': isError(innerForm)}"> <label class="col-sm-2 control-label">{{field.describe}}</label> <div class="col-sm-4" ng-switch="field.type"> <div class="checkbox" ng-switch-when='checkbox'> <label> <input type="checkbox" name="input" ng-model="model[field.name]"> {{field.checkBoxMessage != null ? field.checkBoxMessage : field.describe}} </label> </div> <div class="radio" ng-switch-when='radio'> <div class="radio" ng-repeat='option in field.options'> <label> <input type="radio" name="input" value="{{option.value}}" ng-model="model[field.name]" ng-required="true"> {{option.text}} </label> </div> </div> <div ng-switch-when='select'> <select class="form-control" name="input" ng-model="model[field.name]" ng-options="option.value as option.name for option in field.options" ng-required="field.required == null ? true : field.required"></select> </div> <div ng-switch-default> <input type="{{field.type || 'text'}}" class="form-control" placeholder="{{field.placeholder || ''}}" ng-disabled="!!field.disabled" ng-model="model[field.name]" name="input" ui-validate="validators" ng-required="field.required == null ? true : field.required" ng-pattern="patternForField(field)"> <span class="glyphicon glyphicon-ok form-control-feedback" ng-show="isSuccess(innerForm)"></span> <span class="glyphicon glyphicon-remove form-control-feedback" ng-show="isError(innerForm)"></span> </div> </div> <div class="help-block col-sm-6" ng-show='!hideError || attempted || innerForm.input.$dirty'> <p ng-show="innerForm.input.$error.required">{{field.describe}}不能为空!</p> <p ng-show="innerForm.input.$error.pattern">{{field.describe}}格式错误!</p> <p ng-show="innerForm.input.$error.minLength">{{field.describe}}最少需要{{field.minLength}}个字符!</p> <p ng-show="innerForm.input.$error.maxLength">{{field.describe}}的长度不能少于{{field.maxLength}}个字符!</p> <p ng-show="innerForm.input.$error.custom"> <span ng-show="!!field.validateMessage">{{field.validateMessage}}</span> <span ng-show="!field.validateMessage">{{field.describe}}填写有误!</span> </p> </div> </div> <div ng-if="field.type == 'password' && field.needConfirm == true" class="form-group" ng-class="{'has-feedback has-success': isSuccess(innerForm, 'confirm'), 'has-feedback has-error': isError(innerForm, 'confirm')}"> <label class="col-sm-2 control-label">确认密码</label> <div class="col-sm-4"> <input type="password" class="form-control" ng-model="extraModel[field.name]" name="confirm" ng-required="field.required == null || field.required || !!model[fieldname]" ui-validate="{passwordMatch: '$value==model[field.name]'}" ui-validate-watch=" 'model[field.name]' "> <span class="glyphicon glyphicon-ok form-control-feedback" ng-show="isSuccess(innerForm, 'confirm')"></span> <span class="glyphicon glyphicon-remove form-control-feedback" ng-show="isError(innerForm, 'confirm')"></span> </div> <div class="help-block col-sm-6" ng-show='!hideError || attempted || innerForm.confirm.$dirty'> <span ng-show="innerForm.confirm.$error.required">确认密码不能为空!</span> <span ng-show="!innerForm.confirm.$error.required && innerForm.confirm.$error.passwordMatch">两次密码输入不一致!</span> </div> </div> </div> <div class="form-group" ng-if="submitButton != 'none'"> <div class="col-sm-offset-2 col-sm-8"> <button type="submit" class="btn btn-primary">{{submitButton || '保存修改'}}</button> </div> </div> <div ng-transclude></div> </form>
redduck3/CodeRush
ourplatform/static/js/template/form.html
HTML
apache-2.0
4,914
# Hyophila tortula (Schwaegr.) Hampe SPECIES #### Status SYNONYM #### According to Integrated Taxonomic Information System #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Bryophyta/Bryopsida/Pottiales/Pottiaceae/Hyophila/Hyophila involuta/ Syn. Hyophila tortula/README.md
Markdown
apache-2.0
191
# Artemisia glauca var. cernua (Nutt.) Bush VARIETY #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Artemisia/Artemisia dracunculus/ Syn. Artemisia glauca cernua/README.md
Markdown
apache-2.0
198
# Peperomia acuminata f. acuminata FORM #### Status ACCEPTED #### According to NUB Generator [autonym] #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Piperales/Piperaceae/Peperomia/Peperomia acuminata/Peperomia acuminata acuminata/README.md
Markdown
apache-2.0
171
# Coburgia multiflora (W.T.Aiton) Herb. SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Amaryllidaceae/Brunsvigia/Brunsvigia orientalis/ Syn. Coburgia multiflora/README.md
Markdown
apache-2.0
194
# Leucanthemum vulgare subsp. silvaticum (Brot.) Nyman SUBSPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Leucanthemum/Leucanthemum sylvaticum/ Syn. Leucanthemum vulgare silvaticum/README.md
Markdown
apache-2.0
212
# Syntriandrum Engl. GENUS #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Ranunculales/Menispermaceae/Syntriandrum/README.md
Markdown
apache-2.0
166
# Tradescantia harbisonii Bush SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Commelinales/Commelinaceae/Tradescantia/Tradescantia subacaulis/ Syn. Tradescantia harbisonii/README.md
Markdown
apache-2.0
185
# Chondria decidua Tani & Masuda, 2003 SPECIES #### Status ACCEPTED #### According to World Register of Marine Species #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Rhodophyta/Florideophyceae/Ceramiales/Rhodomelaceae/Chondria/Chondria decidua/README.md
Markdown
apache-2.0
187
# Depazea erdingeri Thüm. SPECIES #### Status ACCEPTED #### According to Index Fungorum #### Published in null #### Original name Depazea erdingeri Thüm. ### Remarks null
mdoering/backbone
life/Fungi/Ascomycota/Sordariomycetes/Diaporthales/Gnomoniaceae/Asteroma/Depazea erdingeri/README.md
Markdown
apache-2.0
177
# Callaeolepium warscewiczii Karst. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Asclepiadaceae/Callaeolepium/Callaeolepium warscewiczii/README.md
Markdown
apache-2.0
183
# Arctium concolor Kuntze SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Cousinia concolor/ Syn. Arctium concolor/README.md
Markdown
apache-2.0
180
# Vincetoxicum raddeanum Albov SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Apocynaceae/Vincetoxicum/Vincetoxicum raddeanum/README.md
Markdown
apache-2.0
178
# Salacia obovata var. obovata VARIETY #### Status ACCEPTED #### According to NUB Generator [autonym] #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Celastrales/Celastraceae/Salacia/Salacia obovata/Salacia obovata obovata/README.md
Markdown
apache-2.0
170
function buildName(firstName = "Will", lastName: string) { return firstName + " " + lastName; } let result1 = buildName("Bob"); // error, too few parameters let result2 = buildName("Bob", "Adams", "Sr."); // error, too many parameters let result3 = buildName("Bob", "Adams"); // okay and returns "Bob Adams" let result4 = buildName(undefined, "Adams"); // okay and returns "Will Adams"
XNSystemsStudy/Modern-Web-Development
src/170109-optional.ts
TypeScript
apache-2.0
420
#!/usr/bin/env ruby require 'erb' require 'json' require 'optparse' @target = nil @users = 1 @concurrency = 1 @maxrate = 10 @maxhits = nil OptionParser.new do | opts | opts.banner = "Usage: generate.rb [options] target" opts.on('--target [string]', "Specify the target server for requests (required)") do | v | @target = v.split(':') end opts.on('--virtual-users [int]', Integer, "Specify the number of virtual users (default: #{@users})") do | v | @users = v end opts.on('--virtual-user-clones [int]', Integer, "Specify the number of each virtual user clones (default: #{@concurrency})") do | v | @concurrency = v end opts.on('--max-request-rate [float]', Float, "Specify the maximum requests per minute (default: #{@maxrate})") do | v | @maxrate = v end opts.on('--max-hits [int]', Integer, "Maximum number of hits to generate jmeter requests (default: #{@maxhits})") do | v | @maxhits = v end opts.on('-h', '--help', 'Display this help') do puts opts exit end end.parse! raise OptionParser::InvalidOption if @target.nil? json = JSON.parse ARGF.read @buckets = Array.new(@users) { Array.new } json['hits']['hits'].each_with_index do | hit, i | next if not @maxhits.nil? and i > @maxhits source = hit['_source'] next if '/_bulk' == source['path'] @buckets[i % @users].push( { :id => hit['_index'] + ':' + hit['_id'], :method => source['method'], :path => source['path'], :querydata => source['querystr'], :requestdata => source['data'], } ) end template = ERB.new File.new("jmeter.jmx.erb").read, nil, "%" puts template.result(binding)
cityindex-attic/logsearch
example/jmeter-loadtest/generate.rb
Ruby
apache-2.0
1,659
# Buchnera floridana Gand. SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in Bull. Soc. Bot. France 66:217. 1919 #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Orobanchaceae/Buchnera/Buchnera floridana/README.md
Markdown
apache-2.0
213
/* * @(#)TIFFHeader.java * * $Date: 2014-03-13 04:15:48 -0400 (Thu, 13 Mar 2014) $ * * Copyright (c) 2011 by Jeremy Wood. * All rights reserved. * * The copyright of this software is owned by Jeremy Wood. * You may not use, copy or modify this software, except in * accordance with the license agreement you entered into with * Jeremy Wood. For details see accompanying license terms. * * This software is probably, but not necessarily, discussed here: * https://javagraphics.java.net/ * * That site should also contain the most recent official version * of this software. (See the SVN repository for more details.) * Modified BSD License Copyright (c) 2015, Jeremy Wood. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * 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. * The name of the contributors may not be used to endorse or promote products derived from this software without specific prior written permission. * * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. * */ package gr.iti.mklab.reveal.forensics.util.ThumbnailExtractor.image.jpeg; import java.io.IOException; import java.io.InputStream; class TIFFHeader { boolean bigEndian; int ifdOffset; TIFFHeader(InputStream in) throws IOException { byte[] array = new byte[4]; if(JPEGMarkerInputStream.readFully(in, array, 2, false)!=2) { throw new IOException("Incomplete TIFF Header"); } if(array[0]==73 && array[1]==73) { //little endian bigEndian = false; } else if(array[0]==77 && array[1]==77) { //big endian bigEndian = true; } else { throw new IOException("Unrecognized endian encoding."); } if(JPEGMarkerInputStream.readFully(in, array, 2, !bigEndian)!=2) { throw new IOException("Incomplete TIFF Header"); } if(!(array[0]==0 && array[1]==42)) { //required byte in TIFF header throw new IOException("Missing required identifier 0x002A."); } if(JPEGMarkerInputStream.readFully(in, array, 4, !bigEndian)!=4) { throw new IOException("Incomplete TIFF Header"); } ifdOffset = ((array[0] & 0xff) << 24) + ((array[1] & 0xff) << 16) + ((array[2] & 0xff) << 8) + ((array[3] & 0xff) << 0) ; } /** The length of this TIFF header. */ int getLength() { return 8; } }
MKLab-ITI/image-forensics
java_service/src/main/java/gr/iti/mklab/reveal/forensics/util/ThumbnailExtractor/image/jpeg/TIFFHeader.java
Java
apache-2.0
3,339
<?php use App\Models\Post; use Illuminate\Support\Facades\DB; use Test\Factory; use Test\TestCase; class PostControllerTest extends TestCase { public function setUp() { parent::setUp(); DB::table('posts')->delete(); $this->user = Factory::create('user'); $this->be($this->user); } public function testIndex() { $this->call('GET', 'posts'); $this->assertResponseOk(); $this->assertViewHas('posts'); } public function testCreate() { $this->call('GET', 'posts/create'); $this->assertResponseOk(); } public function testStore() { $countPosts = Post::count(); $inputs = [ 'title' => 'title POst', 'content' => 'Content posts' ]; $this->call('POST', 'posts', $inputs); $this->assertEquals($countPosts + 1, Post::count()); $this->assertRedirectedTo('/posts'); } public function testEdit() { $post = Factory::create('post'); $this->call('GET', 'posts/'.$post->id.'/edit'); $this->assertResponseOk(); } public function testUpdate() { $oldTitle = 'Old title'; $newTitle = 'New title'; $post = Factory::create('post', ['title' => $oldTitle]); $inputs = [ 'title' => $newTitle, ]; $this->shouldRedirectBack(); $this->call('PUT', 'posts/'.$post->id, $inputs); $freshPost = Post::find($post->id); $this->assertEquals($newTitle, $freshPost->title); } public function testDestroy() { $post = Factory::create('post'); $countPosts = Post::count(); $this->shouldRedirectBack(); $this->call('DELETE', 'posts/'.$post->id); $this->assertEquals($countPosts - 1, Post::count()); } }
pinnackl/cabrette-dev
tests/Http/Controllers/PostControllerTest.php
PHP
apache-2.0
1,851
/** * */ /** * @author root * */ package com.amanaje.activities;
damico/amanaje
source-code/Amanaje/src/com/amanaje/activities/package-info.java
Java
apache-2.0
70
package eu.ailao.hub.dialog; import eu.ailao.hub.corefresol.answers.ClueMemorizer; import eu.ailao.hub.corefresol.concepts.ConceptMemorizer; import eu.ailao.hub.questions.Question; import java.util.ArrayList; /** * Created by Petr Marek on 24.02.2016. * Dialog class represents dialog. It contains id of dialog and ids of questions in this dialog. */ public class Dialog { private int id; private ArrayList<Question> questionsOfDialogue; private ConceptMemorizer conceptMemorizer; private ClueMemorizer clueMemorizer; public Dialog(int id) { this.id = id; this.questionsOfDialogue = new ArrayList<>(); this.conceptMemorizer = new ConceptMemorizer(); this.clueMemorizer = new ClueMemorizer(); } /** * Adds question to dialog * @param questionID id of question */ public void addQuestion(Question questionID) { questionsOfDialogue.add(questionID); } public ArrayList<Question> getQuestions() { return questionsOfDialogue; } /** * Gets all question's ids of dialog * @return array list of question's ids in dialog */ public ArrayList<Integer> getQuestionsIDs() { ArrayList<Integer> questionIDs = new ArrayList<Integer>(); for (int i = 0; i < questionsOfDialogue.size(); i++) { questionIDs.add(questionsOfDialogue.get(i).getYodaQuestionID()); } return questionIDs; } public int getId() { return id; } public ConceptMemorizer getConceptMemorizer() { return conceptMemorizer; } public ClueMemorizer getClueMemorizer() { return clueMemorizer; } public boolean hasQuestionWithId(int id) { for (Question question : questionsOfDialogue) { if (question.getYodaQuestionID() == id) { return true; } } return false; } }
brmson/hub
src/main/java/eu/ailao/hub/dialog/Dialog.java
Java
apache-2.0
1,699
// Copyright 2016 Yahoo Inc. // Licensed under the terms of the Apache license. Please see LICENSE.md file distributed with this work for terms. package com.yahoo.bard.webservice.data.metric; /** * LogicalMetricColumn. */ public class LogicalMetricColumn extends MetricColumn { private final LogicalMetric metric; /** * Constructor. * * @param name The column name * @param metric The logical metric * * @deprecated because LogicalMetricColumn is really only a thing for LogicalTable, so there's no reason for there * to be an alias on the LogicalMetric inside the LogicalTableSchema. */ @Deprecated public LogicalMetricColumn(String name, LogicalMetric metric) { super(name); this.metric = metric; } /** * Constructor. * * @param metric The logical metric */ public LogicalMetricColumn(LogicalMetric metric) { super(metric.getName()); this.metric = metric; } /** * Getter for a logical metric. * * @return logical metric */ public LogicalMetric getLogicalMetric() { return this.metric; } @Override public String toString() { return "{logicalMetric:'" + getName() + "'}"; } }
yahoo/fili
fili-core/src/main/java/com/yahoo/bard/webservice/data/metric/LogicalMetricColumn.java
Java
apache-2.0
1,271
require 'tpaga' Tpaga::Swagger.configure do |config| config.scheme = 'https' config.host = 'sandbox.tpaga.co' config.base_path = '/api' config.inject_format = false config.api_key = ENV["TPAGA_API_KEY"] end
Tpaga/tpaga-demo-api
tpaga_config.rb
Ruby
apache-2.0
218
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>Belkyra</title> <!-- Bootstrap Core CSS --> <link href="../css/bootstrap.min.css" rel="stylesheet"> <!-- Custom CSS --> <link href="../css/services.css" rel="stylesheet"> <!-- Import fonts --> <link href="https://fonts.googleapis.com/css?family=Alegreya+Sans+SC|Open+Sans" rel="stylesheet"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <!-- Navigation --> <nav class="navbar navbar-default navbar-fixed-top" role="navigation"> <!-- contact-bar --> <div class="contact-bar container"> <div class="contact-info"> <div class="phone-number"> <a id="facebook-icon" href="https://www.facebook.com/mdlaserskinclinic"> <img width="20px" height="20px" src="https://cdn1.iconfinder.com/data/icons/logotypes/32/square-facebook-512.png"> </a> <p>416-445-7546</p> </div> </div> </div> <div class="container"> <div class="navbar-header page-scroll"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <div class="navbar-header"> <a class= "navbar-brand logo page-scroll" href="../index.html"> <img id="MD-logo" alt="logo" src="../css/imgs/logo.png"> </a> <a id="title" class= "navbar-brand text page-scroll" href="../index.html"> Laser Skin Clinic </br> and medi-spa </a> </div> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav navbar-right"> <!-- Hidden li included to remove active class from about link when scrolled up past about section --> <li class="hidden"> <a class="page-scroll" href="../index.html#page-top"></a> </li> <li> <a class="page-scroll" href="../index.html#about">about</a> </li> <li> <a class="page-scroll" href="../index.html#treatments">treatments</a> </li> <li> <a class="page-scroll" href="../index.html#products">products</a> </li> <li> <a class="page-scroll" href="../index.html#specials">specials</a> </li> <li> <a class="page-scroll" href="../index.html#staff"> staff </a> </li> <li> <a class="page-scroll" href="../index.html#contact">contact</a> </li> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container --> </nav> <div class="container information"> <div class="row"> <h1>BELKYRA®</h1> <div class="col-sm-8"> <p class="description">BELKYRA® is an innovative injection treatment for both men and women who want to permanently reduce the appearance of a mild to moderate “double chin”, (that is, the fat area under the mandible), without surgery. BELKYRA® is the first and only Health Canada approved injectable treatment for this purpose, meeting research-based, safety requirements. It is not recommended for the treatment of severe fat accumulation in the chin and neck. </p> <br><br> </div> <div class="col-sm-4 photo"> <img src="../css/imgs/belkyra-add.png"> </div> </div> <div class="row"> <div class="faq col-sm-8"> <h3>How does BELKYRA® work?</h3> <p> The active ingredient in BELKYRA® is deoxycholic acid, a naturally occurring molecule in the body that aids in the breakdown and absorption of dietary fat. Once it is injected into the skin under the submental chin area, BELKYRA® targets and eliminates fat cells when injected into the area under your chin over a period of 6-8 weeks. Many patients treated with BELKYRA® experience visible improvement with 2 – 4 treatments. Very rarely, up to a maximum of 6 treatments are needed to achieve ideal results. </p> <br> <h3>How is BELKYRA® administered?</h3> <p> BELKYRA® is given in a series of small injections into the skin under the chin, requiring about 15-20mins to complete. It is relatively painless, but some burning sensation within the first 15-20 mins is expected and desired. </p> <br> <h3>What are the side effects and is there downtime?</h3> <p> For most people, the downtime is minimal and occurs most after the first treatment session. As with other injectible treatments, you may experience some post-op transient pain, bruising and numbness under the chin after the procedure. . In most cases, the use of ice packs will make the injection procedure completely tolerable without using topical anaesthetic creams. In clinical trials, mild burning pain after treatment was gone within 15-30 minutes of treatment. <br> However, the main side-effect from the procedure is immediate swelling in the area due to injecting fluid under the chin, and later, due to inflammation as the fat cells melt down and are disposed by the immune system. Therefore, it is important to expect that things will look worse, before it gets better. Given that the result is permanent without surgery, the side effects are insignificant. </p> <br> <h3>How much does it cost?</h3> <p> BELKYRA® injections require a minimum of 2 to 4 treatments to have efficacy to reduce a double chin depending on the size of the area to be treated. The maximum number of treatments is six, according to the approved guidelines. At MD Laser Skin Clinic, we charge $2200 for the first 2 sessions (spaced 6-8 weeks apart), and $800 for any subsequent treatments, up to a maximum of 6. </p> <br> <p> For more information and an assessment if BELKYRA therapy is the right treatment for you, please call us for a consultation with our trained medical professional. </p> <a id="book-btn" href="../index.html#contact"><button type="button" class="btn btn-default"> Book Today </button></a> </div> <div class="treatments-menu col-sm-4"> <h3>More Treatments:</h3> <ul> <li><a href="botox-for-wrinkles.html">Botox Cosmetic®</a></li> <li><a href="filler.html">Fillers</a></li> <li><a href="botox-for-sweating.html">Botox Therapeutic® (exessive sweating)</a></li> <li><a href="laser-IPL-hair-removal.html">Laser Hair Removal</a></li> <li><a href="botox-for-tmjd.html">Botox Therapeutic® (TMJ muscle pain)</a></li> <li><a href="microneedling.html">Microneedling</a></li> <li><a href="medical-facials.html">Medical Facials</a></li> <li><a href="IPL-photofacial.html">IPL Photofacial Rejuvenation</a></li> <li><a href="chemical-peel.html">Chemical Peeling</a></li> <li><a href="belkyra.html">Belkyra®</a></li> </ul> </div> </div> </div> <footer> <div class="row container"> <div class="col-md-4 nav"> <h4> MD Laser Skin Clinic</h4> <a href="../index.html#about">About</a> </br> <a href="../index.html#treatments">Treatments</a></br> <a href="../index.html#products">Products</a></br> <a href="../index.html#staff">Staff</a></br> <a href="../index.html#specials">Specials</a></br> <a href="../index.html#contact">Contact</a></br> </div> <div class="col-md-4 contact-info"> <h4>Contact Us</h4> <p> Call: 416-445-7546</p> <p> Email: [email protected]</p> <p id="trademark">BOTOX COSMETIC® is a registered trademark of Allergan Inc. <br> LATISSE® is a registered trademark of Allergan Inc. <br> SOFT LIFT™ is a trademark of Allergan Inc. <br> JUVEDERM® is a registered trademark of Allergan Holdings France SAS <br> VOLBELLA™ is a trademark of Allergan Inc. <br> VOLUMA® is a registered trademark of Allergan Inc. </p> <a href="../disclaimer.html">disclaimer</a> </div> <div class="col-md-4 address"> <h4>Address</h4> <p>1200 Lawrence Avenue East</p> <p>Suite 204</p> <p>North York, Ontario</p> <p>M3A 1C1</p> </div> </div> </footer> <!-- jQuery --> <script src="js/jquery.js"></script> <script src="js/custom-jquery.js"></script> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- Scrolling Nav JavaScript --> <script src="js/jquery.easing.min.js"></script> <script src="js/scrolling-nav.js"></script> </body> </html>
tjlam/tjlam.github.io
services/belkyra.html
HTML
apache-2.0
10,799
package esidev import ( "net/http" "time" "github.com/gorilla/mux" ) var _ time.Time var _ = mux.NewRouter func GetIncursions(w http.ResponseWriter, r *http.Request) { var ( localV interface{} err error datasource string ) // shut up warnings localV = localV err = err j := `[ { "constellation_id" : 20000607, "faction_id" : 500019, "has_boss" : true, "infested_solar_systems" : [ 30004148, 30004149, 30004150, 30004151, 30004152, 30004153, 30004154 ], "influence" : 0.9, "staging_solar_system_id" : 30004154, "state" : "mobilizing", "type" : "Incursion" } ]` if err := r.ParseForm(); err != nil { errorOut(w, r, err) return } if r.Form.Get("datasource") != "" { localV, err = processParameters(datasource, r.Form.Get("datasource")) if err != nil { errorOut(w, r, err) return } datasource = localV.(string) } if r.Form.Get("page") != "" { var ( localPage int32 localIntPage interface{} ) localIntPage, err := processParameters(localPage, r.Form.Get("page")) if err != nil { errorOut(w, r, err) return } localPage = localIntPage.(int32) if localPage > 1 { w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) w.Write([]byte("[]")) return } } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) w.Write([]byte(j)) }
antihax/mock-esi
dev/go/api_incursions.go
GO
apache-2.0
1,390
using System.Collections.Generic; using RestSharp; using SimpleJson; namespace MoneySharp.Internal.Model { public class SalesInvoicePost : SalesInvoice { public IList<SalesInvoiceDetail> details_attributes { get; set; } public JsonObject custom_fields_attributes { get; set; } } }
SpringIT/moneysharp
src/MoneySharp/Internal/Model/SalesInvoicePost.cs
C#
apache-2.0
322
package coop.ekologia.presentation.controller.user; import java.io.IOException; import javax.inject.Inject; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import coop.ekologia.presentation.EkologiaServlet; import coop.ekologia.presentation.session.LoginSession; /** * Servlet implementation class LoginConnectionServlet */ @WebServlet(LoginDeconnectionServlet.routing) public class LoginDeconnectionServlet extends EkologiaServlet { private static final long serialVersionUID = 1L; public static final String routing = "/login/deconnection"; public static final String routing(HttpServletRequest request) { return getUrl(request, routing); } @Inject LoginSession loginSession; /** * @see HttpServlet#HttpServlet() */ public LoginDeconnectionServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { loginSession.setUser(null); response.sendRedirect(request.getHeader("referer")); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } }
imie-source/Ekologia
EkologiaGUI/src/coop/ekologia/presentation/controller/user/LoginDeconnectionServlet.java
Java
apache-2.0
1,605
/* * Copyright 2010-2020 Alfresco Software, Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.activiti.engine.impl.cmd; import java.io.InputStream; import org.activiti.engine.ActivitiException; import org.activiti.engine.ActivitiObjectNotFoundException; import org.activiti.engine.delegate.event.ActivitiEventType; import org.activiti.engine.delegate.event.impl.ActivitiEventBuilder; import org.activiti.engine.impl.identity.Authentication; import org.activiti.engine.impl.interceptor.Command; import org.activiti.engine.impl.interceptor.CommandContext; import org.activiti.engine.impl.persistence.entity.AttachmentEntity; import org.activiti.engine.impl.persistence.entity.ByteArrayEntity; import org.activiti.engine.impl.persistence.entity.ExecutionEntity; import org.activiti.engine.impl.persistence.entity.TaskEntity; import org.activiti.engine.impl.util.IoUtil; import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.task.Attachment; import org.activiti.engine.task.Task; /** */ // Not Serializable public class CreateAttachmentCmd implements Command<Attachment> { protected String attachmentType; protected String taskId; protected String processInstanceId; protected String attachmentName; protected String attachmentDescription; protected InputStream content; protected String url; public CreateAttachmentCmd(String attachmentType, String taskId, String processInstanceId, String attachmentName, String attachmentDescription, InputStream content, String url) { this.attachmentType = attachmentType; this.taskId = taskId; this.processInstanceId = processInstanceId; this.attachmentName = attachmentName; this.attachmentDescription = attachmentDescription; this.content = content; this.url = url; } public Attachment execute(CommandContext commandContext) { if (taskId != null) { verifyTaskParameters(commandContext); } if (processInstanceId != null) { verifyExecutionParameters(commandContext); } return executeInternal(commandContext); } protected Attachment executeInternal(CommandContext commandContext) { AttachmentEntity attachment = commandContext.getAttachmentEntityManager().create(); attachment.setName(attachmentName); attachment.setProcessInstanceId(processInstanceId); attachment.setTaskId(taskId); attachment.setDescription(attachmentDescription); attachment.setType(attachmentType); attachment.setUrl(url); attachment.setUserId(Authentication.getAuthenticatedUserId()); attachment.setTime(commandContext.getProcessEngineConfiguration().getClock().getCurrentTime()); commandContext.getAttachmentEntityManager().insert(attachment, false); if (content != null) { byte[] bytes = IoUtil.readInputStream(content, attachmentName); ByteArrayEntity byteArray = commandContext.getByteArrayEntityManager().create(); byteArray.setBytes(bytes); commandContext.getByteArrayEntityManager().insert(byteArray); attachment.setContentId(byteArray.getId()); attachment.setContent(byteArray); } commandContext.getHistoryManager().createAttachmentComment(taskId, processInstanceId, attachmentName, true); if (commandContext.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) { // Forced to fetch the process-instance to associate the right // process definition String processDefinitionId = null; if (attachment.getProcessInstanceId() != null) { ExecutionEntity process = commandContext.getExecutionEntityManager().findById(processInstanceId); if (process != null) { processDefinitionId = process.getProcessDefinitionId(); } } commandContext.getProcessEngineConfiguration().getEventDispatcher() .dispatchEvent(ActivitiEventBuilder.createEntityEvent(ActivitiEventType.ENTITY_CREATED, attachment, processInstanceId, processInstanceId, processDefinitionId)); commandContext.getProcessEngineConfiguration().getEventDispatcher() .dispatchEvent(ActivitiEventBuilder.createEntityEvent(ActivitiEventType.ENTITY_INITIALIZED, attachment, processInstanceId, processInstanceId, processDefinitionId)); } return attachment; } protected TaskEntity verifyTaskParameters(CommandContext commandContext) { TaskEntity task = commandContext.getTaskEntityManager().findById(taskId); if (task == null) { throw new ActivitiObjectNotFoundException("Cannot find task with id " + taskId, Task.class); } if (task.isSuspended()) { throw new ActivitiException("It is not allowed to add an attachment to a suspended task"); } return task; } protected ExecutionEntity verifyExecutionParameters(CommandContext commandContext) { ExecutionEntity execution = commandContext.getExecutionEntityManager().findById(processInstanceId); if (execution == null) { throw new ActivitiObjectNotFoundException("Process instance " + processInstanceId + " doesn't exist", ProcessInstance.class); } if (execution.isSuspended()) { throw new ActivitiException("It is not allowed to add an attachment to a suspended process instance"); } return execution; } }
Activiti/Activiti
activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/cmd/CreateAttachmentCmd.java
Java
apache-2.0
5,884
// // WebViewPushController.h // Tools // // Created by 张书孟 on 2018/4/16. // Copyright © 2018年 张书孟. All rights reserved. // #import "BaseViewController.h" @interface WebViewPushController : BaseViewController @property (nonatomic, strong) NSString *url; @end
ZSMHup/Tools
Tools/Page/HTML5/WebViewPushController.h
C
apache-2.0
282
package org.seasar.doma.internal.jdbc.dialect; import org.seasar.doma.internal.jdbc.sql.SimpleSqlNodeVisitor; import org.seasar.doma.internal.jdbc.sql.node.AnonymousNode; import org.seasar.doma.jdbc.SqlNode; public class StandardCountCalculatingTransformer extends SimpleSqlNodeVisitor<SqlNode, Void> { protected boolean processed; public SqlNode transform(SqlNode sqlNode) { AnonymousNode result = new AnonymousNode(); for (SqlNode child : sqlNode.getChildren()) { result.appendNode(child.accept(this, null)); } return result; } @Override protected SqlNode defaultAction(SqlNode node, Void p) { return node; } }
domaframework/doma
doma-core/src/main/java/org/seasar/doma/internal/jdbc/dialect/StandardCountCalculatingTransformer.java
Java
apache-2.0
656
# Boopis scapigera var. ventosa (Meyen) Wedd. VARIETY #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Calyceraceae/Boopis/Boopis scapigera/Boopis scapigera ventosa/README.md
Markdown
apache-2.0
193
# Phaeosphaeria juncicola (Rehm ex G. Winter) L. Holm, 1957 SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in Symb. bot. upsal. 14(no. 3): 129 (1957) #### Original name Leptosphaeria juncicola Rehm, 1879 ### Remarks null
mdoering/backbone
life/Fungi/Ascomycota/Dothideomycetes/Pleosporales/Phaeosphaeriaceae/Phaeosphaeria/Phaeosphaeria juncicola/README.md
Markdown
apache-2.0
280
<div class="uk-width-1-4@m"> <div class="uk-card uk-card-default uk-card-body uk-margin-large-bottom"> <h3 class="uk-panel-title">分类</h3> <ul class="uk-list uk-list-line"> <li><a href="#">PHP</a></li> <li><a href="#">Javascript</a></li> </ul> </div> <div class="uk-card uk-card-default uk-card-body"> <h3 class="uk-panel-title">友情链接</h3> <ul class="uk-list"> </ul> </div> </div>
ayermac/cblog
themes/index/inc/side.html
HTML
apache-2.0
478
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * COPYRIGHT (C) 2007 * THE REGENTS OF THE UNIVERSITY OF MICHIGAN * ALL RIGHTS RESERVED * * Permission is granted to use, copy, create derivative works * and redistribute this software and such derivative works * for any purpose, so long as the name of The University of * Michigan is not used in any advertising or publicity * pertaining to the use of distribution of this software * without specific, written prior authorization. If the * above copyright notice or any other identification of the * University of Michigan is included in any copy of any * portion of this software, then the disclaimer below must * also be included. * * THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION * FROM THE UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY * PURPOSE, AND WITHOUT WARRANTY BY THE UNIVERSITY OF * MICHIGAN OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING * WITHOUT LIMITATION THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE * REGENTS OF THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE * FOR ANY DAMAGES, INCLUDING SPECIAL, INDIRECT, INCIDENTAL, OR * CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY CLAIM ARISING * OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN * IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF * SUCH DAMAGES. */ #include <errno.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <regex.h> #include "pkinit.h" typedef struct _pkinit_cert_info pkinit_cert_info; typedef enum { kw_undefined = 0, kw_subject = 1, kw_issuer = 2, kw_san = 3, kw_eku = 4, kw_ku = 5 } keyword_type; static char * keyword2string(unsigned int kw) { switch(kw) { case kw_undefined: return "NONE"; break; case kw_subject: return "SUBJECT"; break; case kw_issuer: return "ISSUER"; break; case kw_san: return "SAN"; break; case kw_eku: return "EKU"; break; case kw_ku: return "KU"; break; default: return "INVALID"; break; } } typedef enum { relation_none = 0, relation_and = 1, relation_or = 2 } relation_type; static char * relation2string(unsigned int rel) { switch(rel) { case relation_none: return "NONE"; break; case relation_and: return "AND"; break; case relation_or: return "OR"; break; default: return "INVALID"; break; } } typedef enum { kwvaltype_undefined = 0, kwvaltype_regexp = 1, kwvaltype_list = 2 } kw_value_type; static char * kwval2string(unsigned int kwval) { switch(kwval) { case kwvaltype_undefined: return "NONE"; break; case kwvaltype_regexp: return "REGEXP"; break; case kwvaltype_list: return "LIST"; break; default: return "INVALID"; break; } } struct keyword_desc { const char *value; size_t length; keyword_type kwtype; kw_value_type kwvaltype; } matching_keywords[] = { { "<KU>", 4, kw_ku, kwvaltype_list }, { "<EKU>", 5, kw_eku, kwvaltype_list }, { "<SAN>", 5, kw_san, kwvaltype_regexp }, { "<ISSUER>", 8, kw_issuer, kwvaltype_regexp }, { "<SUBJECT>", 9, kw_subject, kwvaltype_regexp }, { NULL, 0, kw_undefined, kwvaltype_undefined}, }; struct ku_desc { const char *value; size_t length; unsigned int bitval; }; struct ku_desc ku_keywords[] = { { "digitalSignature", 16, PKINIT_KU_DIGITALSIGNATURE }, { "keyEncipherment", 15, PKINIT_KU_KEYENCIPHERMENT }, { NULL, 0, 0 }, }; struct ku_desc eku_keywords[] = { { "pkinit", 6, PKINIT_EKU_PKINIT }, { "msScLogin", 9, PKINIT_EKU_MSSCLOGIN }, { "clientAuth", 10, PKINIT_EKU_CLIENTAUTH }, { "emailProtection", 15, PKINIT_EKU_EMAILPROTECTION }, { NULL, 0, 0 }, }; /* Rule component */ typedef struct _rule_component { struct _rule_component *next; keyword_type kw_type; kw_value_type kwval_type; regex_t regexp; /* Compiled regular expression */ char *regsrc; /* The regular expression source (for debugging) */ unsigned int ku_bits; unsigned int eku_bits; } rule_component; /* Set rule components */ typedef struct _rule_set { relation_type relation; int num_crs; rule_component *crs; } rule_set; static krb5_error_code free_rule_component(krb5_context context, rule_component *rc) { if (rc == NULL) return 0; if (rc->kwval_type == kwvaltype_regexp) { free(rc->regsrc); regfree(&rc->regexp); } free(rc); return 0; } static krb5_error_code free_rule_set(krb5_context context, rule_set *rs) { rule_component *rc, *trc; if (rs == NULL) return 0; for (rc = rs->crs; rc != NULL;) { trc = rc->next; free_rule_component(context, rc); rc = trc; } free(rs); return 0; } static krb5_error_code parse_list_value(krb5_context context, keyword_type type, char *value, rule_component *rc) { krb5_error_code retval; char *comma; struct ku_desc *ku = NULL; int found; size_t len; unsigned int *bitptr; if (value == NULL || value[0] == '\0') { pkiDebug("%s: Missing or empty value for list keyword type %d\n", __FUNCTION__, type); retval = EINVAL; goto out; } if (type == kw_eku) { bitptr = &rc->eku_bits; } else if (type == kw_ku) { bitptr = &rc->ku_bits; } else { pkiDebug("%s: Unknown list keyword type %d\n", __FUNCTION__, type); retval = EINVAL; goto out; } do { found = 0; comma = strchr(value, ','); if (comma != NULL) len = comma - value; else len = strlen(value); if (type == kw_eku) { ku = eku_keywords; } else if (type == kw_ku) { ku = ku_keywords; } for (; ku->value != NULL; ku++) { if (strncasecmp(value, ku->value, len) == 0) { *bitptr |= ku->bitval; found = 1; pkiDebug("%s: Found value '%s', bitfield is now 0x%x\n", __FUNCTION__, ku->value, *bitptr); break; } } if (found) { value += ku->length; if (*value == ',') value += 1; } else { pkiDebug("%s: Urecognized value '%s'\n", __FUNCTION__, value); retval = EINVAL; goto out; } } while (found && *value != '\0'); retval = 0; out: pkiDebug("%s: returning %d\n", __FUNCTION__, retval); return retval; } static krb5_error_code parse_rule_component(krb5_context context, const char **rule, int *remaining, rule_component **ret_rule) { krb5_error_code retval; rule_component *rc = NULL; keyword_type kw_type; kw_value_type kwval_type; char err_buf[128]; int ret; struct keyword_desc *kw, *nextkw; char *nk; int found_next_kw = 0; char *value = NULL; size_t len; for (kw = matching_keywords; kw->value != NULL; kw++) { if (strncmp(*rule, kw->value, kw->length) == 0) { kw_type = kw->kwtype; kwval_type = kw->kwvaltype; *rule += kw->length; *remaining -= kw->length; break; } } if (kw->value == NULL) { pkiDebug("%s: Missing or invalid keyword in rule '%s'\n", __FUNCTION__, *rule); retval = ENOENT; goto out; } pkiDebug("%s: found keyword '%s'\n", __FUNCTION__, kw->value); rc = calloc(1, sizeof(*rc)); if (rc == NULL) { retval = ENOMEM; goto out; } rc->next = NULL; rc->kw_type = kw_type; rc->kwval_type = kwval_type; /* * Before procesing the value for this keyword, * (compiling the regular expression or processing the list) * we need to find the end of it. That means parsing for the * beginning of the next keyword (or the end of the rule). */ nk = strchr(*rule, '<'); while (nk != NULL) { /* Possibly another keyword, check it out */ for (nextkw = matching_keywords; nextkw->value != NULL; nextkw++) { if (strncmp(nk, nextkw->value, nextkw->length) == 0) { /* Found a keyword, nk points to the beginning */ found_next_kw = 1; break; /* Need to break out of the while! */ } } if (!found_next_kw) nk = strchr(nk+1, '<'); /* keep looking */ else break; } if (nk != NULL && found_next_kw) len = (nk - *rule); else len = (*remaining); if (len == 0) { pkiDebug("%s: Missing value for keyword '%s'\n", __FUNCTION__, kw->value); retval = EINVAL; goto out; } value = calloc(1, len+1); if (value == NULL) { retval = ENOMEM; goto out; } memcpy(value, *rule, len); *remaining -= len; *rule += len; pkiDebug("%s: found value '%s'\n", __FUNCTION__, value); if (kw->kwvaltype == kwvaltype_regexp) { ret = regcomp(&rc->regexp, value, REG_EXTENDED); if (ret) { regerror(ret, &rc->regexp, err_buf, sizeof(err_buf)); pkiDebug("%s: Error compiling reg-exp '%s': %s\n", __FUNCTION__, value, err_buf); retval = ret; goto out; } rc->regsrc = strdup(value); if (rc->regsrc == NULL) { retval = ENOMEM; goto out; } } else if (kw->kwvaltype == kwvaltype_list) { retval = parse_list_value(context, rc->kw_type, value, rc); if (retval) { pkiDebug("%s: Error %d, parsing list values for keyword %s\n", __FUNCTION__, retval, kw->value); goto out; } } *ret_rule = rc; retval = 0; out: free(value); if (retval && rc != NULL) free_rule_component(context, rc); pkiDebug("%s: returning %d\n", __FUNCTION__, retval); return retval; } static krb5_error_code parse_rule_set(krb5_context context, const char *rule_in, rule_set **out_rs) { const char *rule; int remaining; krb5_error_code ret, retval; rule_component *rc = NULL, *trc; rule_set *rs; if (rule_in == NULL) return EINVAL; rule = rule_in; remaining = strlen(rule); rs = calloc(1, sizeof(*rs)); if (rs == NULL) { retval = ENOMEM; goto cleanup; } rs->relation = relation_none; if (remaining > 1) { if (rule[0] == '&' && rule[1] == '&') { rs->relation = relation_and; rule += 2; remaining -= 2; } else if (rule_in[0] == '|' && rule_in[1] == '|') { rs->relation = relation_or; rule +=2; remaining -= 2; } } rs->num_crs = 0; while (remaining > 0) { if (rs->relation == relation_none && rs->num_crs > 0) { pkiDebug("%s: Assuming AND relation for multiple components in rule '%s'\n", __FUNCTION__, rule_in); rs->relation = relation_and; } ret = parse_rule_component(context, &rule, &remaining, &rc); if (ret) { retval = ret; goto cleanup; } pkiDebug("%s: After parse_rule_component, remaining %d, rule '%s'\n", __FUNCTION__, remaining, rule); rs->num_crs++; /* * Chain the new component on the end (order matters since * we can short-circuit an OR or an AND relation if an * earlier check passes */ for (trc = rs->crs; trc != NULL && trc->next != NULL; trc = trc->next); if (trc == NULL) rs->crs = rc; else { trc->next = rc; } } *out_rs = rs; retval = 0; cleanup: if (retval && rs != NULL) { free_rule_set(context, rs); } pkiDebug("%s: returning %d\n", __FUNCTION__, retval); return retval; } static int regexp_match(krb5_context context, rule_component *rc, char *value) { int code; pkiDebug("%s: checking %s rule '%s' with value '%s'\n", __FUNCTION__, keyword2string(rc->kw_type), rc->regsrc, value); code = regexec(&rc->regexp, value, 0, NULL, 0); pkiDebug("%s: the result is%s a match\n", __FUNCTION__, code == REG_NOMATCH ? " NOT" : ""); return (code == 0 ? 1: 0); } static int component_match(krb5_context context, rule_component *rc, pkinit_cert_matching_data *md) { int match = 0; int i; krb5_principal p; char *princ_string; switch (rc->kwval_type) { case kwvaltype_regexp: switch (rc->kw_type) { case kw_subject: match = regexp_match(context, rc, md->subject_dn); break; case kw_issuer: match = regexp_match(context, rc, md->issuer_dn); break; case kw_san: if (md->sans == NULL) break; for (i = 0, p = md->sans[i]; p != NULL; p = md->sans[++i]) { krb5_unparse_name(context, p, &princ_string); match = regexp_match(context, rc, princ_string); krb5_free_unparsed_name(context, princ_string); if (match) break; } break; default: pkiDebug("%s: keyword %s, keyword value %s mismatch\n", __FUNCTION__, keyword2string(rc->kw_type), kwval2string(kwvaltype_regexp)); break; } break; case kwvaltype_list: switch(rc->kw_type) { case kw_eku: pkiDebug("%s: checking %s: rule 0x%08x, cert 0x%08x\n", __FUNCTION__, keyword2string(rc->kw_type), rc->eku_bits, md->eku_bits); if ((rc->eku_bits & md->eku_bits) == rc->eku_bits) match = 1; break; case kw_ku: pkiDebug("%s: checking %s: rule 0x%08x, cert 0x%08x\n", __FUNCTION__, keyword2string(rc->kw_type), rc->ku_bits, md->ku_bits); if ((rc->ku_bits & md->ku_bits) == rc->ku_bits) match = 1; break; default: pkiDebug("%s: keyword %s, keyword value %s mismatch\n", __FUNCTION__, keyword2string(rc->kw_type), kwval2string(kwvaltype_regexp)); break; } break; default: pkiDebug("%s: unknown keyword value type %d\n", __FUNCTION__, rc->kwval_type); break; } pkiDebug("%s: returning match = %d\n", __FUNCTION__, match); return match; } /* * Returns match_found == 1 only if exactly one certificate matches * the given rule */ static krb5_error_code check_all_certs(krb5_context context, pkinit_plg_crypto_context plg_cryptoctx, pkinit_req_crypto_context req_cryptoctx, pkinit_identity_crypto_context id_cryptoctx, krb5_principal princ, rule_set *rs, /* rule to check */ pkinit_cert_matching_data **matchdata, int *match_found, size_t *match_index) { krb5_error_code retval; pkinit_cert_matching_data *md; int i; int comp_match = 0; int total_cert_matches = 0; rule_component *rc; int certs_checked = 0; size_t save_index = 0; if (match_found == NULL || match_index == NULL) return EINVAL; *match_index = 0; *match_found = 0; pkiDebug("%s: matching rule relation is %s with %d components\n", __FUNCTION__, relation2string(rs->relation), rs->num_crs); /* * Loop through all the certs available and count * how many match the rule */ for (i = 0, md = matchdata[i]; md != NULL; md = matchdata[++i]) { pkiDebug("%s: subject: '%s'\n", __FUNCTION__, md->subject_dn); #if 0 pkiDebug("%s: issuer: '%s'\n", __FUNCTION__, md->subject_dn); for (j = 0, p = md->sans[j]; p != NULL; p = md->sans[++j]) { char *san_string; krb5_unparse_name(context, p, &san_string); pkiDebug("%s: san: '%s'\n", __FUNCTION__, san_string); krb5_free_unparsed_name(context, san_string); } #endif certs_checked++; for (rc = rs->crs; rc != NULL; rc = rc->next) { comp_match = component_match(context, rc, md); if (comp_match) { pkiDebug("%s: match for keyword type %s\n", __FUNCTION__, keyword2string(rc->kw_type)); } if (comp_match && rs->relation == relation_or) { pkiDebug("%s: cert matches rule (OR relation)\n", __FUNCTION__); total_cert_matches++; save_index = i; goto nextcert; } if (!comp_match && rs->relation == relation_and) { pkiDebug("%s: cert does not match rule (AND relation)\n", __FUNCTION__); goto nextcert; } } if (rc == NULL && comp_match) { pkiDebug("%s: cert matches rule (AND relation)\n", __FUNCTION__); total_cert_matches++; save_index = i; } nextcert: continue; } pkiDebug("%s: After checking %d certs, we found %d matches\n", __FUNCTION__, certs_checked, total_cert_matches); if (total_cert_matches == 1) { *match_found = 1; *match_index = save_index; } retval = 0; pkiDebug("%s: returning %d, match_found %d\n", __FUNCTION__, retval, *match_found); return retval; } krb5_error_code pkinit_cert_matching(krb5_context context, pkinit_plg_crypto_context plg_cryptoctx, pkinit_req_crypto_context req_cryptoctx, pkinit_identity_crypto_context id_cryptoctx, krb5_principal princ) { krb5_error_code retval = KRB5KDC_ERR_PREAUTH_FAILED; int x; char **rules = NULL; rule_set *rs = NULL; int match_found = 0; pkinit_cert_matching_data **matchdata = NULL; size_t match_index = 0; /* If no matching rules, select the default cert and we're done */ pkinit_libdefault_strings(context, krb5_princ_realm(context, princ), KRB5_CONF_PKINIT_CERT_MATCH, &rules); if (rules == NULL) { pkiDebug("%s: no matching rules found in config file\n", __FUNCTION__); retval = crypto_cert_select_default(context, plg_cryptoctx, req_cryptoctx, id_cryptoctx); goto cleanup; } /* parse each rule line one at a time and check all the certs against it */ for (x = 0; rules[x] != NULL; x++) { pkiDebug("%s: Processing rule '%s'\n", __FUNCTION__, rules[x]); /* Free rules from previous time through... */ if (rs != NULL) { free_rule_set(context, rs); rs = NULL; } retval = parse_rule_set(context, rules[x], &rs); if (retval) { if (retval == EINVAL) { pkiDebug("%s: Ignoring invalid rule pkinit_cert_match = '%s'\n", __FUNCTION__, rules[x]); continue; } goto cleanup; } /* * Optimize so that we do not get cert info unless we have * valid rules to check. Once obtained, keep it around * until we are done. */ if (matchdata == NULL) { retval = crypto_cert_get_matching_data(context, plg_cryptoctx, req_cryptoctx, id_cryptoctx, &matchdata); if (retval || matchdata == NULL) { pkiDebug("%s: Error %d obtaining certificate information\n", __FUNCTION__, retval); retval = ENOENT; goto cleanup; } } retval = check_all_certs(context, plg_cryptoctx, req_cryptoctx, id_cryptoctx, princ, rs, matchdata, &match_found, &match_index); if (retval) { pkiDebug("%s: Error %d, checking certs against rule '%s'\n", __FUNCTION__, retval, rules[x]); goto cleanup; } if (match_found) { pkiDebug("%s: We have an exact match with rule '%s'\n", __FUNCTION__, rules[x]); break; } } if (match_found) { pkiDebug("%s: Selecting the matching cert!\n", __FUNCTION__); retval = crypto_cert_select(context, id_cryptoctx, match_index); if (retval) { pkiDebug("%s: crypto_cert_select error %d, %s\n", __FUNCTION__, retval, error_message(retval)); goto cleanup; } } else { TRACE_PKINIT_NO_MATCHING_CERT(context); retval = ENOENT; /* XXX */ goto cleanup; } retval = 0; cleanup: profile_free_list(rules); free_rule_set(context, rs); crypto_cert_free_matching_data_list(context, matchdata); return retval; } krb5_error_code pkinit_client_cert_match(krb5_context context, pkinit_plg_crypto_context plgctx, pkinit_req_crypto_context reqctx, const char *match_rule, krb5_boolean *matched) { krb5_error_code ret; pkinit_cert_matching_data *md = NULL; rule_component *rc = NULL; int comp_match = 0; rule_set *rs = NULL; *matched = FALSE; ret = parse_rule_set(context, match_rule, &rs); if (ret) goto cleanup; ret = crypto_req_cert_matching_data(context, plgctx, reqctx, &md); if (ret) goto cleanup; for (rc = rs->crs; rc != NULL; rc = rc->next) { comp_match = component_match(context, rc, md); if ((comp_match && rs->relation == relation_or) || (!comp_match && rs->relation == relation_and)) { break; } } *matched = comp_match; cleanup: free_rule_set(context, rs); crypto_cert_free_matching_data(context, md); return ret; }
gerritjvv/cryptoplayground
kerberos/kdc/src/krb5-1.16/src/plugins/preauth/pkinit/pkinit_matching.c
C
apache-2.0
22,754
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ignite.internal.processors.cache.persistence; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.MappedByteBuffer; import java.nio.file.OpenOption; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.DataRegionConfiguration; import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.managers.communication.GridIoMessage; import org.apache.ignite.internal.processors.cache.CacheGroupContext; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessage; import org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointHistory; import org.apache.ignite.internal.processors.cache.persistence.file.FileIO; import org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory; import org.apache.ignite.internal.util.lang.GridAbsPredicate; import org.apache.ignite.internal.util.typedef.G; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.plugin.extensions.communication.Message; import org.apache.ignite.spi.IgniteSpiException; import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.junit.Assert; /** * */ public class LocalWalModeChangeDuringRebalancingSelfTest extends GridCommonAbstractTest { /** */ private static boolean disableWalDuringRebalancing = true; /** */ private static final AtomicReference<CountDownLatch> supplyMessageLatch = new AtomicReference<>(); /** */ private static final AtomicReference<CountDownLatch> fileIOLatch = new AtomicReference<>(); /** Replicated cache name. */ private static final String REPL_CACHE = "cache"; /** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setDataStorageConfiguration( new DataStorageConfiguration() .setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setPersistenceEnabled(true) .setMaxSize(200 * 1024 * 1024) .setInitialSize(200 * 1024 * 1024) ) // Test verifies checkpoint count, so it is essencial that no checkpoint is triggered by timeout .setCheckpointFrequency(999_999_999_999L) .setFileIOFactory(new TestFileIOFactory(new DataStorageConfiguration().getFileIOFactory())) ); cfg.setCacheConfiguration( new CacheConfiguration(DEFAULT_CACHE_NAME) // Test checks internal state before and after rebalance, so it is configured to be triggered manually .setRebalanceDelay(-1), new CacheConfiguration(REPL_CACHE) .setRebalanceDelay(-1) .setCacheMode(CacheMode.REPLICATED) ); cfg.setCommunicationSpi(new TcpCommunicationSpi() { @Override public void sendMessage(ClusterNode node, Message msg) throws IgniteSpiException { if (msg instanceof GridIoMessage && ((GridIoMessage)msg).message() instanceof GridDhtPartitionSupplyMessage) { int grpId = ((GridDhtPartitionSupplyMessage)((GridIoMessage)msg).message()).groupId(); if (grpId == CU.cacheId(DEFAULT_CACHE_NAME)) { CountDownLatch latch0 = supplyMessageLatch.get(); if (latch0 != null) try { latch0.await(); } catch (InterruptedException ex) { throw new IgniteException(ex); } } } super.sendMessage(node, msg); } @Override public void sendMessage(ClusterNode node, Message msg, IgniteInClosure<IgniteException> ackC) throws IgniteSpiException { if (msg instanceof GridIoMessage && ((GridIoMessage)msg).message() instanceof GridDhtPartitionSupplyMessage) { int grpId = ((GridDhtPartitionSupplyMessage)((GridIoMessage)msg).message()).groupId(); if (grpId == CU.cacheId(DEFAULT_CACHE_NAME)) { CountDownLatch latch0 = supplyMessageLatch.get(); if (latch0 != null) try { latch0.await(); } catch (InterruptedException ex) { throw new IgniteException(ex); } } } super.sendMessage(node, msg, ackC); } }); cfg.setConsistentId(igniteInstanceName); System.setProperty(IgniteSystemProperties.IGNITE_DISABLE_WAL_DURING_REBALANCING, Boolean.toString(disableWalDuringRebalancing)); return cfg; } /** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); cleanPersistenceDir(); } /** {@inheritDoc} */ @Override protected void afterTest() throws Exception { super.afterTest(); CountDownLatch msgLatch = supplyMessageLatch.get(); if (msgLatch != null) { while (msgLatch.getCount() > 0) msgLatch.countDown(); supplyMessageLatch.set(null); } CountDownLatch fileLatch = fileIOLatch.get(); if (fileLatch != null) { while (fileLatch.getCount() > 0) fileLatch.countDown(); fileIOLatch.set(null); } stopAllGrids(); cleanPersistenceDir(); disableWalDuringRebalancing = true; } /** * @return Count of entries to be processed within test. */ protected int getKeysCount() { return 10_000; } /** * @throws Exception If failed. */ public void testWalDisabledDuringRebalancing() throws Exception { doTestSimple(); } /** * @throws Exception If failed. */ public void testWalNotDisabledIfParameterSetToFalse() throws Exception { disableWalDuringRebalancing = false; doTestSimple(); } /** * @throws Exception If failed. */ private void doTestSimple() throws Exception { Ignite ignite = startGrids(3); ignite.cluster().active(true); IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME); int keysCnt = getKeysCount(); for (int k = 0; k < keysCnt; k++) cache.put(k, k); IgniteEx newIgnite = startGrid(3); final CheckpointHistory cpHist = ((GridCacheDatabaseSharedManager)newIgnite.context().cache().context().database()).checkpointHistory(); GridTestUtils.waitForCondition(new GridAbsPredicate() { @Override public boolean apply() { return !cpHist.checkpoints().isEmpty(); } }, 10_000); U.sleep(10); // To ensure timestamp granularity. long newIgniteStartedTimestamp = System.currentTimeMillis(); ignite.cluster().setBaselineTopology(4); CacheGroupContext grpCtx = newIgnite.cachex(DEFAULT_CACHE_NAME).context().group(); assertEquals(!disableWalDuringRebalancing, grpCtx.walEnabled()); U.sleep(10); // To ensure timestamp granularity. long rebalanceStartedTimestamp = System.currentTimeMillis(); for (Ignite g : G.allGrids()) g.cache(DEFAULT_CACHE_NAME).rebalance(); awaitPartitionMapExchange(); assertTrue(grpCtx.walEnabled()); U.sleep(10); // To ensure timestamp granularity. long rebalanceFinishedTimestamp = System.currentTimeMillis(); for (Integer k = 0; k < keysCnt; k++) assertEquals("k=" + k, k, cache.get(k)); int checkpointsBeforeNodeStarted = 0; int checkpointsBeforeRebalance = 0; int checkpointsAfterRebalance = 0; for (Long timestamp : cpHist.checkpoints()) { if (timestamp < newIgniteStartedTimestamp) checkpointsBeforeNodeStarted++; else if (timestamp >= newIgniteStartedTimestamp && timestamp < rebalanceStartedTimestamp) checkpointsBeforeRebalance++; else if (timestamp >= rebalanceStartedTimestamp && timestamp <= rebalanceFinishedTimestamp) checkpointsAfterRebalance++; } assertEquals(1, checkpointsBeforeNodeStarted); // checkpoint on start assertEquals(0, checkpointsBeforeRebalance); assertEquals(disableWalDuringRebalancing ? 1 : 0, checkpointsAfterRebalance); // checkpoint if WAL was re-activated } /** * @throws Exception If failed. */ public void testLocalAndGlobalWalStateInterdependence() throws Exception { Ignite ignite = startGrids(3); ignite.cluster().active(true); IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME); for (int k = 0; k < getKeysCount(); k++) cache.put(k, k); IgniteEx newIgnite = startGrid(3); ignite.cluster().setBaselineTopology(ignite.cluster().nodes()); CacheGroupContext grpCtx = newIgnite.cachex(DEFAULT_CACHE_NAME).context().group(); assertFalse(grpCtx.walEnabled()); ignite.cluster().disableWal(DEFAULT_CACHE_NAME); for (Ignite g : G.allGrids()) g.cache(DEFAULT_CACHE_NAME).rebalance(); awaitPartitionMapExchange(); assertFalse(grpCtx.walEnabled()); // WAL is globally disabled ignite.cluster().enableWal(DEFAULT_CACHE_NAME); assertTrue(grpCtx.walEnabled()); } /** * Test that local WAL mode changing works well with exchanges merge. * * @throws Exception If failed. */ public void testWithExchangesMerge() throws Exception { final int nodeCnt = 5; final int keyCnt = getKeysCount(); Ignite ignite = startGrids(nodeCnt); ignite.cluster().active(true); IgniteCache<Integer, Integer> cache = ignite.cache(REPL_CACHE); for (int k = 0; k < keyCnt; k++) cache.put(k, k); stopGrid(2); stopGrid(3); stopGrid(4); // Rewrite data to trigger further rebalance. for (int k = 0; k < keyCnt; k++) cache.put(k, k * 2); // Start several grids in parallel to trigger exchanges merge. startGridsMultiThreaded(2, 3); for (int nodeIdx = 2; nodeIdx < nodeCnt; nodeIdx++) { CacheGroupContext grpCtx = grid(nodeIdx).cachex(REPL_CACHE).context().group(); assertFalse(grpCtx.walEnabled()); } // Invoke rebalance manually. for (Ignite g : G.allGrids()) g.cache(REPL_CACHE).rebalance(); awaitPartitionMapExchange(); for (int nodeIdx = 2; nodeIdx < nodeCnt; nodeIdx++) { CacheGroupContext grpCtx = grid(nodeIdx).cachex(REPL_CACHE).context().group(); assertTrue(grpCtx.walEnabled()); } // Check no data loss. for (int nodeIdx = 2; nodeIdx < nodeCnt; nodeIdx++) { IgniteCache<Integer, Integer> cache0 = grid(nodeIdx).cache(REPL_CACHE); for (int k = 0; k < keyCnt; k++) Assert.assertEquals("nodeIdx=" + nodeIdx + ", key=" + k, (Integer) (2 * k), cache0.get(k)); } } /** * @throws Exception If failed. */ public void testParallelExchangeDuringRebalance() throws Exception { doTestParallelExchange(supplyMessageLatch); } /** * @throws Exception If failed. */ public void testParallelExchangeDuringCheckpoint() throws Exception { doTestParallelExchange(fileIOLatch); } /** * @throws Exception If failed. */ private void doTestParallelExchange(AtomicReference<CountDownLatch> latchRef) throws Exception { Ignite ignite = startGrids(3); ignite.cluster().active(true); IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME); for (int k = 0; k < getKeysCount(); k++) cache.put(k, k); IgniteEx newIgnite = startGrid(3); CacheGroupContext grpCtx = newIgnite.cachex(DEFAULT_CACHE_NAME).context().group(); CountDownLatch latch = new CountDownLatch(1); latchRef.set(latch); ignite.cluster().setBaselineTopology(ignite.cluster().nodes()); for (Ignite g : G.allGrids()) g.cache(DEFAULT_CACHE_NAME).rebalance(); assertFalse(grpCtx.walEnabled()); // TODO : test with client node as well startGrid(4); // Trigger exchange assertFalse(grpCtx.walEnabled()); latch.countDown(); assertFalse(grpCtx.walEnabled()); for (Ignite g : G.allGrids()) g.cache(DEFAULT_CACHE_NAME).rebalance(); awaitPartitionMapExchange(); assertTrue(grpCtx.walEnabled()); } /** * @throws Exception If failed. */ public void testDataClearedAfterRestartWithDisabledWal() throws Exception { Ignite ignite = startGrid(0); ignite.cluster().active(true); IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME); int keysCnt = getKeysCount(); for (int k = 0; k < keysCnt; k++) cache.put(k, k); IgniteEx newIgnite = startGrid(1); ignite.cluster().setBaselineTopology(2); CacheGroupContext grpCtx = newIgnite.cachex(DEFAULT_CACHE_NAME).context().group(); assertFalse(grpCtx.localWalEnabled()); stopGrid(1); stopGrid(0); newIgnite = startGrid(1); newIgnite.cluster().active(true); newIgnite.cluster().setBaselineTopology(newIgnite.cluster().nodes()); cache = newIgnite.cache(DEFAULT_CACHE_NAME); for (int k = 0; k < keysCnt; k++) assertFalse("k=" + k +", v=" + cache.get(k), cache.containsKey(k)); } /** * @throws Exception If failed. */ public void testWalNotDisabledAfterShrinkingBaselineTopology() throws Exception { Ignite ignite = startGrids(4); ignite.cluster().active(true); IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME); int keysCnt = getKeysCount(); for (int k = 0; k < keysCnt; k++) cache.put(k, k); for (Ignite g : G.allGrids()) { CacheGroupContext grpCtx = ((IgniteEx)g).cachex(DEFAULT_CACHE_NAME).context().group(); assertTrue(grpCtx.walEnabled()); } stopGrid(2); ignite.cluster().setBaselineTopology(5); for (Ignite g : G.allGrids()) { CacheGroupContext grpCtx = ((IgniteEx)g).cachex(DEFAULT_CACHE_NAME).context().group(); assertTrue(grpCtx.walEnabled()); g.cache(DEFAULT_CACHE_NAME).rebalance(); } awaitPartitionMapExchange(); for (Ignite g : G.allGrids()) { CacheGroupContext grpCtx = ((IgniteEx)g).cachex(DEFAULT_CACHE_NAME).context().group(); assertTrue(grpCtx.walEnabled()); } } /** * */ private static class TestFileIOFactory implements FileIOFactory { /** */ private final FileIOFactory delegate; /** * @param delegate Delegate. */ TestFileIOFactory(FileIOFactory delegate) { this.delegate = delegate; } /** {@inheritDoc} */ @Override public FileIO create(File file) throws IOException { return new TestFileIO(delegate.create(file)); } /** {@inheritDoc} */ @Override public FileIO create(File file, OpenOption... modes) throws IOException { return new TestFileIO(delegate.create(file, modes)); } } /** * */ private static class TestFileIO implements FileIO { /** */ private final FileIO delegate; /** * @param delegate Delegate. */ TestFileIO(FileIO delegate) { this.delegate = delegate; } /** {@inheritDoc} */ @Override public long position() throws IOException { return delegate.position(); } /** {@inheritDoc} */ @Override public void position(long newPosition) throws IOException { delegate.position(newPosition); } /** {@inheritDoc} */ @Override public int read(ByteBuffer destBuf) throws IOException { return delegate.read(destBuf); } /** {@inheritDoc} */ @Override public int read(ByteBuffer destBuf, long position) throws IOException { return delegate.read(destBuf, position); } /** {@inheritDoc} */ @Override public int read(byte[] buf, int off, int len) throws IOException { return delegate.read(buf, off, len); } /** {@inheritDoc} */ @Override public int write(ByteBuffer srcBuf) throws IOException { CountDownLatch latch = fileIOLatch.get(); if (latch != null && Thread.currentThread().getName().contains("checkpoint")) try { latch.await(); } catch (InterruptedException ex) { throw new IgniteException(ex); } return delegate.write(srcBuf); } /** {@inheritDoc} */ @Override public int write(ByteBuffer srcBuf, long position) throws IOException { CountDownLatch latch = fileIOLatch.get(); if (latch != null && Thread.currentThread().getName().contains("checkpoint")) try { latch.await(); } catch (InterruptedException ex) { throw new IgniteException(ex); } return delegate.write(srcBuf, position); } /** {@inheritDoc} */ @Override public int write(byte[] buf, int off, int len) throws IOException { CountDownLatch latch = fileIOLatch.get(); if (latch != null && Thread.currentThread().getName().contains("checkpoint")) try { latch.await(); } catch (InterruptedException ex) { throw new IgniteException(ex); } return delegate.write(buf, off, len); } /** {@inheritDoc} */ @Override public MappedByteBuffer map(int maxWalSegmentSize) throws IOException { return delegate.map(maxWalSegmentSize); } /** {@inheritDoc} */ @Override public void force() throws IOException { delegate.force(); } /** {@inheritDoc} */ @Override public void force(boolean withMetadata) throws IOException { delegate.force(withMetadata); } /** {@inheritDoc} */ @Override public long size() throws IOException { return delegate.size(); } /** {@inheritDoc} */ @Override public void clear() throws IOException { delegate.clear(); } /** {@inheritDoc} */ @Override public void close() throws IOException { delegate.close(); } } }
irudyak/ignite
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/LocalWalModeChangeDuringRebalancingSelfTest.java
Java
apache-2.0
21,207
package marcin_szyszka.mobileseconndhand.models; /** * Created by marcianno on 2016-03-02. */ public class RegisterUserModel { public String Email; public String Password; public String ConfirmPassword; public RegisterUserModel(){ } }
MarcinSzyszka/MobileSecondHand
AndroidStudio_Android/MobileSeconndHand/app/src/main/java/marcin_szyszka/mobileseconndhand/models/RegisterUserModel.java
Java
apache-2.0
260
// // MianTableViewCell.h // SweetFood // // Created by scjy on 16/3/4. // Copyright © 2016年 范芳芳. All rights reserved. // #import <UIKit/UIKit.h> #import "MianModel.h" #import "MainModel.h" @interface MianTableViewCell : UITableViewCell @property (strong, nonatomic) UIImageView *cellImage; @property (strong, nonatomic) UILabel *titleLable; @end
yuanfang711/SweetFood
SweetFood/Classes/Home/cell/MianTableViewCell.h
C
apache-2.0
362
# Xanthophyllum subglobosum Elmer SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Polygalaceae/Xanthophyllum/Xanthophyllum subglobosum/README.md
Markdown
apache-2.0
181
# AUTOGENERATED FILE FROM balenalib/raspberrypi0-2w-64-fedora:34-build # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 RUN dnf install -y \ python3-pip \ python3-dbus \ && dnf clean all # install "virtualenv", since the vast majority of users of this image will want it RUN pip3 install -U --no-cache-dir --ignore-installed pip setuptools \ && pip3 install --no-cache-dir virtualenv RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'As of January 1st, 2020, Python 2 was end-of-life, we will change the latest tag for Balenalib Python base image to Python 3.x and drop support for Python 2 soon. So after 1st July, 2020, all the balenalib Python latest tag will point to the latest Python 3 version and no changes, or fixes will be made to balenalib Python 2 base image. If you are using Python 2 for your application, please upgrade to Python 3 before 1st July.' > /.balena/messages/python-deprecation-warning 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/[email protected]" \ && echo "Running test-stack@python" \ && chmod +x [email protected] \ && bash [email protected] \ && rm -rf [email protected] RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Fedora 34 \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.8.12, Pip v21.3.1, Setuptools v60.5.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo $'#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
resin-io-library/base-images
balena-base-images/python/raspberrypi0-2w-64/fedora/34/3.8.12/build/Dockerfile
Dockerfile
apache-2.0
2,446
// Generated by esidl 0.3.0. // This file is expected to be modified for the Web IDL interface // implementation. Permission to use, copy, modify and distribute // this file in any software license is hereby granted. #include "AudioTrackListImp.h" namespace org { namespace w3c { namespace dom { namespace bootstrap { unsigned int AudioTrackListImp::getLength() { // TODO: implement me! return 0; } html::AudioTrack AudioTrackListImp::getElement(unsigned int index) { // TODO: implement me! return nullptr; } html::AudioTrack AudioTrackListImp::getTrackById(const std::u16string& id) { // TODO: implement me! return nullptr; } events::EventHandlerNonNull AudioTrackListImp::getOnchange() { // TODO: implement me! return nullptr; } void AudioTrackListImp::setOnchange(events::EventHandlerNonNull onchange) { // TODO: implement me! } events::EventHandlerNonNull AudioTrackListImp::getOnaddtrack() { // TODO: implement me! return nullptr; } void AudioTrackListImp::setOnaddtrack(events::EventHandlerNonNull onaddtrack) { // TODO: implement me! } events::EventHandlerNonNull AudioTrackListImp::getOnremovetrack() { // TODO: implement me! return nullptr; } void AudioTrackListImp::setOnremovetrack(events::EventHandlerNonNull onremovetrack) { // TODO: implement me! } } } } }
esrille/escudo
src/html/AudioTrackListImp.cpp
C++
apache-2.0
1,344
package org.annoconf; /** * Created by roma on 3/19/17. */ public interface PropertyValueSource { boolean hasValue(String key); String getValue(String key); }
Roma7-7-7/annoconf
src/main/java/org/annoconf/PropertyValueSource.java
Java
apache-2.0
173
<!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_29) on Sun Feb 05 12:13:54 CET 2012 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory (The Netty Project API Reference (3.3.1.Final)) </TITLE> <META NAME="date" CONTENT="2012-02-05"> <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.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory (The Netty Project API Reference (3.3.1.Final))"; } } </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/jboss/netty/channel/socket/nio/NioClientSocketChannelFactory.html" title="class in org.jboss.netty.channel.socket.nio"><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/jboss/netty/channel/socket/nio//class-useNioClientSocketChannelFactory.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="NioClientSocketChannelFactory.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.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory</B></H2> </CENTER> No usage of org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory <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/jboss/netty/channel/socket/nio/NioClientSocketChannelFactory.html" title="class in org.jboss.netty.channel.socket.nio"><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/jboss/netty/channel/socket/nio//class-useNioClientSocketChannelFactory.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="NioClientSocketChannelFactory.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; 2008-2012 <a href="http://netty.io/">The Netty Project</a>. All Rights Reserved. </BODY> </HTML>
beav/netty-ant
doc/api/org/jboss/netty/channel/socket/nio/class-use/NioClientSocketChannelFactory.html
HTML
apache-2.0
6,527
/****************************************************************************** * 版权所有 刘大磊 2013-07-01 * * 作者:刘大磊 * * 电话:13336390671 * * email:[email protected] * *****************************************************************************/ package com.delmar.core.service; import com.delmar.core.model.CorePage; import com.delmar.core.service.CoreService; /** * @author 刘大磊 2016-08-26 17:08:24 */ public interface CorePageService extends CoreService<CorePage> { /** * @param ids */ void deleteCorePageList(Integer[] ids); }
ldlqdsdcn/wms
core/src/main/java/com/delmar/core/service/CorePageService.java
Java
apache-2.0
729
package de.hsmainz.pubapp.geocoder.controller; import com.google.gson.Gson; import de.hsmainz.pubapp.geocoder.model.ClientInputJson; import de.hsmainz.pubapp.geocoder.model.ErrorJson; import de.hsmainz.pubapp.geocoder.model.geojson.GeoJsonCollection; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.util.Locale; import java.util.ResourceBundle; /** * Interface for all different geocoder APIs * * @author Arno * @since 15.12.2016 */ public abstract class HttpAPIRequest { //**************************************** // CONSTANTS //**************************************** static final ResourceBundle lables = ResourceBundle.getBundle("lable", Locale.getDefault()); static final Logger logger = LogManager.getLogger(HttpGraphhopperRequest.class); //**************************************** // VARIABLES //**************************************** Gson gson = new Gson(); //**************************************** // INIT/CONSTRUCTOR //**************************************** //**************************************** // GETTER/SETTER //**************************************** //**************************************** // PUBLIC METHODS //**************************************** /** * Executes request to geocoder API and creates GeoJSON. Custom ClientJson is used for the input * * @param inputJson the request parameters combined in a custom ClientJson * @return API response converted to a String */ public String requestGeocoder(ClientInputJson inputJson) { String returnString; if (!validateInput(inputJson)) { returnString = gson.toJson(new ErrorJson(lables.getString("message_Input_Empty"))); } else { returnString = requestGeocoder(inputJson.getQueryString(), inputJson.getLocale()); } return returnString; } /** * Executes request to geocoder API and creates GeoJSON * * @param queryString the string containing the address * @param locale the string defining the used language * @return API response converted to a String */ public String requestGeocoder(String queryString, String locale) { String returnString; if (!validateInput(queryString)) { returnString = gson.toJson(new ErrorJson(lables.getString("message_Input_Empty"))); } else { try { URI uri = buildUri(queryString, locale); returnString = request(uri); } catch (URISyntaxException e) { logger.catching(e); returnString = gson.toJson(new ErrorJson(lables.getString("error_incorrect_URI"))); } } return returnString; } //**************************************** // PRIVATE METHODS //**************************************** /** * Creates the URI for API request * * @param queryString the string containing the address * @param locale the string defining the used language * @return Uri for geocoder request to graphhopper API */ abstract URI buildUri(String queryString, String locale) throws URISyntaxException; /** * Executes the request to the API * * @param uri the geocoder URL * @return the requested geoJSON * @throws throws an exception if the request fails */ abstract GeoJsonCollection doHttpGet(URI uri) throws IOException; /** * Method to catch exceptions and create ErrorJSONs * * @param uri * @return returns the GeoJSON or ErrorJSON as a String */ String request(URI uri) { String returnString; try { GeoJsonCollection geoJsonCollection = doHttpGet(uri); if (validateOutput(geoJsonCollection)) { returnString = gson.toJson(geoJsonCollection); } else { returnString = gson.toJson(new ErrorJson(lables.getString("message_no_location"))); } } catch (IOException e) { logger.catching(e); returnString = gson.toJson(new ErrorJson(lables.getString("error_API_request_Faild"))); } return returnString; } /** * validates the Input to reduce unnecessary request to API * * @param inputJson the InputJSON to be validated * @return returns true if InputJSON is valid */ boolean validateInput(ClientInputJson inputJson) { boolean returnValue = true; if (inputJson.getQueryString() == null || inputJson.getQueryString().isEmpty()) { returnValue = false; } if (inputJson.getLocale() == null || inputJson.getLocale().isEmpty()) { returnValue = false; } return returnValue; } /** * validates the Input to reduce unnecessary request to API * * @param inputString the Input String to be validated * @return true if Input String is not Empty */ boolean validateInput(String inputString) { boolean returnValue = true; if (inputString == null || inputString.isEmpty()) { returnValue = false; } return returnValue; } /** * validates the output from the API * * @param geoJsonCollection the API outputJSON to be validated * @return returns true if the outputJSON is not empty */ private boolean validateOutput(GeoJsonCollection geoJsonCollection) { return !geoJsonCollection.getFeatures().isEmpty(); } //**************************************** // INNER CLASSES //**************************************** }
ArnoHeid/PubApp
geocoder/src/main/java/de/hsmainz/pubapp/geocoder/controller/HttpAPIRequest.java
Java
apache-2.0
5,824
package com.txtr.hibernatedelta.model; import static javax.xml.bind.annotation.XmlAccessType.FIELD; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlType; import org.apache.commons.lang3.StringUtils; @XmlAccessorType(FIELD) @XmlType(propOrder = {"name", "columns", "explicitIndexes"}) public class HibernateTable implements IHibernateDatabaseObject { @XmlAttribute private String name; @XmlElementWrapper(name = "columns") @XmlElement(name = "column") private List<HibernateColumn> columns = new ArrayList<HibernateColumn>(); @XmlElementWrapper(name = "indexes") @XmlElement(name = "index") private List<ExplicitHibernateIndex> explicitIndexes = new ArrayList<ExplicitHibernateIndex>(); @XmlAttribute private String sequenceName; @XmlAttribute private boolean virtualRootTable; public HibernateTable(String name, String sequenceName, boolean virtualRootTable) { this.sequenceName = sequenceName; this.virtualRootTable = virtualRootTable; this.name = name; } @SuppressWarnings("UnusedDeclaration") public HibernateTable() { } @Override public String getName() { return name; } public void setName(String name) { this.name = name; } public List<HibernateColumn> getColumns() { return columns; } public List<ExplicitHibernateIndex> getExplicitIndexes() { return explicitIndexes; } public void addColumn(HibernateColumn column) { columns.add(column); } public HibernateColumn getColumn(String name) { for (HibernateColumn column : columns) { if (column.getName().equalsIgnoreCase(name)) { return column; } } throw new IllegalArgumentException("column not found: " + name); } public void addExplicitIndex(ExplicitHibernateIndex hibernateIndex) { explicitIndexes.add(hibernateIndex); } public String getIndexPrefix() { return StringUtils.left(name, 28); } public List<HibernateColumn> getPrimaryKeyColumns() { List<HibernateColumn> result = new ArrayList<HibernateColumn>(); for (HibernateColumn column : columns) { if (column.isPrimaryKey()) { result.add(column); } } return result; } public String getSequenceName() { return sequenceName; } public boolean isVirtualRootTable() { return virtualRootTable; } }
storecast/hibernate-delta
src/main/java/com/txtr/hibernatedelta/model/HibernateTable.java
Java
apache-2.0
2,751
# Nassella sadae Phil. SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Nassella/Nassella chilensis/ Syn. Nassella sadae/README.md
Markdown
apache-2.0
177
/** * */ package me.learn.personal.month5; import java.util.HashSet; import java.util.List; import java.util.Set; /** * Title : * * Date : Dec 23, 2020 * * @author bramanarayan * */ public class WordBreakable { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub } public boolean wordBreak(String s, List<String> wordDict) { Set<String> wordDictSet = new HashSet<>(wordDict); boolean[] dp = new boolean[s.length() + 1]; dp[0] = true; for (int i = 1; i <= s.length(); i++) { for (int j = 0; j < i; j++) { if (dp[j] && wordDictSet.contains(s.substring(j, i))) { dp[i] = true; break; } } } return dp[s.length()]; } }
balajiboggaram/algorithms
src/me/learn/personal/month5/WordBreakable.java
Java
apache-2.0
724
/* Copyright 2015 Ricardo Tubio-Pardavila 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. */ angular.module('snRequestsDirective', [ 'ngMaterial', 'snCommonFilters', 'snApplicationBus', 'snRequestsFilters', 'snControllers', 'snJRPCServices' ]) .controller('snRequestSlotCtrl', [ '$scope', '$mdDialog', '$mdToast', 'satnetRPC', 'snDialog', 'snMessageBus', /** * Controller function for handling the SatNet requests dialog. * * @param {Object} $scope $scope for the controller */ function ($scope, $mdDialog, $mdToast, satnetRPC, snDialog, snMessageBus) { $scope.gui = { groundstation_id: '', spacecraft_id: '', primary: '', hide: { accept: true, drop: true, deny: true, }, slot: {} }; /** * Function that handles the process of accepting a given request that * has already been selected. */ $scope.accept = function () { satnetRPC.rCall( 'gs.operational.accept', [ $scope.groundstation_id, [$scope.slot.identifier] ] ).then(function (results) { snDialog.toastAction('Confirmed slot #',$scope.slot.identifier); $scope.slot.state = 'RESERVED'; snMessageBus.send( snMessageBus.CHANNELS.requests.id, snMessageBus.EVENTS.accepted.id, { gs_id: $scope.gui.groundstation_id, sc_id: $scope.gui.spacecraft_id, primary: $scope.gui.primary, slot: $scope.gui.slot } ); }).catch(function (c) { snDialog.exception('gs.operational.accept', '', c); }); }; /** * Function that handles the process of denying a given request that * has already been selected. * * TODO :: Temporary, it has been linked to the drop function so that * the slot does not stay forever with the DENIED state. */ $scope.deny = function () { satnetRPC.rCall( 'gs.operational.drop', [ $scope.groundstation_id, [$scope.slot.identifier] ] ).then(function (results) { snDialog.toastAction('Denied slot #', $scope.slot.identifier); $scope.slot.state = 'FREE'; snMessageBus.send( snMessageBus.CHANNELS.requests.id, snMessageBus.EVENTS.denied.id, { gs_id: $scope.gui.groundstation_id, sc_id: $scope.gui.spacecraft_id, primary: $scope.gui.primary, slot: $scope.gui.slot } ); }).catch(function (c) { snDialog.exception('gs.operational.drop', '', c); }); }; /** * Function that handles the process of droping a given request that * has already been booked. * * IMPORTANT: This function works both for spacecraft and for * groundstation slots; therefore, there is an inherent * level of complexity added in addition in order to * handle both cases. */ $scope.drop = function () { var rpc = ($scope.gui.primary === 'groundstation') ? 'gs.operational.drop' : 'sc.cancel', segment_id = ($scope.gui.primary === 'groundstation') ? $scope.groundstation_id : $scope.spacecraft_id; satnetRPC.rCall( rpc, [segment_id, [$scope.slot.identifier]] ).then(function (results) { snDialog.toastAction('Dropped slot #', $scope.slot.identifier); $scope.slot.state = 'FREE'; snMessageBus.send( snMessageBus.CHANNELS.requests.id, snMessageBus.EVENTS.dropped.id, { gs_id: $scope.gui.groundstation_id, sc_id: $scope.gui.spacecraft_id, primary: $scope.gui.primary, slot: $scope.gui.slot } ); }).catch(function (c) { snDialog.exception(rpc, '', c); }); }; /** * Function that returns whether o not the "accept" button should be * displayed, taking into account the state of the controller. */ $scope.showAccept = function () { return ($scope.gui.slot.state === 'SELECTED') && !($scope.gui.hide.accept); }; /** * Function that returns whether o not the "deny" button should be * displayed, taking into account the state of the controller. */ $scope.showDeny = function () { return ($scope.gui.slot.state === 'SELECTED') && !($scope.gui.hide.deny); }; /** * Function that returns whether o not the "drop" button should be * displayed, taking into account the state of the controller. */ $scope.showDrop = function () { if ($scope.gui.primary === 'spacecraft') { return !($scope.gui.hide.drop) && ( ($scope.gui.slot.state === 'SELECTED') || ($scope.gui.slot.state === 'RESERVED') ); } else { return !($scope.gui.hide.drop) && ( ($scope.gui.slot.state === 'RESERVED') ); } }; /** * Initialization of the controller. */ $scope.init = function () { $scope.gui.groundstation_id = $scope.gs; $scope.gui.spacecraft_id = $scope.sc; $scope.gui.primary = $scope.primary; $scope.gui.slot = $scope.slot; if ( $scope.gui.primary === 'spacecraft' ) { $scope.gui.hide.drop = false; } else { $scope.gui.hide.accept = false; $scope.gui.hide.deny = false; $scope.gui.hide.drop = false; } }; $scope.init(); } ]) .directive('snRequestSlot', /** * Function that creates the directive itself returning the object required * by Angular. * * @returns {Object} Object directive required by Angular, with restrict * and templateUrl */ function () { return { restrict: 'E', templateUrl: 'operations/templates/requests/slot.html', controller: 'snRequestSlotCtrl', scope: { sc: '@', gs: '@', primary: '@', slot: '=' } }; } ) .controller('snRequestsDlgCtrl', [ '$scope', '$log', '$mdDialog', 'satnetRPC','snDialog', 'snMessageBus', /** * Controller function for handling the SatNet requests dialog. * * @param {Object} $scope $scope for the controller */ function ($scope, $log, $mdDialog, satnetRPC, snDialog, snMessageBus) { $scope.events = { requests: { accepted: { id: snMessageBus.createName( snMessageBus.CHANNELS.requests.id, snMessageBus.EVENTS.accepted.id ) }, denied: { id: snMessageBus.createName( snMessageBus.CHANNELS.requests.id, snMessageBus.EVENTS.denied.id ) }, dropped: { id: snMessageBus.createName( snMessageBus.CHANNELS.requests.id, snMessageBus.EVENTS.dropped.id ) } } }; /** * This function finds the given slot within the dictionary/array of * slots within this controller. * * @param {String} segmentId Identifier of the segment * @param {String} slotId Identifier of the slot */ $scope._findSlot = function (segmentId, slotId) { var slots = $scope.gui.slots[segmentId]; if ((slots === undefined) || (slots.length === 0)) { throw 'No slots for ss = ' + segmentId; } for (var i = 0, L = slots.length; i < L; i++) { if (slots[i].identifier === slotId) { return { index: i, slot: slots[i] }; } } throw 'Slot not found for ss = ' + segmentId; }; /** * Updates the slots dictionary when the slot that triggered the event * was updated to the "FREE" state. * * @param {Object} data The data object attached to the event */ $scope._updateFree = function (data) { var ss_id = (data.primary === 'spacecraft') ? data.gs_id: data.sc_id, other_ss_id = (data.primary === 'spacecraft') ? data.sc_id: data.gs_id, slot = $scope._findSlot(ss_id, data.slot.identifier), slot_other = $scope._findSlot( other_ss_id, data.slot.identifier ); $scope.gui.slots[ss_id].splice(slot.index, 1); $scope.gui.slots[other_ss_id].splice(slot_other.index, 1); }; /** * Updates the slots dictionary when the slot that triggered the event * was not updated to the "FREE" state. * * @param {Object} data The data object attached to the event */ $scope._updateNonFree = function (data) { var ss_id = (data.primary === 'spacecraft') ? data.gs_id: data.sc_id, slot = $scope._findSlot(ss_id, data.slot.identifier); slot.slot.state = data.slot.state; }; /** * CALLBACK * This function is the callback that handles the event triggered * whenever a request slot has been accepted, canceled or denied. * * @param {String} event The name of the event * @param {Object} data The data object generated by the event */ $scope._updateRequestCb = function (event, data) { try { if (data.slot.state === 'FREE') { $scope._updateFree(data); } else { $scope._updateNonFree(data); } } catch (e) { $log.info(e); } }; $scope.$on( $scope.events.requests.accepted.id, $scope._updateRequestCb ); $scope.$on( $scope.events.requests.denied.id, $scope._updateRequestCb ); $scope.$on( $scope.events.requests.dropped.id, $scope._updateRequestCb ); $scope.gui = { gss: [], scs: [], slots: {}, filtered: {} }; /** * Function that closes the dialog. */ $scope.close = function () { $mdDialog.hide(); }; /** * This function is used to check whether the given slot has to be * discarded from amongst the other slots or not. * * @param {Object} slot The slot to be checked * @param {Boolean} 'true' if the slot has to be discarded */ $scope._filterByState = function(slot) { return (slot.state !== 'SELECTED') && (slot.state !== 'RESERVED'); }; /** * This function processes the slots received from the server in order * to adapt them to a more JavaScript "friendly" data structure. It * stores the results directly in the controller's data section. * * @param {String} segmentId Identifier of the segment * @param {Object} results Object with the results from the server */ $scope._processSlots = function (segmentId, results) { $scope.gui.slots[segmentId] = []; if ((results === null) || (angular.equals({}, results))) { return; } var ss_id = Object.keys(results)[0], slots = results[ss_id]; for (var i = 0, L = slots.length; i < L; i++) { if ($scope._filterByState(slots[i])) {continue;} slots[i].segment_id = ss_id; $scope.gui.slots[segmentId].push(slots[i]); } }; /** * This function retrieves the operational slots from the server for a * given segment and stores them internally in a single list for the * controller. * IMPORTANT: It processes the list so that it adds the reference to * the other segment related in the slot by place its id inside the * object of the slot rather than as a key to access the slot. * IMPORTANT 2: It filters out all the slots whose states are neither * 'SELECTED' nor 'BOOKED'. * * @param segmentType String that indicates whether the reference * segment is a ground station ('sc') or a * spacecraft ('sc') * @param segmentId String Identifier of the segment */ $scope._pullSlots = function (segmentType, segmentId) { var rpc_name = segmentType + '.operational'; satnetRPC.rCall(rpc_name, [segmentId]).then(function (results) { $scope._processSlots(segmentId, results); }).catch(function (cause) { snDialog.exception(segmentType + '.operational', '-', cause); }); }; /** * Retrieves the slots for all the ground stations owned by the * currently logged-in user. * @returns */ $scope._pullGsSlots = function () { satnetRPC.rCall('gs.list.mine', []).then(function (results) { $scope.gui.gss = results; for (var i = 0, l = $scope.gui.gss.length;i < l; i++) { $scope._pullSlots('gs', $scope.gui.gss[i]); } }).catch(function (cause) { snDialog.exception('gs.list.mine', '-', cause); }); }; /** * Retrieves the slots for all the spacecraft owned by the * currently logged-in user. * @returns */ $scope._pullScSlots = function () { satnetRPC.rCall('sc.list.mine', []).then(function (results) { $scope.gui.scs = results; for (var i = 0, l = $scope.gui.scs.length; i < l; i++ ) { $scope._pullSlots('sc', $scope.gui.scs[i]); } }).catch(function (cause) { snDialog.exception('sc.list.mine', '-', cause); }); }; /** * Initialization of the controller. */ $scope.init = function () { $scope._pullGsSlots(); $scope._pullScSlots(); }; $scope.init(); } ]) .controller('snRequestsCtrl', [ '$scope', '$mdDialog', /** * Controller function for opening the SatNet requests dialog. * * @param {Object} $scope $scope for the controller * @param {Object} $mdDialog Angular material Dialog service */ function ($scope, $mdDialog) { /** * Function that opens the dialog when the snRequests button is * clicked. */ $scope.openDialog = function () { $mdDialog.show({ templateUrl: 'operations/templates/requests/list.html', controller: 'snRequestsDlgCtrl' }); }; } ]) .directive('snRequests', /** * Function that creates the directive itself returning the object required * by Angular. * * @returns {Object} Object directive required by Angular, with restrict * and templateUrl */ function () { return { restrict: 'E', templateUrl: 'operations/templates/requests/menu.html', controller: 'snRequestsCtrl' }; } );
satnet-project/satnet-ng
src/operations/directives/Requests.js
JavaScript
apache-2.0
17,236
package scadla.utils import scadla._ import squants.space.Length import scala.language.postfixOps import squants.space.LengthConversions._ object Tube { def apply(outerRadius: Length, innerRadius: Length, height: Length) = { Difference( Cylinder(outerRadius, height), Translate(0 mm, 0 mm, -1 mm, Cylinder(innerRadius, height + (2 mm))) ) } }
dzufferey/scadla
src/main/scala/scadla/utils/Tube.scala
Scala
apache-2.0
371
package web; import graphUtil.CycleChainDecomposition; import graphUtil.EdgeChain; import ilog.concert.IloException; import java.util.HashMap; import java.util.List; import java.util.Map; import kepLib.KepInstance; import kepLib.KepProblemData; import kepModeler.ChainsForcedRemainOpenOptions; import kepModeler.KepModeler; import kepModeler.ModelerInputs; import kepModeler.ObjectiveMode; import replicator.DonorEdge; import threading.FixedThreadPool; import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import data.Donor; import data.ExchangeUnit; import database.KidneyDataBase; import exchangeGraph.CycleChainPackingSubtourElimination; import exchangeGraph.SolverOption; public class KidneyServerSolver { private KidneyDataBase database; private Map<String, ModelerInputs<ExchangeUnit, DonorEdge>> dataCache = new HashMap<String, ModelerInputs<ExchangeUnit, DonorEdge>>(); private Optional<FixedThreadPool> threadPool; Optional<Double> maxSolveTimeMs = Optional.of(100.0); public KidneyServerSolver(KidneyDataBase database, Optional<FixedThreadPool> threadPool) { this.database = database; this.threadPool = threadPool; } public ImmutableList<String> availableDatasets() { return database.availableDatasets(); } public Map<Object, Object> getInputs(String databaseName) { return flattenModelerInputs(getModelerInputs(databaseName)); } public Map<Object, Object> getSolution(String databaseName) throws IloException { ModelerInputs<ExchangeUnit, DonorEdge> inputs = getModelerInputs(databaseName); KepModeler modeler = new KepModeler(3, Integer.MAX_VALUE, ChainsForcedRemainOpenOptions.none, new ObjectiveMode.MaximumCardinalityMode()); KepInstance<ExchangeUnit, DonorEdge> instance = modeler.makeKepInstance( inputs, null); CycleChainPackingSubtourElimination<ExchangeUnit, DonorEdge> solver = new CycleChainPackingSubtourElimination<ExchangeUnit, DonorEdge>( instance, true, maxSolveTimeMs, threadPool, SolverOption.makeCheckedOptions(SolverOption.cutsetMode, SolverOption.lazyConstraintCallback, SolverOption.userCutCallback)); solver.solve(); CycleChainDecomposition<ExchangeUnit, DonorEdge> solution = solver .getSolution(); solver.cleanUp(); return flattenSolution(inputs.getKepProblemData(), solution); } private ModelerInputs<ExchangeUnit, DonorEdge> getModelerInputs( String databaseName) { if (this.dataCache.containsKey(databaseName)) { return this.dataCache.get(databaseName); } else { ModelerInputs<ExchangeUnit, DonorEdge> inputs = database .loadInputs(databaseName); this.dataCache.put(databaseName, inputs); return inputs; } } public static Map<Object, Object> flattenModelerInputs( ModelerInputs<ExchangeUnit, DonorEdge> inputs) { Map<Object, Object> ans = new HashMap<Object, Object>(); List<Map<Object, Object>> flatUnits = Lists.newArrayList(); List<Map<Object, Object>> flatEdges = Lists.newArrayList(); for (ExchangeUnit unit : inputs.getKepProblemData().getGraph() .getVertices()) { flatUnits.add(flattenExchangeUnit(inputs, unit)); } for (DonorEdge edge : inputs.getKepProblemData().getGraph().getEdges()) { flatEdges.add(flattenDonorEdge(inputs.getKepProblemData(), edge)); } ans.put("nodes", flatUnits); ans.put("links", flatEdges); return ans; } public static Map<Object, Object> flattenSolution( KepProblemData<ExchangeUnit, DonorEdge> problemData, CycleChainDecomposition<ExchangeUnit, DonorEdge> solution) { Map<Object, Object> ans = new HashMap<Object, Object>(); List<Map<Object, Object>> flatEdges = Lists.newArrayList(); for (EdgeChain<DonorEdge> edgeChain : solution.getEdgeChains()) { for (DonorEdge edge : edgeChain) { flatEdges.add(flattenDonorEdge(problemData, edge)); } } ans.put("links", flatEdges); return ans; } private static Map<Object, Object> flattenDonorEdge( KepProblemData<ExchangeUnit, DonorEdge> kepProblemData, DonorEdge edge) { Map<Object, Object> ans = new HashMap<Object, Object>(); ExchangeUnit source = kepProblemData.getGraph().getSource(edge); ExchangeUnit dest = kepProblemData.getGraph().getDest(edge); String sourceId = makeNodeId(kepProblemData, source); String destId = makeNodeId(kepProblemData, dest); ans.put("sourceId", sourceId); ans.put("targetId", destId); ans.put("id", sourceId + destId); return ans; } private static Map<Object, Object> flattenExchangeUnit( ModelerInputs<ExchangeUnit, DonorEdge> inputs, ExchangeUnit unit) { Map<Object, Object> ans = new HashMap<Object, Object>(); ans.put("id", makeNodeId(inputs.getKepProblemData(), unit)); ans.put("type", makeType(inputs.getKepProblemData(), unit)); ans.put("reachable", true); ans.put("sensitized", computeSensitization(inputs, unit)); return ans; } private static String makeNodeId( KepProblemData<ExchangeUnit, DonorEdge> kepProblemData, ExchangeUnit unit) { if (kepProblemData.getRootNodes().contains(unit)) { return unit.getDonor().get(0).getId(); } else { return unit.getReceiver().getId(); } } private static String makeType( KepProblemData<ExchangeUnit, DonorEdge> kepProblemData, ExchangeUnit unit) { if (kepProblemData.getRootNodes().contains(unit)) { return "root"; } else if (kepProblemData.getPairedNodes().contains(unit)) { return "paired"; } else if (kepProblemData.getTerminalNodes().contains(unit)) { return "terminal"; } else { throw new RuntimeException(); } } private static int computeSensitization( ModelerInputs<ExchangeUnit, DonorEdge> inputs, ExchangeUnit unit) { Map<ExchangeUnit, Double> donorPower = inputs.getAuxiliaryInputStatistics() .getDonorPowerPostPreference(); Map<ExchangeUnit, Double> receiverPower = inputs .getAuxiliaryInputStatistics().getReceiverPowerPostPreference(); // System.out.println(donorPower); // System.out.println(receiverPower); if (inputs.getKepProblemData().getRootNodes().contains(unit)) { if (donorPower.containsKey(unit.getDonor().get(0))) { return singlePersonSensitization(donorPower.get(unit.getDonor().get(0))); } else { // System.err.println("missing donor power data for: " + unit); return 0; } } else if (inputs.getKepProblemData().getPairedNodes().contains(unit)) { double unitDonorPower = 0; for (Donor donor : unit.getDonor()) { if (donorPower.containsKey(donor)) { unitDonorPower += donorPower.get(donor); } else { // System.err.println("missing donor power data for: " + unit); return 0; } } if (receiverPower.containsKey(unit.getReceiver())) { return twoPersonSensitization(unitDonorPower, receiverPower.get(unit.getReceiver())); } else { // System.err.println("missing receiver power for: " + unit); return 0; } } else if (inputs.getKepProblemData().getTerminalNodes().contains(unit)) { if (receiverPower.containsKey(unit.getReceiver())) { return singlePersonSensitization(receiverPower.get(unit.getReceiver())); } else { // System.err.println("missing receiver power for: " + unit); return 0; } } else { throw new RuntimeException(); } } private static int singlePersonSensitization(double matchPower) { if (matchPower < .01) { return 3; } else if (matchPower < .08) { return 2; } else if (matchPower < .2) { return 1; } else { return 0; } } private static int twoPersonSensitization(double donorMatchPower, double receiverMatchPower) { double pmp = 10000 * donorMatchPower * receiverMatchPower; if (pmp < .1) { return 4; } else if (pmp < 5) { return 3; } else if (pmp < 20) { return 2; } else if (pmp < 60) { return 1; } else { return 0; } } }
rma350/kidneyExchange
kidneyMatching/src/web/KidneyServerSolver.java
Java
apache-2.0
8,249
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Journey' db.create_table('places_journey', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('route', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['places.Route'])), ('external_ref', self.gf('django.db.models.fields.TextField')()), ('notes', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), ('runs_on_monday', self.gf('django.db.models.fields.BooleanField')(default=False)), ('runs_on_tuesday', self.gf('django.db.models.fields.BooleanField')(default=False)), ('runs_on_wednesday', self.gf('django.db.models.fields.BooleanField')(default=False)), ('runs_on_thursday', self.gf('django.db.models.fields.BooleanField')(default=False)), ('runs_on_friday', self.gf('django.db.models.fields.BooleanField')(default=False)), ('runs_on_saturday', self.gf('django.db.models.fields.BooleanField')(default=False)), ('runs_on_sunday', self.gf('django.db.models.fields.BooleanField')(default=False)), ('runs_in_termtime', self.gf('django.db.models.fields.BooleanField')(default=False)), ('runs_in_school_holidays', self.gf('django.db.models.fields.BooleanField')(default=False)), ('runs_on_bank_holidays', self.gf('django.db.models.fields.BooleanField')(default=False)), ('runs_on_non_bank_holidays', self.gf('django.db.models.fields.BooleanField')(default=False)), ('runs_from', self.gf('django.db.models.fields.DateField')()), ('runs_until', self.gf('django.db.models.fields.DateField')()), ('vehicle', self.gf('django.db.models.fields.TextField')()), )) db.send_create_signal('places', ['Journey']) # Adding model 'ScheduledStop' db.create_table('places_scheduledstop', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('entity', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['places.Entity'])), ('journey', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['places.Journey'])), ('order', self.gf('django.db.models.fields.IntegerField')()), ('sta', self.gf('django.db.models.fields.TimeField')(null=True, blank=True)), ('std', self.gf('django.db.models.fields.TimeField')(null=True, blank=True)), ('times_estimated', self.gf('django.db.models.fields.BooleanField')(default=False)), ('fare_stage', self.gf('django.db.models.fields.BooleanField')(default=False)), ('activity', self.gf('django.db.models.fields.CharField')(default='B', max_length=1)), )) db.send_create_signal('places', ['ScheduledStop']) def backwards(self, orm): # Deleting model 'Journey' db.delete_table('places_journey') # Deleting model 'ScheduledStop' db.delete_table('places_scheduledstop') models = { 'places.entity': { 'Meta': {'object_name': 'Entity'}, '_identifiers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['places.Identifier']", 'symmetrical': 'False'}), '_metadata': ('django.db.models.fields.TextField', [], {'default': "'{}'"}), 'absolute_url': ('django.db.models.fields.TextField', [], {}), 'all_types': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'entities'", 'blank': 'True', 'to': "orm['places.EntityType']"}), 'all_types_completion': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'entities_completion'", 'blank': 'True', 'to': "orm['places.EntityType']"}), 'geometry': ('django.contrib.gis.db.models.fields.GeometryField', [], {'null': 'True'}), 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['places.EntityGroup']", 'symmetrical': 'False'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'identifier_scheme': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'identifier_value': ('django.db.models.fields.CharField', [], {'max_length': '256'}), 'is_stack': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_sublocation': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'location': ('django.contrib.gis.db.models.fields.PointField', [], {'null': 'True'}), 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['places.Entity']", 'null': 'True'}), 'primary_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['places.EntityType']", 'null': 'True'}), 'source': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['places.Source']"}) }, 'places.entitygroup': { 'Meta': {'object_name': 'EntityGroup'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'ref_code': ('django.db.models.fields.CharField', [], {'max_length': '256'}), 'source': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['places.Source']"}) }, 'places.entitygroupname': { 'Meta': {'unique_together': "(('entity_group', 'language_code'),)", 'object_name': 'EntityGroupName'}, 'entity_group': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'names'", 'to': "orm['places.EntityGroup']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'language_code': ('django.db.models.fields.CharField', [], {'max_length': '10'}), 'title': ('django.db.models.fields.TextField', [], {}) }, 'places.entityname': { 'Meta': {'unique_together': "(('entity', 'language_code'),)", 'object_name': 'EntityName'}, 'entity': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'names'", 'to': "orm['places.Entity']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'language_code': ('django.db.models.fields.CharField', [], {'max_length': '10'}), 'title': ('django.db.models.fields.TextField', [], {}) }, 'places.entitytype': { 'Meta': {'object_name': 'EntityType'}, 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['places.EntityTypeCategory']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'note': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'show_in_category_list': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'show_in_nearby_list': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'}), 'subtype_of': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'subtypes'", 'blank': 'True', 'to': "orm['places.EntityType']"}), 'subtype_of_completion': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'subtypes_completion'", 'blank': 'True', 'to': "orm['places.EntityType']"}) }, 'places.entitytypecategory': { 'Meta': {'object_name': 'EntityTypeCategory'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.TextField', [], {}) }, 'places.entitytypename': { 'Meta': {'unique_together': "(('entity_type', 'language_code'),)", 'object_name': 'EntityTypeName'}, 'entity_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'names'", 'to': "orm['places.EntityType']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'language_code': ('django.db.models.fields.CharField', [], {'max_length': '10'}), 'verbose_name': ('django.db.models.fields.TextField', [], {}), 'verbose_name_plural': ('django.db.models.fields.TextField', [], {}), 'verbose_name_singular': ('django.db.models.fields.TextField', [], {}) }, 'places.identifier': { 'Meta': {'object_name': 'Identifier'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'scheme': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'value': ('django.db.models.fields.CharField', [], {'max_length': '256'}) }, 'places.journey': { 'Meta': {'object_name': 'Journey'}, 'external_ref': ('django.db.models.fields.TextField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'route': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['places.Route']"}), 'runs_from': ('django.db.models.fields.DateField', [], {}), 'runs_in_school_holidays': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'runs_in_termtime': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'runs_on_bank_holidays': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'runs_on_friday': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'runs_on_monday': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'runs_on_non_bank_holidays': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'runs_on_saturday': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'runs_on_sunday': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'runs_on_thursday': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'runs_on_tuesday': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'runs_on_wednesday': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'runs_until': ('django.db.models.fields.DateField', [], {}), 'vehicle': ('django.db.models.fields.TextField', [], {}) }, 'places.route': { 'Meta': {'object_name': 'Route'}, 'external_ref': ('django.db.models.fields.TextField', [], {}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'operator': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'service_id': ('django.db.models.fields.TextField', [], {}), 'service_name': ('django.db.models.fields.TextField', [], {'null': 'True'}), 'stops': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['places.Entity']", 'through': "orm['places.StopOnRoute']", 'symmetrical': 'False'}) }, 'places.scheduledstop': { 'Meta': {'ordering': "['order']", 'object_name': 'ScheduledStop'}, 'activity': ('django.db.models.fields.CharField', [], {'default': "'B'", 'max_length': '1'}), 'entity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['places.Entity']"}), 'fare_stage': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'journey': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['places.Journey']"}), 'order': ('django.db.models.fields.IntegerField', [], {}), 'sta': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}), 'std': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}), 'times_estimated': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) }, 'places.source': { 'Meta': {'object_name': 'Source'}, 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'last_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), 'module_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}) }, 'places.stoponroute': { 'Meta': {'ordering': "['order']", 'object_name': 'StopOnRoute'}, 'entity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['places.Entity']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'order': ('django.db.models.fields.IntegerField', [], {}), 'route': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['places.Route']"}) } } complete_apps = ['places']
mollyproject/mollyproject
molly/apps/places/migrations/0009_auto__add_journey__add_scheduledstop.py
Python
apache-2.0
13,531
package com.jaivox.ui.appmaker; import java.io.*; import java.util.*; import bitpix.list.*; public class Rule2Fsm { static String dir = "./"; basicTree tree; TreeMap <String, String> states; TreeMap <String, String> tags; static String name = "data/road1.tree"; static String yes = "yes"; String startState = "def"; static String casedefault = "(default) (def)"; static basicNode casedefaultnode; Vector <String> store; public Rule2Fsm () { String filename = dir + name; startState = startState; tree = new basicTree (filename); // tree.WriteTree (); states = new TreeMap <String, String> (); tags = new TreeMap <String, String> (); Vector <bitpix.list.basicNode> list = tree.Root.ListChild; casedefaultnode = new basicNode (casedefault); store = new Vector <String> (); store.add ("\n#include errors.dlg\n"); for (int i=0; i<list.size (); i++) { basicNode child = list.elementAt (i); gt (child, startState); } int pos = filename.lastIndexOf ("."); String outfile = filename.substring (0, pos+1) + "dlg"; // writefile (outfile, store); } void Debug (String s) { System.out.println ("[Rule2Fsm]" + s); } void gt (basicNode node, String sofar) { Vector <bitpix.list.basicNode> list = node.ListChild; if (list == null || list.size () == 0) { // emit a state with def emit (node, sofar, "def"); } else { String nextstate = createNextState (node); String morefar = sofar + " " + nextstate; emit (node, sofar, nextstate); list.add (casedefaultnode); for (int i=0; i<list.size (); i++) { basicNode child = list.elementAt (i); gt (child, morefar); } } } void emit (basicNode node, String sofar, String next) { int pos = sofar.lastIndexOf (" "); pos++; String last = sofar.substring (pos); String tag = sofar.replaceAll (" ", "_"); tag = tag + "_" + next; tag = getuniquetag (tag); StringBuffer sb = new StringBuffer (); sb.append ("{\n["+tag+"]\n"); String t = (String)node.Tag; if (t.trim ().length () == 0) return; StringTokenizer st = new StringTokenizer (t, "()"); if (st.countTokens () < 2) { Debug ("Don't have two tokens from "+t); return; } String input = filter (st.nextToken ()).trim (); String output = filter (st.nextToken ()).trim (); while (output.length () == 0) output = filter (st.nextToken ()).trim (); // Debug ("tag="+t+" / input="+input+" output="+output); // sb.append ("\t"+sofar+" ;\n"); // with Gui2Gram, convert input and output to use dotted head tag form String indot = input.replaceAll (" ", "."); String outdot = output.replaceAll (" ", "."); sb.append ("\t"+last+" ;\n"); // sb.append ("\t"+input+" ;\n"); // sb.append ("\t"+output+" ;\n"); sb.append ("\t"+indot+" ;\n"); sb.append ("\t"+outdot+" ;\n"); sb.append ("\t"+next+" ;\n"); sb.append ("}\n"); String all = new String (sb); store.add (all); // System.out.println (all); } static String filter (String line) { return Gui2Gram.filter (line); } String createNextState (basicNode node) { String tag = (String)(node.Tag); StringTokenizer st = new StringTokenizer (tag, "()"); if (st.countTokens () < 2) { Debug ("don't have two tokens in "+tag); return "def"; } String input = st.nextToken ().trim (); String output = st.nextToken ().trim (); while (output.length () == 0) output = st.nextToken ().trim (); StringTokenizer tt = new StringTokenizer (output); int n = tt.countTokens (); StringBuffer sb = new StringBuffer (); for (int i=0; i<Math.min (n, 3); i++) { String token = tt.nextToken (); sb.append (token.charAt (0)); } if (n < 3) { for (int j=n; j<3; j++) { sb.append ('x'); } } String s = new String (sb); String test = states.get (s); if (test != null) { for (int i=1; i<10; i++) { String next = s + i; if (states.get (next) == null) { s = next; break; } } } states.put (s, yes); return s; } String getuniquetag (String in) { if (tags.get (in) == null) { tags.put (in, yes); return in; } else { for (int i=1; i<99; i++) { String next = in+"_"+i; if (tags.get (next) != null) { continue; } tags.put (next, yes); return next; } Debug ("More than 99 tags starting with "+in); return "error"; } } void writeRules (PrintWriter out) { try { for (int i=0; i<store.size (); i++) { out.println (store.elementAt (i)); } } catch (Exception e) { e.printStackTrace (); } } }
jaivox/tools
v2/com/jaivox/ui/appmaker/Rule2Fsm.java
Java
apache-2.0
4,520
# Unona pilosa (Baill.) Baill. SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Magnoliales/Annonaceae/Monanthotaxis/Monanthotaxis pilosa/ Syn. Unona pilosa/README.md
Markdown
apache-2.0
185
/* * Copyright (C) 2012 Jason Gedge <http://www.gedge.ca> * * This file is part of the OpGraph project. * * 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/>. */ /** * Provides commands for the Application API. */ package ca.phon.opgraph.app.commands;
ghedlund/opgraph
app/src/main/java/ca/phon/opgraph/app/commands/package-info.java
Java
apache-2.0
855
<?php class Gep_ScoreController extends Zend_Controller_Action { public function init() { /* Initialize action controller here */ header('content-type: text/html; charset=utf8'); } public function indexAction(){ } public function fullResultAction(){ } }
samlanh/aseansm
application/modules/gep/controllers/ScoreController.php
PHP
apache-2.0
307
<!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 Jan 16 10:54:22 MST 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>org.wildfly.swarm.jaeger (BOM: * : All 2.3.0.Final-SNAPSHOT API)</title> <meta name="date" content="2019-01-16"> <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/jaeger/package-summary.html" target="classFrame">org.wildfly.swarm.jaeger</a></h1> <div class="indexContainer"> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="JaegerFraction.html" title="class in org.wildfly.swarm.jaeger" target="classFrame">JaegerFraction</a></li> </ul> </div> </body> </html>
wildfly-swarm/wildfly-swarm-javadocs
2.3.0.Final-SNAPSHOT/apidocs/org/wildfly/swarm/jaeger/package-frame.html
HTML
apache-2.0
949
/* * Copyright 2013 DigitasLBi Netherlands B.V. * * 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.Collections.Generic; using System.ComponentModel.Composition.Hosting; using System.Diagnostics; using LBi.Cli.Arguments; namespace LBi.LostDoc.ConsoleApplication.Extensibility { public abstract class Command : ICommand { [Parameter(HelpMessage = "Include errors and warning output only.")] public LBi.Cli.Arguments.Switch Quiet { get; set; } [Parameter(HelpMessage = "Include verbose output.")] public LBi.Cli.Arguments.Switch Verbose { get; set; } public abstract void Invoke(CompositionContainer container); protected void ConfigureTraceLevels(IEnumerable<TraceSource> sources) { SourceLevels currentLevel; if (this.Quiet.IsPresent) { currentLevel = SourceLevels.Error | SourceLevels.Warning | SourceLevels.Critical; } else if (this.Verbose.IsPresent) { currentLevel = SourceLevels.All; } else { currentLevel = SourceLevels.Information | SourceLevels.Warning | SourceLevels.Error | SourceLevels.Critical | SourceLevels.ActivityTracing; } foreach (TraceSource source in sources) source.Switch.Level = currentLevel; } } }
LBiNetherlands/LBi.LostDoc
LBi.LostDoc.ConsoleApplication.Extensibility/Command.cs
C#
apache-2.0
2,048
CREATE TABLE TASK_EXECUTION ( TASK_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY , START_TIME DATETIME DEFAULT NULL , END_TIME DATETIME DEFAULT NULL , TASK_NAME VARCHAR(100) , EXIT_CODE INTEGER , EXIT_MESSAGE VARCHAR(2500) , ERROR_MESSAGE VARCHAR(2500) , LAST_UPDATED DATETIME , EXTERNAL_EXECUTION_ID VARCHAR(255), PARENT_EXECUTION_ID BIGINT ); CREATE TABLE TASK_EXECUTION_PARAMS ( TASK_EXECUTION_ID BIGINT NOT NULL , TASK_PARAM VARCHAR(2500) , constraint TASK_EXEC_PARAMS_FK foreign key (TASK_EXECUTION_ID) references TASK_EXECUTION(TASK_EXECUTION_ID) ) ; CREATE TABLE TASK_TASK_BATCH ( TASK_EXECUTION_ID BIGINT NOT NULL , JOB_EXECUTION_ID BIGINT NOT NULL , constraint TASK_EXEC_BATCH_FK foreign key (TASK_EXECUTION_ID) references TASK_EXECUTION(TASK_EXECUTION_ID) ) ; CREATE TABLE TASK_SEQ (ID BIGINT IDENTITY);
trisberg/spring-cloud-task
spring-cloud-task-core/src/main/resources/org/springframework/cloud/task/schema-sqlserver.sql
SQL
apache-2.0
850
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" /> <link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/> <link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/> <!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]--> <style type="text/css" media="all"> @import url('../../../../../style.css'); @import url('../../../../../tree.css'); </style> <script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script> <script src="../../../../../package-nodes-tree.js" type="text/javascript"></script> <script src="../../../../../clover-tree.js" type="text/javascript"></script> <script src="../../../../../clover.js" type="text/javascript"></script> <script src="../../../../../clover-descriptions.js" type="text/javascript"></script> <script src="../../../../../cloud.js" type="text/javascript"></script> <title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title> </head> <body> <div id="page"> <header id="header" role="banner"> <nav class="aui-header aui-dropdown2-trigger-group" role="navigation"> <div class="aui-header-inner"> <div class="aui-header-primary"> <h1 id="logo" class="aui-header-logo aui-header-logo-clover"> <a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a> </h1> </div> <div class="aui-header-secondary"> <ul class="aui-nav"> <li id="system-help-menu"> <a class="aui-nav-link" title="Open online documentation" target="_blank" href="http://openclover.org/documentation"> <span class="aui-icon aui-icon-small aui-iconfont-help">&#160;Help</span> </a> </li> </ul> </div> </div> </nav> </header> <div class="aui-page-panel"> <div class="aui-page-panel-inner"> <div class="aui-page-panel-nav aui-page-panel-nav-clover"> <div class="aui-page-header-inner" style="margin-bottom: 20px;"> <div class="aui-page-header-image"> <a href="http://cardatechnologies.com" target="_top"> <div class="aui-avatar aui-avatar-large aui-avatar-project"> <div class="aui-avatar-inner"> <img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/> </div> </div> </a> </div> <div class="aui-page-header-main" > <h1> <a href="http://cardatechnologies.com" target="_top"> ABA Route Transit Number Validator 1.0.1-SNAPSHOT </a> </h1> </div> </div> <nav class="aui-navgroup aui-navgroup-vertical"> <div class="aui-navgroup-inner"> <ul class="aui-nav"> <li class=""> <a href="../../../../../dashboard.html">Project overview</a> </li> </ul> <div class="aui-nav-heading packages-nav-heading"> <strong>Packages</strong> </div> <div class="aui-nav project-packages"> <form method="get" action="#" class="aui package-filter-container"> <input type="text" autocomplete="off" class="package-filter text" placeholder="Type to filter packages..." name="package-filter" id="package-filter" title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/> </form> <p class="package-filter-no-results-message hidden"> <small>No results found.</small> </p> <div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator"> <div class="packages-tree-container"></div> <div class="clover-packages-lozenges"></div> </div> </div> </div> </nav> </div> <section class="aui-page-panel-content"> <div class="aui-page-panel-content-clover"> <div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs"> <li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li> <li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li> <li><a href="test-Test_AbaRouteValidator_03.html">Class Test_AbaRouteValidator_03</a></li> </ol></div> <h1 class="aui-h2-clover"> Test testAbaNumberCheck_3149_good </h1> <table class="aui"> <thead> <tr> <th>Test</th> <th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th> <th><label title="When the test execution was started">Start time</label></th> <th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th> <th><label title="A failure or error message if the test is not successful.">Message</label></th> </tr> </thead> <tbody> <tr> <td> <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_03.html?line=15641#src-15641" >testAbaNumberCheck_3149_good</a> </td> <td> <span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span> </td> <td> 7 Aug 12:33:30 </td> <td> 0.0 </td> <td> <div></div> <div class="errorMessage"></div> </td> </tr> </tbody> </table> <div>&#160;</div> <table class="aui aui-table-sortable"> <thead> <tr> <th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th> <th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_3149_good</th> </tr> </thead> <tbody> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=27318#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a> </td> <td> <span class="sortValue">0.7352941</span>73.5% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td> </tr> </tbody> </table> </div> <!-- class="aui-page-panel-content-clover" --> <footer id="footer" role="contentinfo"> <section class="footer-body"> <ul> <li> Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1 on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT. </li> </ul> <ul> <li>OpenClover is free and open-source software. </li> </ul> </section> </footer> </section> <!-- class="aui-page-panel-content" --> </div> <!-- class="aui-page-panel-inner" --> </div> <!-- class="aui-page-panel" --> </div> <!-- id="page" --> </body> </html>
dcarda/aba.route.validator
target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_03_testAbaNumberCheck_3149_good_l2u.html
HTML
apache-2.0
9,178
--!A cross-platform build utility based on Lua -- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apache License, Version 2.0 (the -- "License"); you may not use this file except in compliance -- with the License. You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- Copyright (C) 2015 - 2019, TBOOX Open Source Group. -- -- @author ruki -- @file vs201x_solution.lua -- -- imports import("core.project.project") import("vsfile") -- make header function _make_header(slnfile, vsinfo) slnfile:print("Microsoft Visual Studio Solution File, Format Version %s.00", vsinfo.solution_version) slnfile:print("# Visual Studio %s", vsinfo.vstudio_version) end -- make projects function _make_projects(slnfile, vsinfo) -- the vstudio tool uuid for vc project local vctool = "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942" -- make all targets for targetname, target in pairs(project.targets()) do if not target:isphony() then -- enter project slnfile:enter("Project(\"{%s}\") = \"%s\", \"%s\\%s.vcxproj\", \"{%s}\"", vctool, targetname, targetname, targetname, hash.uuid(targetname)) -- add dependences for _, dep in ipairs(target:get("deps")) do slnfile:enter("ProjectSection(ProjectDependencies) = postProject") slnfile:print("{%s} = {%s}", hash.uuid(dep), hash.uuid(dep)) slnfile:leave("EndProjectSection") end -- leave project slnfile:leave("EndProject") end end end -- make global function _make_global(slnfile, vsinfo) -- enter global slnfile:enter("Global") -- add solution configuration platforms slnfile:enter("GlobalSection(SolutionConfigurationPlatforms) = preSolution") for _, mode in ipairs(vsinfo.modes) do for _, arch in ipairs(vsinfo.archs) do slnfile:print("%s|%s = %s|%s", mode, arch, mode, arch) end end slnfile:leave("EndGlobalSection") -- add project configuration platforms slnfile:enter("GlobalSection(ProjectConfigurationPlatforms) = postSolution") for targetname, target in pairs(project.targets()) do if not target:isphony() then for _, mode in ipairs(vsinfo.modes) do for _, arch in ipairs(vsinfo.archs) do slnfile:print("{%s}.%s|%s.ActiveCfg = %s|%s", hash.uuid(targetname), mode, arch, mode, arch) slnfile:print("{%s}.%s|%s.Build.0 = %s|%s", hash.uuid(targetname), mode, arch, mode, arch) end end end end slnfile:leave("EndGlobalSection") -- add solution properties slnfile:enter("GlobalSection(SolutionProperties) = preSolution") slnfile:print("HideSolutionNode = FALSE") slnfile:leave("EndGlobalSection") -- leave global slnfile:leave("EndGlobal") end -- make solution function make(vsinfo) -- init solution name vsinfo.solution_name = project.name() or "vs" .. vsinfo.vstudio_version -- open solution file local slnpath = path.join(vsinfo.solution_dir, vsinfo.solution_name .. ".sln") local slnfile = vsfile.open(slnpath, "w") -- init indent character vsfile.indentchar('\t') -- make header _make_header(slnfile, vsinfo) -- make projects _make_projects(slnfile, vsinfo) -- make global _make_global(slnfile, vsinfo) -- exit solution file slnfile:close() -- convert gb2312 to utf8 io.writefile(slnpath, io.readfile(slnpath):convert("gb2312", "utf8")) end
tboox/xmake
xmake/plugins/project/vstudio/impl/vs201x_solution.lua
Lua
apache-2.0
4,143