code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
// PathVisio, // a tool for data visualization and analysis using Biological Pathways // Copyright 2006-2011 BiGCaT Bioinformatics // // 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.wikipathways.client; import java.io.BufferedOutputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.StringReader; import java.net.URL; import java.rmi.RemoteException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; import javax.xml.rpc.ServiceException; import org.apache.axis.EngineConfiguration; import org.bridgedb.DataSource; import org.bridgedb.Xref; import org.bridgedb.bio.Organism; import org.pathvisio.core.model.ConverterException; import org.pathvisio.core.model.GpmlFormat; import org.pathvisio.core.model.Pathway; import org.pathvisio.core.view.MIMShapes; import org.pathvisio.wikipathways.webservice.WSAuth; import org.pathvisio.wikipathways.webservice.WSCurationTag; import org.pathvisio.wikipathways.webservice.WSCurationTagHistory; import org.pathvisio.wikipathways.webservice.WSPathway; import org.pathvisio.wikipathways.webservice.WSPathwayHistory; import org.pathvisio.wikipathways.webservice.WSPathwayInfo; import org.pathvisio.wikipathways.webservice.WSSearchResult; import org.pathvisio.wikipathways.webservice.WikiPathwaysLocator; import org.pathvisio.wikipathways.webservice.WikiPathwaysPortType; /** * A client API that provides access to the WikiPathways SOAP webservice. * For more documentation on the webservice, see: * http://www.wikipathways.org/index.php/Help:WikiPathways_Webservice * @author thomas * */ public class WikiPathwaysClient { private WikiPathwaysPortType port; private WSAuth auth; /** * Create an instance of this class with the default settings. * @throws ServiceException */ public WikiPathwaysClient() throws ServiceException { this(null); } /** * Create an instance of this class. * @param config The axis configuration. Allows you to set custom implementations of * transport protocols (see {@link EngineConfiguration} for details). * @param portAddress The url that points to the WikiPathways webservice. * @throws ServiceException */ public WikiPathwaysClient(EngineConfiguration config, URL portAddress) throws ServiceException { port = new WikiPathwaysLocator(config).getWikiPathwaysSOAPPort_Http(portAddress); MIMShapes.registerShapes(); } /** * Create an instance of this class. * @param portAddress The url that points to the WikiPathways webservice. * @throws ServiceException */ public WikiPathwaysClient(URL portAddress) throws ServiceException { if(portAddress != null) { port = new WikiPathwaysLocator().getWikiPathwaysSOAPPort_Http(portAddress); } else { port = new WikiPathwaysLocator().getWikiPathwaysSOAPPort_Http(); } MIMShapes.registerShapes(); } /** * Get a info about the pathway (without getting the actual * GPML code). */ public WSPathwayInfo getPathwayInfo(String id) throws RemoteException { return port.getPathwayInfo(id); } /** * Get a pathway from WikiPathways. * @see #toPathway(WSPathway) */ public WSPathway getPathway(String id) throws RemoteException, ConverterException { return getPathway(id, 0); } /** * List all pathways on WikiPathways */ public WSPathwayInfo[] listPathways() throws RemoteException { WSPathwayInfo[] r = port.listPathways(null); if(r == null) r = new WSPathwayInfo[0]; return r; } /** * List all pathways on WikiPathways for the given organism * @param organism The organism to filter by. * @return * @throws RemoteException */ public WSPathwayInfo[] listPathways(Organism organism) throws RemoteException { WSPathwayInfo[] r = port.listPathways(organism.latinName()); if(r == null) r = new WSPathwayInfo[0]; return r; } /** * Lists all available organisms on WikiPathways * @throws RemoteException */ public String[] listOrganisms() throws RemoteException { String[] r = port.listOrganisms(); if(r == null) r = new String[0]; return r; } /** * Get a specific revision of a pathway from WikiPathways * @see #toPathway(WSPathway) */ public WSPathway getPathway(String id, int revision) throws RemoteException, ConverterException { WSPathway wsp = port.getPathway(id, revision); return wsp; } public WSPathwayHistory getPathwayHistory(String id, Date start) throws RemoteException { String timestamp = dateToTimestamp(start); WSPathwayHistory hist = port.getPathwayHistory(id, timestamp); return hist; } public byte[] getPathwayAs(String fileType, String id, int revision) throws RemoteException { return port.getPathwayAs(fileType, id, revision); } public void savePathwayAs(File file, String fileType, String id, int revision) throws IOException { byte[] data = getPathwayAs(fileType, id, revision); BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file)); out.write(data); } /** * Get a list of external references on the pathway (gene, protein or metabolite ids), * translated to the given database system. * @param id The pathway id * @param dataSource The data source to translate to (e.g. BioDataSource.ENTREZ_GENE) * @return The identifiers of the external references. * @throws RemoteException */ public String[] getXrefList(String id, DataSource dataSource) throws RemoteException { String[] xrefs = port.getXrefList(id, dataSource.getSystemCode()); if(xrefs == null) xrefs = new String[0]; return xrefs; } /** * Utility method to create a pathway model from the webservice class * WSPathway. * @param wsp The WSPathway object returned by the webservice. * @return The org.pathvisio.model.Pathway model representation of the GPML code. * @throws ConverterException */ public static Pathway toPathway(WSPathway wsp) throws ConverterException { Pathway p = new Pathway(); p.readFromXml(new StringReader(wsp.getGpml()), true); return p; } /** * Update a pathway on WikiPathways. * Note: you need to login first, see: {@link #login(String, String)}. * @param id The pathway identifier * @param pathway The updated pathway data * @param description A description of the changes * @param revision The revision these changes were based on (to prevent conflicts) */ public void updatePathway(String id, Pathway pathway, String description, int revision) throws ConverterException, RemoteException { ByteArrayOutputStream out = new ByteArrayOutputStream(); GpmlFormat.writeToXml(pathway, out, true); String gpml = out.toString(); port.updatePathway(id, description, gpml, revision, auth); } /** * Creates a new pathway on WikiPathways. * Note: you need to login first, see: {@link #login(String, String)}. * @param pathway The pathway to create on WikiPathways * @return The WSPathwayInfo object, containing the identifier and revision of the created pathway. * @throws RemoteException * @throws ConverterException */ public WSPathwayInfo createPathway(Pathway pathway) throws RemoteException, ConverterException { ByteArrayOutputStream out = new ByteArrayOutputStream(); GpmlFormat.writeToXml(pathway, out, true); String gpml = out.toString(); return port.createPathway(gpml, auth); } /** * Apply a curation tag to a pathway. Will overwrite existing tags with the same name. * @param id The pathway identifier * @param tagName The name of the tag (e.g. CurationTag:Approved) * @param tagText The tag text * @param revision The revision to apply the tag to * @throws RemoteException */ public void saveCurationTag(String id, String tagName, String tagText, int revision) throws RemoteException { port.saveCurationTag(id, tagName, tagText, revision, auth); } /** * Apply a curation tag to a pathway. Will overwrite existing tags with the same name. * @param id The pathway identifier * @param tagName The name of the tag (e.g. CurationTag:Approved) * @param tagText The tag text * @throws RemoteException */ public void saveCurationTag(String id, String tagName, String text) throws RemoteException { saveCurationTag(id, tagName, text, 0); } /** * Remove the given curation tag from the pathway * @param id The pathway identifier * @param tagName The name of the tag (e.g. CurationTag:Approved) * @throws RemoteException */ public void removeCurationTag(String id, String tagName) throws RemoteException { port.removeCurationTag(id, tagName, auth); } /** * Get all curation tags for the given pathway * @param id The pathway identifier * @return An array with the curation tags. * @throws RemoteException */ public WSCurationTag[] getCurationTags(String id) throws RemoteException { WSCurationTag[] tags = port.getCurationTags(id); if(tags == null) tags = new WSCurationTag[0]; return tags; } public WSCurationTag[] getCurationTagsByName(String tagName) throws RemoteException { WSCurationTag[] tags = port.getCurationTagsByName(tagName); if(tags == null) tags = new WSCurationTag[0]; return tags; } /** * Get the curation tag history for the given pathway * @param id The pathway identifier * @param cutoff Only get history items that occured after the given cutoff date * @return An array with the history items * @throws RemoteException */ public WSCurationTagHistory[] getCurationTagHistory(String id, Date cutoff) throws RemoteException { String timestamp = "0"; if(cutoff != null) { // turn Date into expected timestamp format, in GMT: SimpleDateFormat sdf = new SimpleDateFormat ("yyyyMMddHHmmss"); sdf.setTimeZone(TimeZone.getTimeZone("GMT")); timestamp = sdf.format(cutoff); } WSCurationTagHistory[] hist = port.getCurationTagHistory(id, timestamp); if(hist == null) hist = new WSCurationTagHistory[0]; return hist; } /** * Get the curation tag history for the given pathway * @param id The pathway identifier * @return An array with the history items * @throws RemoteException */ public WSCurationTagHistory[] getCurationTagHistory(String id) throws RemoteException { return getCurationTagHistory(id, null); } /** * Login using your WikiPathways account. You need to login in order * to make changes to pathways. * @param name The username of the WikiPathways account * @param pass The password of the WikiPathways account * @throws RemoteException */ public void login(String name, String pass) throws RemoteException { auth = new WSAuth(name, port.login(name, pass)); } /** * Get a list of recently changed pathways. * @param cutoff Only return changes since this date. * @throws RemoteException */ public WSPathwayInfo[] getRecentChanges(Date cutoff) throws RemoteException { String timestamp = dateToTimestamp(cutoff); WSPathwayInfo[] changes = port.getRecentChanges(timestamp); if(changes == null) changes = new WSPathwayInfo[0]; return changes; } private static String dateToTimestamp(Date date) { // turn Date into expected timestamp format, in GMT: SimpleDateFormat sdf = new SimpleDateFormat ("yyyyMMddHHmmss"); sdf.setTimeZone(TimeZone.getTimeZone("GMT")); return sdf.format(date); } public WSSearchResult[] findPathwaysByText(String query) throws RemoteException { WSSearchResult[] r = port.findPathwaysByText(query, null); if(r == null) r = new WSSearchResult[0]; return r; } public WSSearchResult[] findPathwaysByText(String query, Organism organism) throws RemoteException { String species = null; if(organism != null) { species = organism.latinName(); } WSSearchResult[] r = port.findPathwaysByText(query, species); if(r == null) r = new WSSearchResult[0]; return r; } /** * Search for pathways containing one of the given xrefs by taking * into account cross-references to other database systems. * @param xrefs * @return * @throws RemoteException */ public WSSearchResult[] findPathwaysByXref(Xref... xrefs) throws RemoteException { String[] ids = new String[xrefs.length]; String[] codes = new String[xrefs.length]; for(int i = 0; i < xrefs.length; i++) { ids[i] = xrefs[i].getId(); DataSource ds = xrefs[i].getDataSource(); if(ds == null) { codes[i] = null; } else { codes[i] = ds.getSystemCode(); } } WSSearchResult[] r = port.findPathwaysByXref(ids, codes); if(r == null) r = new WSSearchResult[0]; return r; } /** * @deprecated Use {@link #findPathwaysByXref(Xref...)} with a * proper xref (id + datasource) instead. */ public WSSearchResult[] findPathwaysByXref(String id) throws RemoteException { return findPathwaysByXref(new Xref(id, null)); } public WSSearchResult[] findInteractions(String query) throws RemoteException { WSSearchResult[] r = port.findInteractions(query); if(r == null) r = new WSSearchResult[0]; return r; } /** * search by literature reference */ public WSSearchResult[] findPathwaysByLiterature(String query) throws RemoteException { WSSearchResult[] r = port.findPathwaysByLiterature(query); if(r == null) r = new WSSearchResult[0]; return r; } }
wikipathways/org.wikipathways.client
wp-client/src/org/wikipathways/client/WikiPathwaysClient.java
Java
apache-2.0
13,662
package pl.touk.nussknacker.ui.security.oauth2 import akka.http.scaladsl.marshalling.ToResponseMarshallable import akka.http.scaladsl.model.StatusCodes.NotFound import akka.http.scaladsl.model.{ContentTypes, HttpEntity, HttpResponse, StatusCodes} import akka.http.scaladsl.server.directives.{AuthenticationDirective, SecurityDirectives} import akka.http.scaladsl.server.{Directives, Route} import com.typesafe.scalalogging.LazyLogging import io.circe.Encoder import io.circe.generic.JsonCodec import pl.touk.nussknacker.ui.security.CertificatesAndKeys import pl.touk.nussknacker.ui.security.api.{AnonymousAccess, AuthenticatedUser, AuthenticationResources, FrontendStrategySettings} import sttp.client.{NothingT, SttpBackend} import scala.concurrent.{ExecutionContext, Future} class OAuth2AuthenticationResources(override val name: String, realm: String, service: OAuth2Service[AuthenticatedUser, OAuth2AuthorizationData], configuration: OAuth2Configuration)(implicit ec: ExecutionContext, sttpBackend: SttpBackend[Future, Nothing, NothingT]) extends AuthenticationResources with Directives with LazyLogging with AnonymousAccess { import pl.touk.nussknacker.engine.util.Implicits.RichIterable override val frontendStrategySettings: FrontendStrategySettings = FrontendStrategySettings.OAuth2( configuration.authorizeUrl.map(_.toString), configuration.authSeverPublicKey.map(CertificatesAndKeys.textualRepresentationOfPublicKey), configuration.idTokenNonceVerificationRequired, configuration.implicitGrantEnabled, configuration.anonymousUserRole.isDefined ) val anonymousUserRole: Option[String] = configuration.anonymousUserRole override def authenticateReally(): AuthenticationDirective[AuthenticatedUser] = { SecurityDirectives.authenticateOAuth2Async( authenticator = OAuth2Authenticator(configuration, service), realm = realm ) } override lazy val additionalRoute: Route = pathEnd { parameters('code, 'redirect_uri.?) { (authorizationCode, redirectUri) => get { Seq(redirectUri, configuration.redirectUri.map(_.toString)).flatten.exactlyOne.map { redirectUri => complete { oAuth2Authenticate(authorizationCode, redirectUri) } }.getOrElse { complete((NotFound, "Redirect URI must be provided either in configuration or in query params")) } } } } private def oAuth2Authenticate(authorizationCode: String, redirectUri: String): Future[ToResponseMarshallable] = { service.obtainAuthorizationAndUserInfo(authorizationCode, redirectUri).map { case (auth, _) => ToResponseMarshallable(Oauth2AuthenticationResponse(auth.accessToken, auth.tokenType)) }.recover { case OAuth2ErrorHandler(ex) => { logger.debug("Retrieving access token error:", ex) toResponseReject(Map("message" -> "Retrieving access token error. Please try authenticate again.")) } } } private def toResponseReject(entity: Map[String, String]): ToResponseMarshallable = { HttpResponse( status = StatusCodes.BadRequest, entity = HttpEntity(ContentTypes.`application/json`, Encoder.encodeMap[String, String].apply(entity).spaces2) ) } } @JsonCodec case class Oauth2AuthenticationResponse(accessToken: String, tokenType: String)
TouK/nussknacker
security/src/main/scala/pl/touk/nussknacker/ui/security/oauth2/OAuth2AuthenticationResources.scala
Scala
apache-2.0
3,344
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.lang.ant.config.explorer; import com.intellij.ide.util.treeView.AbstractTreeStructure; import com.intellij.ide.util.treeView.NodeDescriptor; import com.intellij.lang.ant.AntBundle; import com.intellij.lang.ant.config.*; import com.intellij.lang.ant.config.impl.MetaTarget; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.ActionCallback; import com.intellij.psi.PsiDocumentManager; import com.intellij.ui.JBColor; import com.intellij.util.ArrayUtilRt; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.*; final class AntExplorerTreeStructure extends AbstractTreeStructure { private static final Logger LOG = Logger.getInstance(AntExplorerTreeStructure.class); private final Project myProject; private final Object myRoot = new Object(); private boolean myFilteredTargets = false; private static final Comparator<AntBuildTarget> ourTargetComparator = (target1, target2) -> { final String name1 = target1.getDisplayName(); if (name1 == null) return Integer.MIN_VALUE; final String name2 = target2.getDisplayName(); if (name2 == null) return Integer.MAX_VALUE; return name1.compareToIgnoreCase(name2); }; AntExplorerTreeStructure(final Project project) { myProject = project; } @Override public boolean isToBuildChildrenInBackground(@NotNull final Object element) { return true; } @Override public boolean isAlwaysLeaf(@NotNull Object element) { return element != myRoot && !(element instanceof AntBuildFile); } @Override @NotNull public AntNodeDescriptor createDescriptor(@NotNull Object element, NodeDescriptor parentDescriptor) { if (element == myRoot) { return new RootNodeDescriptor(myProject, parentDescriptor); } if (element instanceof String) { return new TextInfoNodeDescriptor(myProject, parentDescriptor, (String)element); } if (element instanceof AntBuildFileBase) { return new AntBuildFileNodeDescriptor(myProject, parentDescriptor, (AntBuildFileBase)element); } if (element instanceof AntBuildTargetBase) { return new AntTargetNodeDescriptor(myProject, parentDescriptor, (AntBuildTargetBase)element); } LOG.error("Unknown element for this tree structure " + element); return null; } @Override public Object @NotNull [] getChildElements(@NotNull Object element) { final AntConfiguration configuration = AntConfiguration.getInstance(myProject); if (element == myRoot) { if (!configuration.isInitialized()) { return new Object[] {AntBundle.message("loading.ant.config.progress")}; } return configuration.getBuildFileList().isEmpty() ? new Object[]{AntBundle.message("ant.tree.structure.no.build.files.message")} : configuration.getBuildFiles(); } if (element instanceof AntBuildFile) { final AntBuildFile buildFile = (AntBuildFile)element; final AntBuildModel model = buildFile.getModel(); final List<AntBuildTarget> targets = new ArrayList<>(Arrays.asList(myFilteredTargets ? model.getFilteredTargets() : model.getTargets())); Collections.sort(targets, ourTargetComparator); final List<AntBuildTarget> metaTargets = Arrays.asList(configuration.getMetaTargets(buildFile)); Collections.sort(metaTargets, ourTargetComparator); targets.addAll(metaTargets); return targets.toArray(new AntBuildTarget[0]); } return ArrayUtilRt.EMPTY_OBJECT_ARRAY; } @Override @Nullable public Object getParentElement(@NotNull Object element) { if (element instanceof AntBuildTarget) { if (element instanceof MetaTarget) { return ((MetaTarget)element).getBuildFile(); } return ((AntBuildTarget)element).getModel().getBuildFile(); } if (element instanceof AntBuildFile) { return myRoot; } return null; } @Override public void commit() { PsiDocumentManager.getInstance(myProject).commitAllDocuments(); } @Override public boolean hasSomethingToCommit() { return PsiDocumentManager.getInstance(myProject).hasUncommitedDocuments(); } @NotNull @Override public ActionCallback asyncCommit() { return asyncCommitDocuments(myProject); } @NotNull @Override public Object getRootElement() { return myRoot; } public void setFilteredTargets(boolean value) { myFilteredTargets = value; } private final class RootNodeDescriptor extends AntNodeDescriptor { RootNodeDescriptor(Project project, NodeDescriptor parentDescriptor) { super(project, parentDescriptor); } @Override public Object getElement() { return myRoot; } @Override public boolean update() { myName = ""; return false; } } private static final class TextInfoNodeDescriptor extends AntNodeDescriptor { TextInfoNodeDescriptor(Project project, NodeDescriptor parentDescriptor, String text) { super(project, parentDescriptor); myName = text; myColor = JBColor.blue; } @Override public Object getElement() { return myName; } @Override public boolean update() { return true; } } }
leafclick/intellij-community
plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorerTreeStructure.java
Java
apache-2.0
5,411
# Pilobolus roridus var. umbonatus (Buller) F.M. Hu & R.Y. Zheng, 1989 VARIETY #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in in Hu, Zheng & Chen, Mycosystema 2: 129 (1989) #### Original name Pilobolus umbonatus Buller, 1934 ### Remarks null
mdoering/backbone
life/Fungi/Zygomycota/Mucorales/Pilobolaceae/Pilobolus/Pilobolus roridus/Pilobolus roridus umbonatus/README.md
Markdown
apache-2.0
296
/* * Copyright 2014-2016 See AUTHORS file. * * 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.kotcrab.vis.editor.util.vis; import com.kotcrab.vis.runtime.util.PrettyEnum; import com.kotcrab.vis.runtime.util.autotable.EnumNameProvider; /** @author Kotcrab */ public class PrettyEnumNameProvider<E extends Enum<E> & PrettyEnum> implements EnumNameProvider<E> { @Override public String getPrettyName (E value) { return value.toPrettyString(); } }
piotr-j/VisEditor
editor/src/main/java/com/kotcrab/vis/editor/util/vis/PrettyEnumNameProvider.java
Java
apache-2.0
972
package org.o2i2b2.utils; import java.io.*; public class LogHelper { Exception exception = null; public LogHelper () {} public LogHelper (Exception exception) { this.exception = exception; } public String toString () { return stack2string(exception); } public String stack2string() { return stack2string(exception); } public String stack2string(Exception e) { try { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); return "------\r\n" + sw.toString() + "------\r\n"; } catch(Exception e2) { return "bad stack2string"; } } }
stephenlorenz/o2i2b2
src/main/java/org/o2i2b2/utils/LogHelper.java
Java
apache-2.0
626
/* * Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.apigateway.model.transform; import java.math.*; import javax.annotation.Generated; import com.amazonaws.services.apigateway.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import com.fasterxml.jackson.core.JsonToken; import static com.fasterxml.jackson.core.JsonToken.*; /** * DocumentationVersion JSON Unmarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DocumentationVersionJsonUnmarshaller implements Unmarshaller<DocumentationVersion, JsonUnmarshallerContext> { public DocumentationVersion unmarshall(JsonUnmarshallerContext context) throws Exception { DocumentationVersion documentationVersion = new DocumentationVersion(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return null; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("version", targetDepth)) { context.nextToken(); documentationVersion.setVersion(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("createdDate", targetDepth)) { context.nextToken(); documentationVersion.setCreatedDate(context.getUnmarshaller(java.util.Date.class).unmarshall(context)); } if (context.testExpression("description", targetDepth)) { context.nextToken(); documentationVersion.setDescription(context.getUnmarshaller(String.class).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return documentationVersion; } private static DocumentationVersionJsonUnmarshaller instance; public static DocumentationVersionJsonUnmarshaller getInstance() { if (instance == null) instance = new DocumentationVersionJsonUnmarshaller(); return instance; } }
dagnir/aws-sdk-java
aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/transform/DocumentationVersionJsonUnmarshaller.java
Java
apache-2.0
3,306
using System; using System.Collections.Generic; using SmartQuant.Charting; using SmartQuant.ChartViewers; using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; #if GTK using Compatibility.Gtk; using Gtk; #else using System.Windows.Forms; #endif namespace SmartQuant.Controls.BarChart { public class BarChart : FrameworkControl, IGroupListener { private IContainer components; private Dictionary<int, GroupItem> table = new Dictionary<int, GroupItem>(); private Dictionary<object, List<GroupEvent>> eventsBySelectorKey = new Dictionary<object, List<GroupEvent>>(); private Dictionary<int, List<Group>> orderedGroupTable = new Dictionary<int, List<Group>>(); private Dictionary<object, Dictionary<int, List<Group>>> drawnGroupTable = new Dictionary<object, Dictionary<int, List<Group>>>(); private long barSize = 60; private bool freezeUpdate; private DateTime firstDateTime; private Chart chart; private ComboBox cbxSelector; public PermanentQueue<Event> Queue { get; private set; } public BarChart() { InitComponent(); } protected override void Dispose(bool disposing) { if (disposing) this.components?.Dispose(); base.Dispose(disposing); } private void OnFrameworkCleared(object sender, FrameworkEventArgs args) { InvokeAction(delegate { #if GTK this.cbxSelector.ClearTexts(); #else this.cbxSelector.Items.Clear(); #endif Reset(false); this.chart.UpdatePads(); }); this.eventsBySelectorKey.Clear(); this.eventsBySelectorKey[""] = new List<GroupEvent>(); } protected override void OnInit() { Queue = new PermanentQueue<Event>(); Queue.AddReader(this); Reset(true); this.framework.EventManager.Dispatcher.FrameworkCleared += OnFrameworkCleared; this.framework.GroupDispatcher.AddListener(this); this.eventsBySelectorKey[""] = new List<GroupEvent>(); } protected override void OnClosing(CancelEventArgs args) { Queue.RemoveReader(this); this.framework.EventManager.Dispatcher.FrameworkCleared -= OnFrameworkCleared; this.framework.GroupDispatcher.RemoveListener(this); } public bool OnNewGroup(Group group) { if (!group.Fields.ContainsKey("Pad")) return false; this.table[group.Id] = new GroupItem(group); List<Group> list = null; int key = (int)group.Fields["Pad"].Value; if (!this.orderedGroupTable.TryGetValue(key, out list)) { list = new List<Group>(); this.orderedGroupTable[key] = list; } list.Add(group); InvokeAction(delegate { if (!group.Fields.ContainsKey("SelectorKey")) return; string str = (string)group.Fields["SelectorKey"].Value; #if GTK if (this.cbxSelector.ContainsText(str)) return; this.cbxSelector.AppendText(str); this.eventsBySelectorKey[str] = new List<GroupEvent>(); this.freezeUpdate = true; if (this.cbxSelector.Model.IterNChildren() == 1) this.cbxSelector.Active = 0; #else if (this.cbxSelector.Items.Contains(str)) return; this.cbxSelector.Items.Add(str); this.eventsBySelectorKey[str] = new List<GroupEvent>(); this.freezeUpdate = true; if (this.cbxSelector.Items.Count == 1) this.cbxSelector.SelectedIndex = 0; #endif this.freezeUpdate = false; }); return true; } public void OnNewGroupEvent(GroupEvent groupEvent) { var item = this.table[groupEvent.Group.Id]; Tuple<Viewer, object> tuple = null; item.Table.TryGetValue(groupEvent.Obj.TypeId, out tuple); switch (groupEvent.Obj.TypeId) { case DataObjectType.Bar: BarSeries bs; if (tuple == null) { bs = new BarSeries("", "", -1); int padNumber = item.PadNumber; EnsurePadExists(padNumber, item.Format); int viewerIndex = GetViewerIndex(groupEvent.Group, padNumber); Viewer viewer = this.chart.Pads[padNumber].Insert(viewerIndex, bs as BarSeries); this.chart.Pads[padNumber].Legend.Add(groupEvent.Group.Name, Color.Black); item.Table.Add(groupEvent.Obj.TypeId, new Tuple<Viewer, object>(viewer, bs)); } else bs = tuple.Item2 as BarSeries; bs.Add(groupEvent.Obj as Bar); break; case DataObjectType.Fill: FillSeries fs; if (tuple == null) { fs = new FillSeries(""); var padNumber = item.PadNumber; this.EnsurePadExists(padNumber, item.Format); var viewerIndex = GetViewerIndex(groupEvent.Group, padNumber); Viewer viewer = this.chart.Pads[padNumber].Insert(viewerIndex, fs); item.Table.Add(groupEvent.Obj.TypeId, new Tuple<Viewer, object>(viewer, fs)); } else fs = tuple.Item2 as FillSeries; fs.Add(groupEvent.Obj as Fill); break; case DataObjectType.TimeSeriesItem: TimeSeries ts; if (tuple == null) { ts = new TimeSeries(); var padNumber = item.PadNumber; EnsurePadExists(padNumber, item.Format); var viewerIndex = GetViewerIndex(groupEvent.Group, padNumber); var viewer = this.chart.Pads[padNumber].Insert(viewerIndex, ts); foreach (var kv in groupEvent.Group.Fields) viewer.Set(ts, kv.Value.Name, kv.Value.Value); if (groupEvent.Group.Fields.ContainsKey("Color")) this.chart.Pads[padNumber].Legend.Add(groupEvent.Group.Name, (Color)groupEvent.Group.Fields["Color"].Value); else this.chart.Pads[padNumber].Legend.Add(groupEvent.Group.Name, Color.Black); item.Table.Add(groupEvent.Obj.TypeId, new Tuple<Viewer, object>(viewer, ts)); } else ts = tuple.Item2 as TimeSeries; ts.Add((groupEvent.Obj as TimeSeriesItem).DateTime, (groupEvent.Obj as TimeSeriesItem).Value); break; } } private int GetViewerIndex(Group group, int padNumber) { var list1 = this.orderedGroupTable[padNumber]; List<Group> list2; Dictionary<int, List<Group>> dictionary; var selected = GetComboBoxSelected(); if (!this.drawnGroupTable.TryGetValue(selected, out dictionary)) { dictionary = new Dictionary<int, List<Group>>(); this.drawnGroupTable[selected] = dictionary; } if (!dictionary.TryGetValue(padNumber, out list2)) { dictionary[padNumber] = new List<Group>() { group }; return 0; } else { bool flag = false; for (int i = 0; i < list2.Count; ++i) { Group group1 = list2[i]; if (group1 != group && list1.IndexOf(group) < list1.IndexOf(group1)) { list2.Insert(i, group1); return i; } } if (flag) return 0; list2.Add(group); return list2.Count - 1; } } private void OnNewGroupUpdate_(GroupUpdate groupUpdate) { var item = this.table[groupUpdate.GroupId]; if (groupUpdate.FieldName == "Pad") { int padNumber = item.PadNumber; string format = item.Format; int newPad = (int)groupUpdate.Value; string labelFormat = (string)groupUpdate.Value; foreach (var kv in item.Table) { this.chart.Pads[padNumber].Remove(kv.Value.Item2); this.EnsurePadExists(newPad, labelFormat); this.chart.Pads[newPad].Add(kv.Value.Item2); } item.PadNumber = newPad; item.Format = labelFormat; } if (groupUpdate.FieldName == "Color") { Color color = (Color)groupUpdate.Value; foreach (var kv in item.Table) { if (kv.Value.Item1 is TimeSeriesViewer) (kv.Value.Item1 as TimeSeriesViewer).Color = color; } this.chart.UpdatePads(); } } public void OnNewGroupUpdate(GroupUpdate groupUpdate) { #if GTK Gtk.Application.Invoke((sender, e) => OnNewGroupUpdate_(groupUpdate)); #else if (InvokeRequired) Invoke((Action)delegate { OnNewGroupUpdate(groupUpdate); }); else OnNewGroupUpdate_(groupUpdate); #endif } private void EnsurePadExists(int newPad, string labelFormat) { for (var count = this.chart.Pads.Count; count <= newPad; ++count) { var pad = AddPad(); pad.RegisterViewer(new BarSeriesViewer()); pad.RegisterViewer(new TimeSeriesViewer()); pad.RegisterViewer(new FillSeriesViewer()); pad.RegisterViewer(new TickSeriesViewer()); pad.AxisBottom.Type = EAxisType.DateTime; } this.chart.Pads[newPad].MarginBottom = 0; this.chart.Pads[newPad].AxisBottom.Type = EAxisType.DateTime; this.chart.Pads[newPad].AxisBottom.LabelEnabled = true; this.chart.Pads[newPad].AxisLeft.LabelFormat = labelFormat; this.chart.Pads[newPad].AxisRight.LabelFormat = labelFormat; } private Pad AddPad() { double num1 = 0.15; double Y1 = 0.0; foreach (Pad pad in this.chart.Pads) { double canvasHeight = pad.CanvasHeight; double h = canvasHeight - num1 * canvasHeight / (1.0 - num1); pad.CanvasY1 = Y1; pad.CanvasY2 = Y1 + h; Y1 = pad.CanvasY2; } Pad pad1 = this.chart.Pads[0]; Pad pad2 = this.chart.Pads[this.chart.Pads.Count - 1]; Pad pad3 = this.chart.AddPad(0.0, Y1, 1.0, 1.0); pad3.TitleEnabled = pad2.TitleEnabled; pad3.BackColor = pad1.BackColor; pad3.BorderColor = pad1.BorderColor; pad3.BorderEnabled = pad1.BorderEnabled; pad3.BorderWidth = pad1.BorderWidth; pad3.ForeColor = pad1.ForeColor; pad2.AxisBottom.LabelEnabled = false; pad2.AxisBottom.Height = 0; pad3.AxisBottom.LabelEnabled = true; pad3.AxisBottom.LabelFormat = "MMMM yyyy"; pad3.AxisBottom.Type = EAxisType.DateTime; pad2.MarginBottom = 0; pad3.MarginBottom = 10; pad3.AxisBottom.TitleEnabled = pad2.AxisBottom.TitleEnabled; pad3.MarginTop = 0; pad3.MarginLeft = pad1.MarginLeft; pad3.MarginRight = pad1.MarginRight; pad3.AxisLeft.LabelEnabled = pad1.AxisLeft.LabelEnabled; pad3.AxisLeft.TitleEnabled = pad1.AxisLeft.TitleEnabled; pad3.AxisLeft.Width = 50; pad3.Width = pad2.Width; pad3.AxisRight.LabelEnabled = pad2.AxisRight.LabelEnabled; pad3.AxisBottom.Type = pad2.AxisBottom.Type; pad3.YAxisLabelFormat = "F5"; pad3.LegendEnabled = pad1.LegendEnabled; pad3.LegendPosition = pad1.LegendPosition; pad3.LegendBackColor = pad1.LegendBackColor; pad3.AxisBottom.LabelColor = pad1.AxisBottom.LabelColor; pad3.AxisRight.LabelColor = pad1.AxisRight.LabelColor; pad3.XGridColor = pad1.XGridColor; pad3.YGridColor = pad1.YGridColor; pad3.XGridDashStyle = pad1.XGridDashStyle; pad3.YGridDashStyle = pad1.YGridDashStyle; pad3.SetRangeX(pad1.XRangeMin, pad1.XRangeMax); pad3.AxisBottom.SetRange(pad1.AxisBottom.Min, pad1.AxisBottom.Max); pad3.AxisTop.SetRange(pad1.AxisTop.Min, pad1.AxisTop.Max); pad3.AxisBottom.Zoomed = pad1.AxisBottom.Zoomed; pad3.AxisTop.Zoomed = pad1.AxisTop.Zoomed; pad3.AxisBottom.Enabled = true; pad3.AxisBottom.Height = 20; pad3.AxisBottom.Type = EAxisType.DateTime; pad3.AxisBottom.LabelFormat = "d"; pad3.AxisBottom.LabelEnabled = true; return pad3; } private void MoveWindow(DateTime dateTime) { if (this.firstDateTime == dateTime) { this.chart.SetRangeX(dateTime.Ticks - this.barSize * TimeSpan.TicksPerSecond * 30, dateTime.Ticks); this.firstDateTime = dateTime; } else this.chart.SetRangeX(this.firstDateTime.Ticks, dateTime.Ticks); this.chart.UpdatePads(); } public void UpdateGUI() { if (UpdatedSuspened && this.framework.Mode == FrameworkMode.Simulation) return; var events = Queue.DequeueAll(this); if (events == null) return; var evts = new List<GroupEvent>(); foreach (var e in events) { if (e.TypeId == EventType.GroupEvent) { var gevent = e as GroupEvent; object key = ""; GroupField groupField = null; var selected = GetComboBoxSelected(); if (gevent.Group.Fields.TryGetValue("SelectorKey", out groupField)) key = groupField.Value; if (selected == null && string.IsNullOrEmpty(key.ToString()) || (selected != null && selected.Equals(key))) evts.Add(gevent); List<GroupEvent> list; if (this.eventsBySelectorKey.TryGetValue(key, out list)) list.Add(gevent); } else if (e.TypeId == EventType.OnFrameworkCleared) evts.Clear(); } for (var i = 0; i < evts.Count; ++i) ProcessEvent(evts[i], i == evts.Count - 1); } private void ProcessEvent(GroupEvent groupEvent, bool lastEvent) { OnNewGroupEvent(groupEvent); if (this.firstDateTime == DateTime.MinValue) this.firstDateTime = groupEvent.Obj.DateTime; if (lastEvent) MoveWindow(groupEvent.Obj.DateTime); } private void Reset(bool clearTable) { if (clearTable) { this.orderedGroupTable.Clear(); this.table.Clear(); } else { foreach (var item in this.table.Values) item.Table.Clear(); } this.drawnGroupTable.Clear(); this.firstDateTime = DateTime.MinValue; this.chart.Clear(); this.chart.Divide(1, 1); var pad = this.chart.Pads[0]; pad.RegisterViewer(new BarSeriesViewer()); pad.RegisterViewer(new TimeSeriesViewer()); pad.RegisterViewer(new FillSeriesViewer()); pad.RegisterViewer(new TickSeriesViewer()); this.chart.Pads[0].AxisBottom.LabelFormat = "a"; this.chart.GroupRightMarginEnabled = true; this.chart.GroupLeftMarginEnabled = true; this.chart.GroupZoomEnabled = true; this.chart.Pads[0].MarginBottom = 0; this.chart.Pads[this.chart.Pads.Count - 1].AxisBottom.Type = EAxisType.DateTime; for (int i = 0; i < this.chart.Pads.Count; ++i) { this.chart.Pads[i].MarginRight = 10; this.chart.Pads[i].XAxisLabelEnabled = i == this.chart.Pads.Count - 1; this.chart.Pads[i].XAxisTitleEnabled = false; this.chart.Pads[i].TitleEnabled = false; this.chart.Pads[i].BorderEnabled = false; this.chart.Pads[i].BackColor = Color.FromKnownColor(KnownColor.Control); this.chart.Pads[i].AxisLeft.Width = 50; this.chart.Pads[i].AxisBottom.GridDashStyle = DashStyle.Dot; this.chart.Pads[i].AxisLeft.GridDashStyle = DashStyle.Dot; this.chart.Pads[i].LegendEnabled = true; this.chart.Pads[i].LegendPosition = ELegendPosition.TopLeft; this.chart.Pads[i].LegendBackColor = Color.White; this.chart.Pads[i].AxisBottom.Type = EAxisType.DateTime; } } private void OnSelectorValueChanged(object sender, EventArgs e) { var selected = GetComboBoxSelected(); if (this.freezeUpdate) return; Reset(false); var list = this.eventsBySelectorKey[selected]; for (var i = 0; i < list.Count; ++i) ProcessEvent(list[i], i == list.Count - 1); this.chart.UpdatePads(); } private string GetComboBoxSelected() { #if GTK return this.cbxSelector.ActiveText; #else return this.cbxSelector.SelectedItem.ToString(); #endif } #if GTK private void InitComponent() { this.chart = new Chart(); this.cbxSelector = ComboBox.NewText(); this.cbxSelector.Changed += OnSelectorValueChanged; InitChartCommon(); VBox vb = new VBox(); vb.PackStart(this.cbxSelector, false, true, 0); vb.PackEnd(this.chart, true, true, 0); Add(vb); ShowAll(); } #else private void InitComponent() { this.chart = new Chart(); this.cbxSelector = new ComboBox(); SuspendLayout(); this.cbxSelector.Dock = DockStyle.Top; this.cbxSelector.DropDownStyle = ComboBoxStyle.DropDownList; this.cbxSelector.FormattingEnabled = true; this.cbxSelector.TabIndex = 1; this.cbxSelector.SelectedIndexChanged += OnSelectorValueChanged; this.chart.Dock = DockStyle.Fill; this.chart.TabIndex = 0; InitChartCommon(); AutoScaleMode = AutoScaleMode.Font; Controls.Add(this.chart); Controls.Add(this.cbxSelector); ResumeLayout(false); } #endif private void InitChartCommon() { this.chart.AntiAliasingEnabled = false; this.chart.DoubleBufferingEnabled = true; this.chart.FileName = null; this.chart.GroupLeftMarginEnabled = false; this.chart.GroupRightMarginEnabled = false; this.chart.GroupZoomEnabled = false; this.chart.PadsForeColor = Color.White; this.chart.PrintAlign = EPrintAlign.None; this.chart.PrintHeight = 400; this.chart.PrintLayout = EPrintLayout.Portrait; this.chart.PrintWidth = 600; this.chart.PrintX = 10; this.chart.PrintY = 10; this.chart.SessionStart = TimeSpan.Parse("0.00:00:00"); this.chart.SessionEnd = TimeSpan.Parse("1.00:00:00"); this.chart.SessionGridColor = Color.Blue; this.chart.SessionGridEnabled = false; this.chart.SmoothingEnabled = false; this.chart.TransformationType = ETransformationType.Empty; } } }
fastquant/fastquant.dll
test/DnxForm/src/SmartQuant.Controls/BarChart/BarChart.cs
C#
apache-2.0
21,318
# Cassia discolor Desv. 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/Fabales/Fabaceae/Senna/Senna pallida/ Syn. Cassia discolor/README.md
Markdown
apache-2.0
178
/* * 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.wicket.util; import org.apache.wicket.util.string.PrependingStringBuffer; /** * Encodes long values into the specified alphabet. Encoding is useful when long values need to be * represented in their string form and shorter values are preferred; by using alphabets of length * greater than ten shorter values can be obtained. For example, to encode values into their * hexadecimal representations the {@code 0123456789ABCDEF-} can be used. Long values can be * shortened even further by using longer alphabets. The last character in the alphabet is used as * the negative sign. * * @author igor */ public class LongEncoder { /** * default alphabet that should be safe to use in most circumstances, while still providing good * shortening of long values */ public static String DEFAULT = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; private LongEncoder() { } /** * Encodes the value into the default alphabet: {@value #DEFAULT} * * @param value * @return encoded value */ public static String encode(final long value) { return encode(value, DEFAULT); } /** * Decodes value using the default alphabet: {@value #DEFAULT} * * @param value * @return decoded value */ public static long decode(final String value) { return decode(value, DEFAULT); } /** * Encodes value into the specified alphabet * * @param value * @param alphabet * @return encoded value */ public static String encode(long value, final String alphabet) { final int len = alphabet.length() - 1; PrependingStringBuffer buff = new PrependingStringBuffer(); final boolean negative = value < 0; if (negative) { value = -value; } do { int mod = (int)(value % len); buff.prepend(alphabet.charAt(mod)); value = value / len; } while (value > 0); if (negative) { buff.prepend(alphabet.charAt(len)); } return buff.toString(); } /** * Decodes value using the specified alphabet * * @param value * @param alphabet * @return decoded value */ public static long decode(final String value, final String alphabet) { final int factor = alphabet.length() - 1; final boolean negative = alphabet.charAt(factor) == value.charAt(0); long num = 0; for (int i = (negative) ? 1 : 0, len = value.length(); i < len; i++) { num = num * factor + alphabet.indexOf(value.charAt(i)); } if (negative) { num = -num; } return num; } }
afiantara/apache-wicket-1.5.7
src/wicket-util/src/main/java/org/apache/wicket/util/LongEncoder.java
Java
apache-2.0
3,259
/* * Copyright (C) 2016 Benjamin Fry <benjaminfry@me.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ //! pointer record from parent zone to child zone for dnskey proof use crate::error::*; use crate::rr::dnssec::{Algorithm, DigestType}; use crate::serialize::binary::*; use crate::rr::dnssec::rdata::DNSKEY; use crate::rr::Name; /// [RFC 4034, DNSSEC Resource Records, March 2005](https://tools.ietf.org/html/rfc4034#section-5) /// /// ```text /// 5.1. DS RDATA Wire Format /// /// The RDATA for a DS RR consists of a 2 octet Key Tag field, a 1 octet /// Algorithm field, a 1 octet Digest Type field, and a Digest field. /// /// 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 /// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ /// | Key Tag | Algorithm | Digest Type | /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ /// / / /// / Digest / /// / / /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ /// /// 5.2. Processing of DS RRs When Validating Responses /// /// The DS RR links the authentication chain across zone boundaries, so /// the DS RR requires extra care in processing. The DNSKEY RR referred /// to in the DS RR MUST be a DNSSEC zone key. The DNSKEY RR Flags MUST /// have Flags bit 7 set. If the DNSKEY flags do not indicate a DNSSEC /// zone key, the DS RR (and the DNSKEY RR it references) MUST NOT be /// used in the validation process. /// /// 5.3. The DS RR Presentation Format /// /// The presentation format of the RDATA portion is as follows: /// /// The Key Tag field MUST be represented as an unsigned decimal integer. /// /// The Algorithm field MUST be represented either as an unsigned decimal /// integer or as an algorithm mnemonic specified in Appendix A.1. /// /// The Digest Type field MUST be represented as an unsigned decimal /// integer. /// /// The Digest MUST be represented as a sequence of case-insensitive /// hexadecimal digits. Whitespace is allowed within the hexadecimal /// text. /// ``` #[derive(Debug, PartialEq, Eq, Hash, Clone)] pub struct DS { key_tag: u16, algorithm: Algorithm, digest_type: DigestType, digest: Vec<u8>, } impl DS { /// Constructs a new DS RData /// /// # Arguments /// /// * `key_tag` - the key_tag associated to the DNSKEY /// * `algorithm` - algorithm as specified in the DNSKEY /// * `digest_type` - hash algorithm used to validate the DNSKEY /// * `digest` - hash of the DNSKEY /// /// # Returns /// /// the DS RDATA for use in a Resource Record pub fn new(key_tag: u16, algorithm: Algorithm, digest_type: DigestType, digest: Vec<u8>) -> DS { DS { key_tag, algorithm, digest_type, digest, } } /// [RFC 4034, DNSSEC Resource Records, March 2005](https://tools.ietf.org/html/rfc4034#section-5.1.1) /// /// ```text /// 5.1.1. The Key Tag Field /// /// The Key Tag field lists the key tag of the DNSKEY RR referred to by /// the DS record, in network byte order. /// /// The Key Tag used by the DS RR is identical to the Key Tag used by /// RRSIG RRs. Appendix B describes how to compute a Key Tag. /// ``` pub fn key_tag(&self) -> u16 { self.key_tag } /// [RFC 4034, DNSSEC Resource Records, March 2005](https://tools.ietf.org/html/rfc4034#section-5.1.1) /// /// ```text /// 5.1.2. The Algorithm Field /// /// The Algorithm field lists the algorithm number of the DNSKEY RR /// referred to by the DS record. /// /// The algorithm number used by the DS RR is identical to the algorithm /// number used by RRSIG and DNSKEY RRs. Appendix A.1 lists the /// algorithm number types. /// ``` pub fn algorithm(&self) -> Algorithm { self.algorithm } /// [RFC 4034, DNSSEC Resource Records, March 2005](https://tools.ietf.org/html/rfc4034#section-5.1.1) /// /// ```text /// 5.1.3. The Digest Type Field /// /// The DS RR refers to a DNSKEY RR by including a digest of that DNSKEY /// RR. The Digest Type field identifies the algorithm used to construct /// the digest. Appendix A.2 lists the possible digest algorithm types. /// ``` pub fn digest_type(&self) -> DigestType { self.digest_type } /// [RFC 4034, DNSSEC Resource Records, March 2005](https://tools.ietf.org/html/rfc4034#section-5.1.1) /// /// ```text /// 5.1.4. The Digest Field /// /// The DS record refers to a DNSKEY RR by including a digest of that /// DNSKEY RR. /// /// The digest is calculated by concatenating the canonical form of the /// fully qualified owner name of the DNSKEY RR with the DNSKEY RDATA, /// and then applying the digest algorithm. /// /// digest = digest_algorithm( DNSKEY owner name | DNSKEY RDATA); /// /// "|" denotes concatenation /// /// DNSKEY RDATA = Flags | Protocol | Algorithm | Public Key. /// /// The size of the digest may vary depending on the digest algorithm and /// DNSKEY RR size. As of the time of this writing, the only defined /// digest algorithm is SHA-1, which produces a 20 octet digest. /// ``` pub fn digest(&self) -> &[u8] { &self.digest } /// Validates that a given DNSKEY is covered by the DS record. /// /// # Return /// /// true if and only if the DNSKEY is covered by the DS record. #[cfg(any(feature = "openssl", feature = "ring"))] pub fn covers(&self, name: &Name, key: &DNSKEY) -> ProtoResult<bool> { key.to_digest(name, self.digest_type()) .map(|hash| hash.as_ref() == self.digest()) } /// This will always return an error unless the Ring or OpenSSL features are enabled #[cfg(not(any(feature = "openssl", feature = "ring")))] pub fn covers(&self, _: &Name, _: &DNSKEY) -> ProtoResult<bool> { Err("Ring or OpenSSL must be enabled for this feature".into()) } } /// Read the RData from the given Decoder pub fn read(decoder: &mut BinDecoder, rdata_length: Restrict<u16>) -> ProtoResult<DS> { let start_idx = decoder.index(); let key_tag: u16 = decoder.read_u16()?.unverified(/*key_tag is valid as any u16*/); let algorithm: Algorithm = Algorithm::read(decoder)?; let digest_type: DigestType = DigestType::from_u8(decoder.read_u8()?.unverified(/*DigestType is verified as safe*/))?; let bytes_read = decoder.index() - start_idx; let left: usize = rdata_length .map(|u| u as usize) .checked_sub(bytes_read) .map_err(|_| ProtoError::from("invalid rdata length in DS"))? .unverified(/*used only as length safely*/); let digest = decoder.read_vec(left)?.unverified(/*the byte array will fail in usage if invalid*/); Ok(DS::new(key_tag, algorithm, digest_type, digest)) } /// Write the RData from the given Decoder pub fn emit(encoder: &mut BinEncoder, rdata: &DS) -> ProtoResult<()> { encoder.emit_u16(rdata.key_tag())?; rdata.algorithm().emit(encoder)?; // always 3 for now encoder.emit(rdata.digest_type().into())?; encoder.emit_vec(rdata.digest())?; Ok(()) } #[cfg(test)] mod tests { #![allow(clippy::dbg_macro, clippy::print_stdout)] use super::*; #[test] pub fn test() { let rdata = DS::new( 0xF00F, Algorithm::RSASHA256, DigestType::SHA256, vec![5, 6, 7, 8], ); let mut bytes = Vec::new(); let mut encoder: BinEncoder = BinEncoder::new(&mut bytes); assert!(emit(&mut encoder, &rdata).is_ok()); let bytes = encoder.into_bytes(); println!("bytes: {:?}", bytes); let mut decoder: BinDecoder = BinDecoder::new(bytes); let restrict = Restrict::new(bytes.len() as u16); let read_rdata = read(&mut decoder, restrict).expect("Decoding error"); assert_eq!(rdata, read_rdata); } #[test] #[cfg(any(feature = "openssl", feature = "ring"))] pub fn test_covers() { use crate::rr::dnssec::rdata::DNSKEY; let name = Name::parse("www.example.com.", None).unwrap(); let dnskey_rdata = DNSKEY::new(true, true, false, Algorithm::RSASHA256, vec![1, 2, 3, 4]); let ds_rdata = DS::new( 0, Algorithm::RSASHA256, DigestType::SHA256, dnskey_rdata .to_digest(&name, DigestType::SHA256) .unwrap() .as_ref() .to_owned(), ); assert!(ds_rdata.covers(&name, &dnskey_rdata).unwrap()); } }
tempbottle/trust-dns
crates/proto/src/rr/dnssec/rdata/ds.rs
Rust
apache-2.0
9,641
/* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "firestore/src/android/timestamp_android.h" #include "firestore/src/jni/env.h" #include "firestore/src/jni/loader.h" namespace firebase { namespace firestore { namespace { using jni::Class; using jni::Constructor; using jni::Env; using jni::Local; using jni::Method; constexpr char kClassName[] = PROGUARD_KEEP_CLASS "com/google/firebase/Timestamp"; Constructor<TimestampInternal> kConstructor("(JI)V"); Method<int64_t> kGetSeconds("getSeconds", "()J"); Method<int32_t> kGetNanoseconds("getNanoseconds", "()I"); jclass g_clazz = nullptr; } // namespace void TimestampInternal::Initialize(jni::Loader& loader) { g_clazz = loader.LoadClass(kClassName, kConstructor, kGetSeconds, kGetNanoseconds); } Class TimestampInternal::GetClass() { return Class(g_clazz); } Local<TimestampInternal> TimestampInternal::Create(Env& env, const Timestamp& timestamp) { return env.New(kConstructor, timestamp.seconds(), timestamp.nanoseconds()); } Timestamp TimestampInternal::ToPublic(Env& env) const { int64_t seconds = env.Call(*this, kGetSeconds); int32_t nanoseconds = env.Call(*this, kGetNanoseconds); return Timestamp(seconds, nanoseconds); } } // namespace firestore } // namespace firebase
firebase/firebase-cpp-sdk
firestore/src/android/timestamp_android.cc
C++
apache-2.0
1,870
package com.devin.client.mysise.model.parse; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import com.devin.client.mysise.model.base.WebBody; import com.devin.client.mysise.model.bean.Encourage; import com.devin.client.mysise.model.bean.Encourages; import com.devin.client.mysise.model.url.Url; public class ParseEncouragePunish { private static Encourages encourages = new Encourages(); private static Document document; public static Encourages getEncourages(){ init(); return encourages; } private static void init(){ WebBody.initStudent(Url.encouragePunishURL); document = WebBody.getDocument(); parseAllEncouragePunish(); } private static void parseAllEncouragePunish(){ Elements elements = document.select("table").select("tr"); for(Element e : elements) if (e.select("td[class=tablebody]").hasText()) encourages.getEncourages().add(getEncouragePunish(e.select("td.tablebody"))); } private static Encourage getEncouragePunish(Elements elements){ Encourage encourage = new Encourage(); encourage.setYear(elements.get(0).text()); encourage.setTerm(elements.get(1).text()); encourage.setLevel(elements.get(2).text()); encourage.setReason(elements.get(3).text()); encourage.setDepartment(elements.get(4).text()); encourage.setDate(elements.get(5).text()); return encourage; } }
DevinShuFan/mysise
app/src/main/java/com/devin/client/mysise/model/parse/ParseEncouragePunish.java
Java
apache-2.0
1,396
/** * OLAT - Online Learning and Training<br> * http://www.olat.org * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing,<br> * software distributed under the License is distributed on an "AS IS" BASIS, <br> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> * See the License for the specific language governing permissions and <br> * limitations under the License. * <p> * Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br> * University of Zurich, Switzerland. * <hr> * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * This file has been modified by the OpenOLAT community. Changes are licensed * under the Apache 2.0 license as the original file. */ package org.olat.core.commons.services.tagging.ui; import org.olat.core.gui.UserRequest; import org.olat.core.gui.components.form.flexible.FormItemContainer; import org.olat.core.gui.components.form.flexible.impl.FormBasicController; import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.WindowControl; /** * Description:<br> * TODO: rhaag Class Description for TaggingController * <P> * Initial Date: 11.06.2010 <br> * @author rhaag */ public class TaggingController extends FormBasicController { /** * @param ureq * @param wControl */ public TaggingController(UserRequest ureq, WindowControl wControl) { super(ureq, wControl); initForm(ureq); } /** * @see org.olat.core.gui.control.DefaultController#doDispose() */ @Override protected void doDispose() { //auto-disposed } @Override protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) { // } @Override protected void formOK(UserRequest ureq) { // } }
stevenhva/InfoLearn_OpenOLAT
src/main/java/org/olat/core/commons/services/tagging/ui/TaggingController.java
Java
apache-2.0
2,017
/** * Copyright (c) 2013-2021 Nikita Koksharov * * 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.redisson.liveobject.core; import java.lang.reflect.Method; import net.bytebuddy.implementation.bind.annotation.AllArguments; import net.bytebuddy.implementation.bind.annotation.FieldValue; import net.bytebuddy.implementation.bind.annotation.Origin; import net.bytebuddy.implementation.bind.annotation.RuntimeType; import org.redisson.api.RMap; /** * * @author Rui Gu (https://github.com/jackygurui) */ public class RObjectInterceptor { @RuntimeType public static Object intercept( @Origin Method method, @AllArguments Object[] args, @FieldValue("liveObjectLiveMap") RMap<?, ?> map ) throws Exception { throw new UnsupportedOperationException("Please use RLiveObjectService instance for this type of functions"); } }
redisson/redisson
redisson/src/main/java/org/redisson/liveobject/core/RObjectInterceptor.java
Java
apache-2.0
1,403
#!/bin/sh ########################## Various utility functions ########################## # Canonicalize a directory name canon_dir () { (cd "$1" && pwd -P) } # Extract the argument from "--foo=..." style arguments get_arg () { echo "$1" | sed 's/[^=]*=//' } # Add a parameter to the set of parameters with which to invoke # nosetests add_params () { if [ x"${params}" = x ]; then params="$*" else params="${params} $*" fi } # An alias for the Python interpreter from the virtual environment python () { ${venv_path}/bin/python "$@" } # An alias for pip from the virtual environment pip () { # Invoke using the python from the virtual environment; this works # around spaces being present in the "#!" line python ${venv_path}/bin/pip "$@" } # An alias for pep8, using the virtual environment if requested run_pep8 () { if [ ${venv} = yes ]; then # Invoke using the python from the virtual environment; this # works around spaces being present in the "#!" line python ${venv_path}/bin/pep8 "$@" else pep8 "$@" fi } # An alias for nosetests, using the virtual environment if requested run_nosetests () { if [ ${venv} = yes ]; then # Invoke using the python from the virtual environment; this # works around spaces being present in the "#!" line python ${venv_path}/bin/nosetests "$@" else nosetests "$@" fi } # Output a usage message usage () { cat >&2 <<EOF Usage: ${prog} [options] [<TESTS>] Execute the Striker test suite. Options: -h --help Outputs this help text. -V --virtual-env Set up and use a virtual environment for testing. -N --no-virtual-env Do not set up or use a virtual environment for testing. -r --reset Resets the virtual environment prior to building it. -p --pep8 Execute only the PEP8 compliance check. -P --no-pep8 Do not execute the PEP8 compliance check. -c --coverage Generate a coverage report -H <DIR> --coverage-html=<DIR> Specify the directory to contain the HTML coverage report. <TESTS> A list of test specifications for nosetests. EOF exit ${1:-1} } ################################ Initialization ############################### prog=`basename $0` dir=`dirname $0` dir=`canon_dir "${dir}"` # Initialize parameters for invoking nosetests params= # Initialize other variables venv=ask reset=false pep8=yes coverage=no cov_html=cov_html ############################## Process arguments ############################## while [ $# -gt 0 ]; do case "$1" in -h|--help) usage 0 2>&1 ;; -V|--virtual-env) venv=yes ;; -N|--no-virtual-env) venv=no ;; -r|--reset) reset=true ;; -p|--pep8) pep8=only ;; -P|--no-pep8) pep8=no ;; -c|--coverage) coverage=yes ;; -H|--coverage-html) shift cov_html="$1" ;; --coverage-html=*) cov_html=`get_arg "$1"` ;; --*) echo "Unrecognized option \"$1\"" >&2 usage ;; *) add_params "$1" ;; esac shift done ############################ Set up the environment ########################### # Ask if we should use a virtual environment venv_path="${dir}/.venv" if [ ${venv} = ask ]; then if [ -d ${venv_path} ]; then venv=yes else echo -n "No virtual environment found; create one? (Y/n) " read use_venv if [ "x${use_venv}" = "xY" -o "x${use_venv}" = "xy" -o \ "x${use_venv}" = "x" ]; then venv=yes else venv=no fi fi fi # Set up the virtual environment if requested if [ ${venv} = yes ]; then # Reset the virtual environment if requested if [ ${reset} = true -a -d ${venv_path} ]; then echo "Forced reset of virtual environment" rm -rf ${venv_path} fi # Now create the virtual environment if [ ! -d ${venv_path} ]; then echo "Creating virtual environment" virtualenv ${venv_path} if [ $? -ne 0 ]; then echo "Failed to create virtual environment" >&2 exit 1 fi fi echo "Installing/updating requirements in virtual environment" pip install -U -r ${dir}/requirements.txt -r ${dir}/test-requirements.txt if [ $? -ne 0 ]; then echo "Failed to install/update requirements in virtual environment" >&2 exit 1 fi echo "Installing striker setup in the virtual environment" python ${dir}/setup.py install if [ $? -ne 0 ]; then echo "Failed to install striker setup in virtual environment" >&2 exit 1 fi export VIRTUAL_ENV=${venv_path} fi export BASE_DIR=${dir} ################################ Run the tests ################################ errors=0 if [ ${pep8} != only ]; then # Set up the options for nosetests options="-v" if [ ${coverage} = yes ]; then options="${options} --with-coverage --cover-branches" options="${options} --cover-package=striker" options="${options} --cover-html --cover-html-dir=${cov_html}" fi # Need to restrict tests to just the test directory if [ x"${params}" = x ]; then params=tests fi # Run nosetests echo echo "Testing Python code:" echo run_nosetests ${options} ${params} if [ $? -ne 0 ]; then echo "Tests on Striker failed" >&2 errors=`expr ${errors} + 1` fi fi # Run pep8 if [ ${pep8} != no ]; then echo echo "Running PEP8 tests:" echo run_pep8 ${dir}/striker ${dir}/tests if [ $? -ne 0 ]; then echo "Pep8 compliance test failed" >&2 errors=`expr ${errors} + 1` fi fi if [ ${errors} -gt 0 ]; then echo echo "Test failures encountered!" >&2 else echo echo "Test suite successful!" >&2 fi exit ${errors}
rackerlabs/striker
run_tests.sh
Shell
apache-2.0
5,716
#include <stdio.h> #include <stdlib.h> #include "../common/matrix.h" #include "../common/file_io.h" #include "../common/vector.h" #define FILENAME_IN "in.txt" // TODO: reuse it from lab6 double getA(Matrix *matrix, int ai) { return matrix->data[ai][matrix->w - 1]; } double getB(Matrix *matrix, int bj) { return matrix->data[matrix->h - 1][bj]; } void setA(Matrix *matrix, int ai, double value) { matrix->data[ai][matrix->w - 1] = value; } void setB(Matrix *matrix, int bj, double value) { matrix->data[matrix->h - 1][bj] = value; } double min(double a, double b) { return a > b ? b : a; } // maybe we should move it out from here to common lib double sum(DVector *vector) { double sum = 0; for (int i = 0; i < vector->size; i++) { sum += vector->data[i]; } return sum; } int main(int argc, char const *argv[]) { // reading .. Matrix *c = matrix_readFile(FILENAME_IN); printf("matrix in c:\n"); matrix_print(c); printf("\n"); // pt 1 // TODO: make matrix balanced if needed here // should be reused (and renamed) method fix_ab() from lab6 // pt 2 // matrix used to store data of matrix c', c0, x0 Matrix* matrix = matrix_copy(c); for (int j = 0; j< c->w; j++) { double min = c->data[0][j]; for (int i = 1; i < c->h; i++) { if (min > c->data[i][j]) { min = c->data[i][j]; } } for (int i = 0;i < c->h; i++) { matrix->data[i][j] -= min; } } printf("c' :\n"); matrix_print(matrix); printf("\n"); // pt 3 for (int i = 0; i< c->h; i++) { double min = c->data[i][0]; for (int j = 1; j < c->w; j++) { if (min > c->data[i][j]) { min = c->data[i][j]; } } for (int j = 0; j < c->w; j++) { matrix->data[i][j] -= min; } } printf("c0 :\n"); matrix_print(matrix); printf("\n"); // // pt 4-5 for (int i = 0; i < matrix->h; i++) { for (int j = 0; j< matrix->w; j++) { if (matrix->data[i][j] != 0) continue; double ai = getA(matrix, i); double bj = getB(matrix, j); matrix->data[i][j] = min(ai, bj); setA(matrix, i, ai - matrix->data[i][j]); setB(matrix, j, bj - matrix->data[i][j]); } } // pt 6 // n - нев'язка // nA - по рядках, nB - по стовпцях DVector *nA = DVector_allocate(matrix->h); DVector *nB = DVector_allocate(matrix->w); for (int i = 0; i < matrix->h; i++) { nA->data[i] = getA(matrix, i) - sum(matrix_get_row(matrix, i)); } for (int j = 0; j < matrix->w; j++) { nB->data[j] = getB(matrix, j) - sum(matrix_get_col(matrix, j)); } printf("nA: "); DVector_print(nA); printf("nB: "); DVector_print(nB); double nAB = sum(nA) + sum(nB); printf("nAB = %lf\n", nAB); // free memory matrix_free(c); matrix_free(matrix); DVector_free(nA); DVector_free(nB); return 0; }
gutachok/lnu_mmoi
lab7/main.c
C
apache-2.0
2,876
package dto type ProcessStartRequest struct { Variables VariableList `json:"variables"` }
bigbank-as/go_camunda_client
rest/dto/process_start_request.go
GO
apache-2.0
91
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Thu Dec 05 05:02:04 MST 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>PeriodicRotatingFileHandlerSupplier (BOM: * : All 2.6.0.Final API)</title> <meta name="date" content="2019-12-05"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="PeriodicRotatingFileHandlerSupplier (BOM: * : All 2.6.0.Final API)"; } } catch(err) { } //--> var methods = {"i0":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/PeriodicRotatingFileHandlerSupplier.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.6.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/wildfly/swarm/config/logging/logging_profile/PeriodicRotatingFileHandlerConsumer.html" title="interface in org.wildfly.swarm.config.logging.logging_profile"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../../org/wildfly/swarm/config/logging/logging_profile/RootLogger.html" title="class in org.wildfly.swarm.config.logging.logging_profile"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/logging/logging_profile/PeriodicRotatingFileHandlerSupplier.html" target="_top">Frames</a></li> <li><a href="PeriodicRotatingFileHandlerSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.wildfly.swarm.config.logging.logging_profile</div> <h2 title="Interface PeriodicRotatingFileHandlerSupplier" class="title">Interface PeriodicRotatingFileHandlerSupplier&lt;T extends <a href="../../../../../../org/wildfly/swarm/config/logging/logging_profile/PeriodicRotatingFileHandler.html" title="class in org.wildfly.swarm.config.logging.logging_profile">PeriodicRotatingFileHandler</a>&gt;</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Functional Interface:</dt> <dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd> </dl> <hr> <br> <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang">@FunctionalInterface</a> public interface <span class="typeNameLabel">PeriodicRotatingFileHandlerSupplier&lt;T extends <a href="../../../../../../org/wildfly/swarm/config/logging/logging_profile/PeriodicRotatingFileHandler.html" title="class in org.wildfly.swarm.config.logging.logging_profile">PeriodicRotatingFileHandler</a>&gt;</span></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../../../../org/wildfly/swarm/config/logging/logging_profile/PeriodicRotatingFileHandler.html" title="class in org.wildfly.swarm.config.logging.logging_profile">PeriodicRotatingFileHandler</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/logging/logging_profile/PeriodicRotatingFileHandlerSupplier.html#get--">get</a></span>()</code> <div class="block">Constructed instance of PeriodicRotatingFileHandler resource</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="get--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>get</h4> <pre><a href="../../../../../../org/wildfly/swarm/config/logging/logging_profile/PeriodicRotatingFileHandler.html" title="class in org.wildfly.swarm.config.logging.logging_profile">PeriodicRotatingFileHandler</a>&nbsp;get()</pre> <div class="block">Constructed instance of PeriodicRotatingFileHandler resource</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The instance</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/PeriodicRotatingFileHandlerSupplier.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.6.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/wildfly/swarm/config/logging/logging_profile/PeriodicRotatingFileHandlerConsumer.html" title="interface in org.wildfly.swarm.config.logging.logging_profile"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../../org/wildfly/swarm/config/logging/logging_profile/RootLogger.html" title="class in org.wildfly.swarm.config.logging.logging_profile"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/logging/logging_profile/PeriodicRotatingFileHandlerSupplier.html" target="_top">Frames</a></li> <li><a href="PeriodicRotatingFileHandlerSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
wildfly-swarm/wildfly-swarm-javadocs
2.6.0.Final/apidocs/org/wildfly/swarm/config/logging/logging_profile/PeriodicRotatingFileHandlerSupplier.html
HTML
apache-2.0
9,986
--- title: Gameloft races to 9X more revenue by optimizing for Chrome OS metadesc: When Gameloft optimized for Chromebooks, their game Asphalt 8 saw a 6× increase in daily app users and a nearly 9× boost in their Chrome OS app revenue. app: name: Asphalt 8 logo: ix://stories/asphalt-8/asphalt8-icon.240.png company: Gameloft hero: image: ix://stories/asphalt-8/hero.1500.jpg alt: Game illustration of a car jumping to a navy aircraft carrier. tags: - gaming - keyboard support - high-performance graphics date: 2018-11-01 updated: 2020-05-01 featured: images: - image: ix://featured/gaming-laptop.1500.png alt: Chromebook showing Asphalt 8 being played. - image: ix://featured/car.1500.png alt: A car from Asphalt 8. --- [Gameloft](https://play.google.com/store/apps/dev?id=4826827787946964969) always strives to be among the first developers to publish games on the latest portable hardware in order to provide gamers with heart-pounding experiences on the go. That’s why Gameloft knew Chrome OS was the right home for _Asphalt 8: Airborne_, the latest entry in its mobile racing series. Gameloft was familiar with developing games for different devices, but translating the Asphalt experience to the Chromebook’s unique touchscreen/keyboard hybrid controls, which could be swapped at any time, seemed challenging. However, the process turned out to be as painless as it was rewarding. ## What they did Taking advantage of the Chromebook’s seamless controls and overall power, Gameloft identified several opportunities to improve the experience for Chromebook gamers. Gameloft was able to run Android application packages at even higher performance levels than Chrome apps, allowing it to maintain the series’ breathtaking graphics and breakneck speeds on Chrome OS. Gameloft also added in keyboard controls that were activated when the game detected users were playing on a Chromebook. ![A close up of a laptop with a car racing gameplay.](ix://stories/asphalt-8/asphalt8-gameplay.400.jpg) #[The game’s UI changes automatically when switching between touchscreen and keyboard controls.](ix://stories/asphalt-8/asphalt8-controls.400.jpg [Control command buttons of the Asphalt 8 game.]) Since the Chromebook treats its physical keyboard like an external keyboard on an Android phone, _Asphalt 8: Airborne_ was able to support Chromebook keyboard controls using APIs from the Android SDK Platform. That meant Gameloft only had to dedicate a few days of development time to completely integrate the new control schemes to the game, resulting in a better end-user experience with keyboard controls. Overall, the stability of Chrome OS made for a smooth implementation process, with no major development problems along the way. Gameloft also teamed with Google to offer a free pack of in-app items with the purchase of any Chromebook. Upon initial device setup, users redeemed codes for exclusive cars, turbo boosts, and credits that appeared the next time they opened the app. ![Control logic diagram for Asphalt 8.](ix://stories/asphalt-8/asphalt8-control-logic.860.jpg) ## Results Upon completing the work necessary to deliver a quality experience to their Chromebook users, _Asphalt 8: Airborne_ saw a 6× increase in daily app users and a nearly 9× boost in revenue for the Chrome OS app. The combination of strong results and short turnaround time inspired Gameloft to bring the next entry in the series, _Asphalt 9: Legends_, to Chromebook as well. It has since become standard practice for Gameloft to support Chrome OS across all of its projects. ## Get started Learn how to best [optimize your apps for Chrome OS](/{{locale.code}}/android/optimizing).
chromeos/chromeos.dev
site/en/stories/asphalt-8.md
Markdown
apache-2.0
3,725
package com.ts.service.information.attachedmx; import java.util.List; import com.ts.entity.Page; import com.ts.util.PageData; /** * 说明: 明细表接口 * 创建人: * 创建时间:2016-04-17 * @version */ public interface AttachedMxManager{ /**新增 * @param pd * @throws Exception */ public void save(PageData pd)throws Exception; /**删除 * @param pd * @throws Exception */ public void delete(PageData pd)throws Exception; /**修改 * @param pd * @throws Exception */ public void edit(PageData pd)throws Exception; /**列表 * @param page * @throws Exception */ public List<PageData> list(Page page)throws Exception; /**列表(全部) * @param pd * @throws Exception */ public List<PageData> listAll(PageData pd)throws Exception; /**通过id获取数据 * @param pd * @throws Exception */ public PageData findById(PageData pd)throws Exception; /**批量删除 * @param ArrayDATA_IDS * @throws Exception */ public void deleteAll(String[] ArrayDATA_IDS)throws Exception; /**查询明细总数 * @param pd * @throws Exception */ public PageData findCount(PageData pd)throws Exception; }
ljcservice/autumnprogram
src/main/java/com/ts/service/information/attachedmx/AttachedMxManager.java
Java
apache-2.0
1,254
// Copyright 2010-2014, 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 "converter/converter.h" #include <algorithm> #include <climits> #include <string> #include <vector> #include "base/logging.h" #include "base/number_util.h" #include "base/port.h" #include "base/util.h" #include "composer/composer.h" #include "converter/connector_interface.h" #include "converter/conversion_request.h" #include "converter/immutable_converter_interface.h" #include "converter/segments.h" #include "dictionary/dictionary_interface.h" #include "dictionary/pos_matcher.h" #include "dictionary/suppression_dictionary.h" #include "prediction/predictor_interface.h" #include "rewriter/rewriter_interface.h" #include "transliteration/transliteration.h" #include "usage_stats/usage_stats.h" using mozc::usage_stats::UsageStats; namespace mozc { namespace { const size_t kErrorIndex = static_cast<size_t>(-1); size_t GetSegmentIndex(const Segments *segments, size_t segment_index) { const size_t history_segments_size = segments->history_segments_size(); const size_t result = history_segments_size + segment_index; if (result >= segments->segments_size()) { return kErrorIndex; } return result; } void SetKey(Segments *segments, const string &key) { segments->set_max_history_segments_size(4); segments->clear_conversion_segments(); mozc::Segment *seg = segments->add_segment(); DCHECK(seg); seg->Clear(); seg->set_key(key); seg->set_segment_type(mozc::Segment::FREE); VLOG(2) << segments->DebugString(); } bool IsMobile(const ConversionRequest &request) { return request.request().zero_query_suggestion() && request.request().mixed_conversion(); } bool IsValidSegments(const ConversionRequest &request, const Segments &segments) { // All segments should have candidate for (size_t i = 0; i < segments.segments_size(); ++i) { if (segments.segment(i).candidates_size() != 0) { continue; } // On mobile, we don't distinguish candidates and meta candidates // So it's ok if we have meta candidates even if we don't have candidates // TODO(team): we may remove mobile check if other platforms accept // meta candidate only segment if (IsMobile(request) && segments.segment(i).meta_candidates_size() != 0) { continue; } return false; } return true; } // Extracts the last substring that consists of the same script type. // Returns true if the last substring is successfully extracted. // Examples: // - "" -> false // - "x " -> "x" / ALPHABET // - "x " -> false // - "C60" -> "60" / NUMBER // - "200x" -> "x" / ALPHABET // (currently only NUMBER and ALPHABET are supported) bool ExtractLastTokenWithScriptType(const string &text, string *last_token, Util::ScriptType *last_script_type) { last_token->clear(); *last_script_type = Util::SCRIPT_TYPE_SIZE; ConstChar32ReverseIterator iter(text); if (iter.Done()) { return false; } // Allow one whitespace at the end. if (iter.Get() == ' ') { iter.Next(); if (iter.Done()) { return false; } if (iter.Get() == ' ') { return false; } } vector<char32> reverse_last_token; Util::ScriptType last_script_type_found = Util::GetScriptType(iter.Get()); for (; !iter.Done(); iter.Next()) { const char32 w = iter.Get(); if ((w == ' ') || (Util::GetScriptType(w) != last_script_type_found)) { break; } reverse_last_token.push_back(w); } *last_script_type = last_script_type_found; // TODO(yukawa): Replace reverse_iterator with const_reverse_iterator when // build failure on Android is fixed. for (vector<char32>::reverse_iterator it = reverse_last_token.rbegin(); it != reverse_last_token.rend(); ++it) { Util::UCS4ToUTF8Append(*it, last_token); } return true; } // Tries normalizing input text as a math expression, where full-width numbers // and math symbols are converted to their half-width equivalents except for // some special symbols, e.g., "×", "÷", and "・". Returns false if the input // string contains non-math characters. bool TryNormalizingKeyAsMathExpression(StringPiece s, string *key) { key->reserve(s.size()); for (ConstChar32Iterator iter(s); !iter.Done(); iter.Next()) { // Half-width arabic numbers. if ('0' <= iter.Get() && iter.Get() <= '9') { key->append(1, static_cast<char>(iter.Get())); continue; } // Full-width arabic numbers ("0" -- "9") if (0xFF10 <= iter.Get() && iter.Get() <= 0xFF19) { const char c = iter.Get() - 0xFF10 + '0'; key->append(1, c); continue; } switch (iter.Get()) { case 0x002B: case 0xFF0B: // "+", "+" key->append(1, '+'); break; case 0x002D: case 0x30FC: // "-", "ー" key->append(1, '-'); break; case 0x002A: case 0xFF0A: case 0x00D7: // "*", "*", "×" key->append(1, '*'); break; case 0x002F: case 0xFF0F: case 0x30FB: case 0x00F7: // "/", "/", "・", "÷" key->append(1, '/'); break; case 0x0028: case 0xFF08: // "(", "(" key->append(1, '('); break; case 0x0029: case 0xFF09: // ")", ")" key->append(1, ')'); break; case 0x003D: case 0xFF1D: // "=", "=" key->append(1, '='); break; default: return false; } } return true; } } // namespace ConverterImpl::ConverterImpl() : pos_matcher_(NULL), immutable_converter_(NULL), general_noun_id_(kuint16max) { } ConverterImpl::~ConverterImpl() {} void ConverterImpl::Init(const POSMatcher *pos_matcher, const SuppressionDictionary *suppression_dictionary, PredictorInterface *predictor, RewriterInterface *rewriter, ImmutableConverterInterface *immutable_converter) { // Initializes in order of declaration. pos_matcher_ = pos_matcher; suppression_dictionary_ = suppression_dictionary; predictor_.reset(predictor); rewriter_.reset(rewriter); immutable_converter_ = immutable_converter; general_noun_id_ = pos_matcher_->GetGeneralNounId(); } bool ConverterImpl::StartConversionForRequest(const ConversionRequest &request, Segments *segments) const { if (!request.has_composer()) { LOG(ERROR) << "Request doesn't have composer"; return false; } string conversion_key; switch (request.composer_key_selection()) { case ConversionRequest::CONVERSION_KEY: request.composer().GetQueryForConversion(&conversion_key); break; case ConversionRequest::PREDICTION_KEY: request.composer().GetQueryForPrediction(&conversion_key); break; default: LOG(FATAL) << "Should never reach here"; } SetKey(segments, conversion_key); segments->set_request_type(Segments::CONVERSION); immutable_converter_->ConvertForRequest(request, segments); RewriteAndSuppressCandidates(request, segments); return IsValidSegments(request, *segments); } bool ConverterImpl::StartConversion(Segments *segments, const string &key) const { SetKey(segments, key); segments->set_request_type(Segments::CONVERSION); const ConversionRequest default_request; immutable_converter_->ConvertForRequest(default_request, segments); RewriteAndSuppressCandidates(default_request, segments); return IsValidSegments(default_request, *segments); } bool ConverterImpl::StartReverseConversion(Segments *segments, const string &key) const { segments->Clear(); if (key.empty()) { return false; } SetKey(segments, key); // Check if |key| looks like a math expression. In such case, there's no // chance to get the correct reading by the immutable converter. Rather, // simply returns normalized value. { string value; if (TryNormalizingKeyAsMathExpression(key, &value)) { Segment::Candidate *cand = segments->mutable_segment(0)->push_back_candidate(); cand->Init(); cand->key = key; cand->value.swap(value); return true; } } segments->set_request_type(Segments::REVERSE_CONVERSION); if (!immutable_converter_->Convert(segments)) { return false; } if (segments->segments_size() == 0) { LOG(WARNING) << "no segments from reverse conversion"; return false; } for (int i = 0; i < segments->segments_size(); ++i) { const mozc::Segment &seg = segments->segment(i); if (seg.candidates_size() == 0 || seg.candidate(0).value.empty()) { segments->Clear(); LOG(WARNING) << "got an empty segment from reverse conversion"; return false; } } return true; } // static void ConverterImpl::MaybeSetConsumedKeySizeToCandidate( size_t consumed_key_size, Segment::Candidate* candidate) { if (candidate->attributes & Segment::Candidate::PARTIALLY_KEY_CONSUMED) { // If PARTIALLY_KEY_CONSUMED is set already, // the candidate has set appropriate attribute and size by predictor. return; } candidate->attributes |= Segment::Candidate::PARTIALLY_KEY_CONSUMED; candidate->consumed_key_size = consumed_key_size; } // static void ConverterImpl::MaybeSetConsumedKeySizeToSegment(size_t consumed_key_size, Segment* segment) { for (size_t i = 0; i < segment->candidates_size(); ++i) { MaybeSetConsumedKeySizeToCandidate(consumed_key_size, segment->mutable_candidate(i)); } for (size_t i = 0; i < segment->meta_candidates_size(); ++i) { MaybeSetConsumedKeySizeToCandidate(consumed_key_size, segment->mutable_meta_candidate(i)); } } // TODO(noriyukit): |key| can be a member of ConversionRequest. bool ConverterImpl::Predict(const ConversionRequest &request, const string &key, const Segments::RequestType request_type, Segments *segments) const { const Segments::RequestType original_request_type = segments->request_type(); if ((original_request_type != Segments::PREDICTION && original_request_type != Segments::PARTIAL_PREDICTION) || segments->conversion_segments_size() == 0 || segments->conversion_segment(0).key() != key) { // - If the original request is not prediction relating one // (e.g. conversion), invoke SetKey because current segments has // data for conversion, not prediction. // - If the segment size is 0, invoke SetKey because the segments is not // correctly prepared. // - If the key of the segments differs from the input key, // invoke SetKey because current segments should be completely reset. // - Otherwise keep current key and candidates. // // This SetKey omitting is for mobile predictor. // On normal inputting, we are showing suggestion results. When users // push expansion button, we will add prediction results just after the // suggestion results. For this, we don't reset segments for prediction. // However, we don't have to do so for suggestion. Here, we are deciding // whether the input key is changed or not by using segment key. This is not // perfect because for roman input, conversion key is not updated by // incomplete input, for example, conversion key is "あ" for the input "a", // and will still be "あ" for the input "ak". For avoiding mis-reset of // the results, we will reset always for suggestion request type. SetKey(segments, key); } DCHECK_EQ(1, segments->conversion_segments_size()); DCHECK_EQ(key, segments->conversion_segment(0).key()); segments->set_request_type(request_type); predictor_->PredictForRequest(request, segments); RewriteAndSuppressCandidates(request, segments); if (request_type == Segments::PARTIAL_SUGGESTION || request_type == Segments::PARTIAL_PREDICTION) { // Here 1st segment's key is the query string of // the partial prediction/suggestion. // e.g. If the composition is "わた|しは", the key is "わた". // If partial prediction/suggestion candidate is submitted, // all the characters which are located from the head to the cursor // should be submitted (in above case "わた" should be submitted). // To do this, PARTIALLY_KEY_CONSUMED and consumed_key_sizconsumed_key_size // should be set. // Note that this process should be done in a predictor because // we have to do this on the candidates created by rewriters. MaybeSetConsumedKeySizeToSegment( Util::CharsLen(key), segments->mutable_conversion_segment(0)); } return IsValidSegments(request, *segments); } bool ConverterImpl::StartPredictionForRequest(const ConversionRequest &request, Segments *segments) const { if (!request.has_composer()) { LOG(ERROR) << "Composer is NULL"; return false; } string prediction_key; request.composer().GetQueryForPrediction(&prediction_key); return Predict(request, prediction_key, Segments::PREDICTION, segments); } bool ConverterImpl::StartPrediction(Segments *segments, const string &key) const { const ConversionRequest default_request; return Predict(default_request, key, Segments::PREDICTION, segments); } bool ConverterImpl::StartSuggestion(Segments *segments, const string &key) const { const ConversionRequest default_request; return Predict(default_request, key, Segments::SUGGESTION, segments); } bool ConverterImpl::StartSuggestionForRequest(const ConversionRequest &request, Segments *segments) const { DCHECK(request.has_composer()); string prediction_key; request.composer().GetQueryForPrediction(&prediction_key); return Predict(request, prediction_key, Segments::SUGGESTION, segments); } bool ConverterImpl::StartPartialSuggestion(Segments *segments, const string &key) const { const ConversionRequest default_request; return Predict(default_request, key, Segments::PARTIAL_SUGGESTION, segments); } bool ConverterImpl::StartPartialSuggestionForRequest( const ConversionRequest &request, Segments *segments) const { DCHECK(request.has_composer()); const size_t cursor = request.composer().GetCursor(); if (cursor == 0 || cursor == request.composer().GetLength()) { return StartSuggestionForRequest(request, segments); } string conversion_key; request.composer().GetQueryForConversion(&conversion_key); conversion_key = Util::SubString(conversion_key, 0, cursor); return Predict(request, conversion_key, Segments::PARTIAL_SUGGESTION, segments); } bool ConverterImpl::StartPartialPrediction(Segments *segments, const string &key) const { const ConversionRequest default_request; return Predict(default_request, key, Segments::PARTIAL_PREDICTION, segments); } bool ConverterImpl::StartPartialPredictionForRequest( const ConversionRequest &request, Segments *segments) const { DCHECK(request.has_composer()); const size_t cursor = request.composer().GetCursor(); if (cursor == 0 || cursor == request.composer().GetLength()) { return StartPredictionForRequest(request, segments); } string conversion_key; request.composer().GetQueryForConversion(&conversion_key); conversion_key = Util::SubString(conversion_key, 0, cursor); return Predict(request, conversion_key, Segments::PARTIAL_PREDICTION, segments); } bool ConverterImpl::FinishConversion(const ConversionRequest &request, Segments *segments) const { CommitUsageStats(segments, segments->history_segments_size(), segments->conversion_segments_size()); for (size_t i = 0; i < segments->segments_size(); ++i) { Segment *seg = segments->mutable_segment(i); DCHECK(seg); // revert SUBMITTED segments to FIXED_VALUE // SUBMITTED segments are created by "submit first segment" operation // (ctrl+N for ATOK keymap). // To learn the conversion result, we should change the segment types // to FIXED_VALUE. if (seg->segment_type() == Segment::SUBMITTED) { seg->set_segment_type(Segment::FIXED_VALUE); } if (seg->candidates_size() > 0) { CompletePOSIds(seg->mutable_candidate(0)); } } segments->clear_revert_entries(); rewriter_->Finish(request, segments); predictor_->Finish(segments); // Remove the front segments except for some segments which will be // used as history segments. const int start_index = max( 0, static_cast<int>(segments->segments_size() - segments->max_history_segments_size())); for (int i = 0; i < start_index; ++i) { segments->pop_front_segment(); } // Remaining segments are used as history segments. for (size_t i = 0; i < segments->segments_size(); ++i) { Segment *seg = segments->mutable_segment(i); DCHECK(seg); seg->set_segment_type(Segment::HISTORY); } return true; } bool ConverterImpl::CancelConversion(Segments *segments) const { segments->clear_conversion_segments(); return true; } bool ConverterImpl::ResetConversion(Segments *segments) const { segments->Clear(); return true; } bool ConverterImpl::RevertConversion(Segments *segments) const { if (segments->revert_entries_size() == 0) { return true; } predictor_->Revert(segments); segments->clear_revert_entries(); return true; } bool ConverterImpl::ReconstructHistory(Segments *segments, const string &preceding_text) const { segments->Clear(); string key; string value; uint16 id; if (!GetLastConnectivePart(preceding_text, &key, &value, &id)) { return false; } Segment *segment = segments->add_segment(); segment->set_key(key); segment->set_segment_type(Segment::HISTORY); Segment::Candidate *candidate = segment->push_back_candidate(); candidate->rid = id; candidate->lid = id; candidate->content_key = key; candidate->key = key; candidate->content_value = value; candidate->value = value; candidate->attributes = Segment::Candidate::NO_LEARNING; return true; } bool ConverterImpl::CommitSegmentValueInternal( Segments *segments, size_t segment_index, int candidate_index, Segment::SegmentType segment_type) const { segment_index = GetSegmentIndex(segments, segment_index); if (segment_index == kErrorIndex) { return false; } Segment *segment = segments->mutable_segment(segment_index); const int values_size = static_cast<int>(segment->candidates_size()); if (candidate_index < -transliteration::NUM_T13N_TYPES || candidate_index >= values_size) { return false; } segment->set_segment_type(segment_type); segment->move_candidate(candidate_index, 0); if (candidate_index != 0) { segment->mutable_candidate(0)->attributes |= Segment::Candidate::RERANKED; } return true; } bool ConverterImpl::CommitSegmentValue(Segments *segments, size_t segment_index, int candidate_index) const { return CommitSegmentValueInternal(segments, segment_index, candidate_index, Segment::FIXED_VALUE); } bool ConverterImpl::CommitPartialSuggestionSegmentValue( Segments *segments, size_t segment_index, int candidate_index, const string &current_segment_key, const string &new_segment_key) const { DCHECK_GT(segments->conversion_segments_size(), 0); const size_t raw_segment_index = GetSegmentIndex(segments, segment_index); if (!CommitSegmentValueInternal(segments, segment_index, candidate_index, Segment::SUBMITTED)) { return false; } CommitUsageStats(segments, raw_segment_index, 1); Segment *segment = segments->mutable_segment(raw_segment_index); DCHECK_LT(0, segment->candidates_size()); const Segment::Candidate &submitted_candidate = segment->candidate(0); const bool auto_partial_suggestion = Util::CharsLen(submitted_candidate.key) != Util::CharsLen(segment->key()); segment->set_key(current_segment_key); Segment *new_segment = segments->insert_segment(raw_segment_index + 1); new_segment->set_key(new_segment_key); DCHECK_GT(segments->conversion_segments_size(), 0); if (auto_partial_suggestion) { UsageStats::IncrementCount("CommitAutoPartialSuggestion"); } else { UsageStats::IncrementCount("CommitPartialSuggestion"); } return true; } bool ConverterImpl::FocusSegmentValue(Segments *segments, size_t segment_index, int candidate_index) const { segment_index = GetSegmentIndex(segments, segment_index); if (segment_index == kErrorIndex) { return false; } return rewriter_->Focus(segments, segment_index, candidate_index); } bool ConverterImpl::FreeSegmentValue(Segments *segments, size_t segment_index) const { segment_index = GetSegmentIndex(segments, segment_index); if (segment_index == kErrorIndex) { return false; } Segment *segment = segments->mutable_segment(segment_index); segment->set_segment_type(Segment::FREE); if (segments->request_type() != Segments::CONVERSION) { return false; } return immutable_converter_->Convert(segments); } bool ConverterImpl::CommitSegments( Segments *segments, const vector<size_t> &candidate_index) const { const size_t conversion_segment_index = segments->history_segments_size(); for (size_t i = 0; i < candidate_index.size(); ++i) { // 2nd argument must always be 0 because on each iteration // 1st segment is submitted. // Using 0 means submitting 1st segment iteratively. if (!CommitSegmentValueInternal(segments, 0, candidate_index[i], Segment::SUBMITTED)) { return false; } } CommitUsageStats(segments, conversion_segment_index, candidate_index.size()); return true; } bool ConverterImpl::ResizeSegment(Segments *segments, const ConversionRequest &request, size_t segment_index, int offset_length) const { if (segments->request_type() != Segments::CONVERSION) { return false; } // invalid request if (offset_length == 0) { return false; } segment_index = GetSegmentIndex(segments, segment_index); if (segment_index == kErrorIndex) { return false; } // the last segments cannot become longer if (offset_length > 0 && segment_index == segments->segments_size() - 1) { return false; } const Segment &cur_segment = segments->segment(segment_index); const size_t cur_length = Util::CharsLen(cur_segment.key()); // length cannot become 0 if (cur_length + offset_length == 0) { return false; } const string cur_segment_key = cur_segment.key(); if (offset_length > 0) { int length = offset_length; string last_key; size_t last_clen = 0; { string new_key = cur_segment_key; while (segment_index + 1 < segments->segments_size()) { last_key = segments->segment(segment_index + 1).key(); segments->erase_segment(segment_index + 1); last_clen = Util::CharsLen(last_key.c_str(), last_key.size()); length -= static_cast<int>(last_clen); if (length <= 0) { string tmp; Util::SubString(last_key, 0, length + last_clen, &tmp); new_key += tmp; break; } new_key += last_key; } Segment *segment = segments->mutable_segment(segment_index); segment->Clear(); segment->set_segment_type(Segment::FIXED_BOUNDARY); segment->set_key(new_key); } // scope out |segment|, |new_key| if (length < 0) { // remaining part Segment *segment = segments->insert_segment(segment_index + 1); segment->set_segment_type(Segment::FREE); string new_key; Util::SubString(last_key, static_cast<size_t>(length + last_clen), static_cast<size_t>(-length), &new_key); segment->set_key(new_key); } } else if (offset_length < 0) { if (cur_length + offset_length > 0) { Segment *segment1 = segments->mutable_segment(segment_index); segment1->Clear(); segment1->set_segment_type(Segment::FIXED_BOUNDARY); string new_key; Util::SubString(cur_segment_key, 0, cur_length + offset_length, &new_key); segment1->set_key(new_key); } if (segment_index + 1 < segments->segments_size()) { Segment *segment2 = segments->mutable_segment(segment_index + 1); segment2->set_segment_type(Segment::FREE); string tmp; Util::SubString(cur_segment_key, max(static_cast<size_t>(0), cur_length + offset_length), cur_length, &tmp); tmp += segment2->key(); segment2->set_key(tmp); } else { Segment *segment2 = segments->add_segment(); segment2->set_segment_type(Segment::FREE); string new_key; Util::SubString(cur_segment_key, max(static_cast<size_t>(0), cur_length + offset_length), cur_length, &new_key); segment2->set_key(new_key); } } segments->set_resized(true); immutable_converter_->ConvertForRequest(request, segments); RewriteAndSuppressCandidates(request, segments); return true; } bool ConverterImpl::ResizeSegment(Segments *segments, const ConversionRequest &request, size_t start_segment_index, size_t segments_size, const uint8 *new_size_array, size_t array_size) const { if (segments->request_type() != Segments::CONVERSION) { return false; } const size_t kMaxArraySize = 256; start_segment_index = GetSegmentIndex(segments, start_segment_index); const size_t end_segment_index = start_segment_index + segments_size; if (start_segment_index == kErrorIndex || end_segment_index <= start_segment_index || end_segment_index > segments->segments_size() || array_size > kMaxArraySize) { return false; } string key; for (size_t i = start_segment_index; i < end_segment_index; ++i) { key += segments->segment(i).key(); } if (key.empty()) { return false; } size_t consumed = 0; const size_t key_len = Util::CharsLen(key); vector<string> new_keys; new_keys.reserve(array_size + 1); for (size_t i = 0; i < array_size; ++i) { if (new_size_array[i] != 0 && consumed < key_len) { new_keys.push_back(Util::SubString(key, consumed, new_size_array[i])); consumed += new_size_array[i]; } } if (consumed < key_len) { new_keys.push_back(Util::SubString(key, consumed, key_len - consumed)); } segments->erase_segments(start_segment_index, segments_size); for (size_t i = 0; i < new_keys.size(); ++i) { Segment *seg = segments->insert_segment(start_segment_index + i); seg->set_segment_type(Segment::FIXED_BOUNDARY); seg->set_key(new_keys[i]); } segments->set_resized(true); immutable_converter_->ConvertForRequest(request, segments); RewriteAndSuppressCandidates(request, segments); return true; } void ConverterImpl::CompletePOSIds(Segment::Candidate *candidate) const { DCHECK(candidate); if (candidate->value.empty() || candidate->key.empty()) { return; } if (candidate->lid != 0 && candidate->rid != 0) { return; } // Use general noun, unknown word ("サ変") tend to produce // "する" "して", which are not always acceptable for non-sahen words. candidate->lid = general_noun_id_; candidate->rid = general_noun_id_; const size_t kExpandSizeStart = 5; const size_t kExpandSizeDiff = 50; const size_t kExpandSizeMax = 80; // In almost all cases, user choses the top candidate. // In order to reduce the latency, first, expand 5 candidates. // If no valid candidates are found within 5 candidates, expand // candidates step-by-step. for (size_t size = kExpandSizeStart; size < kExpandSizeMax; size += kExpandSizeDiff) { Segments segments; SetKey(&segments, candidate->key); // use PREDICTION mode, as the size of segments after // PREDICTION mode is always 1, thanks to real time conversion. // However, PREDICTION mode produces "predictions", meaning // that keys of result candidate are not always the same as // query key. It would be nice to have PREDICTION_REALTIME_CONVERSION_ONLY. segments.set_request_type(Segments::PREDICTION); segments.set_max_prediction_candidates_size(size); // In order to complete POSIds, call ImmutableConverter again. if (!immutable_converter_->Convert(&segments)) { LOG(ERROR) << "ImmutableConverter::Convert() failed"; return; } for (size_t i = 0; i < segments.segment(0).candidates_size(); ++i) { const Segment::Candidate &ref_candidate = segments.segment(0).candidate(i); if (ref_candidate.value == candidate->value) { candidate->lid = ref_candidate.lid; candidate->rid = ref_candidate.rid; candidate->cost = ref_candidate.cost; candidate->wcost = ref_candidate.wcost; candidate->structure_cost = ref_candidate.structure_cost; VLOG(1) << "Set LID: " << candidate->lid; VLOG(1) << "Set RID: " << candidate->rid; return; } } } DVLOG(2) << "Cannot set lid/rid. use default value. " << "key: " << candidate->key << ", " << "value: " << candidate->value << ", " << "lid: " << candidate->lid << ", " << "rid: " << candidate->rid; } void ConverterImpl::RewriteAndSuppressCandidates( const ConversionRequest &request, Segments *segments) const { if (!rewriter_->Rewrite(request, segments)) { return; } // Optimization for common use case: Since most of users don't use suppression // dictionary and we can skip the subsequent check. if (suppression_dictionary_->IsEmpty()) { return; } // Although the suppression dictionary is applied at node-level in dictionary // layer, there's possibility that bad words are generated from multiple nodes // and by rewriters. Hence, we need to apply it again at the last stage of // converter. for (size_t i = 0; i < segments->conversion_segments_size(); ++i) { Segment *seg = segments->mutable_conversion_segment(i); for (size_t j = 0; j < seg->candidates_size(); ) { const Segment::Candidate &cand = seg->candidate(j); if (suppression_dictionary_->SuppressEntry(cand.key, cand.value)) { seg->erase_candidate(j); } else { ++j; } } } } void ConverterImpl::CommitUsageStats(const Segments *segments, size_t begin_segment_index, size_t segment_length) const { if (segment_length == 0) { return; } if (begin_segment_index + segment_length > segments->segments_size()) { LOG(ERROR) << "Invalid state. segments size: " << segments->segments_size() << " required size: " << begin_segment_index + segment_length; return; } // Timing stats are scaled by 1,000 to improve the accuracy of average values. uint64 submitted_total_length = 0; for (size_t i = 0; i < segment_length; ++i) { const Segment &segment = segments->segment(begin_segment_index + i); const uint32 submitted_length = Util::CharsLen(segment.candidate(0).value); UsageStats::UpdateTiming("SubmittedSegmentLengthx1000", submitted_length * 1000); submitted_total_length += submitted_length; } UsageStats::UpdateTiming("SubmittedLengthx1000", submitted_total_length * 1000); UsageStats::UpdateTiming("SubmittedSegmentNumberx1000", segment_length * 1000); UsageStats::IncrementCountBy("SubmittedTotalLength", submitted_total_length); } bool ConverterImpl::GetLastConnectivePart(const string &preceding_text, string *key, string *value, uint16 *id) const { key->clear(); value->clear(); *id = general_noun_id_; Util::ScriptType last_script_type = Util::SCRIPT_TYPE_SIZE; string last_token; if (!ExtractLastTokenWithScriptType(preceding_text, &last_token, &last_script_type)) { return false; } // Currently only NUMBER and ALPHABET are supported. switch (last_script_type) { case Util::NUMBER: { Util::FullWidthAsciiToHalfWidthAscii(last_token, key); swap(*value, last_token); *id = pos_matcher_->GetNumberId(); return true; } case Util::ALPHABET: { Util::FullWidthAsciiToHalfWidthAscii(last_token, key); swap(*value, last_token); *id = pos_matcher_->GetUniqueNounId(); return true; } default: return false; } } } // namespace mozc
kishikawakatsumi/Mozc-for-iOS
src/converter/converter.cc
C++
apache-2.0
35,260
/* * Copyright 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.example.android.sampletvinput.simple; import android.content.Context; import android.content.res.AssetFileDescriptor; import android.database.Cursor; import android.media.MediaPlayer; import android.media.tv.TvContract; import android.media.tv.TvInputManager; import android.media.tv.TvInputService; import android.net.Uri; import android.view.Surface; import com.example.android.sampletvinput.R; import java.io.IOException; /** * Simple TV input service which provides two sample channels. * <p> * NOTE: The purpose of this sample is to provide a really simple TV input sample to the developers * so that they can understand the core APIs and when/how/where they should use them with ease. * This means lots of features including EPG, subtitles, multi-audio, parental controls, and overlay * view are missing here. So, to check the example codes for them, see * {@link com.example.android.sampletvinput.rich.RichTvInputService}. * </p> */ public class SimpleTvInputService extends TvInputService { @Override public Session onCreateSession(String inputId) { return new SimpleSessionImpl(this); } /** * Simple session implementation which plays local videos on the application's tune request. */ private class SimpleSessionImpl extends TvInputService.Session { private static final int RESOURCE_1 = R.raw.video_176x144_3gp_h263_300kbps_25fps_aac_stereo_128kbps_22050hz; private static final int RESOURCE_2 = R.raw.video_480x360_mp4_h264_1350kbps_30fps_aac_stereo_192kbps_44100hz; private MediaPlayer mPlayer; private float mVolume; private Surface mSurface; SimpleSessionImpl(Context context) { super(context); } @Override public void onRelease() { if (mPlayer != null) { mPlayer.release(); } } @Override public boolean onSetSurface(Surface surface) { if (mPlayer != null) { mPlayer.setSurface(surface); } mSurface = surface; return true; } @Override public void onSetStreamVolume(float volume) { if (mPlayer != null) { mPlayer.setVolume(volume, volume); } mVolume = volume; } @Override public boolean onTune(Uri channelUri) { String[] projection = {TvContract.Channels.COLUMN_SERVICE_ID}; int resource = RESOURCE_1; Cursor cursor = null; try { cursor = getContentResolver().query(channelUri, projection, null, null, null); if (cursor == null || cursor.getCount() == 0) { return false; } cursor.moveToNext(); resource = (cursor.getInt(0) == SimpleTvInputSetupActivity.CHANNEL_1_SERVICE_ID ? RESOURCE_1 : RESOURCE_2); } finally { if (cursor != null) { cursor.close(); } } return startPlayback(resource); // NOTE: To display the program information (e.g. title) properly in the channel banner, // The implementation needs to register the program metadata on TvProvider. // For the example implementation, please see {@link RichTvInputService}. } @Override public void onSetCaptionEnabled(boolean enabled) { // The sample content does not have caption. Nothing to do in this sample input. // NOTE: If the channel has caption, the implementation should turn on/off the caption // based on {@code enabled}. // For the example implementation for the case, please see {@link RichTvInputService}. } private boolean startPlayback(int resource) { if (mPlayer == null) { mPlayer = new MediaPlayer(); mPlayer.setOnInfoListener(new MediaPlayer.OnInfoListener() { @Override public boolean onInfo(MediaPlayer player, int what, int arg) { // NOTE: TV input should notify the video playback state by using // {@code notifyVideoAvailable()} and {@code notifyVideoUnavailable() so // that the application can display back screen or spinner properly. if (what == MediaPlayer.MEDIA_INFO_BUFFERING_START) { notifyVideoUnavailable( TvInputManager.VIDEO_UNAVAILABLE_REASON_BUFFERING); return true; } else if (what == MediaPlayer.MEDIA_INFO_BUFFERING_END || what == MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START) { notifyVideoAvailable(); return true; } return false; } }); mPlayer.setSurface(mSurface); mPlayer.setVolume(mVolume, mVolume); } else { mPlayer.reset(); } mPlayer.setLooping(true); AssetFileDescriptor afd = getResources().openRawResourceFd(resource); if (afd == null) { return false; } try { mPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getDeclaredLength()); mPlayer.prepare(); mPlayer.start(); } catch (IOException e) { return false; } finally { try { afd.close(); } catch (IOException e) { // Do nothing. } } // The sample content does not have rating information. Just allow the content here. // NOTE: If the content might include problematic scenes, it should not be allowed. // Also, if the content has rating information, the implementation should allow the // content based on the current rating settings by using // {@link android.media.tv.TvInputManager#isRatingBlocked()}. // For the example implementation for the case, please see {@link RichTvInputService}. notifyContentAllowed(); return true; } } }
naroate/androidtv-sample-inputs
app/src/main/java/com/example/android/sampletvinput/simple/SimpleTvInputService.java
Java
apache-2.0
7,181
<!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" href="index.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> <title>RotaPlan</title> </head> <body> <div class="container"> <header> <nav class="navbar navbar-light bg-light navbar-expand-md"> <a class="navbar-brand" href="#">RotaPlan</a> <ul class="navbar-nav"> <li class="nav-item"><a href="/plan" class="nav-link">Planla</a></li> <li class="nav-item"><a href="/manage" class="nav-link">Yönet</a></li> <li class="nav-item"><a href="/report" class="nav-link">Raporlama</a></li> <li class="nav-item"><a href="/" class="nav-link">Çıkış</a></li> </ul> <a href="#" class="nav-link">#username</a> </nav> </header> <aside class="sidebar">Sidebar</aside> <article>Article</article> <footer>Footer</footer> </div> <!-- Optional JavaScript --> <!-- jQuery first, then Popper.js, then Bootstrap JS --> <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> </body> </html>
mertnuhoglu/study
html/cssgrid_02/ex04_master01/index.html
HTML
apache-2.0
1,913
<!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"> <title>FST - Summer Romero</title> <meta name="description" content="Keep track of the statistics from Summer Romero. Average heat score, heat wins, heat wins percentage, epic heats road to the final"> <meta name="author" content=""> <link rel="apple-touch-icon" sizes="57x57" href="/favicon/apple-icon-57x57.png"> <link rel="apple-touch-icon" sizes="60x60" href="/favicon/apple-icon-60x60.png"> <link rel="apple-touch-icon" sizes="72x72" href="/favicon/apple-icon-72x72.png"> <link rel="apple-touch-icon" sizes="76x76" href="/favicon/apple-icon-76x76.png"> <link rel="apple-touch-icon" sizes="114x114" href="/favicon/apple-icon-114x114.png"> <link rel="apple-touch-icon" sizes="120x120" href="/favicon/apple-icon-120x120.png"> <link rel="apple-touch-icon" sizes="144x144" href="/favicon/apple-icon-144x144.png"> <link rel="apple-touch-icon" sizes="152x152" href="/favicon/apple-icon-152x152.png"> <link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-icon-180x180.png"> <link rel="icon" type="image/png" sizes="192x192" href="/favicon/android-icon-192x192.png"> <link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="96x96" href="/favicon/favicon-96x96.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png"> <link rel="manifest" href="/manifest.json"> <meta name="msapplication-TileColor" content="#ffffff"> <meta name="msapplication-TileImage" content="/ms-icon-144x144.png"> <meta name="theme-color" content="#ffffff"> <meta property="og:title" content="Fantasy Surfing tips"/> <meta property="og:image" content="https://fantasysurfingtips.com/img/just_waves.png"/> <meta property="og:description" content="See how great Summer Romero is surfing this year"/> <!-- Bootstrap Core CSS - Uses Bootswatch Flatly Theme: https://bootswatch.com/flatly/ --> <link href="https://fantasysurfingtips.com/css/bootstrap.css" rel="stylesheet"> <!-- Custom CSS --> <link href="https://fantasysurfingtips.com/css/freelancer.css" rel="stylesheet"> <link href="https://cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet" /> <!-- Custom Fonts --> <link href="https://fantasysurfingtips.com/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css"> <script src="https://code.jquery.com/jquery-2.x-git.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ujs/1.2.1/rails.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script> <script src="https://www.w3schools.com/lib/w3data.js"></script> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-2675412311042802", enable_page_level_ads: true }); </script> </head> <body> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.6"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <!-- Navigation --> <div w3-include-html="https://fantasysurfingtips.com/layout/header.html"></div> <!-- Header --> <div w3-include-html="https://fantasysurfingtips.com/layout/sponsor.html"></div> <section > <div class="container"> <div class="row"> <div class="col-sm-3 "> <div class="col-sm-2 "> </div> <div class="col-sm-8 "> <!-- <img src="http://fantasysurfingtips.com/img/surfers/srome.png" class="img-responsive" alt=""> --> <h3 style="text-align:center;">Summer Romero</h3> <a href="https://twitter.com/share" class="" data-via="fansurfingtips"><i class="fa fa-twitter"></i> Share on Twitter</i></a> <br/> <a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Ffantasysurfingtips.com%2Fsurfers%2Fsrome&amp;src=sdkpreparse"><i class="fa fa-facebook"></i> Share on Facebook</a> </div> <div class="col-sm-2 "> </div> </div> <div class="col-sm-3 portfolio-item"> </div> <div class="col-sm-3 portfolio-item"> <h6 style="text-align:center;">Avg Heat Score (FST DATA)</h6> <h1 style="text-align:center;">11.93</h1> </div> </div> <h4 style="text-align:center;" >Epic Battles</h4> <div class="row"> <div class="col-sm-6 "> <p style="text-align:center;">Surfed <b>1</b> heats against <a href="http://fantasysurfingtips.com/surfers/wlt/yshim.html"> Yuko Shimajiri</a> <br/> <b>won 1</b> and <b>lost 0</b></p> </div> <div class="col-sm-6 "> <p style="text-align:center;">Surfed <b>2</b> heats against <a href="http://fantasysurfingtips.com/surfers/wlt/jdup.html"> Justine Dupont</a> <br/> <b>won 0</b> and <b>lost 2</b></p> </div> </div> <hr/> <h4 style="text-align:center;" >Heat Stats (FST data)</h4> <div class="row"> <div class="col-sm-4 portfolio-item"> <h6 style="text-align:center;">Heats</h6> <h2 style="text-align:center;">10</h2> </div> <div class="col-sm-4 portfolio-item"> <h6 style="text-align:center;">Heat wins</h6> <h2 style="text-align:center;">5</h2> </div> <div class="col-sm-4 portfolio-item"> <h6 style="text-align:center;">HEAT WINS PERCENTAGE</h6> <h2 style="text-align:center;">50.0%</h2> </div> </div> <hr/> <h4 style="text-align:center;">Avg Heat Score progression</h4> <div id="avg_chart" style="height: 250px;"></div> <hr/> <h4 style="text-align:center;">Heat stats progression</h4> <div id="heat_chart" style="height: 250px;"></div> <hr/> <style type="text/css"> .heats-all{ z-index: 3; margin-left: 5px; cursor: pointer; } </style> <div class="container"> <div id="disqus_thread"></div> <script> /** * RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS. * LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/ var disqus_config = function () { this.page.url = "http://fantasysurfingtips.com/surfers/srome"; // Replace PAGE_URL with your page's canonical URL variable this.page.identifier = '5080'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable }; (function() { // DON'T EDIT BELOW THIS LINE var d = document, s = d.createElement('script'); s.src = '//fantasysurfingtips.disqus.com/embed.js'; s.setAttribute('data-timestamp', +new Date()); (d.head || d.body).appendChild(s); })(); </script> <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> </div> </section> <script type="text/javascript"> $('.heats-all').click(function(){ $('.heats-all-stat').css('display', 'none') $('#'+$(this).attr('id')+'-stat').css('display', 'block') }); $('.heats-2016').click(function(){ $('.heats-2016-stat').css('display', 'none') $('#'+$(this).attr('id')+'-stat').css('display', 'block') }); $('document').ready(function(){ new Morris.Line({ // ID of the element in which to draw the chart. element: 'avg_chart', // Chart data records -- each entry in this array corresponds to a point on // the chart. data: [{"year":"2012","avg":11.86,"avg_all":11.93},{"year":"2013","avg":12.03,"avg_all":11.93}], // The name of the data record attribute that contains x-values. xkey: 'year', // A list of names of data record attributes that contain y-values. ykeys: ['avg', 'avg_all'], // Labels for the ykeys -- will be displayed when you hover over the // chart. labels: ['Avg score in year', 'Avg score FST DATA'] }); new Morris.Bar({ // ID of the element in which to draw the chart. element: 'heat_chart', // Chart data records -- each entry in this array corresponds to a point on // the chart. data: [{"year":"2012","heats":6,"wins":4,"percs":"66.67%"},{"year":"2013","heats":4,"wins":1,"percs":"25.0%"}], // The name of the data record attribute that contains x-values. xkey: 'year', // A list of names of data record attributes that contain y-values. ykeys: ['heats', 'wins', 'percs'], // Labels for the ykeys -- will be displayed when you hover over the // chart. labels: ['Heats surfed', 'Heats won', 'Winning percentage'] }); }); </script> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> <!-- Footer --> <div w3-include-html="https://fantasysurfingtips.com/layout/footer.html"></div> <script type="text/javascript"> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-74337819-1', 'auto'); // Replace with your property ID. ga('send', 'pageview'); </script> <script> w3IncludeHTML(); </script> <!-- jQuery --> <script src="https://fantasysurfingtips.com/js/jquery.js"></script> <script src="https://cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="https://fantasysurfingtips.com/js/bootstrap.min.js"></script> <!-- Plugin JavaScript --> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script> <script src="https://fantasysurfingtips.com/js/classie.js"></script> <script src="https://fantasysurfingtips.com/js/cbpAnimatedHeader.js"></script> <!-- Contact Form JavaScript --> <script src="https://fantasysurfingtips.com/js/jqBootstrapValidation.js"></script> <script src="https://fantasysurfingtips.com/js/contact_me.js"></script> <!-- Custom Theme JavaScript --> <script src="https://fantasysurfingtips.com/js/freelancer.js"></script> <script type="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script> <script type="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script> </body> </html>
chicofilho/fst
surfers/wlt/srome.html
HTML
apache-2.0
12,004
/* * Copyright 2013 Goran Ehrsson. * * 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 grails.plugins.crm.core; /** * A Pair implementation. * * @param <L> left item * @param <R> right item */ public class Pair<L, R> { private final L left; private final R right; public Pair(L left, R right) { this.left = left; this.right = right; } public L getLeft() { return left; } public R getRight() { return right; } public Object getAt(final int idx) { switch(idx) { case 0: return left; case 1: return right; default: throw new IndexOutOfBoundsException("index " + idx + " is to large for a Pair, must be < 2"); } } @Override public int hashCode() { return left.hashCode() ^ right.hashCode(); } @Override public boolean equals(Object o) { if (o == null) { return false; } if (!(o instanceof Pair)) { return false; } Pair other = (Pair) o; return this.left.equals(other.getLeft()) && this.right.equals(other.getRight()); } @Override public String toString() { return "Pair(" + left + ", " + right + ")"; } }
goeh/grails-crm-core
src/java/grails/plugins/crm/core/Pair.java
Java
apache-2.0
1,843
DROP TABLE IF EXISTS karma; DROP TABLE IF EXISTS need; DROP TABLE IF EXISTS message; DROP TABLE IF EXISTS profile; DROP TABLE IF EXISTS member; CREATE TABLE member ( memberId INT UNSIGNED AUTO_INCREMENT NOT NULL, memberAccessLevel CHAR(1) NOT NULL, memberEmail VARCHAR(255) NOT NULL, memberEmailActivation CHAR(16), memberHash CHAR(128) NOT NULL, memberSalt CHAR(64) NOT NULL, UNIQUE(memberEmail), PRIMARY KEY(memberId) ); CREATE TABLE profile ( profileId INT UNSIGNED AUTO_INCREMENT NOT NULL, memberId INT UNSIGNED NOT NULL, profileBlurb VARCHAR(500), profileHandle VARCHAR(15) NOT NULL, profileFirstName VARCHAR(50) NOT NULL, profileLastName VARCHAR(50) NOT NULL, profilePhoto VARCHAR(255), profilePhotoType VARCHAR(20), UNIQUE(profilePhoto), UNIQUE(profileHandle), INDEX(memberId), FOREIGN KEY(memberId) REFERENCES member(memberId), PRIMARY KEY(profileId) ); CREATE TABLE message ( messageId INT UNSIGNED AUTO_INCREMENT NOT NULL, messageSenderId INT UNSIGNED NOT NULL, messageReceiverId INT UNSIGNED NOT NULL, messageContent VARCHAR(8192) NOT NULL, messageDateTime TIMESTAMP DEFAULT CURRENT_TIMESTAMP, INDEX(messageSenderId), INDEX(messageReceiverId), FOREIGN KEY(messageSenderId) REFERENCES profile(profileId), FOREIGN KEY(messageReceiverId) REFERENCES profile(profileId), PRIMARY KEY(messageId) ); CREATE TABLE need ( needId INT UNSIGNED AUTO_INCREMENT NOT NULL, profileId INT UNSIGNED NOT NULL, needDescription VARCHAR(5000), needFulfilled TINYINT UNSIGNED, needTitle VARCHAR (64), INDEX(needTitle), INDEX(profileId), FOREIGN KEY(profileId) REFERENCES profile(profileId), PRIMARY KEY(needId) ); CREATE TABLE karma ( profileId INT UNSIGNED NOT NULL, needId INT UNSIGNED NOT NULL, karmaAccepted TINYINT UNSIGNED, karmaActionDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP, INDEX(profileId), INDEX(needId), FOREIGN KEY(profileId) REFERENCES profile(profileId), FOREIGN KEY(needId) REFERENCES need(needId), PRIMARY KEY(profileId, needId) );
Derek-Mauldin/karma
sql/karma.sql
SQL
apache-2.0
1,949
/*-------------------------------------------------------------------------- Copyright (c) 2010-2013, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 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 <string.h> #include <sys/ioctl.h> #include <sys/prctl.h> #include <unistd.h> #include <fcntl.h> #include "video_encoder_device_v4l2.h" #include "omx_video_encoder.h" #include <linux/android_pmem.h> #ifdef USE_ION #include <linux/msm_ion.h> #endif #include <media/msm_media_info.h> #include <cutils/properties.h> #ifdef _ANDROID_ #include <media/hardware/HardwareAPI.h> #include <gralloc_priv.h> #endif #define EXTRADATA_IDX(__num_planes) (__num_planes - 1) #define MPEG4_SP_START 0 #define MPEG4_ASP_START (MPEG4_SP_START + 10) #define H263_BP_START 0 #define H264_BP_START 0 #define H264_HP_START (H264_BP_START + 17) #define H264_MP_START (H264_BP_START + 34) #define POLL_TIMEOUT 1000 #define MAX_SUPPORTED_SLICES_PER_FRAME 28 /* Max supported slices with 32 output buffers */ /* MPEG4 profile and level table*/ static const unsigned int mpeg4_profile_level_table[][5]= { /*max mb per frame, max mb per sec, max bitrate, level, profile*/ {99,1485,64000,OMX_VIDEO_MPEG4Level0,OMX_VIDEO_MPEG4ProfileSimple}, {99,1485,64000,OMX_VIDEO_MPEG4Level1,OMX_VIDEO_MPEG4ProfileSimple}, {396,5940,128000,OMX_VIDEO_MPEG4Level2,OMX_VIDEO_MPEG4ProfileSimple}, {396,11880,384000,OMX_VIDEO_MPEG4Level3,OMX_VIDEO_MPEG4ProfileSimple}, {1200,36000,4000000,OMX_VIDEO_MPEG4Level4a,OMX_VIDEO_MPEG4ProfileSimple}, {1620,40500,8000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileSimple}, {3600,108000,12000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileSimple}, {32400,972000,20000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileSimple}, {34560,1036800,20000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileSimple}, {0,0,0,0,0}, {99,1485,128000,OMX_VIDEO_MPEG4Level0,OMX_VIDEO_MPEG4ProfileAdvancedSimple}, {99,1485,128000,OMX_VIDEO_MPEG4Level1,OMX_VIDEO_MPEG4ProfileAdvancedSimple}, {396,5940,384000,OMX_VIDEO_MPEG4Level2,OMX_VIDEO_MPEG4ProfileAdvancedSimple}, {396,11880,768000,OMX_VIDEO_MPEG4Level3,OMX_VIDEO_MPEG4ProfileAdvancedSimple}, {792,23760,3000000,OMX_VIDEO_MPEG4Level4,OMX_VIDEO_MPEG4ProfileAdvancedSimple}, {1620,48600,8000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileAdvancedSimple}, {32400,972000,20000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileAdvancedSimple}, {34560,1036800,20000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileAdvancedSimple}, {0,0,0,0,0}, }; /* H264 profile and level table*/ static const unsigned int h264_profile_level_table[][5]= { /*max mb per frame, max mb per sec, max bitrate, level, profile*/ {99,1485,64000,OMX_VIDEO_AVCLevel1,OMX_VIDEO_AVCProfileBaseline}, {99,1485,128000,OMX_VIDEO_AVCLevel1b,OMX_VIDEO_AVCProfileBaseline}, {396,3000,192000,OMX_VIDEO_AVCLevel11,OMX_VIDEO_AVCProfileBaseline}, {396,6000,384000,OMX_VIDEO_AVCLevel12,OMX_VIDEO_AVCProfileBaseline}, {396,11880,768000,OMX_VIDEO_AVCLevel13,OMX_VIDEO_AVCProfileBaseline}, {396,11880,2000000,OMX_VIDEO_AVCLevel2,OMX_VIDEO_AVCProfileBaseline}, {792,19800,4000000,OMX_VIDEO_AVCLevel21,OMX_VIDEO_AVCProfileBaseline}, {1620,20250,4000000,OMX_VIDEO_AVCLevel22,OMX_VIDEO_AVCProfileBaseline}, {1620,40500,10000000,OMX_VIDEO_AVCLevel3,OMX_VIDEO_AVCProfileBaseline}, {3600,108000,14000000,OMX_VIDEO_AVCLevel31,OMX_VIDEO_AVCProfileBaseline}, {5120,216000,20000000,OMX_VIDEO_AVCLevel32,OMX_VIDEO_AVCProfileBaseline}, {8192,245760,20000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileBaseline}, {8192,245760,50000000,OMX_VIDEO_AVCLevel41,OMX_VIDEO_AVCProfileBaseline}, {8704,522240,50000000,OMX_VIDEO_AVCLevel42,OMX_VIDEO_AVCProfileBaseline}, {22080,589824,135000000,OMX_VIDEO_AVCLevel5,OMX_VIDEO_AVCProfileBaseline}, {36864,983040,240000000,OMX_VIDEO_AVCLevel51,OMX_VIDEO_AVCProfileBaseline}, {0,0,0,0,0}, {99,1485,64000,OMX_VIDEO_AVCLevel1,OMX_VIDEO_AVCProfileHigh}, {99,1485,160000,OMX_VIDEO_AVCLevel1b,OMX_VIDEO_AVCProfileHigh}, {396,3000,240000,OMX_VIDEO_AVCLevel11,OMX_VIDEO_AVCProfileHigh}, {396,6000,480000,OMX_VIDEO_AVCLevel12,OMX_VIDEO_AVCProfileHigh}, {396,11880,960000,OMX_VIDEO_AVCLevel13,OMX_VIDEO_AVCProfileHigh}, {396,11880,2500000,OMX_VIDEO_AVCLevel2,OMX_VIDEO_AVCProfileHigh}, {792,19800,5000000,OMX_VIDEO_AVCLevel21,OMX_VIDEO_AVCProfileHigh}, {1620,20250,5000000,OMX_VIDEO_AVCLevel22,OMX_VIDEO_AVCProfileHigh}, {1620,40500,12500000,OMX_VIDEO_AVCLevel3,OMX_VIDEO_AVCProfileHigh}, {3600,108000,17500000,OMX_VIDEO_AVCLevel31,OMX_VIDEO_AVCProfileHigh}, {5120,216000,25000000,OMX_VIDEO_AVCLevel32,OMX_VIDEO_AVCProfileHigh}, {8192,245760,25000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileHigh}, {8192,245760,50000000,OMX_VIDEO_AVCLevel41,OMX_VIDEO_AVCProfileHigh}, {8704,522240,50000000,OMX_VIDEO_AVCLevel42,OMX_VIDEO_AVCProfileHigh}, {22080,589824,135000000,OMX_VIDEO_AVCLevel5,OMX_VIDEO_AVCProfileHigh}, {36864,983040,240000000,OMX_VIDEO_AVCLevel51,OMX_VIDEO_AVCProfileHigh}, {0,0,0,0,0}, {99,1485,64000,OMX_VIDEO_AVCLevel1,OMX_VIDEO_AVCProfileMain}, {99,1485,128000,OMX_VIDEO_AVCLevel1b,OMX_VIDEO_AVCProfileMain}, {396,3000,192000,OMX_VIDEO_AVCLevel11,OMX_VIDEO_AVCProfileMain}, {396,6000,384000,OMX_VIDEO_AVCLevel12,OMX_VIDEO_AVCProfileMain}, {396,11880,768000,OMX_VIDEO_AVCLevel13,OMX_VIDEO_AVCProfileMain}, {396,11880,2000000,OMX_VIDEO_AVCLevel2,OMX_VIDEO_AVCProfileMain}, {792,19800,4000000,OMX_VIDEO_AVCLevel21,OMX_VIDEO_AVCProfileMain}, {1620,20250,4000000,OMX_VIDEO_AVCLevel22,OMX_VIDEO_AVCProfileMain}, {1620,40500,10000000,OMX_VIDEO_AVCLevel3,OMX_VIDEO_AVCProfileMain}, {3600,108000,14000000,OMX_VIDEO_AVCLevel31,OMX_VIDEO_AVCProfileMain}, {5120,216000,20000000,OMX_VIDEO_AVCLevel32,OMX_VIDEO_AVCProfileMain}, {8192,245760,20000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileMain}, {8192,245760,50000000,OMX_VIDEO_AVCLevel41,OMX_VIDEO_AVCProfileMain}, {8704,522240,50000000,OMX_VIDEO_AVCLevel42,OMX_VIDEO_AVCProfileMain}, {22080,589824,135000000,OMX_VIDEO_AVCLevel5,OMX_VIDEO_AVCProfileMain}, {36864,983040,240000000,OMX_VIDEO_AVCLevel51,OMX_VIDEO_AVCProfileMain}, {0,0,0,0,0} }; /* H263 profile and level table*/ static const unsigned int h263_profile_level_table[][5]= { /*max mb per frame, max mb per sec, max bitrate, level, profile*/ {99,1485,64000,OMX_VIDEO_H263Level10,OMX_VIDEO_H263ProfileBaseline}, {396,5940,128000,OMX_VIDEO_H263Level20,OMX_VIDEO_H263ProfileBaseline}, {396,11880,384000,OMX_VIDEO_H263Level30,OMX_VIDEO_H263ProfileBaseline}, {396,11880,2048000,OMX_VIDEO_H263Level40,OMX_VIDEO_H263ProfileBaseline}, {99,1485,128000,OMX_VIDEO_H263Level45,OMX_VIDEO_H263ProfileBaseline}, {396,19800,4096000,OMX_VIDEO_H263Level50,OMX_VIDEO_H263ProfileBaseline}, {810,40500,8192000,OMX_VIDEO_H263Level60,OMX_VIDEO_H263ProfileBaseline}, {1620,81000,16384000,OMX_VIDEO_H263Level70,OMX_VIDEO_H263ProfileBaseline}, {32400,972000,20000000,OMX_VIDEO_H263Level70,OMX_VIDEO_H263ProfileBaseline}, {34560,1036800,20000000,OMX_VIDEO_H263Level70,OMX_VIDEO_H263ProfileBaseline}, {0,0,0,0,0} }; #define Log2(number, power) { OMX_U32 temp = number; power = 0; while( (0 == (temp & 0x1)) && power < 16) { temp >>=0x1; power++; } } #define Q16ToFraction(q,num,den) { OMX_U32 power; Log2(q,power); num = q >> power; den = 0x1 << (16 - power); } #ifdef INPUT_BUFFER_LOG FILE *inputBufferFile1; char inputfilename [] = "/data/input.yuv"; #endif #ifdef OUTPUT_BUFFER_LOG FILE *outputBufferFile1; char outputfilename [] = "/data/output-bitstream.\0\0\0\0"; #endif //constructor venc_dev::venc_dev(class omx_venc *venc_class) { //nothing to do int i = 0; venc_handle = venc_class; etb = ebd = ftb = fbd = 0; for (i = 0; i < MAX_PORT; i++) streaming[i] = false; stopped = 1; paused = false; async_thread_created = false; color_format = 0; pthread_mutex_init(&pause_resume_mlock, NULL); pthread_cond_init(&pause_resume_cond, NULL); memset(&extradata_info, 0, sizeof(extradata_info)); memset(&idrperiod, 0, sizeof(idrperiod)); memset(&multislice, 0, sizeof(multislice)); memset (&slice_mode, 0 , sizeof(slice_mode)); memset(&m_sVenc_cfg, 0, sizeof(m_sVenc_cfg)); memset(&rate_ctrl, 0, sizeof(rate_ctrl)); memset(&bitrate, 0, sizeof(bitrate)); memset(&intra_period, 0, sizeof(intra_period)); memset(&codec_profile, 0, sizeof(codec_profile)); memset(&set_param, 0, sizeof(set_param)); memset(&time_inc, 0, sizeof(time_inc)); memset(&m_sInput_buff_property, 0, sizeof(m_sInput_buff_property)); memset(&m_sOutput_buff_property, 0, sizeof(m_sOutput_buff_property)); memset(&session_qp, 0, sizeof(session_qp)); memset(&entropy, 0, sizeof(entropy)); memset(&dbkfilter, 0, sizeof(dbkfilter)); memset(&intra_refresh, 0, sizeof(intra_refresh)); memset(&hec, 0, sizeof(hec)); memset(&voptimecfg, 0, sizeof(voptimecfg)); memset(&capability, 0, sizeof(capability)); } venc_dev::~venc_dev() { //nothing to do } void* venc_dev::async_venc_message_thread (void *input) { struct venc_msg venc_msg; omx_video* omx_venc_base = NULL; omx_venc *omx = reinterpret_cast<omx_venc*>(input); omx_venc_base = reinterpret_cast<omx_video*>(input); OMX_BUFFERHEADERTYPE* omxhdr = NULL; prctl(PR_SET_NAME, (unsigned long)"VideoEncCallBackThread", 0, 0, 0); struct v4l2_plane plane[VIDEO_MAX_PLANES]; struct pollfd pfd; struct v4l2_buffer v4l2_buf; struct v4l2_event dqevent; pfd.events = POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM | POLLRDBAND | POLLPRI; pfd.fd = omx->handle->m_nDriver_fd; int error_code = 0,rc=0; memset(&v4l2_buf, 0, sizeof(v4l2_buf)); while (1) { pthread_mutex_lock(&omx->handle->pause_resume_mlock); if (omx->handle->paused) { venc_msg.msgcode = VEN_MSG_PAUSE; venc_msg.statuscode = VEN_S_SUCCESS; if (omx->async_message_process(input, &venc_msg) < 0) { DEBUG_PRINT_ERROR("\nERROR: Failed to process pause msg"); pthread_mutex_unlock(&omx->handle->pause_resume_mlock); break; } /* Block here until the IL client resumes us again */ pthread_cond_wait(&omx->handle->pause_resume_cond, &omx->handle->pause_resume_mlock); venc_msg.msgcode = VEN_MSG_RESUME; venc_msg.statuscode = VEN_S_SUCCESS; if (omx->async_message_process(input, &venc_msg) < 0) { DEBUG_PRINT_ERROR("\nERROR: Failed to process resume msg"); pthread_mutex_unlock(&omx->handle->pause_resume_mlock); break; } } pthread_mutex_unlock(&omx->handle->pause_resume_mlock); rc = poll(&pfd, 1, POLL_TIMEOUT); if (!rc) { DEBUG_PRINT_HIGH("Poll timedout, pipeline stalled due to client/firmware ETB: %d, EBD: %d, FTB: %d, FBD: %d\n", omx->handle->etb, omx->handle->ebd, omx->handle->ftb, omx->handle->fbd); continue; } else if (rc < 0) { DEBUG_PRINT_ERROR("Error while polling: %d\n", rc); break; } if ((pfd.revents & POLLIN) || (pfd.revents & POLLRDNORM)) { v4l2_buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; v4l2_buf.memory = V4L2_MEMORY_USERPTR; v4l2_buf.length = omx->handle->num_planes; v4l2_buf.m.planes = plane; while (!ioctl(pfd.fd, VIDIOC_DQBUF, &v4l2_buf)) { venc_msg.msgcode=VEN_MSG_OUTPUT_BUFFER_DONE; venc_msg.statuscode=VEN_S_SUCCESS; omxhdr=omx_venc_base->m_out_mem_ptr+v4l2_buf.index; venc_msg.buf.len= v4l2_buf.m.planes->bytesused; venc_msg.buf.offset = v4l2_buf.m.planes->data_offset; venc_msg.buf.flags = 0; venc_msg.buf.ptrbuffer = (OMX_U8 *)omx_venc_base->m_pOutput_pmem[v4l2_buf.index].buffer; venc_msg.buf.clientdata=(void*)omxhdr; venc_msg.buf.timestamp = (uint64_t) v4l2_buf.timestamp.tv_sec * (uint64_t) 1000000 + (uint64_t) v4l2_buf.timestamp.tv_usec; /* TODO: ideally report other types of frames as well * for now it doesn't look like IL client cares about * other types */ if (v4l2_buf.flags & V4L2_QCOM_BUF_FLAG_IDRFRAME) venc_msg.buf.flags |= QOMX_VIDEO_PictureTypeIDR; if (v4l2_buf.flags & V4L2_BUF_FLAG_KEYFRAME) venc_msg.buf.flags |= OMX_BUFFERFLAG_SYNCFRAME; if (v4l2_buf.flags & V4L2_QCOM_BUF_FLAG_CODECCONFIG) venc_msg.buf.flags |= OMX_BUFFERFLAG_CODECCONFIG; if (v4l2_buf.flags & V4L2_BUF_FLAG_EOS) venc_msg.buf.flags |= OMX_BUFFERFLAG_EOS; if (omx->handle->num_planes > 1 && v4l2_buf.m.planes->bytesused) venc_msg.buf.flags |= OMX_BUFFERFLAG_EXTRADATA; omx->handle->fbd++; if (omx->async_message_process(input,&venc_msg) < 0) { DEBUG_PRINT_ERROR("\nERROR: Wrong ioctl message"); break; } } } if ((pfd.revents & POLLOUT) || (pfd.revents & POLLWRNORM)) { v4l2_buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; v4l2_buf.memory = V4L2_MEMORY_USERPTR; v4l2_buf.m.planes = plane; v4l2_buf.length = 1; while (!ioctl(pfd.fd, VIDIOC_DQBUF, &v4l2_buf)) { venc_msg.msgcode=VEN_MSG_INPUT_BUFFER_DONE; venc_msg.statuscode=VEN_S_SUCCESS; omxhdr=omx_venc_base->m_inp_mem_ptr+v4l2_buf.index; venc_msg.buf.clientdata=(void*)omxhdr; omx->handle->ebd++; if (omx->async_message_process(input,&venc_msg) < 0) { DEBUG_PRINT_ERROR("\nERROR: Wrong ioctl message"); break; } } } if (pfd.revents & POLLPRI) { rc = ioctl(pfd.fd, VIDIOC_DQEVENT, &dqevent); if (dqevent.type == V4L2_EVENT_MSM_VIDC_CLOSE_DONE) { DEBUG_PRINT_HIGH("CLOSE DONE\n"); break; } else if (dqevent.type == V4L2_EVENT_MSM_VIDC_FLUSH_DONE) { venc_msg.msgcode = VEN_MSG_FLUSH_INPUT_DONE; venc_msg.statuscode = VEN_S_SUCCESS; if (omx->async_message_process(input,&venc_msg) < 0) { DEBUG_PRINT_ERROR("\nERROR: Wrong ioctl message"); break; } venc_msg.msgcode = VEN_MSG_FLUSH_OUPUT_DONE; venc_msg.statuscode = VEN_S_SUCCESS; if (omx->async_message_process(input,&venc_msg) < 0) { DEBUG_PRINT_ERROR("\nERROR: Wrong ioctl message"); break; } } else if (dqevent.type == V4L2_EVENT_MSM_VIDC_SYS_ERROR) { DEBUG_PRINT_ERROR("\n HW Error recieved \n"); venc_msg.statuscode=VEN_S_EFAIL; if (omx->async_message_process(input,&venc_msg) < 0) { DEBUG_PRINT_ERROR("\nERROR: Wrong ioctl message"); break; } } } } DEBUG_PRINT_HIGH("omx_venc: Async Thread exit\n"); return NULL; } static const int event_type[] = { V4L2_EVENT_MSM_VIDC_FLUSH_DONE, V4L2_EVENT_MSM_VIDC_CLOSE_DONE, V4L2_EVENT_MSM_VIDC_SYS_ERROR }; static OMX_ERRORTYPE subscribe_to_events(int fd) { OMX_ERRORTYPE eRet = OMX_ErrorNone; struct v4l2_event_subscription sub; int array_sz = sizeof(event_type)/sizeof(int); int i,rc; memset(&sub, 0, sizeof(sub)); if (fd < 0) { printf("Invalid input: %d\n", fd); return OMX_ErrorBadParameter; } for (i = 0; i < array_sz; ++i) { memset(&sub, 0, sizeof(sub)); sub.type = event_type[i]; rc = ioctl(fd, VIDIOC_SUBSCRIBE_EVENT, &sub); if (rc) { printf("Failed to subscribe event: 0x%x\n", sub.type); break; } } if (i < array_sz) { for (--i; i >=0 ; i--) { memset(&sub, 0, sizeof(sub)); sub.type = event_type[i]; rc = ioctl(fd, VIDIOC_UNSUBSCRIBE_EVENT, &sub); if (rc) printf("Failed to unsubscribe event: 0x%x\n", sub.type); } eRet = OMX_ErrorNotImplemented; } return eRet; } bool venc_dev::handle_extradata(void *buffer, int index) { OMX_BUFFERHEADERTYPE *p_bufhdr = (OMX_BUFFERHEADERTYPE *) buffer; OMX_OTHER_EXTRADATATYPE *p_extra = NULL; if (!extradata_info.uaddr) { DEBUG_PRINT_ERROR("Extradata buffers not allocated\n"); return false; } p_extra = (OMX_OTHER_EXTRADATATYPE *) ((unsigned)(p_bufhdr->pBuffer + p_bufhdr->nOffset + p_bufhdr->nFilledLen + 3)&(~3)); char *p_extradata = extradata_info.uaddr + index * extradata_info.buffer_size; if ((OMX_U8*)p_extra > (p_bufhdr->pBuffer + p_bufhdr->nAllocLen)) { DEBUG_PRINT_ERROR("Insufficient buffer size\n"); p_extra = NULL; return false; } memcpy(p_extra, p_extradata, extradata_info.buffer_size); return true; } int venc_dev::venc_set_format(int format) { int rc = true; if (format) color_format = format; else { color_format = 0; rc = false; } return rc; } OMX_ERRORTYPE venc_dev::allocate_extradata() { if (extradata_info.allocated) { DEBUG_PRINT_ERROR("2nd allocation return"); return OMX_ErrorNone; } #ifdef USE_ION if (extradata_info.buffer_size) { if (extradata_info.ion.ion_alloc_data.handle) { munmap((void *)extradata_info.uaddr, extradata_info.size); close(extradata_info.ion.fd_ion_data.fd); free_ion_memory(&extradata_info.ion); } extradata_info.size = (extradata_info.size + 4095) & (~4095); extradata_info.ion.ion_device_fd = alloc_map_ion_memory( extradata_info.size, &extradata_info.ion.ion_alloc_data, &extradata_info.ion.fd_ion_data, 0); if (extradata_info.ion.ion_device_fd < 0) { DEBUG_PRINT_ERROR("Failed to alloc extradata memory\n"); return OMX_ErrorInsufficientResources; } extradata_info.uaddr = (char *)mmap(NULL, extradata_info.size, PROT_READ|PROT_WRITE, MAP_SHARED, extradata_info.ion.fd_ion_data.fd , 0); if (extradata_info.uaddr == MAP_FAILED) { DEBUG_PRINT_ERROR("Failed to map extradata memory\n"); close(extradata_info.ion.fd_ion_data.fd); free_ion_memory(&extradata_info.ion); return OMX_ErrorInsufficientResources; } } #endif extradata_info.allocated = 1; return OMX_ErrorNone; } void venc_dev::free_extradata() { #ifdef USE_ION if (extradata_info.uaddr) { munmap((void *)extradata_info.uaddr, extradata_info.size); close(extradata_info.ion.fd_ion_data.fd); free_ion_memory(&extradata_info.ion); } memset(&extradata_info, 0, sizeof(extradata_info)); #endif } bool venc_dev::venc_open(OMX_U32 codec) { int r; unsigned int alignment = 0,buffer_size = 0, temp =0; struct v4l2_control control; OMX_STRING device_name = (OMX_STRING)"/dev/video/venus_enc"; char platform_name[PROPERTY_VALUE_MAX]; property_get("ro.board.platform", platform_name, "0"); if (!strncmp(platform_name, "msm8610", 7)) { device_name = (OMX_STRING)"/dev/video/q6_enc"; } m_nDriver_fd = open (device_name, O_RDWR); if (m_nDriver_fd == 0) { DEBUG_PRINT_ERROR("ERROR: Got fd as 0 for msm_vidc_enc, Opening again\n"); m_nDriver_fd = open (device_name, O_RDWR); } if ((int)m_nDriver_fd < 0) { DEBUG_PRINT_ERROR("ERROR: Omx_venc::Comp Init Returning failure\n"); return false; } DEBUG_PRINT_LOW("\nm_nDriver_fd = %d\n", m_nDriver_fd); // set the basic configuration of the video encoder driver m_sVenc_cfg.input_width = OMX_CORE_QCIF_WIDTH; m_sVenc_cfg.input_height= OMX_CORE_QCIF_HEIGHT; m_sVenc_cfg.dvs_width = OMX_CORE_QCIF_WIDTH; m_sVenc_cfg.dvs_height = OMX_CORE_QCIF_HEIGHT; m_sVenc_cfg.fps_num = 30; m_sVenc_cfg.fps_den = 1; m_sVenc_cfg.targetbitrate = 64000; m_sVenc_cfg.inputformat= V4L2_PIX_FMT_NV12; if (codec == OMX_VIDEO_CodingMPEG4) { m_sVenc_cfg.codectype = V4L2_PIX_FMT_MPEG4; codec_profile.profile = V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE; profile_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_2; #ifdef OUTPUT_BUFFER_LOG strcat(outputfilename, "m4v"); #endif } else if (codec == OMX_VIDEO_CodingH263) { m_sVenc_cfg.codectype = V4L2_PIX_FMT_H263; codec_profile.profile = VEN_PROFILE_H263_BASELINE; profile_level.level = VEN_LEVEL_H263_20; #ifdef OUTPUT_BUFFER_LOG strcat(outputfilename, "263"); #endif } else if (codec == OMX_VIDEO_CodingAVC) { m_sVenc_cfg.codectype = V4L2_PIX_FMT_H264; codec_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE; profile_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_1_0; #ifdef OUTPUT_BUFFER_LOG strcat(outputfilename, "264"); #endif } else if (codec == OMX_VIDEO_CodingVPX) { m_sVenc_cfg.codectype = V4L2_PIX_FMT_VP8; codec_profile.profile = V4L2_MPEG_VIDC_VIDEO_VP8_UNUSED; profile_level.level = V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_0; #ifdef OUTPUT_BUFFER_LOG strcat(outputfilename, "ivf"); #endif } #ifdef INPUT_BUFFER_LOG inputBufferFile1 = fopen (inputfilename, "ab"); if (!inputBufferFile1) DEBUG_PRINT_ERROR("Input File open failed"); #endif #ifdef OUTPUT_BUFFER_LOG outputBufferFile1 = fopen (outputfilename, "ab"); #endif int ret; ret = subscribe_to_events(m_nDriver_fd); if (ret) { DEBUG_PRINT_ERROR("\n Subscribe Event Failed \n"); return false; } struct v4l2_capability cap; struct v4l2_fmtdesc fdesc; struct v4l2_format fmt; struct v4l2_requestbuffers bufreq; ret = ioctl(m_nDriver_fd, VIDIOC_QUERYCAP, &cap); if (ret) { DEBUG_PRINT_ERROR("Failed to query capabilities\n"); } else { DEBUG_PRINT_LOW("Capabilities: driver_name = %s, card = %s, bus_info = %s," " version = %d, capabilities = %x\n", cap.driver, cap.card, cap.bus_info, cap.version, cap.capabilities); } ret=0; fdesc.type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; fdesc.index=0; while (ioctl(m_nDriver_fd, VIDIOC_ENUM_FMT, &fdesc) == 0) { DEBUG_PRINT_LOW("fmt: description: %s, fmt: %x, flags = %x\n", fdesc.description, fdesc.pixelformat, fdesc.flags); fdesc.index++; } fdesc.type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; fdesc.index=0; while (ioctl(m_nDriver_fd, VIDIOC_ENUM_FMT, &fdesc) == 0) { DEBUG_PRINT_LOW("fmt: description: %s, fmt: %x, flags = %x\n", fdesc.description, fdesc.pixelformat, fdesc.flags); fdesc.index++; } m_sOutput_buff_property.alignment=m_sInput_buff_property.alignment=4096; fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height; fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width; fmt.fmt.pix_mp.pixelformat = m_sVenc_cfg.codectype; /*TODO: Return values not handled properly in this function anywhere. * Need to handle those.*/ ret = ioctl(m_nDriver_fd, VIDIOC_S_FMT, &fmt); if (ret) { DEBUG_PRINT_ERROR("Failed to set format on capture port\n"); return false; } m_sOutput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage; fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height; fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width; fmt.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_NV12; ret = ioctl(m_nDriver_fd, VIDIOC_S_FMT, &fmt); m_sInput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage; bufreq.memory = V4L2_MEMORY_USERPTR; bufreq.count = 2; bufreq.type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; ret = ioctl(m_nDriver_fd,VIDIOC_REQBUFS, &bufreq); m_sInput_buff_property.mincount = m_sInput_buff_property.actualcount = bufreq.count; bufreq.type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; bufreq.count = 2; ret = ioctl(m_nDriver_fd,VIDIOC_REQBUFS, &bufreq); m_sOutput_buff_property.mincount = m_sOutput_buff_property.actualcount = bufreq.count; metadatamode = 0; control.id = V4L2_CID_MPEG_VIDEO_HEADER_MODE; control.value = V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE; DEBUG_PRINT_LOW("Calling IOCTL to disable seq_hdr in sync_frame id=%d, val=%d\n", control.id, control.value); if (ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control)) DEBUG_PRINT_ERROR("Failed to set control\n"); struct v4l2_frmsizeenum frmsize; //Get the hardware capabilities memset((void *)&frmsize,0,sizeof(frmsize)); frmsize.index = 0; frmsize.pixel_format = m_sVenc_cfg.codectype; ret = ioctl(m_nDriver_fd, VIDIOC_ENUM_FRAMESIZES, &frmsize); if (ret || frmsize.type != V4L2_FRMSIZE_TYPE_STEPWISE) { DEBUG_PRINT_ERROR("Failed to get framesizes\n"); return false; } if (frmsize.type == V4L2_FRMSIZE_TYPE_STEPWISE) { capability.min_width = frmsize.stepwise.min_width; capability.max_width = frmsize.stepwise.max_width; capability.min_height = frmsize.stepwise.min_height; capability.max_height = frmsize.stepwise.max_height; } return true; } static OMX_ERRORTYPE unsubscribe_to_events(int fd) { OMX_ERRORTYPE eRet = OMX_ErrorNone; struct v4l2_event_subscription sub; int array_sz = sizeof(event_type)/sizeof(int); int i,rc; if (fd < 0) { printf("Invalid input: %d\n", fd); return OMX_ErrorBadParameter; } for (i = 0; i < array_sz; ++i) { memset(&sub, 0, sizeof(sub)); sub.type = event_type[i]; rc = ioctl(fd, VIDIOC_UNSUBSCRIBE_EVENT, &sub); if (rc) { printf("Failed to unsubscribe event: 0x%x\n", sub.type); break; } } return eRet; } void venc_dev::venc_close() { struct v4l2_encoder_cmd enc; DEBUG_PRINT_LOW("\nvenc_close: fd = %d", m_nDriver_fd); if ((int)m_nDriver_fd >= 0) { enc.cmd = V4L2_ENC_CMD_STOP; ioctl(m_nDriver_fd, VIDIOC_ENCODER_CMD, &enc); DEBUG_PRINT_HIGH("venc_close E\n"); if (async_thread_created) pthread_join(m_tid,NULL); DEBUG_PRINT_HIGH("venc_close X\n"); unsubscribe_to_events(m_nDriver_fd); close(m_nDriver_fd); m_nDriver_fd = -1; } #ifdef INPUT_BUFFER_LOG fclose (inputBufferFile1); #endif #ifdef OUTPUT_BUFFER_LOG fclose (outputBufferFile1); #endif } bool venc_dev::venc_set_buf_req(unsigned long *min_buff_count, unsigned long *actual_buff_count, unsigned long *buff_size, unsigned long port) { unsigned long temp_count = 0; if (port == 0) { if (*actual_buff_count > m_sInput_buff_property.mincount) { temp_count = m_sInput_buff_property.actualcount; m_sInput_buff_property.actualcount = *actual_buff_count; DEBUG_PRINT_LOW("\n I/P Count set to %lu\n", *actual_buff_count); } } else { if (*actual_buff_count > m_sOutput_buff_property.mincount) { temp_count = m_sOutput_buff_property.actualcount; m_sOutput_buff_property.actualcount = *actual_buff_count; DEBUG_PRINT_LOW("\n O/P Count set to %lu\n", *actual_buff_count); } } return true; } bool venc_dev::venc_loaded_start() { return true; } bool venc_dev::venc_loaded_stop() { return true; } bool venc_dev::venc_loaded_start_done() { return true; } bool venc_dev::venc_loaded_stop_done() { return true; } bool venc_dev::venc_get_seq_hdr(void *buffer, unsigned buffer_size, unsigned *header_len) { return true; } bool venc_dev::venc_get_buf_req(unsigned long *min_buff_count, unsigned long *actual_buff_count, unsigned long *buff_size, unsigned long port) { struct v4l2_format fmt; struct v4l2_requestbuffers bufreq; unsigned int buf_size = 0, extra_data_size = 0, client_extra_data_size = 0; int ret; if (port == 0) { fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height; fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width; fmt.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_NV12; ret = ioctl(m_nDriver_fd, VIDIOC_G_FMT, &fmt); m_sInput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage; bufreq.memory = V4L2_MEMORY_USERPTR; if (*actual_buff_count) bufreq.count = *actual_buff_count; else bufreq.count = 2; bufreq.type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; ret = ioctl(m_nDriver_fd,VIDIOC_REQBUFS, &bufreq); if (ret) { DEBUG_PRINT_ERROR("\n VIDIOC_REQBUFS OUTPUT_MPLANE Failed \n "); return false; } m_sInput_buff_property.mincount = m_sInput_buff_property.actualcount = bufreq.count; *min_buff_count = m_sInput_buff_property.mincount; *actual_buff_count = m_sInput_buff_property.actualcount; #ifdef USE_ION // For ION memory allocations of the allocated buffer size // must be 4k aligned, hence aligning the input buffer // size to 4k. m_sInput_buff_property.datasize = (m_sInput_buff_property.datasize + 4095) & (~4095); #endif *buff_size = m_sInput_buff_property.datasize; } else { int extra_idx = 0; fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height; fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width; fmt.fmt.pix_mp.pixelformat = m_sVenc_cfg.codectype; ret = ioctl(m_nDriver_fd, VIDIOC_S_FMT, &fmt); m_sOutput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage; fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height; fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width; fmt.fmt.pix_mp.pixelformat = m_sVenc_cfg.codectype; ret = ioctl(m_nDriver_fd, VIDIOC_G_FMT, &fmt); m_sOutput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage; bufreq.memory = V4L2_MEMORY_USERPTR; if (*actual_buff_count) bufreq.count = *actual_buff_count; else bufreq.count = 2; bufreq.type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; ret = ioctl(m_nDriver_fd,VIDIOC_REQBUFS, &bufreq); if (ret) { DEBUG_PRINT_ERROR("\n VIDIOC_REQBUFS CAPTURE_MPLANE Failed \n "); return false; } m_sOutput_buff_property.mincount = m_sOutput_buff_property.actualcount = bufreq.count; *min_buff_count = m_sOutput_buff_property.mincount; *actual_buff_count = m_sOutput_buff_property.actualcount; *buff_size = m_sOutput_buff_property.datasize; num_planes = fmt.fmt.pix_mp.num_planes; extra_idx = EXTRADATA_IDX(num_planes); if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) { extra_data_size = fmt.fmt.pix_mp.plane_fmt[extra_idx].sizeimage; } else if (extra_idx >= VIDEO_MAX_PLANES) { DEBUG_PRINT_ERROR("Extradata index is more than allowed: %d\n", extra_idx); return OMX_ErrorBadParameter; } extradata_info.buffer_size = extra_data_size; extradata_info.count = m_sOutput_buff_property.actualcount; extradata_info.size = extradata_info.buffer_size * extradata_info.count; } return true; } bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index ) { DEBUG_PRINT_LOW("venc_set_param:: venc-720p\n"); struct v4l2_format fmt; struct v4l2_requestbuffers bufreq; int ret; switch (index) { case OMX_IndexParamPortDefinition: { OMX_PARAM_PORTDEFINITIONTYPE *portDefn; portDefn = (OMX_PARAM_PORTDEFINITIONTYPE *) paramData; DEBUG_PRINT_LOW("venc_set_param: OMX_IndexParamPortDefinition\n"); if (portDefn->nPortIndex == PORT_INDEX_IN) { if (!venc_set_encode_framerate(portDefn->format.video.xFramerate, 0)) { return false; } if (!venc_set_color_format(portDefn->format.video.eColorFormat)) { return false; } if (m_sVenc_cfg.input_height != portDefn->format.video.nFrameHeight || m_sVenc_cfg.input_width != portDefn->format.video.nFrameWidth) { DEBUG_PRINT_LOW("\n Basic parameter has changed"); m_sVenc_cfg.input_height = portDefn->format.video.nFrameHeight; m_sVenc_cfg.input_width = portDefn->format.video.nFrameWidth; fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height; fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width; fmt.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_NV12; if (ioctl(m_nDriver_fd, VIDIOC_S_FMT, &fmt)) { DEBUG_PRINT_ERROR("\n VIDIOC_S_FMT OUTPUT_MPLANE Failed \n "); return false; } m_sInput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage; bufreq.memory = V4L2_MEMORY_USERPTR; bufreq.count = portDefn->nBufferCountActual; bufreq.type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; if (ioctl(m_nDriver_fd,VIDIOC_REQBUFS, &bufreq)) { DEBUG_PRINT_ERROR("\n VIDIOC_REQBUFS OUTPUT_MPLANE Failed \n "); return false; } if (bufreq.count == portDefn->nBufferCountActual) m_sInput_buff_property.mincount = m_sInput_buff_property.actualcount = bufreq.count; if (portDefn->nBufferCountActual >= m_sInput_buff_property.mincount) m_sInput_buff_property.actualcount = portDefn->nBufferCountActual; } DEBUG_PRINT_LOW("input: actual: %d, min: %d, count_req: %d\n", portDefn->nBufferCountActual, m_sInput_buff_property.mincount, bufreq.count); } else if (portDefn->nPortIndex == PORT_INDEX_OUT) { fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height; fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width; fmt.fmt.pix_mp.pixelformat = m_sVenc_cfg.codectype; if (ioctl(m_nDriver_fd, VIDIOC_S_FMT, &fmt)) { DEBUG_PRINT_ERROR("\n VIDIOC_S_FMT CAPTURE_MPLANE Failed \n "); return false; } m_sOutput_buff_property.datasize = fmt.fmt.pix_mp.plane_fmt[0].sizeimage; if (!venc_set_target_bitrate(portDefn->format.video.nBitrate, 0)) { return false; } if ((portDefn->nBufferCountActual >= m_sOutput_buff_property.mincount) && (m_sOutput_buff_property.datasize == portDefn->nBufferSize)) { m_sOutput_buff_property.actualcount = portDefn->nBufferCountActual; bufreq.memory = V4L2_MEMORY_USERPTR; bufreq.count = portDefn->nBufferCountActual; bufreq.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; if (ioctl(m_nDriver_fd,VIDIOC_REQBUFS, &bufreq)) { DEBUG_PRINT_ERROR("\nERROR: Request for setting o/p buffer count failed: requested: %lu, current: %lu", portDefn->nBufferCountActual, m_sOutput_buff_property.actualcount); return false; } if (bufreq.count == portDefn->nBufferCountActual) m_sOutput_buff_property.mincount = m_sOutput_buff_property.actualcount = bufreq.count; if (portDefn->nBufferCountActual >= m_sOutput_buff_property.mincount) m_sOutput_buff_property.actualcount = portDefn->nBufferCountActual; if (num_planes > 1) extradata_info.count = m_sOutput_buff_property.actualcount; } else { DEBUG_PRINT_ERROR("\nERROR: Setting Output buffer requirements failed"); return false; } DEBUG_PRINT_LOW("Output: actual: %d, min: %d, count_req: %d\n", portDefn->nBufferCountActual, m_sOutput_buff_property.mincount, bufreq.count); } else { DEBUG_PRINT_ERROR("\nERROR: Invalid Port Index for OMX_IndexParamPortDefinition"); } break; } case OMX_IndexParamVideoPortFormat: { OMX_VIDEO_PARAM_PORTFORMATTYPE *portFmt; portFmt =(OMX_VIDEO_PARAM_PORTFORMATTYPE *)paramData; DEBUG_PRINT_LOW("venc_set_param: OMX_IndexParamVideoPortFormat\n"); if (portFmt->nPortIndex == (OMX_U32) PORT_INDEX_IN) { if (!venc_set_color_format(portFmt->eColorFormat)) { return false; } } else if (portFmt->nPortIndex == (OMX_U32) PORT_INDEX_OUT) { if (!venc_set_encode_framerate(portFmt->xFramerate, 0)) { return false; } } else { DEBUG_PRINT_ERROR("\nERROR: Invalid Port Index for OMX_IndexParamVideoPortFormat"); } break; } case OMX_IndexParamVideoBitrate: { OMX_VIDEO_PARAM_BITRATETYPE* pParam; pParam = (OMX_VIDEO_PARAM_BITRATETYPE*)paramData; DEBUG_PRINT_LOW("venc_set_param: OMX_IndexParamVideoBitrate\n"); if (pParam->nPortIndex == (OMX_U32) PORT_INDEX_OUT) { if (!venc_set_target_bitrate(pParam->nTargetBitrate, 0)) { DEBUG_PRINT_ERROR("\nERROR: Target Bit Rate setting failed"); return false; } if (!venc_set_ratectrl_cfg(pParam->eControlRate)) { DEBUG_PRINT_ERROR("\nERROR: Rate Control setting failed"); return false; } } else { DEBUG_PRINT_ERROR("\nERROR: Invalid Port Index for OMX_IndexParamVideoBitrate"); } break; } case OMX_IndexParamVideoMpeg4: { OMX_VIDEO_PARAM_MPEG4TYPE* pParam; OMX_U32 bFrames = 0; pParam = (OMX_VIDEO_PARAM_MPEG4TYPE*)paramData; DEBUG_PRINT_LOW("venc_set_param: OMX_IndexParamVideoMpeg4\n"); if (pParam->nPortIndex == (OMX_U32) PORT_INDEX_OUT) { if (!venc_set_voptiming_cfg(pParam->nTimeIncRes)) { DEBUG_PRINT_ERROR("\nERROR: Request for setting vop_timing failed"); return false; } m_profile_set = false; m_level_set = false; if (!venc_set_profile_level (pParam->eProfile, pParam->eLevel)) { DEBUG_PRINT_ERROR("\nERROR: Unsuccessful in updating Profile and level"); return false; } else { if (pParam->eProfile == OMX_VIDEO_MPEG4ProfileAdvancedSimple) { if (pParam->nBFrames) { DEBUG_PRINT_HIGH("INFO: Only 1 Bframe is supported"); bFrames = 1; } } else { if (pParam->nBFrames) { DEBUG_PRINT_ERROR("Warning: B frames not supported\n"); bFrames = 0; } } } if (!venc_set_intra_period (pParam->nPFrames,bFrames)) { DEBUG_PRINT_ERROR("\nERROR: Request for setting intra period failed"); return false; } if (!venc_set_multislice_cfg(OMX_IndexParamVideoMpeg4,pParam->nSliceHeaderSpacing)) { DEBUG_PRINT_ERROR("\nERROR: Unsuccessful in updating slice_config"); return false; } } else { DEBUG_PRINT_ERROR("\nERROR: Invalid Port Index for OMX_IndexParamVideoMpeg4"); } break; } case OMX_IndexParamVideoH263: { OMX_VIDEO_PARAM_H263TYPE* pParam = (OMX_VIDEO_PARAM_H263TYPE*)paramData; DEBUG_PRINT_LOW("venc_set_param: OMX_IndexParamVideoH263\n"); OMX_U32 bFrames = 0; if (pParam->nPortIndex == (OMX_U32) PORT_INDEX_OUT) { m_profile_set = false; m_level_set = false; if (!venc_set_profile_level (pParam->eProfile, pParam->eLevel)) { DEBUG_PRINT_ERROR("\nERROR: Unsuccessful in updating Profile and level"); return false; } if (pParam->nBFrames) DEBUG_PRINT_ERROR("\nWARNING: B frame not supported for H.263"); if (venc_set_intra_period (pParam->nPFrames, bFrames) == false) { DEBUG_PRINT_ERROR("\nERROR: Request for setting intra period failed"); return false; } } else { DEBUG_PRINT_ERROR("\nERROR: Invalid Port Index for OMX_IndexParamVideoH263"); } break; } case OMX_IndexParamVideoAvc: { DEBUG_PRINT_LOW("venc_set_param:OMX_IndexParamVideoAvc\n"); OMX_VIDEO_PARAM_AVCTYPE* pParam = (OMX_VIDEO_PARAM_AVCTYPE*)paramData; OMX_U32 bFrames = 0; if (pParam->nPortIndex == (OMX_U32) PORT_INDEX_OUT) { DEBUG_PRINT_LOW("pParam->eProfile :%d ,pParam->eLevel %d\n", pParam->eProfile,pParam->eLevel); m_profile_set = false; m_level_set = false; if (!venc_set_profile_level (pParam->eProfile,pParam->eLevel)) { DEBUG_PRINT_ERROR("\nERROR: Unsuccessful in updating Profile and level %d, %d", pParam->eProfile, pParam->eLevel); return false; } else { if (pParam->eProfile != OMX_VIDEO_AVCProfileBaseline) { if (pParam->nBFrames) { DEBUG_PRINT_HIGH("INFO: Only 1 Bframe is supported"); bFrames = 1; } } else { if (pParam->nBFrames) { DEBUG_PRINT_ERROR("Warning: B frames not supported\n"); bFrames = 0; } } } if (!venc_set_intra_period (pParam->nPFrames, bFrames)) { DEBUG_PRINT_ERROR("\nERROR: Request for setting intra period failed"); return false; } if (!venc_set_entropy_config (pParam->bEntropyCodingCABAC, pParam->nCabacInitIdc)) { DEBUG_PRINT_ERROR("\nERROR: Request for setting Entropy failed"); return false; } if (!venc_set_inloop_filter (pParam->eLoopFilterMode)) { DEBUG_PRINT_ERROR("\nERROR: Request for setting Inloop filter failed"); return false; } if (!venc_set_multislice_cfg(OMX_IndexParamVideoAvc, pParam->nSliceHeaderSpacing)) { DEBUG_PRINT_ERROR("\nWARNING: Unsuccessful in updating slice_config"); return false; } } else { DEBUG_PRINT_ERROR("\nERROR: Invalid Port Index for OMX_IndexParamVideoAvc"); } //TBD, lot of other variables to be updated, yet to decide break; } case (OMX_INDEXTYPE)OMX_IndexParamVideoVp8: { DEBUG_PRINT_LOW("venc_set_param:OMX_IndexParamVideoVp8\n"); OMX_VIDEO_PARAM_VP8TYPE* pParam = (OMX_VIDEO_PARAM_VP8TYPE*)paramData; if (!venc_set_profile_level (pParam->eProfile, pParam->eLevel)) { DEBUG_PRINT_ERROR("\nERROR: Unsuccessful in updating Profile and level %d, %d", pParam->eProfile, pParam->eLevel); return false; } break; } case OMX_IndexParamVideoIntraRefresh: { DEBUG_PRINT_LOW("venc_set_param:OMX_IndexParamVideoIntraRefresh\n"); OMX_VIDEO_PARAM_INTRAREFRESHTYPE *intra_refresh = (OMX_VIDEO_PARAM_INTRAREFRESHTYPE *)paramData; if (intra_refresh->nPortIndex == (OMX_U32) PORT_INDEX_OUT) { if (venc_set_intra_refresh(intra_refresh->eRefreshMode, intra_refresh->nCirMBs) == false) { DEBUG_PRINT_ERROR("\nERROR: Setting Intra refresh failed"); return false; } } else { DEBUG_PRINT_ERROR("\nERROR: Invalid Port Index for OMX_IndexParamVideoIntraRefresh"); } break; } case OMX_IndexParamVideoErrorCorrection: { DEBUG_PRINT_LOW("venc_set_param:OMX_IndexParamVideoErrorCorrection\n"); OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE *error_resilience = (OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE *)paramData; if (error_resilience->nPortIndex == (OMX_U32) PORT_INDEX_OUT) { if (venc_set_error_resilience(error_resilience) == false) { DEBUG_PRINT_ERROR("\nERROR: Setting Intra refresh failed"); return false; } } else { DEBUG_PRINT_ERROR("\nERROR: Invalid Port Index for OMX_IndexParamVideoErrorCorrection"); } break; } case OMX_IndexParamVideoProfileLevelCurrent: { DEBUG_PRINT_LOW("venc_set_param:OMX_IndexParamVideoProfileLevelCurrent\n"); OMX_VIDEO_PARAM_PROFILELEVELTYPE *profile_level = (OMX_VIDEO_PARAM_PROFILELEVELTYPE *)paramData; if (profile_level->nPortIndex == (OMX_U32) PORT_INDEX_OUT) { m_profile_set = false; m_level_set = false; if (!venc_set_profile_level (profile_level->eProfile, profile_level->eLevel)) { DEBUG_PRINT_ERROR("\nWARNING: Unsuccessful in updating Profile and level"); return false; } } else { DEBUG_PRINT_ERROR("\nERROR: Invalid Port Index for OMX_IndexParamVideoProfileLevelCurrent"); } break; } case OMX_IndexParamVideoQuantization: { DEBUG_PRINT_LOW("venc_set_param:OMX_IndexParamVideoQuantization\n"); OMX_VIDEO_PARAM_QUANTIZATIONTYPE *session_qp = (OMX_VIDEO_PARAM_QUANTIZATIONTYPE *)paramData; if (session_qp->nPortIndex == (OMX_U32) PORT_INDEX_OUT) { if (venc_set_session_qp (session_qp->nQpI, session_qp->nQpP, session_qp->nQpB) == false) { DEBUG_PRINT_ERROR("\nERROR: Setting Session QP failed"); return false; } } else { DEBUG_PRINT_ERROR("\nERROR: Invalid Port Index for OMX_IndexParamVideoQuantization"); } break; } case OMX_QcomIndexEnableSliceDeliveryMode: { QOMX_EXTNINDEX_PARAMTYPE* pParam = (QOMX_EXTNINDEX_PARAMTYPE*)paramData; if (pParam->nPortIndex == PORT_INDEX_OUT) { if (venc_set_slice_delivery_mode(pParam->bEnable) == false) { DEBUG_PRINT_ERROR("Setting slice delivery mode failed"); return OMX_ErrorUnsupportedSetting; } } else { DEBUG_PRINT_ERROR("OMX_QcomIndexEnableSliceDeliveryMode " "called on wrong port(%d)", pParam->nPortIndex); return OMX_ErrorBadPortIndex; } break; } case OMX_ExtraDataVideoEncoderSliceInfo: { DEBUG_PRINT_LOW("venc_set_param: OMX_ExtraDataVideoEncoderSliceInfo"); OMX_U32 extra_data = *(OMX_U32 *)paramData; if (venc_set_extradata(extra_data) == false) { DEBUG_PRINT_ERROR("ERROR: Setting " "OMX_ExtraDataVideoEncoderSliceInfo failed"); return false; } extradata = true; break; } case OMX_IndexParamVideoSliceFMO: default: DEBUG_PRINT_ERROR("\nERROR: Unsupported parameter in venc_set_param: %u", index); break; //case } return true; } bool venc_dev::venc_set_config(void *configData, OMX_INDEXTYPE index) { DEBUG_PRINT_LOW("\n Inside venc_set_config"); switch (index) { case OMX_IndexConfigVideoBitrate: { OMX_VIDEO_CONFIG_BITRATETYPE *bit_rate = (OMX_VIDEO_CONFIG_BITRATETYPE *) configData; DEBUG_PRINT_LOW("\n venc_set_config: OMX_IndexConfigVideoBitrate"); if (bit_rate->nPortIndex == (OMX_U32)PORT_INDEX_OUT) { if (venc_set_target_bitrate(bit_rate->nEncodeBitrate, 1) == false) { DEBUG_PRINT_ERROR("\nERROR: Setting Target Bit rate failed"); return false; } } else { DEBUG_PRINT_ERROR("\nERROR: Invalid Port Index for OMX_IndexConfigVideoBitrate"); } break; } case OMX_IndexConfigVideoFramerate: { OMX_CONFIG_FRAMERATETYPE *frame_rate = (OMX_CONFIG_FRAMERATETYPE *) configData; DEBUG_PRINT_LOW("\n venc_set_config: OMX_IndexConfigVideoFramerate"); if (frame_rate->nPortIndex == (OMX_U32)PORT_INDEX_OUT) { if (venc_set_encode_framerate(frame_rate->xEncodeFramerate, 1) == false) { DEBUG_PRINT_ERROR("\nERROR: Setting Encode Framerate failed"); return false; } } else { DEBUG_PRINT_ERROR("\nERROR: Invalid Port Index for OMX_IndexConfigVideoFramerate"); } break; } case QOMX_IndexConfigVideoIntraperiod: { DEBUG_PRINT_LOW("venc_set_param:QOMX_IndexConfigVideoIntraperiod\n"); QOMX_VIDEO_INTRAPERIODTYPE *intraperiod = (QOMX_VIDEO_INTRAPERIODTYPE *)configData; if (intraperiod->nPortIndex == (OMX_U32) PORT_INDEX_OUT) { if (venc_set_intra_period(intraperiod->nPFrames, intraperiod->nBFrames) == false) { DEBUG_PRINT_ERROR("\nERROR: Request for setting intra period failed"); return false; } } break; } case OMX_IndexConfigVideoIntraVOPRefresh: { OMX_CONFIG_INTRAREFRESHVOPTYPE *intra_vop_refresh = (OMX_CONFIG_INTRAREFRESHVOPTYPE *) configData; DEBUG_PRINT_LOW("\n venc_set_config: OMX_IndexConfigVideoIntraVOPRefresh"); if (intra_vop_refresh->nPortIndex == (OMX_U32)PORT_INDEX_OUT) { if (venc_set_intra_vop_refresh(intra_vop_refresh->IntraRefreshVOP) == false) { DEBUG_PRINT_ERROR("\nERROR: Setting Encode Framerate failed"); return false; } } else { DEBUG_PRINT_ERROR("\nERROR: Invalid Port Index for OMX_IndexConfigVideoFramerate"); } break; } case OMX_IndexConfigCommonRotate: { OMX_CONFIG_ROTATIONTYPE *config_rotation = reinterpret_cast<OMX_CONFIG_ROTATIONTYPE*>(configData); OMX_U32 nFrameWidth; DEBUG_PRINT_HIGH("\nvenc_set_config: updating the new Dims"); nFrameWidth = m_sVenc_cfg.input_width; m_sVenc_cfg.input_width = m_sVenc_cfg.input_height; m_sVenc_cfg.input_height = nFrameWidth; if (/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_BASE_CFG,(void*)&ioctl_msg) < */0) { DEBUG_PRINT_ERROR("\nERROR: Dimension Change for Rotation failed"); return false; } break; } case OMX_IndexConfigVideoAVCIntraPeriod: { OMX_VIDEO_CONFIG_AVCINTRAPERIOD *avc_iperiod = (OMX_VIDEO_CONFIG_AVCINTRAPERIOD*) configData; DEBUG_PRINT_LOW("venc_set_param: OMX_IndexConfigVideoAVCIntraPeriod"); if (venc_set_idr_period(avc_iperiod->nPFrames, avc_iperiod->nIDRPeriod) == false) { DEBUG_PRINT_ERROR("ERROR: Setting " "OMX_IndexConfigVideoAVCIntraPeriod failed"); return false; } break; } default: DEBUG_PRINT_ERROR("\n Unsupported config index = %u", index); break; } return true; } unsigned venc_dev::venc_stop( void) { struct venc_msg venc_msg; int rc = 0; if (!stopped) { enum v4l2_buf_type cap_type; if (streaming[OUTPUT_PORT]) { cap_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; rc = ioctl(m_nDriver_fd, VIDIOC_STREAMOFF, &cap_type); if (rc) { DEBUG_PRINT_ERROR("Failed to call streamoff on driver: capability: %d, %d\n", cap_type, rc); } else streaming[OUTPUT_PORT] = false; } if (!rc && streaming[CAPTURE_PORT]) { cap_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; rc = ioctl(m_nDriver_fd, VIDIOC_STREAMOFF, &cap_type); if (rc) { DEBUG_PRINT_ERROR("Failed to call streamoff on driver: capability: %d, %d\n", cap_type, rc); } else streaming[CAPTURE_PORT] = false; } if (!rc) { venc_stop_done(); stopped = 1; } } return rc; } unsigned venc_dev::venc_pause(void) { pthread_mutex_lock(&pause_resume_mlock); paused = true; pthread_mutex_unlock(&pause_resume_mlock); return 0; } unsigned venc_dev::venc_resume(void) { pthread_mutex_lock(&pause_resume_mlock); paused = false; pthread_mutex_unlock(&pause_resume_mlock); return pthread_cond_signal(&pause_resume_cond); } unsigned venc_dev::venc_start_done(void) { struct venc_msg venc_msg; venc_msg.msgcode = VEN_MSG_START; venc_msg.statuscode = VEN_S_SUCCESS; venc_handle->async_message_process(venc_handle,&venc_msg); return 0; } unsigned venc_dev::venc_stop_done(void) { struct venc_msg venc_msg; free_extradata(); venc_msg.msgcode=VEN_MSG_STOP; venc_msg.statuscode=VEN_S_SUCCESS; venc_handle->async_message_process(venc_handle,&venc_msg); return 0; } unsigned venc_dev::venc_set_message_thread_id(pthread_t tid) { async_thread_created = true; m_tid=tid; return 0; } unsigned venc_dev::venc_start(void) { enum v4l2_buf_type buf_type; int ret,r; DEBUG_PRINT_HIGH("\n %s(): Check Profile/Level set in driver before start", __func__); if (!venc_set_profile_level(0, 0)) { DEBUG_PRINT_ERROR("\n ERROR: %s(): Driver Profile/Level is NOT SET", __func__); } else { DEBUG_PRINT_HIGH("\n %s(): Driver Profile[%lu]/Level[%lu] successfully SET", __func__, codec_profile.profile, profile_level.level); } venc_config_print(); /* Check if slice_delivery mode is enabled & max slices is sufficient for encoding complete frame */ if (slice_mode.enable && multislice.mslice_size && (m_sVenc_cfg.input_width * m_sVenc_cfg.input_height)/(256 * multislice.mslice_size) >= MAX_SUPPORTED_SLICES_PER_FRAME) { DEBUG_PRINT_ERROR("slice_mode: %d, max slices (%d) should be less than (%d)\n", slice_mode.enable, (m_sVenc_cfg.input_width * m_sVenc_cfg.input_height)/(256 * multislice.mslice_size), MAX_SUPPORTED_SLICES_PER_FRAME); return 1; } buf_type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; DEBUG_PRINT_LOW("send_command_proxy(): Idle-->Executing\n"); ret=ioctl(m_nDriver_fd, VIDIOC_STREAMON,&buf_type); if (ret) return 1; streaming[CAPTURE_PORT] = true; stopped = 0; return 0; } void venc_dev::venc_config_print() { DEBUG_PRINT_HIGH("\nENC_CONFIG: Codec: %ld, Profile %ld, level : %ld", m_sVenc_cfg.codectype, codec_profile.profile, profile_level.level); DEBUG_PRINT_HIGH("\n ENC_CONFIG: Width: %ld, Height:%ld, Fps: %ld", m_sVenc_cfg.input_width, m_sVenc_cfg.input_height, m_sVenc_cfg.fps_num/m_sVenc_cfg.fps_den); DEBUG_PRINT_HIGH("\nENC_CONFIG: Bitrate: %ld, RC: %ld, I-Period: %ld", bitrate.target_bitrate, rate_ctrl.rcmode, intra_period.num_pframes); DEBUG_PRINT_HIGH("\nENC_CONFIG: qpI: %ld, qpP: %ld, qpb: %ld", session_qp.iframeqp, session_qp.pframqp,session_qp.bframqp); DEBUG_PRINT_HIGH("\nENC_CONFIG: VOP_Resolution: %ld, Slice-Mode: %ld, Slize_Size: %ld", voptimecfg.voptime_resolution, multislice.mslice_mode, multislice.mslice_size); DEBUG_PRINT_HIGH("\nENC_CONFIG: EntropyMode: %d, CabacModel: %ld", entropy.longentropysel, entropy.cabacmodel); DEBUG_PRINT_HIGH("\nENC_CONFIG: DB-Mode: %ld, alpha: %ld, Beta: %ld\n", dbkfilter.db_mode, dbkfilter.slicealpha_offset, dbkfilter.slicebeta_offset); DEBUG_PRINT_HIGH("\nENC_CONFIG: IntraMB/Frame: %ld, HEC: %ld, IDR Period: %ld\n", intra_refresh.mbcount, hec.header_extension, idrperiod.idrperiod); } unsigned venc_dev::venc_flush( unsigned port) { struct v4l2_encoder_cmd enc; DEBUG_PRINT_LOW("in %s", __func__); enc.cmd = V4L2_ENC_QCOM_CMD_FLUSH; enc.flags = V4L2_QCOM_CMD_FLUSH_OUTPUT | V4L2_QCOM_CMD_FLUSH_CAPTURE; if (ioctl(m_nDriver_fd, VIDIOC_ENCODER_CMD, &enc)) { DEBUG_PRINT_ERROR("\n Flush Port (%d) Failed ", port); return -1; } return 0; } //allocating I/P memory from pmem and register with the device bool venc_dev::venc_use_buf(void *buf_addr, unsigned port,unsigned index) { struct pmem *pmem_tmp; struct v4l2_buffer buf; struct v4l2_plane plane[VIDEO_MAX_PLANES]; int rc = 0, extra_idx; pmem_tmp = (struct pmem *)buf_addr; DEBUG_PRINT_LOW("\n venc_use_buf:: pmem_tmp = %p", pmem_tmp); if (port == PORT_INDEX_IN) { buf.index = index; buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; buf.memory = V4L2_MEMORY_USERPTR; plane[0].length = pmem_tmp->size; plane[0].m.userptr = (unsigned long)pmem_tmp->buffer; plane[0].reserved[0] = pmem_tmp->fd; plane[0].reserved[1] = 0; plane[0].data_offset = pmem_tmp->offset; buf.m.planes = plane; buf.length = 1; rc = ioctl(m_nDriver_fd, VIDIOC_PREPARE_BUF, &buf); if (rc) DEBUG_PRINT_LOW("VIDIOC_PREPARE_BUF Failed\n"); } else if (port == PORT_INDEX_OUT) { extra_idx = EXTRADATA_IDX(num_planes); if ((num_planes > 1) && (extra_idx)) { rc = allocate_extradata(); if (rc) DEBUG_PRINT_ERROR("Failed to allocate extradata: %d\n", rc); } buf.index = index; buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; buf.memory = V4L2_MEMORY_USERPTR; plane[0].length = pmem_tmp->size; plane[0].m.userptr = (unsigned long)pmem_tmp->buffer; plane[0].reserved[0] = pmem_tmp->fd; plane[0].reserved[1] = 0; plane[0].data_offset = pmem_tmp->offset; buf.m.planes = plane; buf.length = num_planes; if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) { plane[extra_idx].length = extradata_info.buffer_size; plane[extra_idx].m.userptr = (unsigned long) (extradata_info.uaddr + index * extradata_info.buffer_size); #ifdef USE_ION plane[extra_idx].reserved[0] = extradata_info.ion.fd_ion_data.fd; #endif plane[extra_idx].reserved[1] = extradata_info.buffer_size * index; plane[extra_idx].data_offset = 0; } else if (extra_idx >= VIDEO_MAX_PLANES) { DEBUG_PRINT_ERROR("Extradata index is more than allowed: %d\n", extra_idx); return OMX_ErrorBadParameter; } rc = ioctl(m_nDriver_fd, VIDIOC_PREPARE_BUF, &buf); if (rc) DEBUG_PRINT_LOW("VIDIOC_PREPARE_BUF Failed\n"); } else { DEBUG_PRINT_ERROR("\nERROR: venc_use_buf:Invalid Port Index "); return false; } return true; } bool venc_dev::venc_free_buf(void *buf_addr, unsigned port) { struct pmem *pmem_tmp; struct venc_bufferpayload dev_buffer; memset(&dev_buffer, 0, sizeof(dev_buffer)); pmem_tmp = (struct pmem *)buf_addr; if (port == PORT_INDEX_IN) { dev_buffer.pbuffer = (OMX_U8 *)pmem_tmp->buffer; dev_buffer.fd = pmem_tmp->fd; dev_buffer.maped_size = pmem_tmp->size; dev_buffer.sz = pmem_tmp->size; dev_buffer.offset = pmem_tmp->offset; DEBUG_PRINT_LOW("\n venc_free_buf:pbuffer = %x,fd = %x, offset = %d, maped_size = %d", \ dev_buffer.pbuffer, \ dev_buffer.fd, \ dev_buffer.offset, \ dev_buffer.maped_size); } else if (port == PORT_INDEX_OUT) { dev_buffer.pbuffer = (OMX_U8 *)pmem_tmp->buffer; dev_buffer.fd = pmem_tmp->fd; dev_buffer.sz = pmem_tmp->size; dev_buffer.maped_size = pmem_tmp->size; dev_buffer.offset = pmem_tmp->offset; DEBUG_PRINT_LOW("\n venc_free_buf:pbuffer = %x,fd = %x, offset = %d, maped_size = %d", \ dev_buffer.pbuffer, \ dev_buffer.fd, \ dev_buffer.offset, \ dev_buffer.maped_size); } else { DEBUG_PRINT_ERROR("\nERROR: venc_free_buf:Invalid Port Index "); return false; } return true; } bool venc_dev::venc_color_align(OMX_BUFFERHEADERTYPE *buffer, OMX_U32 width, OMX_U32 height) { OMX_U32 y_stride = VENUS_Y_STRIDE(COLOR_FMT_NV12, width), y_scanlines = VENUS_Y_SCANLINES(COLOR_FMT_NV12, height), uv_stride = VENUS_UV_STRIDE(COLOR_FMT_NV12, width), uv_scanlines = VENUS_UV_SCANLINES(COLOR_FMT_NV12, height), src_chroma_offset = width * height; if (buffer->nAllocLen >= VENUS_BUFFER_SIZE(COLOR_FMT_NV12, width, height)) { OMX_U8* src_buf = buffer->pBuffer, *dst_buf = buffer->pBuffer; //Do chroma first, so that we can convert it in-place src_buf += width * height; dst_buf += y_stride * y_scanlines; for (int line = height / 2 - 1; line >= 0; --line) { memmove(dst_buf + line * uv_stride, src_buf + line * width, width); } dst_buf = src_buf = buffer->pBuffer; //Copy the Y next for (int line = height - 1; line > 0; --line) { memmove(dst_buf + line * y_stride, src_buf + line * width, width); } } else { DEBUG_PRINT_ERROR("Failed to align Chroma. from %u to %u : \ Insufficient bufferLen=%u v/s Required=%u", (width*height), src_chroma_offset, buffer->nAllocLen, VENUS_BUFFER_SIZE(COLOR_FMT_NV12, width, height)); return false; } return true; } bool venc_dev::venc_empty_buf(void *buffer, void *pmem_data_buf, unsigned index, unsigned fd) { struct pmem *temp_buffer; struct v4l2_buffer buf; struct v4l2_plane plane; int rc=0; struct OMX_BUFFERHEADERTYPE *bufhdr; encoder_media_buffer_type * meta_buf = NULL; temp_buffer = (struct pmem *)buffer; memset (&buf, 0, sizeof(buf)); memset (&plane, 0, sizeof(plane)); if (buffer == NULL) { DEBUG_PRINT_ERROR("\nERROR: venc_etb: buffer is NULL"); return false; } bufhdr = (OMX_BUFFERHEADERTYPE *)buffer; DEBUG_PRINT_LOW("\n Input buffer length %d",bufhdr->nFilledLen); if (pmem_data_buf) { DEBUG_PRINT_LOW("\n Internal PMEM addr for i/p Heap UseBuf: %p", pmem_data_buf); plane.m.userptr = (unsigned long)pmem_data_buf; plane.data_offset = bufhdr->nOffset; plane.length = bufhdr->nAllocLen; plane.bytesused = bufhdr->nFilledLen; } else { // -------------------------------------------------------------------------------------- // [Usage] [metadatamode] [Type] [color_format] [Where is buffer info] // --------------------------------------------------------------------------------------- // Camera-2 1 CameraSource 0 meta-handle // Camera-3 1 GrallocSource 0 gralloc-private-handle // surface encode (RBG) 1 GrallocSource 1 bufhdr (color-converted) // CPU (Eg: MediaCodec) 0 -- 0 bufhdr // --------------------------------------------------------------------------------------- if (metadatamode) { plane.m.userptr = index; meta_buf = (encoder_media_buffer_type *)bufhdr->pBuffer; if (!meta_buf) { //empty EOS buffer if (!bufhdr->nFilledLen && (bufhdr->nFlags & OMX_BUFFERFLAG_EOS)) { plane.data_offset = bufhdr->nOffset; plane.length = bufhdr->nAllocLen; plane.bytesused = bufhdr->nFilledLen; DEBUG_PRINT_LOW("venc_empty_buf: empty EOS buffer"); } else { return false; } } else if (!color_format) { if (meta_buf->buffer_type == kMetadataBufferTypeCameraSource) { plane.data_offset = meta_buf->meta_handle->data[1]; plane.length = meta_buf->meta_handle->data[2]; plane.bytesused = meta_buf->meta_handle->data[2]; DEBUG_PRINT_LOW("venc_empty_buf: camera buf: fd = %d filled %d of %d", fd, plane.bytesused, plane.length); } else if (meta_buf->buffer_type == kMetadataBufferTypeGrallocSource) { private_handle_t *handle = (private_handle_t *)meta_buf->meta_handle; fd = handle->fd; plane.data_offset = 0; plane.length = handle->size; plane.bytesused = handle->size; DEBUG_PRINT_LOW("venc_empty_buf: Opaque camera buf: fd = %d " ": filled %d of %d", fd, plane.bytesused, plane.length); } } else { plane.data_offset = bufhdr->nOffset; plane.length = bufhdr->nAllocLen; plane.bytesused = bufhdr->nFilledLen; DEBUG_PRINT_LOW("venc_empty_buf: Opaque non-camera buf: fd = %d " ": filled %d of %d", fd, plane.bytesused, plane.length); } } else { plane.data_offset = bufhdr->nOffset; plane.length = bufhdr->nAllocLen; plane.bytesused = bufhdr->nFilledLen; DEBUG_PRINT_LOW("venc_empty_buf: non-camera buf: fd = %d filled %d of %d", fd, plane.bytesused, plane.length); } } buf.index = index; buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; buf.memory = V4L2_MEMORY_USERPTR; plane.reserved[0] = fd; plane.reserved[1] = 0; buf.m.planes = &plane; buf.length = 1; if (bufhdr->nFlags & OMX_BUFFERFLAG_EOS) buf.flags = V4L2_BUF_FLAG_EOS; buf.timestamp.tv_sec = bufhdr->nTimeStamp / 1000000; buf.timestamp.tv_usec = (bufhdr->nTimeStamp % 1000000); rc = ioctl(m_nDriver_fd, VIDIOC_QBUF, &buf); if (rc) { DEBUG_PRINT_ERROR("Failed to qbuf (etb) to driver"); return false; } etb++; if (!streaming[OUTPUT_PORT]) { enum v4l2_buf_type buf_type; buf_type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; int ret; ret = ioctl(m_nDriver_fd, VIDIOC_STREAMON, &buf_type); if (ret) { DEBUG_PRINT_ERROR("Failed to call streamon\n"); return false; } else { streaming[OUTPUT_PORT] = true; } } #ifdef INPUT_BUFFER_LOG int i; int stride = VENUS_Y_STRIDE(COLOR_FMT_NV12, m_sVenc_cfg.input_width); int scanlines = VENUS_Y_SCANLINES(COLOR_FMT_NV12, m_sVenc_cfg.input_height); char *temp = (char *)bufhdr->pBuffer; for (i = 0; i < m_sVenc_cfg.input_height; i++) { fwrite(temp, m_sVenc_cfg.input_width, 1, inputBufferFile1); temp += stride; } temp = (char *)bufhdr->pBuffer + (stride * scanlines); for (i = 0; i < m_sVenc_cfg.input_height/2; i++) { fwrite(temp, m_sVenc_cfg.input_width, 1, inputBufferFile1); temp += stride; } #endif return true; } bool venc_dev::venc_fill_buf(void *buffer, void *pmem_data_buf,unsigned index,unsigned fd) { struct pmem *temp_buffer = NULL; struct venc_buffer frameinfo; struct v4l2_buffer buf; struct v4l2_plane plane[VIDEO_MAX_PLANES]; int rc = 0, extra_idx; struct OMX_BUFFERHEADERTYPE *bufhdr; if (buffer == NULL) return false; bufhdr = (OMX_BUFFERHEADERTYPE *)buffer; if (pmem_data_buf) { DEBUG_PRINT_LOW("\n Internal PMEM addr for o/p Heap UseBuf: %p", pmem_data_buf); plane[0].m.userptr = (unsigned long)pmem_data_buf; } else { DEBUG_PRINT_LOW("\n Shared PMEM addr for o/p PMEM UseBuf/AllocateBuf: %p", bufhdr->pBuffer); plane[0].m.userptr = (unsigned long)bufhdr->pBuffer; } buf.index = index; buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; buf.memory = V4L2_MEMORY_USERPTR; plane[0].length = bufhdr->nAllocLen; plane[0].bytesused = bufhdr->nFilledLen; plane[0].reserved[0] = fd; plane[0].reserved[1] = 0; plane[0].data_offset = bufhdr->nOffset; buf.m.planes = plane; buf.length = num_planes; extra_idx = EXTRADATA_IDX(num_planes); if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) { plane[extra_idx].bytesused = 0; plane[extra_idx].length = extradata_info.buffer_size; plane[extra_idx].m.userptr = (unsigned long) (extradata_info.uaddr + index * extradata_info.buffer_size); #ifdef USE_ION plane[extra_idx].reserved[0] = extradata_info.ion.fd_ion_data.fd; #endif plane[extra_idx].reserved[1] = extradata_info.buffer_size * index; plane[extra_idx].data_offset = 0; } else if (extra_idx >= VIDEO_MAX_PLANES) { DEBUG_PRINT_ERROR("Extradata index higher than expected: %d\n", extra_idx); return false; } rc = ioctl(m_nDriver_fd, VIDIOC_QBUF, &buf); if (rc) { DEBUG_PRINT_ERROR("Failed to qbuf (ftb) to driver"); return false; } ftb++; return true; } bool venc_dev::venc_set_extradata(OMX_U32 extra_data) { struct v4l2_control control; control.id = V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA; control.value = V4L2_MPEG_VIDC_EXTRADATA_MULTISLICE_INFO; DEBUG_PRINT_HIGH("venc_set_extradata:: %x", (int) extra_data); if (multislice.mslice_mode && multislice.mslice_mode != V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE) { if (ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control)) { DEBUG_PRINT_ERROR("ERROR: Request for setting extradata failed"); return false; } } else { DEBUG_PRINT_ERROR("Failed to set slice extradata, slice_mode " "is set to [%lu]", multislice.mslice_mode); } return true; } bool venc_dev::venc_set_slice_delivery_mode(OMX_U32 enable) { struct v4l2_control control; if (enable) { control.id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_DELIVERY_MODE; control.value = 1; DEBUG_PRINT_LOW("Set slice_delivery_mode: %d", control.value); if (multislice.mslice_mode == V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB && m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264) { if (ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control)) { DEBUG_PRINT_ERROR("Request for setting slice delivery mode failed"); return false; } else { DEBUG_PRINT_LOW("Successfully set Slice delivery mode id: %d, value=%d\n", control.id, control.value); slice_mode.enable = 1; } } else { DEBUG_PRINT_ERROR("Failed to set slice delivery mode, slice_mode [%d] " "is not MB BASED or [%lu] is not H264 codec ", multislice.mslice_mode, m_sVenc_cfg.codectype); } } else { DEBUG_PRINT_ERROR("Slice_DELIVERY_MODE not enabled\n"); } return true; } bool venc_dev::venc_set_session_qp(OMX_U32 i_frame_qp, OMX_U32 p_frame_qp,OMX_U32 b_frame_qp) { int rc; struct v4l2_control control; control.id = V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP; control.value = i_frame_qp; DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); session_qp.iframeqp = control.value; control.id = V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP; control.value = p_frame_qp; DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); session_qp.pframqp = control.value; if ((codec_profile.profile == V4L2_MPEG_VIDEO_H264_PROFILE_MAIN) || (codec_profile.profile == V4L2_MPEG_VIDEO_H264_PROFILE_HIGH)) { control.id = V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP; control.value = b_frame_qp; DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); session_qp.bframqp = control.value; } return true; } bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel) { struct venc_profile requested_profile = {0}; struct ven_profilelevel requested_level = {0}; unsigned long mb_per_frame = 0; DEBUG_PRINT_LOW("venc_set_profile_level:: eProfile = %d, Level = %d", eProfile, eLevel); mb_per_frame = ((m_sVenc_cfg.input_height + 15) >> 4)* ((m_sVenc_cfg.input_width + 15) >> 4); if ((eProfile == 0) && (eLevel == 0) && m_profile_set && m_level_set) { DEBUG_PRINT_LOW("\n Profile/Level setting complete before venc_start"); return true; } DEBUG_PRINT_LOW("\n Validating Profile/Level from table"); if (!venc_validate_profile_level(&eProfile, &eLevel)) { DEBUG_PRINT_LOW("\nERROR: Profile/Level validation failed"); return false; } if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_MPEG4) { DEBUG_PRINT_LOW("eProfile = %d, OMX_VIDEO_MPEG4ProfileSimple = %d and " "OMX_VIDEO_MPEG4ProfileAdvancedSimple = %d", eProfile, OMX_VIDEO_MPEG4ProfileSimple, OMX_VIDEO_MPEG4ProfileAdvancedSimple); if (eProfile == OMX_VIDEO_MPEG4ProfileSimple) { requested_profile.profile = V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE; } else if (eProfile == OMX_VIDEO_MPEG4ProfileAdvancedSimple) { requested_profile.profile = V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE; } else { DEBUG_PRINT_LOW("\nERROR: Unsupported MPEG4 profile = %u", eProfile); return false; } DEBUG_PRINT_LOW("eLevel = %d, OMX_VIDEO_MPEG4Level0 = %d, OMX_VIDEO_MPEG4Level1 = %d," "OMX_VIDEO_MPEG4Level2 = %d, OMX_VIDEO_MPEG4Level3 = %d, OMX_VIDEO_MPEG4Level4 = %d," "OMX_VIDEO_MPEG4Level5 = %d", eLevel, OMX_VIDEO_MPEG4Level0, OMX_VIDEO_MPEG4Level1, OMX_VIDEO_MPEG4Level2, OMX_VIDEO_MPEG4Level3, OMX_VIDEO_MPEG4Level4, OMX_VIDEO_MPEG4Level5); if (mb_per_frame >= 3600) { if (requested_profile.profile == V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE) requested_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_5; if (requested_profile.profile == V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE) requested_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_5; } else { switch (eLevel) { case OMX_VIDEO_MPEG4Level0: requested_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_0; break; case OMX_VIDEO_MPEG4Level0b: requested_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B; break; case OMX_VIDEO_MPEG4Level1: requested_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_1; break; case OMX_VIDEO_MPEG4Level2: requested_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_2; break; case OMX_VIDEO_MPEG4Level3: requested_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_3; break; case OMX_VIDEO_MPEG4Level4a: requested_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_4; break; case OMX_VIDEO_MPEG4Level5: requested_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_5; break; default: return false; // TODO update corresponding levels for MPEG4_LEVEL_3b,MPEG4_LEVEL_6 break; } } } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H263) { switch (eProfile) { case OMX_VIDEO_H263ProfileBaseline: requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_BASELINE; break; case OMX_VIDEO_H263ProfileH320Coding: requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_H320CODING; break; case OMX_VIDEO_H263ProfileBackwardCompatible: requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_BACKWARDCOMPATIBLE; break; case OMX_VIDEO_H263ProfileISWV2: requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_ISWV2; break; case OMX_VIDEO_H263ProfileISWV3: requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_ISWV3; break; case OMX_VIDEO_H263ProfileHighCompression: requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_HIGHCOMPRESSION; break; case OMX_VIDEO_H263ProfileInternet: requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_INTERNET; break; case OMX_VIDEO_H263ProfileInterlace: requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_INTERLACE; break; case OMX_VIDEO_H263ProfileHighLatency: requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_HIGHLATENCY; break; default: DEBUG_PRINT_LOW("\nERROR: Unsupported H.263 profile = %u", requested_profile.profile); return false; } //profile level switch (eLevel) { case OMX_VIDEO_H263Level10: requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_1_0; break; case OMX_VIDEO_H263Level20: requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_2_0; break; case OMX_VIDEO_H263Level30: requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_3_0; break; case OMX_VIDEO_H263Level40: requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_4_0; break; case OMX_VIDEO_H263Level45: requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_4_5; break; case OMX_VIDEO_H263Level50: requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_5_0; break; case OMX_VIDEO_H263Level60: requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_6_0; break; case OMX_VIDEO_H263Level70: requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_7_0; break; default: return false; break; } } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264) { if (eProfile == OMX_VIDEO_AVCProfileBaseline) { requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE; } else if (eProfile == OMX_VIDEO_AVCProfileMain) { requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_MAIN; } else if (eProfile == OMX_VIDEO_AVCProfileExtended) { requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED; } else if (eProfile == OMX_VIDEO_AVCProfileHigh) { requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH; } else if (eProfile == OMX_VIDEO_AVCProfileHigh10) { requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10; } else if (eProfile == OMX_VIDEO_AVCProfileHigh422) { requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422; } else if (eProfile == OMX_VIDEO_AVCProfileHigh444) { requested_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE; } else { DEBUG_PRINT_LOW("\nERROR: Unsupported H.264 profile = %u", requested_profile.profile); return false; } //profile level switch (eLevel) { case OMX_VIDEO_AVCLevel1: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_1_0; break; case OMX_VIDEO_AVCLevel1b: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_1B; break; case OMX_VIDEO_AVCLevel11: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_1_1; break; case OMX_VIDEO_AVCLevel12: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_1_2; break; case OMX_VIDEO_AVCLevel13: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_1_3; break; case OMX_VIDEO_AVCLevel2: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_2_0; break; case OMX_VIDEO_AVCLevel21: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_2_1; break; case OMX_VIDEO_AVCLevel22: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_2_2; break; case OMX_VIDEO_AVCLevel3: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_3_0; break; case OMX_VIDEO_AVCLevel31: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_3_1; break; case OMX_VIDEO_AVCLevel32: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_3_2; break; case OMX_VIDEO_AVCLevel4: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_4_0; break; case OMX_VIDEO_AVCLevel41: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_4_1; break; case OMX_VIDEO_AVCLevel42: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_4_2; break; case OMX_VIDEO_AVCLevel5: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_5_0; break; case OMX_VIDEO_AVCLevel51: requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_5_1; break; default : DEBUG_PRINT_ERROR("\nERROR: Unsupported H.264 level= %lu", requested_level.level); return false; break; } } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_VP8) { if (!(eProfile == OMX_VIDEO_VP8ProfileMain)) { DEBUG_PRINT_ERROR("\nERROR: Unsupported VP8 profile = %u", eProfile); return false; } requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_VP8_UNUSED; m_profile_set = true; switch(eLevel) { case OMX_VIDEO_VP8Level_Version0: requested_level.level = V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_0; break; case OMX_VIDEO_VP8Level_Version1: requested_level.level = V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_1; break; default: DEBUG_PRINT_ERROR("\nERROR: Unsupported VP8 level= %lu", eLevel); return false; break; } } if (!m_profile_set) { int rc; struct v4l2_control control; if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264) { control.id = V4L2_CID_MPEG_VIDEO_H264_PROFILE; } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_MPEG4) { control.id = V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE; } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H263) { control.id = V4L2_CID_MPEG_VIDC_VIDEO_H263_PROFILE; } else { DEBUG_PRINT_ERROR("\n Wrong CODEC \n"); return false; } control.value = requested_profile.profile; DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); codec_profile.profile = control.value; m_profile_set = true; } if (!m_level_set) { int rc; struct v4l2_control control; if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264) { control.id = V4L2_CID_MPEG_VIDEO_H264_LEVEL; } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_MPEG4) { control.id = V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL; } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H263) { control.id = V4L2_CID_MPEG_VIDC_VIDEO_H263_LEVEL; } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_VP8) { control.id = V4L2_CID_MPEG_VIDC_VIDEO_VP8_PROFILE_LEVEL; } else { DEBUG_PRINT_ERROR("\n Wrong CODEC \n"); return false; } control.value = requested_level.level; DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); profile_level.level = control.value; m_level_set = true; } return true; } bool venc_dev::venc_set_voptiming_cfg( OMX_U32 TimeIncRes) { struct venc_voptimingcfg vop_timing_cfg; DEBUG_PRINT_LOW("\n venc_set_voptiming_cfg: TimeRes = %u", TimeIncRes); vop_timing_cfg.voptime_resolution = TimeIncRes; voptimecfg.voptime_resolution = vop_timing_cfg.voptime_resolution; return true; } bool venc_dev::venc_set_intra_period(OMX_U32 nPFrames, OMX_U32 nBFrames) { DEBUG_PRINT_LOW("\n venc_set_intra_period: nPFrames = %u", nPFrames); int rc; struct v4l2_control control; if ((codec_profile.profile != V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE) && (codec_profile.profile != V4L2_MPEG_VIDEO_H264_PROFILE_MAIN) && (codec_profile.profile != V4L2_MPEG_VIDEO_H264_PROFILE_HIGH)) { nBFrames=0; } control.id = V4L2_CID_MPEG_VIDC_VIDEO_NUM_P_FRAMES; control.value = nPFrames; rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); intra_period.num_pframes = control.value; control.id = V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES; control.value = nBFrames; DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); intra_period.num_bframes = control.value; if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264) { control.id = V4L2_CID_MPEG_VIDC_VIDEO_IDR_PERIOD; control.value = 1; rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } idrperiod.idrperiod = 1; } return true; } bool venc_dev::venc_set_idr_period(OMX_U32 nPFrames, OMX_U32 nIDRPeriod) { int rc = 0; struct v4l2_control control; DEBUG_PRINT_LOW("\n venc_set_idr_period: nPFrames = %u, nIDRPeriod: %u\n", nPFrames, nIDRPeriod); if (m_sVenc_cfg.codectype != V4L2_PIX_FMT_H264) { DEBUG_PRINT_ERROR("\nERROR: IDR period valid for H264 only!!"); return false; } if (venc_set_intra_period (nPFrames, intra_period.num_bframes) == false) { DEBUG_PRINT_ERROR("\nERROR: Request for setting intra period failed"); return false; } intra_period.num_pframes = nPFrames; control.id = V4L2_CID_MPEG_VIDC_VIDEO_IDR_PERIOD; control.value = nIDRPeriod; rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } idrperiod.idrperiod = nIDRPeriod; return true; } bool venc_dev::venc_set_entropy_config(OMX_BOOL enable, OMX_U32 i_cabac_level) { int rc = 0; struct v4l2_control control; DEBUG_PRINT_LOW("\n venc_set_entropy_config: CABAC = %u level: %u", enable, i_cabac_level); if (enable &&(codec_profile.profile != V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE)) { control.value = V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC; control.id = V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE; DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); entropy.longentropysel = control.value; if (i_cabac_level == 0) { control.value = V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_0; } else if (i_cabac_level == 1) { control.value = V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_1; } else if (i_cabac_level == 2) { control.value = V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_2; } control.id = V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL; //control.value = entropy_cfg.cabacmodel; DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); entropy.longentropysel=control.value; } else if (!enable) { control.value = V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC; control.id = V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE; DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); entropy.longentropysel=control.value; } else { DEBUG_PRINT_ERROR("\nInvalid Entropy mode for Baseline Profile"); return false; } return true; } bool venc_dev::venc_set_multislice_cfg(OMX_INDEXTYPE Codec, OMX_U32 nSlicesize) // MB { int rc; struct v4l2_control control; bool status = true; if ((Codec != OMX_IndexParamVideoH263) && (nSlicesize)) { control.value = V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB; } else { control.value = V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE; } control.id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE; DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); multislice.mslice_mode=control.value; if (multislice.mslice_mode!=V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE) { control.id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB; control.value = nSlicesize; DEBUG_PRINT_LOW("Calling SLICE_MB IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); multislice.mslice_size=control.value; } return status; } bool venc_dev::venc_set_intra_refresh(OMX_VIDEO_INTRAREFRESHTYPE ir_mode, OMX_U32 irMBs) { bool status = true; int rc; struct v4l2_control control_mode,control_mbs; control_mode.id = V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_MODE; // There is no disabled mode. Disabled mode is indicated by a 0 count. if (irMBs == 0 || ir_mode == OMX_VIDEO_IntraRefreshMax) { control_mode.value = V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_NONE; return status; } else if ((ir_mode == OMX_VIDEO_IntraRefreshCyclic) && (irMBs < ((m_sVenc_cfg.input_width * m_sVenc_cfg.input_height)>>8))) { control_mode.value = V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_CYCLIC; control_mbs.id=V4L2_CID_MPEG_VIDC_VIDEO_CIR_MBS; control_mbs.value=irMBs; } else if ((ir_mode == OMX_VIDEO_IntraRefreshAdaptive) && (irMBs < ((m_sVenc_cfg.input_width * m_sVenc_cfg.input_height)>>8))) { control_mode.value = V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_ADAPTIVE; control_mbs.id=V4L2_CID_MPEG_VIDC_VIDEO_AIR_MBS; control_mbs.value=irMBs; } else if ((ir_mode == OMX_VIDEO_IntraRefreshBoth) && (irMBs < ((m_sVenc_cfg.input_width * m_sVenc_cfg.input_height)>>8))) { control_mode.value = V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_CYCLIC_ADAPTIVE; } else { DEBUG_PRINT_ERROR("\nERROR: Invalid IntraRefresh Parameters:" "mb count: %lu, mb mode:%d", irMBs, ir_mode); return false; } DEBUG_PRINT_LOW("Calling IOCTL set control for id=%lu, val=%lu\n", control_mode.id, control_mode.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control_mode); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control_mode.id, control_mode.value); DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control_mbs.id, control_mbs.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control_mbs); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control_mbs.id, control_mbs.value); intra_refresh.irmode = control_mode.value; intra_refresh.mbcount = control_mbs.value; return status; } bool venc_dev::venc_set_error_resilience(OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE* error_resilience) { bool status = true; struct venc_headerextension hec_cfg; struct venc_multiclicecfg multislice_cfg; int rc; struct v4l2_control control; memset(&control, 0, sizeof(control)); if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_MPEG4) { if (error_resilience->bEnableHEC) { hec_cfg.header_extension = 1; } else { hec_cfg.header_extension = 0; } hec.header_extension = error_resilience->bEnableHEC; } if (error_resilience->bEnableRVLC) { DEBUG_PRINT_ERROR("\n RVLC is not Supported"); return false; } if (( m_sVenc_cfg.codectype != V4L2_PIX_FMT_H263) && (error_resilience->bEnableDataPartitioning)) { DEBUG_PRINT_ERROR("\n DataPartioning are not Supported for MPEG4/H264"); return false; } if (( m_sVenc_cfg.codectype != V4L2_PIX_FMT_H263) && (error_resilience->nResynchMarkerSpacing)) { multislice_cfg.mslice_mode = VEN_MSLICE_CNT_BYTE; multislice_cfg.mslice_size = error_resilience->nResynchMarkerSpacing; control.id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE; control.value = V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES; } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H263 && error_resilience->bEnableDataPartitioning) { multislice_cfg.mslice_mode = VEN_MSLICE_GOB; multislice_cfg.mslice_size = error_resilience->nResynchMarkerSpacing; control.id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE; control.value = V4L2_MPEG_VIDEO_MULTI_SLICE_GOB; } else { multislice_cfg.mslice_mode = VEN_MSLICE_OFF; multislice_cfg.mslice_size = 0; control.id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE; control.value = V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE; } DEBUG_PRINT_LOW("\n %s(): mode = %u, size = %u", __func__, multislice_cfg.mslice_mode, multislice_cfg.mslice_size); printf("Calling IOCTL set control for id=%x, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { printf("Failed to set Slice mode control\n"); return false; } printf("Success IOCTL set control for id=%x, value=%d\n", control.id, control.value); multislice.mslice_mode=control.value; control.id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES; control.value = error_resilience->nResynchMarkerSpacing; printf("Calling IOCTL set control for id=%x, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { printf("Failed to set MAX MB control\n"); return false; } printf("Success IOCTL set control for id=%x, value=%d\n", control.id, control.value); multislice.mslice_mode = multislice_cfg.mslice_mode; multislice.mslice_size = multislice_cfg.mslice_size; return status; } bool venc_dev::venc_set_inloop_filter(OMX_VIDEO_AVCLOOPFILTERTYPE loopfilter) { int rc; struct v4l2_control control; control.id=V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE; if (loopfilter == OMX_VIDEO_AVCLoopFilterEnable) { control.value=V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED; } else if (loopfilter == OMX_VIDEO_AVCLoopFilterDisable) { control.value=V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED; } else if (loopfilter == OMX_VIDEO_AVCLoopFilterDisableSliceBoundary) { control.value=V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY; } DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); dbkfilter.db_mode=control.value; control.id=V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA; control.value=0; DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); control.id=V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA; control.value=0; DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); dbkfilter.slicealpha_offset = dbkfilter.slicebeta_offset = 0; return true; } bool venc_dev::venc_set_target_bitrate(OMX_U32 nTargetBitrate, OMX_U32 config) { DEBUG_PRINT_LOW("\n venc_set_target_bitrate: bitrate = %u", nTargetBitrate); struct v4l2_control control; int rc = 0; control.id = V4L2_CID_MPEG_VIDEO_BITRATE; control.value = nTargetBitrate; DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); m_sVenc_cfg.targetbitrate = control.value; bitrate.target_bitrate = control.value; if (!config) { m_level_set = false; if (venc_set_profile_level(0, 0)) { DEBUG_PRINT_HIGH("Calling set level (Bitrate) with %lu\n",profile_level.level); } } return true; } bool venc_dev::venc_set_encode_framerate(OMX_U32 encode_framerate, OMX_U32 config) { struct v4l2_streamparm parm; int rc = 0; struct venc_framerate frame_rate_cfg; Q16ToFraction(encode_framerate,frame_rate_cfg.fps_numerator,frame_rate_cfg.fps_denominator); parm.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; parm.parm.output.timeperframe.numerator = frame_rate_cfg.fps_denominator; parm.parm.output.timeperframe.denominator = frame_rate_cfg.fps_numerator; if (frame_rate_cfg.fps_numerator > 0) rc = ioctl(m_nDriver_fd, VIDIOC_S_PARM, &parm); if (rc) { DEBUG_PRINT_ERROR("ERROR: Request for setting framerate failed\n"); return false; } m_sVenc_cfg.fps_den = frame_rate_cfg.fps_denominator; m_sVenc_cfg.fps_num = frame_rate_cfg.fps_numerator; if (!config) { m_level_set = false; if (venc_set_profile_level(0, 0)) { DEBUG_PRINT_HIGH("Calling set level (Framerate) with %lu\n",profile_level.level); } } return true; } bool venc_dev::venc_set_color_format(OMX_COLOR_FORMATTYPE color_format) { struct v4l2_format fmt; DEBUG_PRINT_LOW("\n venc_set_color_format: color_format = %u ", color_format); if (color_format == OMX_COLOR_FormatYUV420SemiPlanar || color_format == QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m) { m_sVenc_cfg.inputformat = V4L2_PIX_FMT_NV12; } else if (color_format == QOMX_COLOR_FormatYVU420SemiPlanar) { m_sVenc_cfg.inputformat = V4L2_PIX_FMT_NV21; } else { DEBUG_PRINT_ERROR("\nWARNING: Unsupported Color format [%d]", color_format); m_sVenc_cfg.inputformat = V4L2_PIX_FMT_NV12; DEBUG_PRINT_HIGH("\n Default color format YUV420SemiPlanar is set"); } fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; fmt.fmt.pix_mp.pixelformat = m_sVenc_cfg.inputformat; fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height; fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width; if (ioctl(m_nDriver_fd, VIDIOC_S_FMT, &fmt)) { DEBUG_PRINT_ERROR("Failed setting color format %x", color_format); return false; } return true; } bool venc_dev::venc_set_intra_vop_refresh(OMX_BOOL intra_vop_refresh) { DEBUG_PRINT_LOW("\n venc_set_intra_vop_refresh: intra_vop = %uc", intra_vop_refresh); if (intra_vop_refresh == OMX_TRUE) { struct v4l2_control control; int rc; control.id = V4L2_CID_MPEG_VIDC_VIDEO_REQUEST_IFRAME; control.value = 1; printf("Calling IOCTL set control for id=%x, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { printf("Failed to set Intra Frame Request control\n"); return false; } printf("Success IOCTL set control for id=%x, value=%d\n", control.id, control.value); } else { DEBUG_PRINT_ERROR("\nERROR: VOP Refresh is False, no effect"); } return true; } bool venc_dev::venc_set_ratectrl_cfg(OMX_VIDEO_CONTROLRATETYPE eControlRate) { bool status = true; struct v4l2_control control; int rc = 0; control.id = V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL; switch (eControlRate) { case OMX_Video_ControlRateDisable: control.value=V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_OFF; break; case OMX_Video_ControlRateVariableSkipFrames: control.value=V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_VBR_VFR; break; case OMX_Video_ControlRateVariable: control.value=V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_VBR_CFR; break; case OMX_Video_ControlRateConstantSkipFrames: control.value=V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_CBR_VFR; break; case OMX_Video_ControlRateConstant: control.value=V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_CBR_CFR; break; default: status = false; break; } if (status) { DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value); rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control); if (rc) { DEBUG_PRINT_ERROR("Failed to set control\n"); return false; } DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value); rate_ctrl.rcmode = control.value; } return status; } bool venc_dev::venc_get_profile_level(OMX_U32 *eProfile,OMX_U32 *eLevel) { bool status = true; if (eProfile == NULL || eLevel == NULL) { return false; } if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_MPEG4) { switch (codec_profile.profile) { case V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE: *eProfile = OMX_VIDEO_MPEG4ProfileSimple; break; case V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE: *eProfile = OMX_VIDEO_MPEG4ProfileAdvancedSimple; break; default: *eProfile = OMX_VIDEO_MPEG4ProfileMax; status = false; break; } if (!status) { return status; } //profile level switch (profile_level.level) { case V4L2_MPEG_VIDEO_MPEG4_LEVEL_0: *eLevel = OMX_VIDEO_MPEG4Level0; break; case V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B: *eLevel = OMX_VIDEO_MPEG4Level0b; break; case V4L2_MPEG_VIDEO_MPEG4_LEVEL_1: *eLevel = OMX_VIDEO_MPEG4Level1; break; case V4L2_MPEG_VIDEO_MPEG4_LEVEL_2: *eLevel = OMX_VIDEO_MPEG4Level2; break; case V4L2_MPEG_VIDEO_MPEG4_LEVEL_3: *eLevel = OMX_VIDEO_MPEG4Level3; break; case V4L2_MPEG_VIDEO_MPEG4_LEVEL_4: *eLevel = OMX_VIDEO_MPEG4Level4; break; case V4L2_MPEG_VIDEO_MPEG4_LEVEL_5: *eLevel = OMX_VIDEO_MPEG4Level5; break; default: *eLevel = OMX_VIDEO_MPEG4LevelMax; status = false; break; } } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H263) { if (codec_profile.profile == VEN_PROFILE_H263_BASELINE) { *eProfile = OMX_VIDEO_H263ProfileBaseline; } else { *eProfile = OMX_VIDEO_H263ProfileMax; return false; } switch (profile_level.level) { case VEN_LEVEL_H263_10: *eLevel = OMX_VIDEO_H263Level10; break; case VEN_LEVEL_H263_20: *eLevel = OMX_VIDEO_H263Level20; break; case VEN_LEVEL_H263_30: *eLevel = OMX_VIDEO_H263Level30; break; case VEN_LEVEL_H263_40: *eLevel = OMX_VIDEO_H263Level40; break; case VEN_LEVEL_H263_45: *eLevel = OMX_VIDEO_H263Level45; break; case VEN_LEVEL_H263_50: *eLevel = OMX_VIDEO_H263Level50; break; case VEN_LEVEL_H263_60: *eLevel = OMX_VIDEO_H263Level60; break; case VEN_LEVEL_H263_70: *eLevel = OMX_VIDEO_H263Level70; break; default: *eLevel = OMX_VIDEO_H263LevelMax; status = false; break; } } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264) { switch (codec_profile.profile) { case V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE: *eProfile = OMX_VIDEO_AVCProfileBaseline; break; case V4L2_MPEG_VIDEO_H264_PROFILE_MAIN: *eProfile = OMX_VIDEO_AVCProfileMain; break; case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH: *eProfile = OMX_VIDEO_AVCProfileHigh; break; case V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED: *eProfile = OMX_VIDEO_AVCProfileExtended; break; case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10: *eProfile = OMX_VIDEO_AVCProfileHigh10; break; case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422: *eProfile = OMX_VIDEO_AVCProfileHigh422; break; case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE: *eProfile = OMX_VIDEO_AVCProfileHigh444; break; default: *eProfile = OMX_VIDEO_AVCProfileMax; status = false; break; } if (!status) { return status; } switch (profile_level.level) { case V4L2_MPEG_VIDEO_H264_LEVEL_1_0: *eLevel = OMX_VIDEO_AVCLevel1; break; case V4L2_MPEG_VIDEO_H264_LEVEL_1B: *eLevel = OMX_VIDEO_AVCLevel1b; break; case V4L2_MPEG_VIDEO_H264_LEVEL_1_1: *eLevel = OMX_VIDEO_AVCLevel11; break; case V4L2_MPEG_VIDEO_H264_LEVEL_1_2: *eLevel = OMX_VIDEO_AVCLevel12; break; case V4L2_MPEG_VIDEO_H264_LEVEL_1_3: *eLevel = OMX_VIDEO_AVCLevel13; break; case V4L2_MPEG_VIDEO_H264_LEVEL_2_0: *eLevel = OMX_VIDEO_AVCLevel2; break; case V4L2_MPEG_VIDEO_H264_LEVEL_2_1: *eLevel = OMX_VIDEO_AVCLevel21; break; case V4L2_MPEG_VIDEO_H264_LEVEL_2_2: *eLevel = OMX_VIDEO_AVCLevel22; break; case V4L2_MPEG_VIDEO_H264_LEVEL_3_0: *eLevel = OMX_VIDEO_AVCLevel3; break; case V4L2_MPEG_VIDEO_H264_LEVEL_3_1: *eLevel = OMX_VIDEO_AVCLevel31; break; case V4L2_MPEG_VIDEO_H264_LEVEL_3_2: *eLevel = OMX_VIDEO_AVCLevel32; break; case V4L2_MPEG_VIDEO_H264_LEVEL_4_0: *eLevel = OMX_VIDEO_AVCLevel4; break; case V4L2_MPEG_VIDEO_H264_LEVEL_4_1: *eLevel = OMX_VIDEO_AVCLevel41; break; case V4L2_MPEG_VIDEO_H264_LEVEL_4_2: *eLevel = OMX_VIDEO_AVCLevel42; break; case V4L2_MPEG_VIDEO_H264_LEVEL_5_0: *eLevel = OMX_VIDEO_AVCLevel5; break; case V4L2_MPEG_VIDEO_H264_LEVEL_5_1: *eLevel = OMX_VIDEO_AVCLevel51; break; default : *eLevel = OMX_VIDEO_AVCLevelMax; status = false; break; } } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_VP8) { switch (codec_profile.profile) { case V4L2_MPEG_VIDC_VIDEO_VP8_UNUSED: *eProfile = OMX_VIDEO_VP8ProfileMain; break; default: *eProfile = OMX_VIDEO_VP8ProfileMax; status = false; break; } if (!status) { return status; } switch (profile_level.level) { case V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_0: *eLevel = OMX_VIDEO_VP8Level_Version0; break; case V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_1: *eLevel = OMX_VIDEO_VP8Level_Version1; break; default: *eLevel = OMX_VIDEO_VP8LevelMax; status = false; break; } } return status; } bool venc_dev::venc_validate_profile_level(OMX_U32 *eProfile, OMX_U32 *eLevel) { OMX_U32 new_profile = 0, new_level = 0; unsigned const int *profile_tbl = NULL; OMX_U32 mb_per_frame, mb_per_sec; bool profile_level_found = false; DEBUG_PRINT_LOW("\n Init profile table for respective codec"); //validate the ht,width,fps,bitrate and set the appropriate profile and level if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_MPEG4) { if (*eProfile == 0) { if (!m_profile_set) { *eProfile = OMX_VIDEO_MPEG4ProfileSimple; } else { switch (codec_profile.profile) { case V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE: *eProfile = OMX_VIDEO_MPEG4ProfileAdvancedSimple; break; case V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE: *eProfile = OMX_VIDEO_MPEG4ProfileSimple; break; default: DEBUG_PRINT_LOW("\n %s(): Unknown Error", __func__); return false; } } } if (*eLevel == 0 && !m_level_set) { *eLevel = OMX_VIDEO_MPEG4LevelMax; } if (*eProfile == OMX_VIDEO_MPEG4ProfileSimple) { profile_tbl = (unsigned int const *)mpeg4_profile_level_table; } else if (*eProfile == OMX_VIDEO_MPEG4ProfileAdvancedSimple) { profile_tbl = (unsigned int const *) (&mpeg4_profile_level_table[MPEG4_ASP_START]); } else { DEBUG_PRINT_LOW("\n Unsupported MPEG4 profile type %lu", *eProfile); return false; } } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264) { if (*eProfile == 0) { if (!m_profile_set) { *eProfile = OMX_VIDEO_AVCProfileBaseline; } else { switch (codec_profile.profile) { case V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE: *eProfile = OMX_VIDEO_AVCProfileBaseline; break; case V4L2_MPEG_VIDEO_H264_PROFILE_MAIN: *eProfile = OMX_VIDEO_AVCProfileMain; break; case V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED: *eProfile = OMX_VIDEO_AVCProfileExtended; break; case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH: *eProfile = OMX_VIDEO_AVCProfileHigh; break; case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10: *eProfile = OMX_VIDEO_AVCProfileHigh10; break; case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422: *eProfile = OMX_VIDEO_AVCProfileHigh422; break; case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE: *eProfile = OMX_VIDEO_AVCProfileHigh444; break; default: DEBUG_PRINT_LOW("\n %s(): Unknown Error", __func__); return false; } } } if (*eLevel == 0 && !m_level_set) { *eLevel = OMX_VIDEO_AVCLevelMax; } if (*eProfile == OMX_VIDEO_AVCProfileBaseline) { profile_tbl = (unsigned int const *)h264_profile_level_table; } else if (*eProfile == OMX_VIDEO_AVCProfileHigh) { profile_tbl = (unsigned int const *) (&h264_profile_level_table[H264_HP_START]); } else if (*eProfile == OMX_VIDEO_AVCProfileMain) { profile_tbl = (unsigned int const *) (&h264_profile_level_table[H264_MP_START]); } else { DEBUG_PRINT_LOW("\n Unsupported AVC profile type %lu", *eProfile); return false; } } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H263) { if (*eProfile == 0) { if (!m_profile_set) { *eProfile = OMX_VIDEO_H263ProfileBaseline; } else { switch (codec_profile.profile) { case VEN_PROFILE_H263_BASELINE: *eProfile = OMX_VIDEO_H263ProfileBaseline; break; default: DEBUG_PRINT_LOW("\n %s(): Unknown Error", __func__); return false; } } } if (*eLevel == 0 && !m_level_set) { *eLevel = OMX_VIDEO_H263LevelMax; } if (*eProfile == OMX_VIDEO_H263ProfileBaseline) { profile_tbl = (unsigned int const *)h263_profile_level_table; } else { DEBUG_PRINT_LOW("\n Unsupported H.263 profile type %lu", *eProfile); return false; } } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_VP8) { if (*eProfile == 0) { *eProfile = OMX_VIDEO_VP8ProfileMain; } else { switch (codec_profile.profile) { case V4L2_MPEG_VIDC_VIDEO_VP8_UNUSED: *eProfile = OMX_VIDEO_VP8ProfileMain; break; default: DEBUG_PRINT_ERROR("\n %s(): Unknown VP8 profile", __func__); return false; } } if (*eLevel == 0) { switch (profile_level.level) { case V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_0: *eLevel = OMX_VIDEO_VP8Level_Version0; break; case V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_1: *eLevel = OMX_VIDEO_VP8Level_Version1; break; default: DEBUG_PRINT_ERROR("\n %s(): Unknown VP8 level", __func__); return false; } } return true; } else { DEBUG_PRINT_LOW("\n Invalid codec type"); return false; } mb_per_frame = ((m_sVenc_cfg.input_height + 15) >> 4)* ((m_sVenc_cfg.input_width + 15)>> 4); if ((mb_per_frame >= 3600) && (m_sVenc_cfg.codectype == (unsigned long) V4L2_PIX_FMT_MPEG4)) { if (codec_profile.profile == (unsigned long) V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE) profile_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_5; if (codec_profile.profile == (unsigned long) V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE) profile_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_5; { new_level = profile_level.level; new_profile = codec_profile.profile; return true; } } mb_per_sec = mb_per_frame * m_sVenc_cfg.fps_num / m_sVenc_cfg.fps_den; do { if (mb_per_frame <= (unsigned int)profile_tbl[0]) { if (mb_per_sec <= (unsigned int)profile_tbl[1]) { if (m_sVenc_cfg.targetbitrate <= (unsigned int)profile_tbl[2]) { new_level = (int)profile_tbl[3]; new_profile = (int)profile_tbl[4]; profile_level_found = true; DEBUG_PRINT_LOW("\n Appropriate profile/level found %d/%d\n", new_profile, new_level); break; } } } profile_tbl = profile_tbl + 5; } while (profile_tbl[0] != 0); if (profile_level_found != true) { DEBUG_PRINT_LOW("\n ERROR: Unsupported profile/level\n"); return false; } if ((*eLevel == OMX_VIDEO_MPEG4LevelMax) || (*eLevel == OMX_VIDEO_AVCLevelMax) || (*eLevel == OMX_VIDEO_H263LevelMax || (*eLevel == OMX_VIDEO_VP8ProfileMax))) { *eLevel = new_level; } DEBUG_PRINT_LOW("%s: Returning with eProfile = %lu\n" "Level = %lu", __func__, *eProfile, *eLevel); return true; } #ifdef _ANDROID_ICS_ bool venc_dev::venc_set_meta_mode(bool mode) { metadatamode = 1; return true; } #endif bool venc_dev::venc_is_video_session_supported(unsigned long width, unsigned long height) { if ((width * height < capability.min_width * capability.min_height) || (width * height > capability.max_width * capability.max_height)) { DEBUG_PRINT_ERROR( "Unsupported video resolution WxH = (%d)x(%d) supported range = min (%d)x(%d) - max (%d)x(%d)\n", width, height, capability.min_width, capability.min_height, capability.max_width, capability.max_height); return false; } DEBUG_PRINT_LOW("\n video session supported\n"); return true; }
indashnet/InDashNet.Open.UN2000
android/hardware/qcom/media/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
C++
apache-2.0
128,310
# Aglaia marginata Craib SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Sapindales/Meliaceae/Aglaia/Aglaia marginata/README.md
Markdown
apache-2.0
172
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="de"> <head> <!-- Generated by javadoc (1.8.0_231) on Sun Nov 17 02:10:24 CET 2019 --> <title>Serialized Form</title> <meta name="date" content="2019-11-17"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script type="text/javascript" src="script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Serialized Form"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="overview-tree.html">Tree</a></li> <li><a href="deprecated-list.html">Deprecated</a></li> <li><a href="index-files/index-1.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?serialized-form.html" target="_top">Frames</a></li> <li><a href="serialized-form.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 title="Serialized Form" class="title">Serialized Form</h1> </div> <div class="serializedFormContainer"> <ul class="blockList"> <li class="blockList"> <h2 title="Package">Package&nbsp;org.deidentifier.arx</h2> <ul class="blockList"> <li class="blockList"><a name="org.deidentifier.arx.ARXClassificationConfiguration"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/ARXClassificationConfiguration.html" title="class in org.deidentifier.arx">org.deidentifier.arx.ARXClassificationConfiguration</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-8751059558718015927L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>deterministic</h4> <pre>boolean deterministic</pre> <div class="block">Deterministic</div> </li> <li class="blockList"> <h4>maxRecords</h4> <pre>int maxRecords</pre> <div class="block">Max records</div> </li> <li class="blockList"> <h4>numberOfFolds</h4> <pre>int numberOfFolds</pre> <div class="block">Folds</div> </li> <li class="blockList"> <h4>seed</h4> <pre>long seed</pre> <div class="block">Seed</div> </li> <li class="blockList"> <h4>vectorLength</h4> <pre>int vectorLength</pre> <div class="block">Configuration</div> </li> <li class="blockListLast"> <h4>modified</h4> <pre>boolean modified</pre> <div class="block">Modified</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.ARXConfiguration"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/ARXConfiguration.html" title="class in org.deidentifier.arx">org.deidentifier.arx.ARXConfiguration</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-6713510386735241964L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>absMaxOutliers</h4> <pre>int absMaxOutliers</pre> <div class="block">Absolute suppression limit.</div> </li> <li class="blockList"> <h4>aCriteria</h4> <pre><a href="org/deidentifier/arx/criteria/PrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">PrivacyCriterion</a>[] aCriteria</pre> <div class="block">Criteria.</div> </li> <li class="blockList"> <h4>bCriteria</h4> <pre><a href="org/deidentifier/arx/criteria/SampleBasedCriterion.html" title="class in org.deidentifier.arx.criteria">SampleBasedCriterion</a>[] bCriteria</pre> <div class="block">Criteria.</div> </li> <li class="blockList"> <h4>attributeWeights</h4> <pre>java.util.Map&lt;K,V&gt; attributeWeights</pre> <div class="block">A map of weights per attribute.</div> </li> <li class="blockList"> <h4>criteria</h4> <pre>java.util.Set&lt;E&gt; criteria</pre> <div class="block">The criteria.</div> </li> <li class="blockList"> <h4>metric</h4> <pre><a href="org/deidentifier/arx/metric/Metric.html" title="class in org.deidentifier.arx.metric">Metric</a>&lt;<a href="org/deidentifier/arx/metric/Metric.html" title="type parameter in Metric">T</a> extends <a href="org/deidentifier/arx/metric/InformationLoss.html" title="class in org.deidentifier.arx.metric">InformationLoss</a>&lt;?&gt;&gt; metric</pre> <div class="block">The metric.</div> </li> <li class="blockList"> <h4>practicalMonotonicity</h4> <pre>boolean practicalMonotonicity</pre> <div class="block">Do we assume practical monotonicity.</div> </li> <li class="blockList"> <h4>relMaxOutliers</h4> <pre>double relMaxOutliers</pre> <div class="block">Relative tuple outliers.</div> </li> <li class="blockList"> <h4>requirements</h4> <pre>int requirements</pre> <div class="block">The requirements per equivalence class.</div> </li> <li class="blockList"> <h4>snapshotLength</h4> <pre>int snapshotLength</pre> <div class="block">The snapshot length.</div> </li> <li class="blockList"> <h4>suppressedAttributeTypes</h4> <pre>java.lang.Integer suppressedAttributeTypes</pre> <div class="block">Defines values of which attribute type are to be replaced by the suppression string in suppressed tuples.</div> </li> <li class="blockList"> <h4>suppressionAlwaysEnabled</h4> <pre>java.lang.Boolean suppressionAlwaysEnabled</pre> <div class="block">Determines whether suppression is applied to the output of anonymous as well as non-anonymous transformations.</div> </li> <li class="blockList"> <h4>heuristicSearchForSampleBasedCriteria</h4> <pre>boolean heuristicSearchForSampleBasedCriteria</pre> <div class="block">Are we performing optimal anonymization for sample-based criteria?</div> </li> <li class="blockList"> <h4>heuristicSearchEnabled</h4> <pre>boolean heuristicSearchEnabled</pre> <div class="block">Should we use the heuristic search algorithm?</div> </li> <li class="blockList"> <h4>heuristicSearchThreshold</h4> <pre>java.lang.Integer heuristicSearchThreshold</pre> <div class="block">We will use the heuristic algorithm, if the size of the search space exceeds this threshold</div> </li> <li class="blockList"> <h4>heuristicSearchTimeLimit</h4> <pre>java.lang.Integer heuristicSearchTimeLimit</pre> <div class="block">The heuristic algorithm will terminate after the given time limit</div> </li> <li class="blockList"> <h4>heuristicSearchStepLimit</h4> <pre>java.lang.Integer heuristicSearchStepLimit</pre> <div class="block">The heuristic algorithm will terminate after the given number of search steps</div> </li> <li class="blockList"> <h4>costBenefitConfiguration</h4> <pre><a href="org/deidentifier/arx/ARXCostBenefitConfiguration.html" title="class in org.deidentifier.arx">ARXCostBenefitConfiguration</a> costBenefitConfiguration</pre> <div class="block">Cost/benefit configuration</div> </li> <li class="blockList"> <h4>dpSearchBudget</h4> <pre>java.lang.Double dpSearchBudget</pre> <div class="block">The privacy budget to use for the data-dependent differential privacy search algorithm</div> </li> <li class="blockList"> <h4>numOutputRecords</h4> <pre>int numOutputRecords</pre> <div class="block">Number of output records</div> </li> <li class="blockListLast"> <h4>searchStepSemantics</h4> <pre><a href="org/deidentifier/arx/ARXConfiguration.SearchStepSemantics.html" title="enum in org.deidentifier.arx">ARXConfiguration.SearchStepSemantics</a> searchStepSemantics</pre> <div class="block">Semantics of heuristic search steps</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.ARXCostBenefitConfiguration"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/ARXCostBenefitConfiguration.html" title="class in org.deidentifier.arx">org.deidentifier.arx.ARXCostBenefitConfiguration</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-560679186676701860L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>publisherBenefit</h4> <pre>double publisherBenefit</pre> <div class="block">Basic parameters</div> </li> <li class="blockList"> <h4>publisherLoss</h4> <pre>double publisherLoss</pre> <div class="block">Basic parameters</div> </li> <li class="blockList"> <h4>adversaryGain</h4> <pre>double adversaryGain</pre> <div class="block">Basic parameters</div> </li> <li class="blockListLast"> <h4>adversaryCost</h4> <pre>double adversaryCost</pre> <div class="block">Basic parameters</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.ARXFeatureScaling"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/ARXFeatureScaling.html" title="class in org.deidentifier.arx">org.deidentifier.arx.ARXFeatureScaling</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5844012255436186950L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>functions</h4> <pre>java.util.Map&lt;K,V&gt; functions</pre> <div class="block">Functions for feature scaling</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.ARXLattice"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/ARXLattice.html" title="class in org.deidentifier.arx">org.deidentifier.arx.ARXLattice</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-8790104959905019184L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialization Methods</h3> <ul class="blockList"> <li class="blockListLast"> <h4>readObject</h4> <pre>private&nbsp;void&nbsp;readObject(java.io.ObjectInputStream&nbsp;aInputStream) throws java.lang.ClassNotFoundException, java.io.IOException</pre> <div class="block">De-serialization.</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.ClassNotFoundException</code></dd> <dd><code>java.io.IOException</code></dd> </dl> </li> </ul> </li> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>access</h4> <pre><a href="org/deidentifier/arx/ARXLattice.Access.html" title="class in org.deidentifier.arx">ARXLattice.Access</a> access</pre> <div class="block">The accessor.</div> </li> <li class="blockList"> <h4>metric</h4> <pre><a href="org/deidentifier/arx/metric/Metric.html" title="class in org.deidentifier.arx.metric">Metric</a>&lt;<a href="org/deidentifier/arx/metric/Metric.html" title="type parameter in Metric">T</a> extends <a href="org/deidentifier/arx/metric/InformationLoss.html" title="class in org.deidentifier.arx.metric">InformationLoss</a>&lt;?&gt;&gt; metric</pre> <div class="block">Metric.</div> </li> <li class="blockList"> <h4>size</h4> <pre>int size</pre> <div class="block">The number of nodes.</div> </li> <li class="blockList"> <h4>virtualSize</h4> <pre>java.lang.Long virtualSize</pre> <div class="block">The virtual size: TODO: Legacy field. Remove later.</div> </li> <li class="blockList"> <h4>virtualSizeLargeLattice</h4> <pre>java.math.BigInteger virtualSizeLargeLattice</pre> <div class="block">The virtual size</div> </li> <li class="blockList"> <h4>uncertainty</h4> <pre>boolean uncertainty</pre> <div class="block">Is practical monotonicity being assumed.</div> </li> <li class="blockList"> <h4>complete</h4> <pre>java.lang.Boolean complete</pre> <div class="block">Kept only for backwards compatibility</div> </li> <li class="blockList"> <h4>monotonicAnonymous</h4> <pre>boolean monotonicAnonymous</pre> <div class="block">Monotonicity of information loss.</div> </li> <li class="blockList"> <h4>monotonicNonAnonymous</h4> <pre>boolean monotonicNonAnonymous</pre> <div class="block">Monotonicity of information loss.</div> </li> <li class="blockList"> <h4>minimumInformationLoss</h4> <pre><a href="org/deidentifier/arx/metric/InformationLoss.html" title="class in org.deidentifier.arx.metric">InformationLoss</a>&lt;<a href="org/deidentifier/arx/metric/InformationLoss.html" title="type parameter in InformationLoss">T</a>&gt; minimumInformationLoss</pre> <div class="block">Minimum loss in the lattice.</div> </li> <li class="blockListLast"> <h4>maximumInformationLoss</h4> <pre><a href="org/deidentifier/arx/metric/InformationLoss.html" title="class in org.deidentifier.arx.metric">InformationLoss</a>&lt;<a href="org/deidentifier/arx/metric/InformationLoss.html" title="type parameter in InformationLoss">T</a>&gt; maximumInformationLoss</pre> <div class="block">Maximum loss in the lattice.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.ARXLattice.Access"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/ARXLattice.Access.html" title="class in org.deidentifier.arx">org.deidentifier.arx.ARXLattice.Access</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>6654627605797832468L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>lattice</h4> <pre><a href="org/deidentifier/arx/ARXLattice.html" title="class in org.deidentifier.arx">ARXLattice</a> lattice</pre> <div class="block">Lattice</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.ARXPopulationModel"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/ARXPopulationModel.html" title="class in org.deidentifier.arx">org.deidentifier.arx.ARXPopulationModel</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>6331644478717881214L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>region</h4> <pre><a href="org/deidentifier/arx/ARXPopulationModel.Region.html" title="enum in org.deidentifier.arx">ARXPopulationModel.Region</a> region</pre> <div class="block">The region</div> </li> <li class="blockList"> <h4>sampleFraction</h4> <pre>double sampleFraction</pre> <div class="block">TODO: This field is here for backwards compatibility only!</div> </li> <li class="blockListLast"> <h4>populationSize</h4> <pre>java.lang.Long populationSize</pre> <div class="block">The sample fraction</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.ARXProcessStatistics"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/ARXProcessStatistics.html" title="class in org.deidentifier.arx">org.deidentifier.arx.ARXProcessStatistics</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7984648262848553971L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>steps</h4> <pre>java.util.List&lt;E&gt; steps</pre> <div class="block">List of steps performed</div> </li> <li class="blockList"> <h4>transformationsTotal</h4> <pre>long transformationsTotal</pre> <div class="block">Total transformations available in this step</div> </li> <li class="blockList"> <h4>transformationsTotalLargeLattice</h4> <pre>java.math.BigInteger transformationsTotalLargeLattice</pre> <div class="block">Total transformations available in this step</div> </li> <li class="blockList"> <h4>transformationsChecked</h4> <pre>long transformationsChecked</pre> <div class="block">Transformations checked in this step</div> </li> <li class="blockList"> <h4>initialNumberOfRecords</h4> <pre>int initialNumberOfRecords</pre> <div class="block">If known</div> </li> <li class="blockListLast"> <h4>duration</h4> <pre>long duration</pre> <div class="block">Duration</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.ARXProcessStatistics.Step"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/ARXProcessStatistics.Step.html" title="class in org.deidentifier.arx">org.deidentifier.arx.ARXProcessStatistics.Step</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7432752645871431439L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>transformation</h4> <pre>int[] transformation</pre> <div class="block">Transformation<?> selected in this step</div> </li> <li class="blockList"> <h4>top</h4> <pre>int[] top</pre> <div class="block">Top transformation available in this step</div> </li> <li class="blockList"> <h4>headermap</h4> <pre>java.util.Map&lt;K,V&gt; headermap</pre> <div class="block">Maps attributes to indices</div> </li> <li class="blockList"> <h4>score</h4> <pre><a href="org/deidentifier/arx/metric/InformationLoss.html" title="class in org.deidentifier.arx.metric">InformationLoss</a>&lt;<a href="org/deidentifier/arx/metric/InformationLoss.html" title="type parameter in InformationLoss">T</a>&gt; score</pre> <div class="block">Information loss at this step</div> </li> <li class="blockList"> <h4>numRecordsTransformed</h4> <pre>int numRecordsTransformed</pre> <div class="block">Number of records transformed in this step</div> </li> <li class="blockListLast"> <h4>optimal</h4> <pre>boolean optimal</pre> <div class="block">Is the solution optimal</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.ARXSolverConfiguration"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/ARXSolverConfiguration.html" title="class in org.deidentifier.arx">org.deidentifier.arx.ARXSolverConfiguration</a> extends de.linearbits.newtonraphson.NewtonRaphsonConfiguration&lt;<a href="org/deidentifier/arx/ARXSolverConfiguration.html" title="class in org.deidentifier.arx">ARXSolverConfiguration</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7122709349147064168L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>modified</h4> <pre>boolean modified</pre> <div class="block">Modified</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.AttributeType"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/AttributeType.html" title="class in org.deidentifier.arx">org.deidentifier.arx.AttributeType</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7358540408016873823L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>type</h4> <pre>int type</pre> <div class="block">The type.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.AttributeType.Hierarchy"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/AttributeType.Hierarchy.html" title="class in org.deidentifier.arx">org.deidentifier.arx.AttributeType.Hierarchy</a> extends <a href="org/deidentifier/arx/AttributeType.html" title="class in org.deidentifier.arx">AttributeType</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-4721439386792383385L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.AttributeType.Hierarchy.DefaultHierarchy"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/AttributeType.Hierarchy.DefaultHierarchy.html" title="class in org.deidentifier.arx">org.deidentifier.arx.AttributeType.Hierarchy.DefaultHierarchy</a> extends <a href="org/deidentifier/arx/AttributeType.Hierarchy.html" title="class in org.deidentifier.arx">AttributeType.Hierarchy</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>7493568420925738049L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialization Methods</h3> <ul class="blockList"> <li class="blockListLast"> <h4>readObject</h4> <pre>private&nbsp;void&nbsp;readObject(java.io.ObjectInputStream&nbsp;ois) throws java.lang.ClassNotFoundException, java.io.IOException</pre> <div class="block">This fixes a bug, where hierarchies which have been loaded from CSV files are trimmed but hierarchies which are deserialized are not. We fix this by implementing custom deserialization.</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.ClassNotFoundException</code></dd> <dd><code>java.io.IOException</code></dd> </dl> </li> </ul> </li> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>hierarchy</h4> <pre>java.util.List&lt;E&gt; hierarchy</pre> <div class="block">The raw data.</div> </li> <li class="blockListLast"> <h4>array</h4> <pre>java.lang.String[][] array</pre> <div class="block">The array.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.AttributeType.MicroAggregationFunction"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/AttributeType.MicroAggregationFunction.html" title="class in org.deidentifier.arx">org.deidentifier.arx.AttributeType.MicroAggregationFunction</a> extends <a href="org/deidentifier/arx/AttributeType.html" title="class in org.deidentifier.arx">AttributeType</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7175337291872533713L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>function</h4> <pre><a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.html" title="class in org.deidentifier.arx.framework.check.distribution">DistributionAggregateFunction</a> function</pre> <div class="block">The microaggregation function</div> </li> <li class="blockList"> <h4>requiredScale</h4> <pre><a href="org/deidentifier/arx/DataScale.html" title="enum in org.deidentifier.arx">DataScale</a> requiredScale</pre> <div class="block">The required scale</div> </li> <li class="blockListLast"> <h4>label</h4> <pre>java.lang.String label</pre> <div class="block">The label</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.AttributeType.MicroAggregationFunctionDescription"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/AttributeType.MicroAggregationFunctionDescription.html" title="class in org.deidentifier.arx">org.deidentifier.arx.AttributeType.MicroAggregationFunctionDescription</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-6608355532280843693L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>requiredScale</h4> <pre><a href="org/deidentifier/arx/DataScale.html" title="enum in org.deidentifier.arx">DataScale</a> requiredScale</pre> <div class="block">The required scale</div> </li> <li class="blockListLast"> <h4>label</h4> <pre>java.lang.String label</pre> <div class="block">The label</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.DataGeneralizationScheme"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/DataGeneralizationScheme.html" title="class in org.deidentifier.arx">org.deidentifier.arx.DataGeneralizationScheme</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-5402090022629905154L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>degrees</h4> <pre>java.util.Map&lt;K,V&gt; degrees</pre> <div class="block">Degrees</div> </li> <li class="blockList"> <h4>levels</h4> <pre>java.util.Map&lt;K,V&gt; levels</pre> <div class="block">Levels</div> </li> <li class="blockList"> <h4>degree</h4> <pre><a href="org/deidentifier/arx/DataGeneralizationScheme.GeneralizationDegree.html" title="enum in org.deidentifier.arx">DataGeneralizationScheme.GeneralizationDegree</a> degree</pre> <div class="block">Degree</div> </li> <li class="blockListLast"> <h4>attributes</h4> <pre>java.util.Set&lt;E&gt; attributes</pre> <div class="block">Data</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.DataSubset"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/DataSubset.html" title="class in org.deidentifier.arx">org.deidentifier.arx.DataSubset</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>3945730896172205344L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>set</h4> <pre><a href="org/deidentifier/arx/RowSet.html" title="class in org.deidentifier.arx">RowSet</a> set</pre> <div class="block">The subset as a bitset.</div> </li> <li class="blockListLast"> <h4>array</h4> <pre>int[] array</pre> <div class="block">The subset as a sorted array of indices.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.DataType"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/DataType.html" title="class in org.deidentifier.arx">org.deidentifier.arx.DataType</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-4380267779210935078L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.DataType.ARXDate"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/DataType.ARXDate.html" title="class in org.deidentifier.arx">org.deidentifier.arx.DataType.ARXDate</a> extends <a href="org/deidentifier/arx/DataType.html" title="class in org.deidentifier.arx">DataType</a>&lt;java.util.Date&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-1658470914184442833L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>format</h4> <pre>java.text.SimpleDateFormat format</pre> <div class="block">Format.</div> </li> <li class="blockList"> <h4>string</h4> <pre>java.lang.String string</pre> <div class="block">Format string.</div> </li> <li class="blockListLast"> <h4>locale</h4> <pre>java.util.Locale locale</pre> <div class="block">Locale.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.DataType.ARXDecimal"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/DataType.ARXDecimal.html" title="class in org.deidentifier.arx">org.deidentifier.arx.DataType.ARXDecimal</a> extends <a href="org/deidentifier/arx/DataType.html" title="class in org.deidentifier.arx">DataType</a>&lt;java.lang.Double&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>7293446977526103610L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>format</h4> <pre>java.text.DecimalFormat format</pre> <div class="block">Format.</div> </li> <li class="blockList"> <h4>string</h4> <pre>java.lang.String string</pre> <div class="block">Format string.</div> </li> <li class="blockListLast"> <h4>locale</h4> <pre>java.util.Locale locale</pre> <div class="block">Locale.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.DataType.ARXInteger"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/DataType.ARXInteger.html" title="class in org.deidentifier.arx">org.deidentifier.arx.DataType.ARXInteger</a> extends <a href="org/deidentifier/arx/DataType.html" title="class in org.deidentifier.arx">DataType</a>&lt;java.lang.Long&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-631163546929231044L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>format</h4> <pre>java.text.DecimalFormat format</pre> <div class="block">Format.</div> </li> <li class="blockList"> <h4>string</h4> <pre>java.lang.String string</pre> <div class="block">Format string.</div> </li> <li class="blockListLast"> <h4>locale</h4> <pre>java.util.Locale locale</pre> <div class="block">Locale.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.DataType.ARXOrderedString"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/DataType.ARXOrderedString.html" title="class in org.deidentifier.arx">org.deidentifier.arx.DataType.ARXOrderedString</a> extends <a href="org/deidentifier/arx/DataType.html" title="class in org.deidentifier.arx">DataType</a>&lt;java.lang.String&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-830897705078418835L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>order</h4> <pre>java.util.Map&lt;K,V&gt; order</pre> <div class="block">The defined order</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.DataType.ARXString"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/DataType.ARXString.html" title="class in org.deidentifier.arx">org.deidentifier.arx.DataType.ARXString</a> extends <a href="org/deidentifier/arx/DataType.html" title="class in org.deidentifier.arx">DataType</a>&lt;java.lang.String&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>903334212175979691L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.DataType.DataTypeDescription"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/DataType.DataTypeDescription.html" title="class in org.deidentifier.arx">org.deidentifier.arx.DataType.DataTypeDescription</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>6369986224526795419L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>clazz</h4> <pre>java.lang.Class&lt;T&gt; clazz</pre> <div class="block">The wrapped java class.</div> </li> <li class="blockList"> <h4>exampleFormats</h4> <pre>java.util.List&lt;E&gt; exampleFormats</pre> <div class="block">If yes, a list of available formats.</div> </li> <li class="blockList"> <h4>hasFormat</h4> <pre>boolean hasFormat</pre> <div class="block">Can the type be parameterized with a format string.</div> </li> <li class="blockList"> <h4>label</h4> <pre>java.lang.String label</pre> <div class="block">A human readable label.</div> </li> <li class="blockListLast"> <h4>scale</h4> <pre><a href="org/deidentifier/arx/DataScale.html" title="enum in org.deidentifier.arx">DataScale</a> scale</pre> <div class="block">The associated scale of measure</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.RowSet"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/RowSet.html" title="class in org.deidentifier.arx">org.deidentifier.arx.RowSet</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>1492499772279795327L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>array</h4> <pre>long[] array</pre> <div class="block">Array</div> </li> <li class="blockList"> <h4>length</h4> <pre>int length</pre> <div class="block">Length of array</div> </li> <li class="blockListLast"> <h4>size</h4> <pre>int size</pre> <div class="block">Number of bits set</div> </li> </ul> </li> </ul> </li> </ul> </li> <li class="blockList"> <h2 title="Package">Package&nbsp;org.deidentifier.arx.aggregates</h2> <ul class="blockList"> <li class="blockList"><a name="org.deidentifier.arx.aggregates.AggregateFunction"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.AggregateFunction</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>3803318906010996154L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>type</h4> <pre><a href="org/deidentifier/arx/DataType.html" title="class in org.deidentifier.arx">DataType</a>&lt;<a href="org/deidentifier/arx/DataType.html" title="type parameter in DataType">T</a>&gt; type</pre> <div class="block">The data type.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.AggregateFunction.AggregateFunctionWithParameter"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/AggregateFunction.AggregateFunctionWithParameter.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.AggregateFunction.AggregateFunctionWithParameter</a> extends <a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="class in org.deidentifier.arx.aggregates">AggregateFunction</a>&lt;<a href="org/deidentifier/arx/aggregates/AggregateFunction.AggregateFunctionWithParameter.html" title="type parameter in AggregateFunction.AggregateFunctionWithParameter">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>1L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.AggregateFunction.GenericArithmeticMean"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericArithmeticMean.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.AggregateFunction.GenericArithmeticMean</a> extends <a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="class in org.deidentifier.arx.aggregates">AggregateFunction</a>&lt;<a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericArithmeticMean.html" title="type parameter in AggregateFunction.GenericArithmeticMean">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-901667129625212217L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.AggregateFunction.GenericArithmeticMeanOfBounds"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericArithmeticMeanOfBounds.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.AggregateFunction.GenericArithmeticMeanOfBounds</a> extends <a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="class in org.deidentifier.arx.aggregates">AggregateFunction</a>&lt;<a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericArithmeticMeanOfBounds.html" title="type parameter in AggregateFunction.GenericArithmeticMeanOfBounds">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5067728720270473715L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.AggregateFunction.GenericBounds"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericBounds.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.AggregateFunction.GenericBounds</a> extends <a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="class in org.deidentifier.arx.aggregates">AggregateFunction</a>&lt;<a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericBounds.html" title="type parameter in AggregateFunction.GenericBounds">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-8884657842545379206L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.AggregateFunction.GenericCommonPrefix"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericCommonPrefix.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.AggregateFunction.GenericCommonPrefix</a> extends <a href="org/deidentifier/arx/aggregates/AggregateFunction.AggregateFunctionWithParameter.html" title="class in org.deidentifier.arx.aggregates">AggregateFunction.AggregateFunctionWithParameter</a>&lt;<a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericCommonPrefix.html" title="type parameter in AggregateFunction.GenericCommonPrefix">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>526809670467390820L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>redaction</h4> <pre>java.lang.Character redaction</pre> <div class="block">SVUID</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.AggregateFunction.GenericConstant"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericConstant.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.AggregateFunction.GenericConstant</a> extends <a href="org/deidentifier/arx/aggregates/AggregateFunction.AggregateFunctionWithParameter.html" title="class in org.deidentifier.arx.aggregates">AggregateFunction.AggregateFunctionWithParameter</a>&lt;<a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericConstant.html" title="type parameter in AggregateFunction.GenericConstant">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-8995068916108125096L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>value</h4> <pre>java.lang.String value</pre> <div class="block">SVUID</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.AggregateFunction.GenericGeometricMean"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericGeometricMean.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.AggregateFunction.GenericGeometricMean</a> extends <a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="class in org.deidentifier.arx.aggregates">AggregateFunction</a>&lt;<a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericGeometricMean.html" title="type parameter in AggregateFunction.GenericGeometricMean">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-1756610766270481335L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.AggregateFunction.GenericGeometricMeanOfBounds"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericGeometricMeanOfBounds.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.AggregateFunction.GenericGeometricMeanOfBounds</a> extends <a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="class in org.deidentifier.arx.aggregates">AggregateFunction</a>&lt;<a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericGeometricMeanOfBounds.html" title="type parameter in AggregateFunction.GenericGeometricMeanOfBounds">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>8155390779775522723L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.AggregateFunction.GenericInterval"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericInterval.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.AggregateFunction.GenericInterval</a> extends <a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="class in org.deidentifier.arx.aggregates">AggregateFunction</a>&lt;<a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericInterval.html" title="type parameter in AggregateFunction.GenericInterval">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-5182521036467379023L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>lowerIncluded</h4> <pre>boolean lowerIncluded</pre> <div class="block">SVUID</div> </li> <li class="blockListLast"> <h4>upperIncluded</h4> <pre>boolean upperIncluded</pre> <div class="block">SVUID</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.AggregateFunction.GenericSet"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericSet.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.AggregateFunction.GenericSet</a> extends <a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="class in org.deidentifier.arx.aggregates">AggregateFunction</a>&lt;<a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericSet.html" title="type parameter in AggregateFunction.GenericSet">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-4029191421720743653L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.AggregateFunction.GenericSetOfPrefixes"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericSetOfPrefixes.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.AggregateFunction.GenericSetOfPrefixes</a> extends <a href="org/deidentifier/arx/aggregates/AggregateFunction.AggregateFunctionWithParameter.html" title="class in org.deidentifier.arx.aggregates">AggregateFunction.AggregateFunctionWithParameter</a>&lt;<a href="org/deidentifier/arx/aggregates/AggregateFunction.GenericSetOfPrefixes.html" title="type parameter in AggregateFunction.GenericSetOfPrefixes">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-4164142474804296433L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>length</h4> <pre>int length</pre> <div class="block">SVUID</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.ClassificationConfigurationLogisticRegression"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/ClassificationConfigurationLogisticRegression.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.ClassificationConfigurationLogisticRegression</a> extends <a href="org/deidentifier/arx/ARXClassificationConfiguration.html" title="class in org.deidentifier.arx">ARXClassificationConfiguration</a>&lt;<a href="org/deidentifier/arx/aggregates/ClassificationConfigurationLogisticRegression.html" title="class in org.deidentifier.arx.aggregates">ClassificationConfigurationLogisticRegression</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7432423626032273246L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>alpha</h4> <pre>double alpha</pre> <div class="block">Configuration</div> </li> <li class="blockList"> <h4>decayExponent</h4> <pre>double decayExponent</pre> <div class="block">-1 equals even weighting of all examples, 0 means only use exponential annealing</div> </li> <li class="blockList"> <h4>lambda</h4> <pre>double lambda</pre> <div class="block">Configuration</div> </li> <li class="blockList"> <h4>learningRate</h4> <pre>double learningRate</pre> <div class="block">Configuration</div> </li> <li class="blockList"> <h4>stepOffset</h4> <pre>int stepOffset</pre> <div class="block">Configuration</div> </li> <li class="blockList"> <h4>vectorLength</h4> <pre>int vectorLength</pre> <div class="block">Configuration. TODO: We needed to replicate this here for backwards compatibility</div> </li> <li class="blockList"> <h4>maxRecords</h4> <pre>int maxRecords</pre> <div class="block">Max records TODO: We needed to replicate this here for backwards compatibility</div> </li> <li class="blockList"> <h4>seed</h4> <pre>int seed</pre> <div class="block">Seed TODO: We needed to replicate this here for backwards compatibility</div> </li> <li class="blockList"> <h4>numberOfFolds</h4> <pre>int numberOfFolds</pre> <div class="block">Folds TODO: We needed to replicate this here for backwards compatibility</div> </li> <li class="blockList"> <h4>deterministic</h4> <pre>boolean deterministic</pre> <div class="block">Deterministic TODO: We needed to replicate this here for backwards compatibility</div> </li> <li class="blockListLast"> <h4>prior</h4> <pre><a href="org/deidentifier/arx/aggregates/ClassificationConfigurationLogisticRegression.PriorFunction.html" title="enum in org.deidentifier.arx.aggregates">ClassificationConfigurationLogisticRegression.PriorFunction</a> prior</pre> <div class="block">Configuration</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.ClassificationConfigurationNaiveBayes"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/ClassificationConfigurationNaiveBayes.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.ClassificationConfigurationNaiveBayes</a> extends <a href="org/deidentifier/arx/ARXClassificationConfiguration.html" title="class in org.deidentifier.arx">ARXClassificationConfiguration</a>&lt;<a href="org/deidentifier/arx/aggregates/ClassificationConfigurationNaiveBayes.html" title="class in org.deidentifier.arx.aggregates">ClassificationConfigurationNaiveBayes</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5899021797968063868L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>type</h4> <pre><a href="org/deidentifier/arx/aggregates/ClassificationConfigurationNaiveBayes.Type.html" title="enum in org.deidentifier.arx.aggregates">ClassificationConfigurationNaiveBayes.Type</a> type</pre> <div class="block">Type</div> </li> <li class="blockListLast"> <h4>sigma</h4> <pre>double sigma</pre> <div class="block">Prior count</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.ClassificationConfigurationRandomForest"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/ClassificationConfigurationRandomForest.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.ClassificationConfigurationRandomForest</a> extends <a href="org/deidentifier/arx/ARXClassificationConfiguration.html" title="class in org.deidentifier.arx">ARXClassificationConfiguration</a>&lt;<a href="org/deidentifier/arx/aggregates/ClassificationConfigurationRandomForest.html" title="class in org.deidentifier.arx.aggregates">ClassificationConfigurationRandomForest</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>7928077920858462047L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>numberOfTrees</h4> <pre>int numberOfTrees</pre> <div class="block">Number of trees</div> </li> <li class="blockList"> <h4>numberOfVariablesToSplit</h4> <pre>int numberOfVariablesToSplit</pre> <div class="block">Number of variables to split: sqrt(#features) seems to provide good result</div> </li> <li class="blockList"> <h4>minimumSizeOfLeafNodes</h4> <pre>int minimumSizeOfLeafNodes</pre> <div class="block">Number of variables to split: sqrt(#features) seems to provide good result</div> </li> <li class="blockList"> <h4>maximumNumberOfLeafNodes</h4> <pre>int maximumNumberOfLeafNodes</pre> <div class="block">Number of variables to split: sqrt(#features) seems to provide good result</div> </li> <li class="blockList"> <h4>subsample</h4> <pre>double subsample</pre> <div class="block">1.0 = sampling with replacement; <1.0 = sampling without replacement</div> </li> <li class="blockListLast"> <h4>splitRule</h4> <pre><a href="org/deidentifier/arx/aggregates/ClassificationConfigurationRandomForest.SplitRule.html" title="enum in org.deidentifier.arx.aggregates">ClassificationConfigurationRandomForest.SplitRule</a> splitRule</pre> <div class="block">Split rule</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilder"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/HierarchyBuilder.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.HierarchyBuilder</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-4182364711973630816L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>type</h4> <pre><a href="org/deidentifier/arx/aggregates/HierarchyBuilder.Type.html" title="enum in org.deidentifier.arx.aggregates">HierarchyBuilder.Type</a> type</pre> <div class="block">The type.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilderDate"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/HierarchyBuilderDate.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.HierarchyBuilderDate</a> extends <a href="org/deidentifier/arx/aggregates/HierarchyBuilder.html" title="class in org.deidentifier.arx.aggregates">HierarchyBuilder</a>&lt;java.util.Date&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>6294885577802586286L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>granularities</h4> <pre><a href="org/deidentifier/arx/aggregates/HierarchyBuilderDate.Granularity.html" title="enum in org.deidentifier.arx.aggregates">HierarchyBuilderDate.Granularity</a>[] granularities</pre> <div class="block">Granularities</div> </li> <li class="blockList"> <h4>timeZone</h4> <pre>java.util.TimeZone timeZone</pre> <div class="block">Timezones</div> </li> <li class="blockList"> <h4>format</h4> <pre><a href="org/deidentifier/arx/aggregates/HierarchyBuilderDate.Format.html" title="class in org.deidentifier.arx.aggregates">HierarchyBuilderDate.Format</a> format</pre> <div class="block">Format</div> </li> <li class="blockList"> <h4>datatype</h4> <pre><a href="org/deidentifier/arx/DataType.ARXDate.html" title="class in org.deidentifier.arx">DataType.ARXDate</a> datatype</pre> <div class="block">Type</div> </li> <li class="blockList"> <h4>topCoding</h4> <pre>java.util.Date topCoding</pre> <div class="block">Top coding</div> </li> <li class="blockListLast"> <h4>bottomCoding</h4> <pre>java.util.Date bottomCoding</pre> <div class="block">Bottom coding</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilderDate.Format"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/HierarchyBuilderDate.Format.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.HierarchyBuilderDate.Format</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-4412882420968107563L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>map</h4> <pre>java.util.Map&lt;K,V&gt; map</pre> <div class="block">Map</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/HierarchyBuilderGroupingBased.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased</a> extends <a href="org/deidentifier/arx/aggregates/HierarchyBuilder.html" title="class in org.deidentifier.arx.aggregates">HierarchyBuilder</a>&lt;<a href="org/deidentifier/arx/aggregates/HierarchyBuilderGroupingBased.html" title="type parameter in HierarchyBuilderGroupingBased">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>3208791665131141362L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>groups</h4> <pre>java.util.Map&lt;K,V&gt; groups</pre> <div class="block">All fanouts for each level.</div> </li> <li class="blockList"> <h4>datatype</h4> <pre><a href="org/deidentifier/arx/DataType.html" title="class in org.deidentifier.arx">DataType</a>&lt;<a href="org/deidentifier/arx/DataType.html" title="type parameter in DataType">T</a>&gt; datatype</pre> <div class="block">The data type.</div> </li> <li class="blockListLast"> <h4>function</h4> <pre><a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="class in org.deidentifier.arx.aggregates">AggregateFunction</a>&lt;<a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="type parameter in AggregateFunction">T</a>&gt; function</pre> <div class="block">The default aggregate function, might be null.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased.AbstractGroup"> <!-- --> </a> <h3>Class org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased.AbstractGroup extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7657969446040078411L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>label</h4> <pre>java.lang.String label</pre> <div class="block">TODO</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased.Group"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/HierarchyBuilderGroupingBased.Group.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased.Group</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-5767501048737045793L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>size</h4> <pre>int size</pre> <div class="block">Fanout.</div> </li> <li class="blockListLast"> <h4>function</h4> <pre><a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="class in org.deidentifier.arx.aggregates">AggregateFunction</a>&lt;<a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="type parameter in AggregateFunction">T</a>&gt; function</pre> <div class="block">Aggregate function.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased.Level"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/HierarchyBuilderGroupingBased.Level.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased.Level</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>1410005675926162598L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>level</h4> <pre>int level</pre> <div class="block">Level.</div> </li> <li class="blockList"> <h4>list</h4> <pre>java.util.List&lt;E&gt; list</pre> <div class="block">List of groups.</div> </li> <li class="blockListLast"> <h4>builder</h4> <pre><a href="org/deidentifier/arx/aggregates/HierarchyBuilderGroupingBased.html" title="class in org.deidentifier.arx.aggregates">HierarchyBuilderGroupingBased</a>&lt;<a href="org/deidentifier/arx/aggregates/HierarchyBuilderGroupingBased.html" title="type parameter in HierarchyBuilderGroupingBased">T</a>&gt; builder</pre> <div class="block">Builder.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilderIntervalBased"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/HierarchyBuilderIntervalBased.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.HierarchyBuilderIntervalBased</a> extends <a href="org/deidentifier/arx/aggregates/HierarchyBuilderGroupingBased.html" title="class in org.deidentifier.arx.aggregates">HierarchyBuilderGroupingBased</a>&lt;<a href="org/deidentifier/arx/aggregates/HierarchyBuilderIntervalBased.html" title="type parameter in HierarchyBuilderIntervalBased">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>3663874945543082808L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>lowerRange</h4> <pre><a href="org/deidentifier/arx/aggregates/HierarchyBuilderIntervalBased.Range.html" title="class in org.deidentifier.arx.aggregates">HierarchyBuilderIntervalBased.Range</a>&lt;<a href="org/deidentifier/arx/aggregates/HierarchyBuilderIntervalBased.Range.html" title="type parameter in HierarchyBuilderIntervalBased.Range">U</a>&gt; lowerRange</pre> <div class="block">Adjustment.</div> </li> <li class="blockList"> <h4>upperRange</h4> <pre><a href="org/deidentifier/arx/aggregates/HierarchyBuilderIntervalBased.Range.html" title="class in org.deidentifier.arx.aggregates">HierarchyBuilderIntervalBased.Range</a>&lt;<a href="org/deidentifier/arx/aggregates/HierarchyBuilderIntervalBased.Range.html" title="type parameter in HierarchyBuilderIntervalBased.Range">U</a>&gt; upperRange</pre> <div class="block">Adjustment.</div> </li> <li class="blockListLast"> <h4>intervals</h4> <pre>java.util.List&lt;E&gt; intervals</pre> <div class="block">Defined intervals.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilderIntervalBased.IndexNode"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/HierarchyBuilderIntervalBased.IndexNode.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.HierarchyBuilderIntervalBased.IndexNode</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5985820929677249525L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>children</h4> <pre><a href="org/deidentifier/arx/aggregates/HierarchyBuilderIntervalBased.IndexNode.html" title="class in org.deidentifier.arx.aggregates">HierarchyBuilderIntervalBased.IndexNode</a>[] children</pre> <div class="block">Children.</div> </li> <li class="blockList"> <h4>isLeaf</h4> <pre>boolean isLeaf</pre> <div class="block">IsLeaf.</div> </li> <li class="blockList"> <h4>leafs</h4> <pre><a href="org/deidentifier/arx/aggregates/HierarchyBuilderIntervalBased.Interval.html" title="class in org.deidentifier.arx.aggregates">HierarchyBuilderIntervalBased.Interval</a>&lt;<a href="org/deidentifier/arx/aggregates/HierarchyBuilderIntervalBased.Interval.html" title="type parameter in HierarchyBuilderIntervalBased.Interval">T</a>&gt;[] leafs</pre> <div class="block">Leafs.</div> </li> <li class="blockList"> <h4>max</h4> <pre>java.lang.Object max</pre> <div class="block">Max is exclusive.</div> </li> <li class="blockListLast"> <h4>min</h4> <pre>java.lang.Object min</pre> <div class="block">Min is inclusive.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilderIntervalBased.Interval"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/HierarchyBuilderIntervalBased.Interval.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.HierarchyBuilderIntervalBased.Interval</a> extends org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased.AbstractGroup implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5985820929677249525L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>function</h4> <pre><a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="class in org.deidentifier.arx.aggregates">AggregateFunction</a>&lt;<a href="org/deidentifier/arx/aggregates/AggregateFunction.html" title="type parameter in AggregateFunction">T</a>&gt; function</pre> <div class="block">The function.</div> </li> <li class="blockList"> <h4>max</h4> <pre>java.lang.Object max</pre> <div class="block">Max is exclusive.</div> </li> <li class="blockList"> <h4>min</h4> <pre>java.lang.Object min</pre> <div class="block">Min is inclusive.</div> </li> <li class="blockList"> <h4>builder</h4> <pre><a href="org/deidentifier/arx/aggregates/HierarchyBuilderGroupingBased.html" title="class in org.deidentifier.arx.aggregates">HierarchyBuilderGroupingBased</a>&lt;<a href="org/deidentifier/arx/aggregates/HierarchyBuilderGroupingBased.html" title="type parameter in HierarchyBuilderGroupingBased">T</a>&gt; builder</pre> <div class="block">The builder.</div> </li> <li class="blockListLast"> <h4>lower</h4> <pre>java.lang.Boolean lower</pre> <div class="block">Null for normal intervals, true if <min, false if >max.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilderIntervalBased.Range"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/HierarchyBuilderIntervalBased.Range.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.HierarchyBuilderIntervalBased.Range</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-5385139177770612960L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>repeatBound</h4> <pre>java.lang.Object repeatBound</pre> <div class="block">Snap from.</div> </li> <li class="blockList"> <h4>snapBound</h4> <pre>java.lang.Object snapBound</pre> <div class="block">Bottom/top coding from.</div> </li> <li class="blockListLast"> <h4>labelBound</h4> <pre>java.lang.Object labelBound</pre> <div class="block">Minimum / maximum value.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilderOrderBased"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/HierarchyBuilderOrderBased.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.HierarchyBuilderOrderBased</a> extends <a href="org/deidentifier/arx/aggregates/HierarchyBuilderGroupingBased.html" title="class in org.deidentifier.arx.aggregates">HierarchyBuilderGroupingBased</a>&lt;<a href="org/deidentifier/arx/aggregates/HierarchyBuilderOrderBased.html" title="type parameter in HierarchyBuilderOrderBased">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-2749758635401073668L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>comparator</h4> <pre>java.util.Comparator&lt;T&gt; comparator</pre> <div class="block">Comparator</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilderOrderBased.CloseElements"> <!-- --> </a> <h3>Class org.deidentifier.arx.aggregates.HierarchyBuilderOrderBased.CloseElements extends org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased.AbstractGroup implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>7224062023293601561L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>values</h4> <pre>java.lang.String[] values</pre> <div class="block">Values</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilderOrderBased.SerializableComparator"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/HierarchyBuilderOrderBased.SerializableComparator.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.HierarchyBuilderOrderBased.SerializableComparator</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>3851134667082727602L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.aggregates.HierarchyBuilderRedactionBased"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/aggregates/HierarchyBuilderRedactionBased.html" title="class in org.deidentifier.arx.aggregates">org.deidentifier.arx.aggregates.HierarchyBuilderRedactionBased</a> extends <a href="org/deidentifier/arx/aggregates/HierarchyBuilder.html" title="class in org.deidentifier.arx.aggregates">HierarchyBuilder</a>&lt;<a href="org/deidentifier/arx/aggregates/HierarchyBuilderRedactionBased.html" title="type parameter in HierarchyBuilderRedactionBased">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>3625654600380531803L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>aligmentOrder</h4> <pre><a href="org/deidentifier/arx/aggregates/HierarchyBuilderRedactionBased.Order.html" title="enum in org.deidentifier.arx.aggregates">HierarchyBuilderRedactionBased.Order</a> aligmentOrder</pre> <div class="block">Alignment order.</div> </li> <li class="blockList"> <h4>paddingCharacter</h4> <pre>char paddingCharacter</pre> <div class="block">Padding character.</div> </li> <li class="blockList"> <h4>redactionCharacter</h4> <pre>char redactionCharacter</pre> <div class="block">Redaction character.</div> </li> <li class="blockList"> <h4>redactionOrder</h4> <pre><a href="org/deidentifier/arx/aggregates/HierarchyBuilderRedactionBased.Order.html" title="enum in org.deidentifier.arx.aggregates">HierarchyBuilderRedactionBased.Order</a> redactionOrder</pre> <div class="block">Redaction order.</div> </li> <li class="blockList"> <h4>maxValueLength</h4> <pre>java.lang.Double maxValueLength</pre> <div class="block">Meta-data about the nature of the domain of the attribute. Modeled as Double for backwards compatibility</div> </li> <li class="blockList"> <h4>domainSize</h4> <pre>java.lang.Double domainSize</pre> <div class="block">Meta-data about the nature of the domain of the attribute. Modeled as Double for backwards compatibility</div> </li> <li class="blockListLast"> <h4>alphabetSize</h4> <pre>java.lang.Double alphabetSize</pre> <div class="block">Meta-data about the nature of the domain of the attribute. Modeled as Double for backwards compatibility</div> </li> </ul> </li> </ul> </li> </ul> </li> <li class="blockList"> <h2 title="Package">Package&nbsp;org.deidentifier.arx.criteria</h2> <ul class="blockList"> <li class="blockList"><a name="org.deidentifier.arx.criteria.AverageReidentificationRisk"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/AverageReidentificationRisk.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.AverageReidentificationRisk</a> extends <a href="org/deidentifier/arx/criteria/RiskBasedCriterion.html" title="class in org.deidentifier.arx.criteria">RiskBasedCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-2953252206954936045L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>smallestSize</h4> <pre>java.lang.Integer smallestSize</pre> <div class="block">Smallest size, derived from highest risk</div> </li> <li class="blockList"> <h4>highestRisk</h4> <pre>java.lang.Double highestRisk</pre> <div class="block">Highest risk</div> </li> <li class="blockListLast"> <h4>recordsAtRisk</h4> <pre>java.lang.Double recordsAtRisk</pre> <div class="block">Records with a risk higher than the highest risk</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.BasicBLikeness"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/BasicBLikeness.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.BasicBLikeness</a> extends <a href="org/deidentifier/arx/criteria/ExplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">ExplicitPrivacyCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>2528498679732389575L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>b</h4> <pre>double b</pre> <div class="block">Parameter</div> </li> <li class="blockListLast"> <h4>distribution</h4> <pre>double[] distribution</pre> <div class="block">The original distribution.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.DDisclosurePrivacy"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/DDisclosurePrivacy.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.DDisclosurePrivacy</a> extends <a href="org/deidentifier/arx/criteria/ExplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">ExplicitPrivacyCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>1543994581019659183L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>d</h4> <pre>double d</pre> <div class="block">Parameter</div> </li> <li class="blockListLast"> <h4>distribution</h4> <pre>double[] distribution</pre> <div class="block">The original distribution.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.DistinctLDiversity"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/DistinctLDiversity.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.DistinctLDiversity</a> extends <a href="org/deidentifier/arx/criteria/LDiversity.html" title="class in org.deidentifier.arx.criteria">LDiversity</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7973221140269608088L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.DPresence"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/DPresence.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.DPresence</a> extends <a href="org/deidentifier/arx/criteria/ImplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">ImplicitPrivacyCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>8534004943055128797L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>dMin</h4> <pre>double dMin</pre> <div class="block">Delta min.</div> </li> <li class="blockList"> <h4>dMax</h4> <pre>double dMax</pre> <div class="block">Delta max.</div> </li> <li class="blockListLast"> <h4>subset</h4> <pre><a href="org/deidentifier/arx/DataSubset.html" title="class in org.deidentifier.arx">DataSubset</a> subset</pre> <div class="block">A compressed representation of the research subset.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.EDDifferentialPrivacy"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/EDDifferentialPrivacy.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.EDDifferentialPrivacy</a> extends <a href="org/deidentifier/arx/criteria/ImplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">ImplicitPrivacyCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>242579895476272606L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>epsilon</h4> <pre>double epsilon</pre> <div class="block">Parameter</div> </li> <li class="blockList"> <h4>delta</h4> <pre>double delta</pre> <div class="block">Parameter</div> </li> <li class="blockList"> <h4>k</h4> <pre>int k</pre> <div class="block">Parameter</div> </li> <li class="blockList"> <h4>beta</h4> <pre>double beta</pre> <div class="block">Parameter</div> </li> <li class="blockList"> <h4>subset</h4> <pre><a href="org/deidentifier/arx/DataSubset.html" title="class in org.deidentifier.arx">DataSubset</a> subset</pre> <div class="block">Parameter</div> </li> <li class="blockListLast"> <h4>generalization</h4> <pre><a href="org/deidentifier/arx/DataGeneralizationScheme.html" title="class in org.deidentifier.arx">DataGeneralizationScheme</a> generalization</pre> <div class="block">Parameter</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.EnhancedBLikeness"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/EnhancedBLikeness.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.EnhancedBLikeness</a> extends <a href="org/deidentifier/arx/criteria/ExplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">ExplicitPrivacyCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5319052409590347904L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>b</h4> <pre>double b</pre> <div class="block">Parameter</div> </li> <li class="blockListLast"> <h4>distribution</h4> <pre>double[] distribution</pre> <div class="block">The original distribution.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.EntropyLDiversity"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/EntropyLDiversity.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.EntropyLDiversity</a> extends <a href="org/deidentifier/arx/criteria/LDiversity.html" title="class in org.deidentifier.arx.criteria">LDiversity</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-354688551915634000L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialization Methods</h3> <ul class="blockList"> <li class="blockListLast"> <h4>readObject</h4> <pre>private&nbsp;void&nbsp;readObject(java.io.ObjectInputStream&nbsp;ois) throws java.lang.ClassNotFoundException, java.io.IOException</pre> <div class="block">Custom de-serialization If we de-serialize an older object where the entropy estimator could not be chosen, set the estimator to the default: Shannon.</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.ClassNotFoundException</code></dd> <dd><code>java.io.IOException</code></dd> </dl> </li> </ul> </li> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>estimator</h4> <pre><a href="org/deidentifier/arx/criteria/EntropyLDiversity.EntropyEstimator.html" title="enum in org.deidentifier.arx.criteria">EntropyLDiversity.EntropyEstimator</a> estimator</pre> <div class="block">Entropy estimator to be used</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.EqualDistanceTCloseness"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/EqualDistanceTCloseness.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.EqualDistanceTCloseness</a> extends <a href="org/deidentifier/arx/criteria/TCloseness.html" title="class in org.deidentifier.arx.criteria">TCloseness</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-1383357036299011323L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>distribution</h4> <pre>double[] distribution</pre> <div class="block">The original distribution.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.ExplicitPrivacyCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/ExplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.ExplicitPrivacyCriterion</a> extends <a href="org/deidentifier/arx/criteria/PrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">PrivacyCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-6467044039242481225L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>attribute</h4> <pre>java.lang.String attribute</pre> <div class="block">Attribute</div> </li> <li class="blockListLast"> <h4>index</h4> <pre>int index</pre> <div class="block">Attribute index</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.HierarchicalDistanceTCloseness"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/HierarchicalDistanceTCloseness.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.HierarchicalDistanceTCloseness</a> extends <a href="org/deidentifier/arx/criteria/TCloseness.html" title="class in org.deidentifier.arx.criteria">TCloseness</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-2142590190479670706L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>hierarchy</h4> <pre><a href="org/deidentifier/arx/AttributeType.Hierarchy.html" title="class in org.deidentifier.arx">AttributeType.Hierarchy</a> hierarchy</pre> <div class="block">The hierarchy used for the EMD.</div> </li> <li class="blockList"> <h4>tree</h4> <pre>int[] tree</pre> <div class="block">Internal tree.</div> </li> <li class="blockList"> <h4>start</h4> <pre>int start</pre> <div class="block">Internal offset.</div> </li> <li class="blockListLast"> <h4>empty</h4> <pre>int[] empty</pre> <div class="block">Internal empty tree.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.ImplicitPrivacyCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/ImplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.ImplicitPrivacyCriterion</a> extends <a href="org/deidentifier/arx/criteria/PrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">PrivacyCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-6467044039242481225L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.Inclusion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/Inclusion.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.Inclusion</a> extends <a href="org/deidentifier/arx/criteria/DPresence.html" title="class in org.deidentifier.arx.criteria">DPresence</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-3984193225980793775L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.KAnonymity"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/KAnonymity.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.KAnonymity</a> extends <a href="org/deidentifier/arx/criteria/ImplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">ImplicitPrivacyCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-8370928677928140572L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>k</h4> <pre>int k</pre> <div class="block">The parameter k.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.KMap"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/KMap.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.KMap</a> extends <a href="org/deidentifier/arx/criteria/ImplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">ImplicitPrivacyCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-6966985761538810077L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>k</h4> <pre>int k</pre> <div class="block">K</div> </li> <li class="blockList"> <h4>subset</h4> <pre><a href="org/deidentifier/arx/DataSubset.html" title="class in org.deidentifier.arx">DataSubset</a> subset</pre> <div class="block">A compressed representation of the research subset.</div> </li> <li class="blockList"> <h4>derivedK</h4> <pre>int derivedK</pre> <div class="block">The parameter k'.</div> </li> <li class="blockList"> <h4>significanceLevel</h4> <pre>double significanceLevel</pre> <div class="block">The significance level</div> </li> <li class="blockList"> <h4>populationModel</h4> <pre><a href="org/deidentifier/arx/ARXPopulationModel.html" title="class in org.deidentifier.arx">ARXPopulationModel</a> populationModel</pre> <div class="block">The population model</div> </li> <li class="blockList"> <h4>estimator</h4> <pre><a href="org/deidentifier/arx/criteria/KMap.CellSizeEstimator.html" title="enum in org.deidentifier.arx.criteria">KMap.CellSizeEstimator</a> estimator</pre> <div class="block">The selected estimator</div> </li> <li class="blockListLast"> <h4>type1Error</h4> <pre>double type1Error</pre> <div class="block">The actual type I error.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.LDiversity"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/LDiversity.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.LDiversity</a> extends <a href="org/deidentifier/arx/criteria/ExplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">ExplicitPrivacyCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>6429149925699964530L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>l</h4> <pre>double l</pre> <div class="block">The parameter l.</div> </li> <li class="blockListLast"> <h4>minSize</h4> <pre>int minSize</pre> <div class="block">The derived minimal size of a class</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.OrderedDistanceTCloseness"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/OrderedDistanceTCloseness.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.OrderedDistanceTCloseness</a> extends <a href="org/deidentifier/arx/criteria/TCloseness.html" title="class in org.deidentifier.arx.criteria">TCloseness</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-2395544663063577862L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>distribution</h4> <pre>double[] distribution</pre> <div class="block">The original distribution.</div> </li> <li class="blockList"> <h4>order</h4> <pre>int[] order</pre> <div class="block">The order of the elements.</div> </li> <li class="blockList"> <h4>orderNumber</h4> <pre>int[] orderNumber</pre> <div class="block">The order of the elements.</div> </li> <li class="blockList"> <h4>baseDistances</h4> <pre>double[] baseDistances</pre> <div class="block">Partial distances of the original distribution.</div> </li> <li class="blockList"> <h4>baseSums</h4> <pre>double[] baseSums</pre> <div class="block">Partial sums of the original distribution.</div> </li> <li class="blockListLast"> <h4>minOrder</h4> <pre>int minOrder</pre> <div class="block">Minimal order number that must be present</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.PopulationUniqueness"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/PopulationUniqueness.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.PopulationUniqueness</a> extends <a href="org/deidentifier/arx/criteria/RiskBasedCriterion.html" title="class in org.deidentifier.arx.criteria">RiskBasedCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>618039085843721351L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>statisticalModel</h4> <pre><a href="org/deidentifier/arx/risk/RiskModelPopulationUniqueness.PopulationUniquenessModel.html" title="enum in org.deidentifier.arx.risk">RiskModelPopulationUniqueness.PopulationUniquenessModel</a> statisticalModel</pre> <div class="block">The statistical model</div> </li> <li class="blockList"> <h4>populationModel</h4> <pre><a href="org/deidentifier/arx/ARXPopulationModel.html" title="class in org.deidentifier.arx">ARXPopulationModel</a> populationModel</pre> <div class="block">The population model</div> </li> <li class="blockListLast"> <h4>solverConfig</h4> <pre><a href="org/deidentifier/arx/ARXSolverConfiguration.html" title="class in org.deidentifier.arx">ARXSolverConfiguration</a> solverConfig</pre> <div class="block">The solver config</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.PrivacyCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/PrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.PrivacyCriterion</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-8460571120677880409L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>monotonic</h4> <pre>boolean monotonic</pre> <div class="block">Is the criterion monotonic with generalization and suppression.</div> </li> <li class="blockListLast"> <h4>monotonicWithGeneralization</h4> <pre>java.lang.Boolean monotonicWithGeneralization</pre> <div class="block">Is the criterion monotonic with generalization.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.ProfitabilityJournalist"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/ProfitabilityJournalist.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.ProfitabilityJournalist</a> extends <a href="org/deidentifier/arx/criteria/ProfitabilityProsecutor.html" title="class in org.deidentifier.arx.criteria">ProfitabilityProsecutor</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5089787798100584405L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>subset</h4> <pre><a href="org/deidentifier/arx/DataSubset.html" title="class in org.deidentifier.arx">DataSubset</a> subset</pre> <div class="block">Data subset</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.ProfitabilityJournalistNoAttack"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/ProfitabilityJournalistNoAttack.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.ProfitabilityJournalistNoAttack</a> extends <a href="org/deidentifier/arx/criteria/ProfitabilityProsecutorNoAttack.html" title="class in org.deidentifier.arx.criteria">ProfitabilityProsecutorNoAttack</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>1073520003237793563L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>subset</h4> <pre><a href="org/deidentifier/arx/DataSubset.html" title="class in org.deidentifier.arx">DataSubset</a> subset</pre> <div class="block">The data subset</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.ProfitabilityProsecutor"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/ProfitabilityProsecutor.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.ProfitabilityProsecutor</a> extends <a href="org/deidentifier/arx/criteria/ImplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">ImplicitPrivacyCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-1698534839214708559L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>config</h4> <pre><a href="org/deidentifier/arx/ARXCostBenefitConfiguration.html" title="class in org.deidentifier.arx">ARXCostBenefitConfiguration</a> config</pre> <div class="block">Configuration</div> </li> <li class="blockList"> <h4>shares</h4> <pre><a href="org/deidentifier/arx/metric/v2/DomainShare.html" title="interface in org.deidentifier.arx.metric.v2">DomainShare</a>[] shares</pre> <div class="block">Domain shares for each dimension.</div> </li> <li class="blockList"> <h4>aggregation</h4> <pre><a href="org/deidentifier/arx/framework/data/DataAggregationInformation.html" title="class in org.deidentifier.arx.framework.data">DataAggregationInformation</a> aggregation</pre> <div class="block">The microaggregation functions.</div> </li> <li class="blockList"> <h4>maxIL</h4> <pre>double maxIL</pre> <div class="block">MaxIL</div> </li> <li class="blockListLast"> <h4>riskModel</h4> <pre><a href="org/deidentifier/arx/risk/RiskModelCostBenefit.html" title="class in org.deidentifier.arx.risk">RiskModelCostBenefit</a> riskModel</pre> <div class="block">Risk model</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.ProfitabilityProsecutorNoAttack"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/ProfitabilityProsecutorNoAttack.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.ProfitabilityProsecutorNoAttack</a> extends <a href="org/deidentifier/arx/criteria/ImplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">ImplicitPrivacyCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-1283022087083117810L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>k</h4> <pre>int k</pre> <div class="block">The underlying k-anonymity privacy model</div> </li> <li class="blockListLast"> <h4>config</h4> <pre><a href="org/deidentifier/arx/ARXCostBenefitConfiguration.html" title="class in org.deidentifier.arx">ARXCostBenefitConfiguration</a> config</pre> <div class="block">The underlying cost/benefit configuration</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.RecursiveCLDiversity"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/RecursiveCLDiversity.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.RecursiveCLDiversity</a> extends <a href="org/deidentifier/arx/criteria/LDiversity.html" title="class in org.deidentifier.arx.criteria">LDiversity</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-5893481096346270328L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>c</h4> <pre>double c</pre> <div class="block">The parameter c.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.RiskBasedCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/RiskBasedCriterion.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.RiskBasedCriterion</a> extends <a href="org/deidentifier/arx/criteria/SampleBasedCriterion.html" title="class in org.deidentifier.arx.criteria">SampleBasedCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-2711630526630937284L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>threshold</h4> <pre>double threshold</pre> <div class="block">The threshold</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.SampleBasedCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/SampleBasedCriterion.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.SampleBasedCriterion</a> extends <a href="org/deidentifier/arx/criteria/PrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">PrivacyCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5687067920181297803L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.SampleUniqueness"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/SampleUniqueness.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.SampleUniqueness</a> extends <a href="org/deidentifier/arx/criteria/RiskBasedCriterion.html" title="class in org.deidentifier.arx.criteria">RiskBasedCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-4528395062333281525L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.criteria.TCloseness"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/criteria/TCloseness.html" title="class in org.deidentifier.arx.criteria">org.deidentifier.arx.criteria.TCloseness</a> extends <a href="org/deidentifier/arx/criteria/ExplicitPrivacyCriterion.html" title="class in org.deidentifier.arx.criteria">ExplicitPrivacyCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-139670758266526116L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>t</h4> <pre>double t</pre> <div class="block">The param t.</div> </li> </ul> </li> </ul> </li> </ul> </li> <li class="blockList"> <h2 title="Package">Package&nbsp;org.deidentifier.arx.exceptions</h2> <ul class="blockList"> <li class="blockList"><a name="org.deidentifier.arx.exceptions.ComputationInterruptedException"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/exceptions/ComputationInterruptedException.html" title="class in org.deidentifier.arx.exceptions">org.deidentifier.arx.exceptions.ComputationInterruptedException</a> extends java.lang.RuntimeException implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5339918851212367422L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.exceptions.ReliabilityException"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/exceptions/ReliabilityException.html" title="class in org.deidentifier.arx.exceptions">org.deidentifier.arx.exceptions.ReliabilityException</a> extends java.lang.Exception implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7250206365096133932L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.exceptions.RollbackRequiredException"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/exceptions/RollbackRequiredException.html" title="class in org.deidentifier.arx.exceptions">org.deidentifier.arx.exceptions.RollbackRequiredException</a> extends java.lang.Exception implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7587463020191596936L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.exceptions.UnexpectedErrorException"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/exceptions/UnexpectedErrorException.html" title="class in org.deidentifier.arx.exceptions">org.deidentifier.arx.exceptions.UnexpectedErrorException</a> extends java.lang.RuntimeException implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>3465383124059681997L</dd> </dl> </li> </ul> </li> <li class="blockList"> <h2 title="Package">Package&nbsp;org.deidentifier.arx.framework.check.distribution</h2> <ul class="blockList"> <li class="blockList"><a name="org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.html" title="class in org.deidentifier.arx.framework.check.distribution">org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>331877806010996154L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>ignoreMissingData</h4> <pre>boolean ignoreMissingData</pre> <div class="block">Whether or not null values should be ignored</div> </li> <li class="blockListLast"> <h4>typePreserving</h4> <pre>boolean typePreserving</pre> <div class="block">Stores whether this is a type-preserving function</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction.DistributionAggregateFunctionArithmeticMean"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.DistributionAggregateFunctionArithmeticMean.html" title="class in org.deidentifier.arx.framework.check.distribution">org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction.DistributionAggregateFunctionArithmeticMean</a> extends <a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.html" title="class in org.deidentifier.arx.framework.check.distribution">DistributionAggregateFunction</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>8379579591466576517L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>minimum</h4> <pre>java.lang.Double minimum</pre> <div class="block">Minimum</div> </li> <li class="blockListLast"> <h4>maximum</h4> <pre>java.lang.Double maximum</pre> <div class="block">Maximum</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction.DistributionAggregateFunctionGeometricMean"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.DistributionAggregateFunctionGeometricMean.html" title="class in org.deidentifier.arx.framework.check.distribution">org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction.DistributionAggregateFunctionGeometricMean</a> extends <a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.html" title="class in org.deidentifier.arx.framework.check.distribution">DistributionAggregateFunction</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-3835477735362966307L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>minimum</h4> <pre>java.lang.Double minimum</pre> <div class="block">Minimum</div> </li> <li class="blockListLast"> <h4>maximum</h4> <pre>java.lang.Double maximum</pre> <div class="block">Maximum</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction.DistributionAggregateFunctionInterval"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.DistributionAggregateFunctionInterval.html" title="class in org.deidentifier.arx.framework.check.distribution">org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction.DistributionAggregateFunctionInterval</a> extends <a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.html" title="class in org.deidentifier.arx.framework.check.distribution">DistributionAggregateFunction</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>2349775566497080868L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction.DistributionAggregateFunctionMedian"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.DistributionAggregateFunctionMedian.html" title="class in org.deidentifier.arx.framework.check.distribution">org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction.DistributionAggregateFunctionMedian</a> extends <a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.html" title="class in org.deidentifier.arx.framework.check.distribution">DistributionAggregateFunction</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>4877214760061314248L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>minimum</h4> <pre>java.lang.Double minimum</pre> <div class="block">Minimum</div> </li> <li class="blockListLast"> <h4>maximum</h4> <pre>java.lang.Double maximum</pre> <div class="block">Maximum</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction.DistributionAggregateFunctionMode"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.DistributionAggregateFunctionMode.html" title="class in org.deidentifier.arx.framework.check.distribution">org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction.DistributionAggregateFunctionMode</a> extends <a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.html" title="class in org.deidentifier.arx.framework.check.distribution">DistributionAggregateFunction</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-3424849372778696640L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>minimum</h4> <pre>double minimum</pre> <div class="block">Minimum</div> </li> <li class="blockListLast"> <h4>maximum</h4> <pre>double maximum</pre> <div class="block">Maximum</div> </li> </ul> </li> </ul> </li> </ul> </li> <li class="blockList"> <h2 title="Package">Package&nbsp;org.deidentifier.arx.framework.data</h2> <ul class="blockList"> <li class="blockList"><a name="org.deidentifier.arx.framework.data.Data"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/framework/data/Data.html" title="class in org.deidentifier.arx.framework.data">org.deidentifier.arx.framework.data.Data</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>9088882549074658790L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>data</h4> <pre><a href="org/deidentifier/arx/framework/data/DataMatrix.html" title="class in org.deidentifier.arx.framework.data">DataMatrix</a> data</pre> <div class="block">Row, Dimension.</div> </li> <li class="blockList"> <h4>header</h4> <pre>java.lang.String[] header</pre> <div class="block">The header.</div> </li> <li class="blockList"> <h4>dictionary</h4> <pre><a href="org/deidentifier/arx/framework/data/Dictionary.html" title="class in org.deidentifier.arx.framework.data">Dictionary</a> dictionary</pre> <div class="block">The associated dictionary.</div> </li> <li class="blockList"> <h4>columns</h4> <pre>int[] columns</pre> <div class="block">The associated map.</div> </li> <li class="blockListLast"> <h4>map</h4> <pre>java.util.Map&lt;K,V&gt; map</pre> <div class="block">Maps attributes to their index</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.framework.data.DataAggregationInformation"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/framework/data/DataAggregationInformation.html" title="class in org.deidentifier.arx.framework.data">org.deidentifier.arx.framework.data.DataAggregationInformation</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>6666226136889537126L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>header</h4> <pre>java.lang.String[] header</pre> <div class="block">Name of all attributes</div> </li> <li class="blockList"> <h4>columns</h4> <pre>int[] columns</pre> <div class="block">Columns in original dataset</div> </li> <li class="blockList"> <h4>hotThreshold</h4> <pre>int hotThreshold</pre> <div class="block">Index of first column that is cold. All columns from <code>0</code> to <code>hotThreshold - 1</code> must be analyzed in hot mode.</div> </li> <li class="blockList"> <h4>hotQIsNotGeneralized</h4> <pre>int[] hotQIsNotGeneralized</pre> <div class="block">Indices of attributes in <code>columns</code> which must be aggregated during the anonymization process but which are not generalized.</div> </li> <li class="blockList"> <h4>hotQIsNotGeneralizedFunctions</h4> <pre><a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.html" title="class in org.deidentifier.arx.framework.check.distribution">DistributionAggregateFunction</a>[] hotQIsNotGeneralizedFunctions</pre> <div class="block">Function of i-th attribute (in hotQIsNotGeneralized) that must be aggregated during the anonymization process but which is not generalized.</div> </li> <li class="blockList"> <h4>hotQIsNotGeneralizedDomainSizes</h4> <pre>int[] hotQIsNotGeneralizedDomainSizes</pre> <div class="block">Domain size of i-th attribute (in hotQIsNotGeneralized) that must be aggregated during the anonymization process but which is not generalized.</div> </li> <li class="blockList"> <h4>hotQIsGeneralized</h4> <pre>int[] hotQIsGeneralized</pre> <div class="block">Indices of attributes in <code>columns</code> which must be aggregated during the anonymization process and which are also generalized.</div> </li> <li class="blockList"> <h4>hotQIsGeneralizedFunctions</h4> <pre><a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.html" title="class in org.deidentifier.arx.framework.check.distribution">DistributionAggregateFunction</a>[] hotQIsGeneralizedFunctions</pre> <div class="block">Function of i-th attribute (in hotQIsGeneralized) that must be aggregated during the anonymization process and which are is generalized.</div> </li> <li class="blockList"> <h4>hotQIsGeneralizedDomainSizes</h4> <pre>int[] hotQIsGeneralizedDomainSizes</pre> <div class="block">Domain size of i-th attribute (in hotQIsGeneralized) that must be aggregated during the anonymization process and which are is generalized.</div> </li> <li class="blockList"> <h4>coldQIs</h4> <pre>int[] coldQIs</pre> <div class="block">Indices of attributes in <code>columns</code> which must be aggregated only after the anonymization process.</div> </li> <li class="blockList"> <h4>coldQIsFunctions</h4> <pre><a href="org/deidentifier/arx/framework/check/distribution/DistributionAggregateFunction.html" title="class in org.deidentifier.arx.framework.check.distribution">DistributionAggregateFunction</a>[] coldQIsFunctions</pre> <div class="block">Function of i-th attribute (in coldQIs) that must be aggregated only after the anonymization process.</div> </li> <li class="blockListLast"> <h4>coldQIsDomainSizes</h4> <pre>int[] coldQIsDomainSizes</pre> <div class="block">Domain size of i-th attribute (in coldQIs) that must be aggregated only after the anonymization process.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.framework.data.DataMatrix"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/framework/data/DataMatrix.html" title="class in org.deidentifier.arx.framework.data">org.deidentifier.arx.framework.data.DataMatrix</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>1626391500373995527L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>array</h4> <pre>int[] array</pre> <div class="block">Backing array</div> </li> <li class="blockList"> <h4>rows</h4> <pre>int rows</pre> <div class="block">The number of rows.</div> </li> <li class="blockList"> <h4>columns</h4> <pre>int columns</pre> <div class="block">The number of columns.</div> </li> <li class="blockList"> <h4>iteratorI</h4> <pre>int iteratorI</pre> <div class="block">Iterate</div> </li> <li class="blockList"> <h4>iteratorOffset</h4> <pre>int iteratorOffset</pre> <div class="block">Iterate</div> </li> <li class="blockListLast"> <h4>baseOffset</h4> <pre>int baseOffset</pre> <div class="block">Iterate</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.framework.data.DataMatrixSubset"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/framework/data/DataMatrixSubset.html" title="class in org.deidentifier.arx.framework.data">org.deidentifier.arx.framework.data.DataMatrixSubset</a> extends <a href="org/deidentifier/arx/framework/data/DataMatrix.html" title="class in org.deidentifier.arx.framework.data">DataMatrix</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>2302168888330117731L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>subset</h4> <pre>int[] subset</pre> <div class="block">Subset</div> </li> <li class="blockListLast"> <h4>matrix</h4> <pre><a href="org/deidentifier/arx/framework/data/DataMatrix.html" title="class in org.deidentifier.arx.framework.data">DataMatrix</a> matrix</pre> <div class="block">Matrix</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.framework.data.Dictionary"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/framework/data/Dictionary.html" title="class in org.deidentifier.arx.framework.data">org.deidentifier.arx.framework.data.Dictionary</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>6448285732641604559L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialization Methods</h3> <ul class="blockList"> <li class="blockListLast"> <h4>readObject</h4> <pre>private&nbsp;void&nbsp;readObject(java.io.ObjectInputStream&nbsp;stream) throws java.io.IOException, java.lang.ClassNotFoundException</pre> <div class="block">Custom de-serialization for backwards compatibility</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.io.IOException</code></dd> <dd><code>java.lang.ClassNotFoundException</code></dd> </dl> </li> </ul> </li> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>mapping</h4> <pre>java.lang.String[][] mapping</pre> <div class="block">The resulting array mapping dimension->integer->string.</div> </li> <li class="blockListLast"> <h4>suppressed</h4> <pre>int[] suppressed</pre> <div class="block">Codes of suppressed values for each dimension</div> </li> </ul> </li> </ul> </li> </ul> </li> <li class="blockList"> <h2 title="Package">Package&nbsp;org.deidentifier.arx.gui.model</h2> <ul class="blockList"> <li class="blockList"><a name="org.deidentifier.arx.gui.model.Model"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/Model.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.Model</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7669920657919151279L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>snapshotSizeDataset</h4> <pre>double snapshotSizeDataset</pre> <div class="block">Anonymization parameter.</div> </li> <li class="blockList"> <h4>snapshotSizeSnapshot</h4> <pre>double snapshotSizeSnapshot</pre> <div class="block">Anonymization parameter.</div> </li> <li class="blockList"> <h4>historySize</h4> <pre>int historySize</pre> <div class="block">Anonymization parameter.</div> </li> <li class="blockList"> <h4>maximalSizeForComplexOperations</h4> <pre>int maximalSizeForComplexOperations</pre> <div class="block">Threshold.</div> </li> <li class="blockList"> <h4>initialNodesInViewer</h4> <pre>int initialNodesInViewer</pre> <div class="block">Threshold.</div> </li> <li class="blockList"> <h4>maxNodesInViewer</h4> <pre>int maxNodesInViewer</pre> <div class="block">Threshold.</div> </li> <li class="blockList"> <h4>description</h4> <pre>java.lang.String description</pre> <div class="block">The project description.</div> </li> <li class="blockList"> <h4>inputBytes</h4> <pre>long inputBytes</pre> <div class="block">The size of the input file.</div> </li> <li class="blockList"> <h4>modified</h4> <pre>boolean modified</pre> <div class="block">Is the project file modified.</div> </li> <li class="blockList"> <h4>name</h4> <pre>java.lang.String name</pre> <div class="block">The project name.</div> </li> <li class="blockList"> <h4>separator</h4> <pre>char separator</pre> <div class="block">Left for backwards compatibility only!</div> </li> <li class="blockList"> <h4>csvSyntax</h4> <pre><a href="org/deidentifier/arx/io/CSVSyntax.html" title="class in org.deidentifier.arx.io">CSVSyntax</a> csvSyntax</pre> <div class="block">The projects CSV syntax</div> </li> <li class="blockList"> <h4>time</h4> <pre>long time</pre> <div class="block">Execution time of last anonymization.</div> </li> <li class="blockList"> <h4>locale</h4> <pre>java.util.Locale locale</pre> <div class="block">Locale.</div> </li> <li class="blockList"> <h4>auditTrail</h4> <pre>java.util.List&lt;E&gt; auditTrail</pre> <div class="block">The audit trail</div> </li> <li class="blockList"> <h4>charset</h4> <pre>java.lang.String charset</pre> <div class="block">Standard charset since ARX > 3.7.1. Older projects will have the value <code>null</code></div> </li> <li class="blockList"> <h4>debugEnabled</h4> <pre>boolean debugEnabled</pre> <div class="block">Is the debugging mode enabled.</div> </li> <li class="blockList"> <h4>groups</h4> <pre>int[] groups</pre> <div class="block">Indices of groups in the current output view.</div> </li> <li class="blockList"> <h4>optimalNodeAsString</h4> <pre>java.lang.String optimalNodeAsString</pre> <div class="block">Label.</div> </li> <li class="blockList"> <h4>outputNodeAsString</h4> <pre>java.lang.String outputNodeAsString</pre> <div class="block">Label.</div> </li> <li class="blockList"> <h4>selectedClassValue</h4> <pre>java.lang.String selectedClassValue</pre> <div class="block">Current selection.</div> </li> <li class="blockList"> <h4>selectedAttribute</h4> <pre>java.lang.String selectedAttribute</pre> <div class="block">Current selection.</div> </li> <li class="blockList"> <h4>showVisualization</h4> <pre>java.lang.Boolean showVisualization</pre> <div class="block">Enable/disable.</div> </li> <li class="blockList"> <h4>pair</h4> <pre>java.lang.String[] pair</pre> <div class="block">Last two selections.</div> </li> <li class="blockList"> <h4>query</h4> <pre>java.lang.String query</pre> <div class="block">Query.</div> </li> <li class="blockList"> <h4>subsetOrigin</h4> <pre>java.lang.String subsetOrigin</pre> <div class="block">Origin of current subset.</div> </li> <li class="blockList"> <h4>inputConfig</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelConfiguration.html" title="class in org.deidentifier.arx.gui.model">ModelConfiguration</a> inputConfig</pre> <div class="block">The current input configuration.</div> </li> <li class="blockList"> <h4>nodeFilter</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelNodeFilter.html" title="class in org.deidentifier.arx.gui.model">ModelNodeFilter</a> nodeFilter</pre> <div class="block">A filter describing which transformations are currently selected.</div> </li> <li class="blockList"> <h4>viewConfig</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelViewConfig.html" title="class in org.deidentifier.arx.gui.model">ModelViewConfig</a> viewConfig</pre> <div class="block">Configuration of the data view.</div> </li> <li class="blockList"> <h4>outputConfig</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelConfiguration.html" title="class in org.deidentifier.arx.gui.model">ModelConfiguration</a> outputConfig</pre> <div class="block">The current output configuration.</div> </li> <li class="blockList"> <h4>riskModel</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelRisk.html" title="class in org.deidentifier.arx.gui.model">ModelRisk</a> riskModel</pre> <div class="block">The current risk model.</div> </li> <li class="blockList"> <h4>dPresenceModel</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelDPresenceCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelDPresenceCriterion</a> dPresenceModel</pre> <div class="block">Model for a specific privacy criterion.</div> </li> <li class="blockList"> <h4>kMapModel</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelKMapCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelKMapCriterion</a> kMapModel</pre> <div class="block">Model for a specific privacy criterion.</div> </li> <li class="blockList"> <h4>kAnonymityModel</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelKAnonymityCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelKAnonymityCriterion</a> kAnonymityModel</pre> <div class="block">Model for a specific privacy criterion.</div> </li> <li class="blockList"> <h4>lDiversityModel</h4> <pre>java.util.Map&lt;K,V&gt; lDiversityModel</pre> <div class="block">Model for a specific privacy criterion.</div> </li> <li class="blockList"> <h4>tClosenessModel</h4> <pre>java.util.Map&lt;K,V&gt; tClosenessModel</pre> <div class="block">Model for a specific privacy criterion.</div> </li> <li class="blockList"> <h4>riskBasedModel</h4> <pre>java.util.Set&lt;E&gt; riskBasedModel</pre> <div class="block">Model for a specific privacy criterion.</div> </li> <li class="blockList"> <h4>differentialPrivacyModel</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelDifferentialPrivacyCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelDifferentialPrivacyCriterion</a> differentialPrivacyModel</pre> <div class="block">Model for a specific privacy criterion.</div> </li> <li class="blockList"> <h4>dDisclosurePrivacyModel</h4> <pre>java.util.Map&lt;K,V&gt; dDisclosurePrivacyModel</pre> <div class="block">Model for a specific privacy criterion.</div> </li> <li class="blockList"> <h4>stackelbergPrivacyModel</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelProfitabilityCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelProfitabilityCriterion</a> stackelbergPrivacyModel</pre> <div class="block">Model for a specific privacy criterion.</div> </li> <li class="blockList"> <h4>bLikenessModel</h4> <pre>java.util.Map&lt;K,V&gt; bLikenessModel</pre> <div class="block">Model for a specific privacy criterion.</div> </li> <li class="blockList"> <h4>metricConfig</h4> <pre><a href="org/deidentifier/arx/metric/MetricConfiguration.html" title="class in org.deidentifier.arx.metric">MetricConfiguration</a> metricConfig</pre> <div class="block">Configuration.</div> </li> <li class="blockList"> <h4>metricDescription</h4> <pre><a href="org/deidentifier/arx/metric/MetricDescription.html" title="class in org.deidentifier.arx.metric">MetricDescription</a> metricDescription</pre> <div class="block">Description.</div> </li> <li class="blockList"> <h4>useListwiseDeletion</h4> <pre>java.lang.Boolean useListwiseDeletion</pre> <div class="block">Summary statistics</div> </li> <li class="blockList"> <h4>useFunctionalHierarchies</h4> <pre>java.lang.Boolean useFunctionalHierarchies</pre> <div class="block">Utility estimation during anonymization</div> </li> <li class="blockList"> <h4>selectedQuasiIdentifiers</h4> <pre>java.util.Set&lt;E&gt; selectedQuasiIdentifiers</pre> <div class="block">Selected quasi identifiers</div> </li> <li class="blockList"> <h4>localRecodingModel</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelLocalRecoding.html" title="class in org.deidentifier.arx.gui.model">ModelLocalRecoding</a> localRecodingModel</pre> <div class="block">The local recoding model</div> </li> <li class="blockList"> <h4>heuristicSearchThreshold</h4> <pre>java.lang.Integer heuristicSearchThreshold</pre> <div class="block">Heuristic search threshold</div> </li> <li class="blockList"> <h4>heuristicSearchTimeLimit</h4> <pre>java.lang.Integer heuristicSearchTimeLimit</pre> <div class="block">Heuristic search threshold</div> </li> <li class="blockList"> <h4>heuristicSearchStepLimit</h4> <pre>java.lang.Integer heuristicSearchStepLimit</pre> <div class="block">Heuristic search threshold</div> </li> <li class="blockList"> <h4>anonymizationConfiguration</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelAnonymizationConfiguration.html" title="class in org.deidentifier.arx.gui.model">ModelAnonymizationConfiguration</a> anonymizationConfiguration</pre> <div class="block">General anonymization configuration. Proxy for some fields for backwards compatibility</div> </li> <li class="blockList"> <h4>selectedFeatures</h4> <pre>java.util.Set&lt;E&gt; selectedFeatures</pre> <div class="block">Selected attributes</div> </li> <li class="blockList"> <h4>selectedClasses</h4> <pre>java.util.Set&lt;E&gt; selectedClasses</pre> <div class="block">Selected attributes</div> </li> <li class="blockList"> <h4>classificationModel</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelClassification.html" title="class in org.deidentifier.arx.gui.model">ModelClassification</a> classificationModel</pre> <div class="block">Model</div> </li> <li class="blockListLast"> <h4>optimizationStatistics</h4> <pre><a href="org/deidentifier/arx/ARXProcessStatistics.html" title="class in org.deidentifier.arx">ARXProcessStatistics</a> optimizationStatistics</pre> <div class="block">Statistics about the last optimization process</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelAnonymizationConfiguration"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelAnonymizationConfiguration.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelAnonymizationConfiguration</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-1135902359268189624L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>model</h4> <pre><a href="org/deidentifier/arx/gui/model/Model.html" title="class in org.deidentifier.arx.gui.model">Model</a> model</pre> <div class="block">Model</div> </li> <li class="blockList"> <h4>searchType</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelAnonymizationConfiguration.SearchType.html" title="enum in org.deidentifier.arx.gui.model">ModelAnonymizationConfiguration.SearchType</a> searchType</pre> <div class="block">Result</div> </li> <li class="blockListLast"> <h4>transformationType</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelAnonymizationConfiguration.TransformationType.html" title="enum in org.deidentifier.arx.gui.model">ModelAnonymizationConfiguration.TransformationType</a> transformationType</pre> <div class="block">Result</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelAuditTrailEntry"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelAuditTrailEntry.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelAuditTrailEntry</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-3945294611839543672L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelAuditTrailEntry.AuditTrailEntryFindReplace"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelAuditTrailEntry.AuditTrailEntryFindReplace.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelAuditTrailEntry.AuditTrailEntryFindReplace</a> extends <a href="org/deidentifier/arx/gui/model/ModelAuditTrailEntry.html" title="class in org.deidentifier.arx.gui.model">ModelAuditTrailEntry</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-2321052598039892818L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>attribute</h4> <pre>java.lang.String attribute</pre> <div class="block">The attribute</div> </li> <li class="blockList"> <h4>searchString</h4> <pre>java.lang.String searchString</pre> <div class="block">The search string</div> </li> <li class="blockListLast"> <h4>replacementString</h4> <pre>java.lang.String replacementString</pre> <div class="block">The replacement string</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelBLikenessCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelBLikenessCriterion.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelBLikenessCriterion</a> extends <a href="org/deidentifier/arx/gui/model/ModelExplicitCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelExplicitCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>2269238032187539934L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>enhanced</h4> <pre>boolean enhanced</pre> <div class="block">Is this the enhanced variant</div> </li> <li class="blockListLast"> <h4>beta</h4> <pre>double beta</pre> <div class="block">Delta</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelClassification"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelClassification.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelClassification</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5361564507029617616L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>modified</h4> <pre>boolean modified</pre> <div class="block">Modified</div> </li> <li class="blockList"> <h4>configCurrent</h4> <pre><a href="org/deidentifier/arx/ARXClassificationConfiguration.html" title="class in org.deidentifier.arx">ARXClassificationConfiguration</a>&lt;<a href="org/deidentifier/arx/ARXClassificationConfiguration.html" title="type parameter in ARXClassificationConfiguration">T</a> extends <a href="org/deidentifier/arx/ARXClassificationConfiguration.html" title="class in org.deidentifier.arx">ARXClassificationConfiguration</a>&lt;?&gt;&gt; configCurrent</pre> <div class="block">Current configuration</div> </li> <li class="blockList"> <h4>config</h4> <pre><a href="org/deidentifier/arx/aggregates/ClassificationConfigurationLogisticRegression.html" title="class in org.deidentifier.arx.aggregates">ClassificationConfigurationLogisticRegression</a> config</pre> <div class="block">Configuration logistic regression</div> </li> <li class="blockList"> <h4>configNaiveBayes</h4> <pre><a href="org/deidentifier/arx/aggregates/ClassificationConfigurationNaiveBayes.html" title="class in org.deidentifier.arx.aggregates">ClassificationConfigurationNaiveBayes</a> configNaiveBayes</pre> <div class="block">Configuration naive bayes</div> </li> <li class="blockList"> <h4>configRandomForest</h4> <pre><a href="org/deidentifier/arx/aggregates/ClassificationConfigurationRandomForest.html" title="class in org.deidentifier.arx.aggregates">ClassificationConfigurationRandomForest</a> configRandomForest</pre> <div class="block">Configuration random forest</div> </li> <li class="blockListLast"> <h4>featureScaling</h4> <pre><a href="org/deidentifier/arx/ARXFeatureScaling.html" title="class in org.deidentifier.arx">ARXFeatureScaling</a> featureScaling</pre> <div class="block">Feature scaling</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelConfiguration"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelConfiguration.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelConfiguration</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-2887699232096897527L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>min</h4> <pre>java.util.Map&lt;K,V&gt; min</pre> <div class="block">Minimum generalization.</div> </li> <li class="blockList"> <h4>max</h4> <pre>java.util.Map&lt;K,V&gt; max</pre> <div class="block">Maximum generalization.</div> </li> <li class="blockList"> <h4>config</h4> <pre><a href="org/deidentifier/arx/ARXConfiguration.html" title="class in org.deidentifier.arx">ARXConfiguration</a> config</pre> <div class="block">Associated ARXConfiguration.</div> </li> <li class="blockList"> <h4>modified</h4> <pre>boolean modified</pre> <div class="block">Is this model modified.</div> </li> <li class="blockList"> <h4>hierarchies</h4> <pre>java.util.Map&lt;K,V&gt; hierarchies</pre> <div class="block">The associated hierarchies.</div> </li> <li class="blockList"> <h4>microAggregationFunctions</h4> <pre>java.util.Map&lt;K,V&gt; microAggregationFunctions</pre> <div class="block">The associated microaggregation functions.</div> </li> <li class="blockList"> <h4>microAggregationIgnoreMissingData</h4> <pre>java.util.Map&lt;K,V&gt; microAggregationIgnoreMissingData</pre> <div class="block">The associated handling of null values.</div> </li> <li class="blockList"> <h4>transformationModes</h4> <pre>java.util.Map&lt;K,V&gt; transformationModes</pre> <div class="block">The associated mode</div> </li> <li class="blockList"> <h4>researchSubset</h4> <pre><a href="org/deidentifier/arx/RowSet.html" title="class in org.deidentifier.arx">RowSet</a> researchSubset</pre> <div class="block">The associated research subset.</div> </li> <li class="blockList"> <h4>suppressionWeight</h4> <pre>java.lang.Double suppressionWeight</pre> <div class="block">The suppression weight.</div> </li> <li class="blockListLast"> <h4>hierarchyBuilders</h4> <pre>java.util.Map&lt;K,V&gt; hierarchyBuilders</pre> <div class="block">Hierarchy builder.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelCriterion.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelCriterion</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>8097643412538848066L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>enabled</h4> <pre>boolean enabled</pre> <div class="block">Is this criterion enabled.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelDDisclosurePrivacyCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelDDisclosurePrivacyCriterion.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelDDisclosurePrivacyCriterion</a> extends <a href="org/deidentifier/arx/gui/model/ModelExplicitCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelExplicitCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>4708272194910927203L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>d</h4> <pre>double d</pre> <div class="block">Delta</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelDifferentialPrivacyCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelDifferentialPrivacyCriterion.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelDifferentialPrivacyCriterion</a> extends <a href="org/deidentifier/arx/gui/model/ModelImplicitCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelImplicitCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>1803345324372136700L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>delta</h4> <pre>double delta</pre> <div class="block">Delta</div> </li> <li class="blockList"> <h4>epsilon</h4> <pre>double epsilon</pre> <div class="block">Epsilon</div> </li> <li class="blockList"> <h4>epsilonGeneralizationFraction</h4> <pre>java.lang.Double epsilonGeneralizationFraction</pre> <div class="block">Fraction of epsilon to use for automatic generalization</div> </li> <li class="blockListLast"> <h4>generalization</h4> <pre><a href="org/deidentifier/arx/DataGeneralizationScheme.html" title="class in org.deidentifier.arx">DataGeneralizationScheme</a> generalization</pre> <div class="block">Generalization scheme to be used or null in the case of data-dependent differential privacy</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelDPresenceCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelDPresenceCriterion.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelDPresenceCriterion</a> extends <a href="org/deidentifier/arx/gui/model/ModelImplicitCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelImplicitCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-1765428286262869856L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>dmin</h4> <pre>double dmin</pre> <div class="block">Dmin.</div> </li> <li class="blockListLast"> <h4>dmax</h4> <pre>double dmax</pre> <div class="block">Dmax.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelExplicitCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelExplicitCriterion.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelExplicitCriterion</a> extends <a href="org/deidentifier/arx/gui/model/ModelCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>2140859935908452477L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>attribute</h4> <pre>java.lang.String attribute</pre> <div class="block">The attribute.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelImplicitCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelImplicitCriterion.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelImplicitCriterion</a> extends <a href="org/deidentifier/arx/gui/model/ModelCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>7568685950981139601L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelKAnonymityCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelKAnonymityCriterion.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelKAnonymityCriterion</a> extends <a href="org/deidentifier/arx/gui/model/ModelImplicitCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelImplicitCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>6393748805356545958L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>k</h4> <pre>int k</pre> <div class="block">K.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelKMapCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelKMapCriterion.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelKMapCriterion</a> extends <a href="org/deidentifier/arx/gui/model/ModelImplicitCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelImplicitCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>2268947734419591705L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>k</h4> <pre>int k</pre> <div class="block">k.</div> </li> <li class="blockList"> <h4>significanceLevel</h4> <pre>double significanceLevel</pre> <div class="block">The significance level</div> </li> <li class="blockListLast"> <h4>estimator</h4> <pre><a href="org/deidentifier/arx/criteria/KMap.CellSizeEstimator.html" title="enum in org.deidentifier.arx.criteria">KMap.CellSizeEstimator</a> estimator</pre> <div class="block">The estimator</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelLDiversityCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelLDiversityCriterion.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelLDiversityCriterion</a> extends <a href="org/deidentifier/arx/gui/model/ModelExplicitCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelExplicitCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-9172448654255959945L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>variant</h4> <pre>int variant</pre> <div class="block">The variant to use.</div> </li> <li class="blockList"> <h4>l</h4> <pre>int l</pre> <div class="block">Parameter "l"</div> </li> <li class="blockListLast"> <h4>c</h4> <pre>double c</pre> <div class="block">Parameter "c", if any</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelLocalRecoding"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelLocalRecoding.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelLocalRecoding</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-5333464333997155970L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>gsFactor</h4> <pre>double gsFactor</pre> <div class="block">GS-Factor</div> </li> <li class="blockList"> <h4>numIterations</h4> <pre>int numIterations</pre> <div class="block">The number of iterations to perform</div> </li> <li class="blockList"> <h4>adaptionFactor</h4> <pre>double adaptionFactor</pre> <div class="block">Is the GS-Factor adaptive</div> </li> <li class="blockListLast"> <h4>mode</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelLocalRecoding.LocalRecodingMode.html" title="enum in org.deidentifier.arx.gui.model">ModelLocalRecoding.LocalRecodingMode</a> mode</pre> <div class="block">The type of recoding to perform</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelNodeFilter"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelNodeFilter.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelNodeFilter</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5451641489562102719L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialization Methods</h3> <ul class="blockList"> <li class="blockListLast"> <h4>readObject</h4> <pre>private&nbsp;void&nbsp;readObject(java.io.ObjectInputStream&nbsp;stream) throws java.io.IOException, java.lang.ClassNotFoundException</pre> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.io.IOException</code></dd> <dd><code>java.lang.ClassNotFoundException</code></dd> </dl> </li> </ul> </li> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>anonymity</h4> <pre>java.util.Set&lt;E&gt; anonymity</pre> <div class="block">The anonymity properties allowed.</div> </li> <li class="blockList"> <h4>generalizations</h4> <pre>java.util.Set&lt;E&gt;[] generalizations</pre> <div class="block">The generalization levels allowed.</div> </li> <li class="blockList"> <h4>maxNumNodesInitial</h4> <pre>int maxNumNodesInitial</pre> <div class="block">The initial number of nodes.</div> </li> <li class="blockList"> <h4>minInformationLoss</h4> <pre>double minInformationLoss</pre> <div class="block">Bound for min. score.</div> </li> <li class="blockListLast"> <h4>maxInformationLoss</h4> <pre>double maxInformationLoss</pre> <div class="block">Bound for max. score.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelProfitabilityCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelProfitabilityCriterion.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelProfitabilityCriterion</a> extends <a href="org/deidentifier/arx/gui/model/ModelImplicitCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelImplicitCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-4305859036159393453L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>attackerModel</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelProfitabilityCriterion.AttackerModel.html" title="enum in org.deidentifier.arx.gui.model">ModelProfitabilityCriterion.AttackerModel</a> attackerModel</pre> <div class="block">Prosecutor model</div> </li> <li class="blockListLast"> <h4>allowAttacks</h4> <pre>boolean allowAttacks</pre> <div class="block">Do we allow attacks to happen?</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelRisk"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelRisk.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelRisk</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5405871228130041796L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>modified</h4> <pre>boolean modified</pre> <div class="block">Modified</div> </li> <li class="blockList"> <h4>populationModel</h4> <pre><a href="org/deidentifier/arx/ARXPopulationModel.html" title="class in org.deidentifier.arx">ARXPopulationModel</a> populationModel</pre> <div class="block">Model</div> </li> <li class="blockList"> <h4>config</h4> <pre><a href="org/deidentifier/arx/ARXSolverConfiguration.html" title="class in org.deidentifier.arx">ARXSolverConfiguration</a> config</pre> <div class="block">Model</div> </li> <li class="blockList"> <h4>maxQiSize</h4> <pre>int maxQiSize</pre> <div class="block">Model</div> </li> <li class="blockList"> <h4>viewEnabledForInput</h4> <pre>java.util.Map&lt;K,V&gt; viewEnabledForInput</pre> <div class="block">Model</div> </li> <li class="blockList"> <h4>viewEnabledForOutput</h4> <pre>java.util.Map&lt;K,V&gt; viewEnabledForOutput</pre> <div class="block">Model</div> </li> <li class="blockList"> <h4>riskModelForAttributes</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelRisk.RiskModelForAttributes.html" title="enum in org.deidentifier.arx.gui.model">ModelRisk.RiskModelForAttributes</a> riskModelForAttributes</pre> <div class="block">Model</div> </li> <li class="blockList"> <h4>riskThresholdRecordsAtRisk</h4> <pre>java.lang.Double riskThresholdRecordsAtRisk</pre> <div class="block">Model</div> </li> <li class="blockList"> <h4>riskThresholdHighestRisk</h4> <pre>java.lang.Double riskThresholdHighestRisk</pre> <div class="block">Model</div> </li> <li class="blockListLast"> <h4>riskThresholdSuccessRate</h4> <pre>java.lang.Double riskThresholdSuccessRate</pre> <div class="block">Model</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelRiskBasedCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelRiskBasedCriterion.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelRiskBasedCriterion</a> extends <a href="org/deidentifier/arx/gui/model/ModelImplicitCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelImplicitCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-3653781193588952725L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>threshold</h4> <pre>double threshold</pre> <div class="block">Threshold</div> </li> <li class="blockListLast"> <h4>variant</h4> <pre>int variant</pre> <div class="block">The variant to use.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelTClosenessCriterion"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelTClosenessCriterion.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelTClosenessCriterion</a> extends <a href="org/deidentifier/arx/gui/model/ModelExplicitCriterion.html" title="class in org.deidentifier.arx.gui.model">ModelExplicitCriterion</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>4901053938589514626L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>variant</h4> <pre>int variant</pre> <div class="block">The variant.</div> </li> <li class="blockListLast"> <h4>t</h4> <pre>double t</pre> <div class="block">T.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.gui.model.ModelViewConfig"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/gui/model/ModelViewConfig.html" title="class in org.deidentifier.arx.gui.model">org.deidentifier.arx.gui.model.ModelViewConfig</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>4770598345842536623L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>mode</h4> <pre><a href="org/deidentifier/arx/gui/model/ModelViewConfig.Mode.html" title="enum in org.deidentifier.arx.gui.model">ModelViewConfig.Mode</a> mode</pre> <div class="block">Mode.</div> </li> <li class="blockList"> <h4>attribute</h4> <pre>java.lang.String attribute</pre> <div class="block">Attribute.</div> </li> <li class="blockList"> <h4>subset</h4> <pre>boolean subset</pre> <div class="block">Subset.</div> </li> <li class="blockList"> <h4>sortOrder</h4> <pre>boolean sortOrder</pre> <div class="block">Sort order.</div> </li> <li class="blockListLast"> <h4>changed</h4> <pre>boolean changed</pre> <div class="block">Changed flag.</div> </li> </ul> </li> </ul> </li> </ul> </li> <li class="blockList"> <h2 title="Package">Package&nbsp;org.deidentifier.arx.io</h2> <ul class="blockList"> <li class="blockList"><a name="org.deidentifier.arx.io.CSVOptions"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/io/CSVOptions.html" title="class in org.deidentifier.arx.io">org.deidentifier.arx.io.CSVOptions</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>2422613628612481137L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>maxColumns</h4> <pre>java.lang.Integer maxColumns</pre> <div class="block">The max columns.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.io.CSVSyntax"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/io/CSVSyntax.html" title="class in org.deidentifier.arx.io">org.deidentifier.arx.io.CSVSyntax</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-3978502790060734961L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>delimiter</h4> <pre>char delimiter</pre> <div class="block">The delimiter.</div> </li> <li class="blockList"> <h4>quote</h4> <pre>char quote</pre> <div class="block">The quote.</div> </li> <li class="blockList"> <h4>escape</h4> <pre>char escape</pre> <div class="block">The escape.</div> </li> <li class="blockList"> <h4>linebreak</h4> <pre>char[] linebreak</pre> <div class="block">The linebreak.</div> </li> <li class="blockListLast"> <h4>maxColumns</h4> <pre>int maxColumns</pre> <div class="block">Max columns</div> </li> </ul> </li> </ul> </li> </ul> </li> <li class="blockList"> <h2 title="Package">Package&nbsp;org.deidentifier.arx.metric</h2> <ul class="blockList"> <li class="blockList"><a name="org.deidentifier.arx.metric.InformationLoss"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/InformationLoss.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.InformationLoss</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-5347658129539223333L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>metadata</h4> <pre>java.util.List&lt;E&gt; metadata</pre> <div class="block">Metadata</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.Metric"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/Metric.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.Metric</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-2657745103125430229L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>independent</h4> <pre>boolean independent</pre> <div class="block">Is the metric independent?.</div> </li> <li class="blockList"> <h4>monotonicWithGeneralization</h4> <pre>java.lang.Boolean monotonicWithGeneralization</pre> <div class="block">Is the metric monotonic with generalization?.</div> </li> <li class="blockList"> <h4>monotonic</h4> <pre>boolean monotonic</pre> <div class="block">Is the metric monotonic with suppression?.</div> </li> <li class="blockList"> <h4>gFactor</h4> <pre>java.lang.Double gFactor</pre> <div class="block">Configuration factor.</div> </li> <li class="blockList"> <h4>gsFactor</h4> <pre>java.lang.Double gsFactor</pre> <div class="block">Configuration factor.</div> </li> <li class="blockListLast"> <h4>sFactor</h4> <pre>java.lang.Double sFactor</pre> <div class="block">Configuration factor.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.MetricAECS"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/MetricAECS.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.MetricAECS</a> extends <a href="org/deidentifier/arx/metric/MetricDefault.html" title="class in org.deidentifier.arx.metric">MetricDefault</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-532478849890959974L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>rowCount</h4> <pre>double rowCount</pre> <div class="block">Number of tuples.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.MetricConfiguration"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/MetricConfiguration.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.MetricConfiguration</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>871854276489749340L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>monotonic</h4> <pre>boolean monotonic</pre> <div class="block">Monotonic variant.</div> </li> <li class="blockList"> <h4>gsFactor</h4> <pre>double gsFactor</pre> <div class="block">Coding model.</div> </li> <li class="blockList"> <h4>precomputed</h4> <pre>boolean precomputed</pre> <div class="block">Precomputed.</div> </li> <li class="blockList"> <h4>precomputationThreshold</h4> <pre>double precomputationThreshold</pre> <div class="block">Precomputation threshold.</div> </li> <li class="blockListLast"> <h4>aggregateFunction</h4> <pre><a href="org/deidentifier/arx/metric/Metric.AggregateFunction.html" title="enum in org.deidentifier.arx.metric">Metric.AggregateFunction</a> aggregateFunction</pre> <div class="block">Aggregate function.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.MetricDefault"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/MetricDefault.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.MetricDefault</a> extends <a href="org/deidentifier/arx/metric/Metric.html" title="class in org.deidentifier.arx.metric">Metric</a>&lt;org.deidentifier.arx.metric.InformationLossDefault&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>2672819203235170632L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.MetricDescription"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/MetricDescription.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.MetricDescription</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-2774981286637344244L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>name</h4> <pre>java.lang.String name</pre> <div class="block">Name.</div> </li> <li class="blockList"> <h4>monotonicVariantSupported</h4> <pre>boolean monotonicVariantSupported</pre> <div class="block">Monotonic variant supported.</div> </li> <li class="blockList"> <h4>attributeWeightsSupported</h4> <pre>boolean attributeWeightsSupported</pre> <div class="block">Attribute weights supported.</div> </li> <li class="blockList"> <h4>configurableCodingModelSupported</h4> <pre>boolean configurableCodingModelSupported</pre> <div class="block">Configurable coding model supported.</div> </li> <li class="blockList"> <h4>precomputationSupported</h4> <pre>boolean precomputationSupported</pre> <div class="block">Pre-computation supported.</div> </li> <li class="blockList"> <h4>aggregateFunctionSupported</h4> <pre>boolean aggregateFunctionSupported</pre> <div class="block">Aggregate functions supported.</div> </li> <li class="blockListLast"> <h4>attackerModelSupported</h4> <pre>boolean attackerModelSupported</pre> <div class="block">Are different attacker models supported.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.MetricDM"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/MetricDM.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.MetricDM</a> extends <a href="org/deidentifier/arx/metric/MetricDefault.html" title="class in org.deidentifier.arx.metric">MetricDefault</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>4886262855672670521L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>rowCount</h4> <pre>int rowCount</pre> <div class="block">Number of tuples.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.MetricDMStar"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/MetricDMStar.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.MetricDMStar</a> extends <a href="org/deidentifier/arx/metric/MetricDefault.html" title="class in org.deidentifier.arx.metric">MetricDefault</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-3324788439890959974L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>rowCount</h4> <pre>double rowCount</pre> <div class="block">Number of tuples.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.MetricEntropy"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/MetricEntropy.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.MetricEntropy</a> extends <a href="org/deidentifier/arx/metric/MetricDefault.html" title="class in org.deidentifier.arx.metric">MetricDefault</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-8618697919821588987L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>cache</h4> <pre>double[][] cache</pre> <div class="block">Column -> Level -> Value.</div> </li> <li class="blockList"> <h4>cardinalities</h4> <pre>int[][][] cardinalities</pre> <div class="block">Column -> Id -> Level -> Count.</div> </li> <li class="blockListLast"> <h4>hierarchies</h4> <pre>int[][][] hierarchies</pre> <div class="block">Column -> Id -> Level -> Output.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.MetricHeight"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/MetricHeight.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.MetricHeight</a> extends <a href="org/deidentifier/arx/metric/MetricDefault.html" title="class in org.deidentifier.arx.metric">MetricDefault</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5911337622032778562L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>minHeight</h4> <pre>int minHeight</pre> <div class="block">The minimum height.</div> </li> <li class="blockListLast"> <h4>maxHeight</h4> <pre>int maxHeight</pre> <div class="block">The maximum height.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.MetricNMEntropy"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/MetricNMEntropy.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.MetricNMEntropy</a> extends <a href="org/deidentifier/arx/metric/MetricEntropy.html" title="class in org.deidentifier.arx.metric">MetricEntropy</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5789738609326541247L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.MetricNMPrecision"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/MetricNMPrecision.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.MetricNMPrecision</a> extends <a href="org/deidentifier/arx/metric/MetricWeighted.html" title="class in org.deidentifier.arx.metric">MetricWeighted</a>&lt;org.deidentifier.arx.metric.InformationLossDefault&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-218192738838711533L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>height</h4> <pre>int[] height</pre> <div class="block">Height.</div> </li> <li class="blockListLast"> <h4>cells</h4> <pre>double cells</pre> <div class="block">Number of cells.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.MetricPrecision"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/MetricPrecision.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.MetricPrecision</a> extends <a href="org/deidentifier/arx/metric/MetricWeighted.html" title="class in org.deidentifier.arx.metric">MetricWeighted</a>&lt;org.deidentifier.arx.metric.InformationLossDefault&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7612335677779934529L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>maxLevels</h4> <pre>int[] maxLevels</pre> <div class="block">Height.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.MetricStatic"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/MetricStatic.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.MetricStatic</a> extends <a href="org/deidentifier/arx/metric/MetricWeighted.html" title="class in org.deidentifier.arx.metric">MetricWeighted</a>&lt;org.deidentifier.arx.metric.InformationLossDefault&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>3778891174824606177L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>_infoloss</h4> <pre>java.util.Map&lt;K,V&gt; _infoloss</pre> <div class="block">The user defined information loss per level, indexed by column name.</div> </li> <li class="blockListLast"> <h4>infoloss</h4> <pre>double[][] infoloss</pre> <div class="block">The pre-calculated information loss.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.MetricWeighted"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/MetricWeighted.html" title="class in org.deidentifier.arx.metric">org.deidentifier.arx.metric.MetricWeighted</a> extends <a href="org/deidentifier/arx/metric/Metric.html" title="class in org.deidentifier.arx.metric">Metric</a>&lt;<a href="org/deidentifier/arx/metric/MetricWeighted.html" title="type parameter in MetricWeighted">T</a> extends <a href="org/deidentifier/arx/metric/InformationLoss.html" title="class in org.deidentifier.arx.metric">InformationLoss</a>&lt;?&gt;&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>6508220940790010968L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>weights</h4> <pre>double[] weights</pre> <div class="block">The weights.</div> </li> </ul> </li> </ul> </li> </ul> </li> <li class="blockList"> <h2 title="Package">Package&nbsp;org.deidentifier.arx.metric.v2</h2> <ul class="blockList"> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.AbstractILMultiDimensional"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/AbstractILMultiDimensional.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.AbstractILMultiDimensional</a> extends <a href="org/deidentifier/arx/metric/InformationLoss.html" title="class in org.deidentifier.arx.metric">InformationLoss</a>&lt;double[]&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>4600789773980813693L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>values</h4> <pre>double[] values</pre> <div class="block">Values.</div> </li> <li class="blockListLast"> <h4>weights</h4> <pre>double[] weights</pre> <div class="block">Weights.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.AbstractILMultiDimensionalReduced"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/AbstractILMultiDimensionalReduced.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.AbstractILMultiDimensionalReduced</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractILMultiDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractILMultiDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>7228258212711188233L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>aggregate</h4> <pre>double aggregate</pre> <div class="block">Aggregate.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.AbstractMetricMultiDimensional"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/AbstractMetricMultiDimensional.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.AbstractMetricMultiDimensional</a> extends <a href="org/deidentifier/arx/metric/Metric.html" title="class in org.deidentifier.arx.metric">Metric</a>&lt;<a href="org/deidentifier/arx/metric/v2/AbstractILMultiDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractILMultiDimensional</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>3909752748519119689L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>weights</h4> <pre>double[] weights</pre> <div class="block">The weights.</div> </li> <li class="blockList"> <h4>dimensions</h4> <pre>int dimensions</pre> <div class="block">Number of dimensions.</div> </li> <li class="blockList"> <h4>dimensionsGeneralized</h4> <pre>int dimensionsGeneralized</pre> <div class="block">Number of dimensions with generalization</div> </li> <li class="blockList"> <h4>dimensionsAggregated</h4> <pre>int dimensionsAggregated</pre> <div class="block">Number of dimensions with aggregation</div> </li> <li class="blockList"> <h4>min</h4> <pre>double[] min</pre> <div class="block">Min.</div> </li> <li class="blockList"> <h4>max</h4> <pre>double[] max</pre> <div class="block">Max.</div> </li> <li class="blockList"> <h4>function</h4> <pre><a href="org/deidentifier/arx/metric/Metric.AggregateFunction.html" title="enum in org.deidentifier.arx.metric">Metric.AggregateFunction</a> function</pre> <div class="block">The aggregate function.</div> </li> <li class="blockList"> <h4>aggregation</h4> <pre><a href="org/deidentifier/arx/framework/data/DataAggregationInformation.html" title="class in org.deidentifier.arx.framework.data">DataAggregationInformation</a> aggregation</pre> <div class="block">The microaggregation functions.</div> </li> <li class="blockListLast"> <h4>k</h4> <pre>int k</pre> <div class="block">Minimal size of equivalence classes enforced by the differential privacy model</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.AbstractMetricMultiDimensionalPotentiallyPrecomputed"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/AbstractMetricMultiDimensionalPotentiallyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.AbstractMetricMultiDimensionalPotentiallyPrecomputed</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricMultiDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricMultiDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>7278544218893194559L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>precomputed</h4> <pre>boolean precomputed</pre> <div class="block">Is this instance precomputed.</div> </li> <li class="blockList"> <h4>threshold</h4> <pre>double threshold</pre> <div class="block">The threshold.</div> </li> <li class="blockList"> <h4>defaultMetric</h4> <pre><a href="org/deidentifier/arx/metric/v2/AbstractMetricMultiDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricMultiDimensional</a> defaultMetric</pre> <div class="block">The default metric.</div> </li> <li class="blockListLast"> <h4>precomputedMetric</h4> <pre><a href="org/deidentifier/arx/metric/v2/AbstractMetricMultiDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricMultiDimensional</a> precomputedMetric</pre> <div class="block">The precomputed variant.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.AbstractMetricSingleDimensional"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/AbstractMetricSingleDimensional.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.AbstractMetricSingleDimensional</a> extends <a href="org/deidentifier/arx/metric/Metric.html" title="class in org.deidentifier.arx.metric">Metric</a>&lt;<a href="org/deidentifier/arx/metric/v2/ILSingleDimensional.html" title="class in org.deidentifier.arx.metric.v2">ILSingleDimensional</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-1082954137578580790L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>tuples</h4> <pre>java.lang.Double tuples</pre> <div class="block">Row count.</div> </li> <li class="blockListLast"> <h4>aggregation</h4> <pre><a href="org/deidentifier/arx/framework/data/DataAggregationInformation.html" title="class in org.deidentifier.arx.framework.data">DataAggregationInformation</a> aggregation</pre> <div class="block">The microaggregation functions.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.Cardinalities"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/Cardinalities.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.Cardinalities</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>6164578830669365810L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>cardinalities</h4> <pre>int[][][] cardinalities</pre> <div class="block">Cardinalities: Column -> Id -> Level -> Count.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.DomainShareInterval"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/DomainShareInterval.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.DomainShareInterval</a> extends <a href="org/deidentifier/arx/aggregates/HierarchyBuilderIntervalBased.html" title="class in org.deidentifier.arx.aggregates">HierarchyBuilderIntervalBased</a>&lt;<a href="org/deidentifier/arx/metric/v2/DomainShareInterval.html" title="type parameter in DomainShareInterval">T</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>3430961217394466615L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialization Methods</h3> <ul class="blockList"> <li class="blockList"> <h4>readObject</h4> <pre>private&nbsp;void&nbsp;readObject(java.io.ObjectInputStream&nbsp;aInputStream) throws java.lang.ClassNotFoundException, java.io.IOException</pre> <div class="block">De-serialization.</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.ClassNotFoundException</code></dd> <dd><code>java.io.IOException</code></dd> </dl> </li> <li class="blockListLast"> <h4>writeObject</h4> <pre>private&nbsp;void&nbsp;writeObject(java.io.ObjectOutputStream&nbsp;aOutputStream) throws java.io.IOException</pre> <div class="block">Serialization.</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.io.IOException</code></dd> </dl> </li> </ul> </li> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>domainSize</h4> <pre>double domainSize</pre> <div class="block">The domain size.</div> </li> <li class="blockList"> <h4>dataType</h4> <pre><a href="org/deidentifier/arx/DataType.DataTypeWithRatioScale.html" title="interface in org.deidentifier.arx">DataType.DataTypeWithRatioScale</a>&lt;<a href="org/deidentifier/arx/DataType.DataTypeWithRatioScale.html" title="type parameter in DataType.DataTypeWithRatioScale">T</a>&gt; dataType</pre> <div class="block">Data type.</div> </li> <li class="blockListLast"> <h4>shares</h4> <pre>double[] shares</pre> <div class="block">One share per attribute.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.DomainShareMaterialized"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/DomainShareMaterialized.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.DomainShareMaterialized</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-8981924690395236648L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialization Methods</h3> <ul class="blockList"> <li class="blockList"> <h4>readObject</h4> <pre>private&nbsp;void&nbsp;readObject(java.io.ObjectInputStream&nbsp;aInputStream) throws java.lang.ClassNotFoundException, java.io.IOException</pre> <div class="block">De-serialization.</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.ClassNotFoundException</code></dd> <dd><code>java.io.IOException</code></dd> </dl> </li> <li class="blockListLast"> <h4>writeObject</h4> <pre>private&nbsp;void&nbsp;writeObject(java.io.ObjectOutputStream&nbsp;aOutputStream) throws java.io.IOException</pre> <div class="block">Serialization.</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.io.IOException</code></dd> </dl> </li> </ul> </li> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>size</h4> <pre>double size</pre> <div class="block">The size of the domain.</div> </li> <li class="blockListLast"> <h4>shares</h4> <pre>double[] shares</pre> <div class="block">One share per attribute.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.DomainShareRedaction"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/DomainShareRedaction.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.DomainShareRedaction</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>2015677962393713964L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>maxValueLength</h4> <pre>double maxValueLength</pre> <div class="block">Meta-data about the nature of the domain of the attribute.</div> </li> <li class="blockList"> <h4>domainSize</h4> <pre>double domainSize</pre> <div class="block">Meta-data about the nature of the domain of the attribute.</div> </li> <li class="blockList"> <h4>alphabetSize</h4> <pre>double alphabetSize</pre> <div class="block">Meta-data about the nature of the domain of the attribute.</div> </li> <li class="blockList"> <h4>minInput</h4> <pre>double minInput</pre> <div class="block">For interpolating linearly from input to output range.</div> </li> <li class="blockList"> <h4>maxInput</h4> <pre>double maxInput</pre> <div class="block">For interpolating linearly from input to output range.</div> </li> <li class="blockList"> <h4>minOutput</h4> <pre>double minOutput</pre> <div class="block">For interpolating linearly from input to output range.</div> </li> <li class="blockListLast"> <h4>maxOutput</h4> <pre>double maxOutput</pre> <div class="block">For interpolating linearly from input to output range.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.DomainShareReliable"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/DomainShareReliable.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.DomainShareReliable</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-396317436976075163L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialization Methods</h3> <ul class="blockList"> <li class="blockList"> <h4>readObject</h4> <pre>private&nbsp;void&nbsp;readObject(java.io.ObjectInputStream&nbsp;aInputStream) throws java.lang.ClassNotFoundException, java.io.IOException</pre> <div class="block">De-serialization.</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.lang.ClassNotFoundException</code></dd> <dd><code>java.io.IOException</code></dd> </dl> </li> <li class="blockListLast"> <h4>writeObject</h4> <pre>private&nbsp;void&nbsp;writeObject(java.io.ObjectOutputStream&nbsp;aOutputStream) throws java.io.IOException</pre> <div class="block">Serialization.</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.io.IOException</code></dd> </dl> </li> </ul> </li> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>shares</h4> <pre>org.apache.commons.math3.fraction.BigFraction[] shares</pre> <div class="block">One share per attribute.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.ILMultiDimensionalArithmeticMean"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/ILMultiDimensionalArithmeticMean.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.ILMultiDimensionalArithmeticMean</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractILMultiDimensionalReduced.html" title="class in org.deidentifier.arx.metric.v2">AbstractILMultiDimensionalReduced</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5142553922311764185L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.ILMultiDimensionalGeometricMean"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/ILMultiDimensionalGeometricMean.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.ILMultiDimensionalGeometricMean</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractILMultiDimensionalReduced.html" title="class in org.deidentifier.arx.metric.v2">AbstractILMultiDimensionalReduced</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>621501985571033348L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.ILMultiDimensionalMax"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/ILMultiDimensionalMax.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.ILMultiDimensionalMax</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractILMultiDimensionalReduced.html" title="class in org.deidentifier.arx.metric.v2">AbstractILMultiDimensionalReduced</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-3373577899437514858L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.ILMultiDimensionalRank"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/ILMultiDimensionalRank.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.ILMultiDimensionalRank</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractILMultiDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractILMultiDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>591145071792293317L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialization Methods</h3> <ul class="blockList"> <li class="blockListLast"> <h4>readObject</h4> <pre>private&nbsp;void&nbsp;readObject(java.io.ObjectInputStream&nbsp;stream) throws java.io.IOException, java.lang.ClassNotFoundException</pre> <div class="block">Overwritten to handle changes in how the mean is computed.</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code>java.io.IOException</code></dd> <dd><code>java.lang.ClassNotFoundException</code></dd> </dl> </li> </ul> </li> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>aggregate</h4> <pre>double[] aggregate</pre> <div class="block">Aggregate.</div> </li> <li class="blockListLast"> <h4>mean</h4> <pre>double mean</pre> <div class="block">Geometric mean.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.ILMultiDimensionalSum"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/ILMultiDimensionalSum.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.ILMultiDimensionalSum</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractILMultiDimensionalReduced.html" title="class in org.deidentifier.arx.metric.v2">AbstractILMultiDimensionalReduced</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>6456243227046629659L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.ILScore"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/ILScore.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.ILScore</a> extends <a href="org/deidentifier/arx/metric/InformationLoss.html" title="class in org.deidentifier.arx.metric">InformationLoss</a>&lt;org.apache.commons.math3.fraction.BigFraction&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-2638719458508437194L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>value</h4> <pre>org.apache.commons.math3.fraction.BigFraction value</pre> <div class="block">Value</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.ILSingleDimensional"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/ILSingleDimensional.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.ILSingleDimensional</a> extends <a href="org/deidentifier/arx/metric/InformationLoss.html" title="class in org.deidentifier.arx.metric">InformationLoss</a>&lt;java.lang.Double&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>8045076435539841773L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>value</h4> <pre>double value</pre> <div class="block">Values.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDHeight"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDHeight.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDHeight</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricMultiDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricMultiDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-4720395539299677086L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDNMLoss"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDNMLoss.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDNMLoss</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricMultiDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricMultiDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-573670902335136600L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>tuples</h4> <pre>double tuples</pre> <div class="block">Total number of tuples, depends on existence of research subset.</div> </li> <li class="blockList"> <h4>shares</h4> <pre><a href="org/deidentifier/arx/metric/v2/DomainShare.html" title="interface in org.deidentifier.arx.metric.v2">DomainShare</a>[] shares</pre> <div class="block">Domain shares for each dimension.</div> </li> <li class="blockList"> <h4>sharesReliable</h4> <pre><a href="org/deidentifier/arx/metric/v2/DomainShareReliable.html" title="class in org.deidentifier.arx.metric.v2">DomainShareReliable</a>[] sharesReliable</pre> <div class="block">Reliable domain shares for each dimension.</div> </li> <li class="blockList"> <h4>gFactor</h4> <pre>double gFactor</pre> <div class="block">We must override this for backward compatibility. Remove, when re-implemented.</div> </li> <li class="blockList"> <h4>gsFactor</h4> <pre>double gsFactor</pre> <div class="block">We must override this for backward compatibility. Remove, when re-implemented.</div> </li> <li class="blockListLast"> <h4>sFactor</h4> <pre>double sFactor</pre> <div class="block">We must override this for backward compatibility. Remove, when re-implemented.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDNMLossPotentiallyPrecomputed"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDNMLossPotentiallyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDNMLossPotentiallyPrecomputed</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricMultiDimensionalPotentiallyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricMultiDimensionalPotentiallyPrecomputed</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-409964525491865637L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDNMLossPrecomputed"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDNMLossPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDNMLossPrecomputed</a> extends <a href="org/deidentifier/arx/metric/v2/MetricMDNMLoss.html" title="class in org.deidentifier.arx.metric.v2">MetricMDNMLoss</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7505441444551612996L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>cardinalities</h4> <pre><a href="org/deidentifier/arx/metric/v2/Cardinalities.html" title="class in org.deidentifier.arx.metric.v2">Cardinalities</a> cardinalities</pre> <div class="block">Cardinalities.</div> </li> <li class="blockListLast"> <h4>values</h4> <pre>int[][][] values</pre> <div class="block">Distinct values: attribute -> level -> values.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDNMPrecision"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDNMPrecision.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDNMPrecision</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricMultiDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricMultiDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>7972929684708525849L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>rowCount</h4> <pre>double rowCount</pre> <div class="block">Row count.</div> </li> <li class="blockListLast"> <h4>heights</h4> <pre>int[] heights</pre> <div class="block">Hierarchy heights.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDNUEntropy"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDNUEntropy.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDNUEntropy</a> extends <a href="org/deidentifier/arx/metric/v2/MetricMDNUEntropyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">MetricMDNUEntropyPrecomputed</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-8114158144622853288L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDNUEntropyPotentiallyPrecomputed"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDNUEntropyPotentiallyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDNUEntropyPotentiallyPrecomputed</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricMultiDimensionalPotentiallyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricMultiDimensionalPotentiallyPrecomputed</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>7044684079235440871L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDNUEntropyPrecomputed"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDNUEntropyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDNUEntropyPrecomputed</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricMultiDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricMultiDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>8053878428909814308L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>cardinalities</h4> <pre><a href="org/deidentifier/arx/metric/v2/Cardinalities.html" title="class in org.deidentifier.arx.metric.v2">Cardinalities</a> cardinalities</pre> <div class="block">Cardinalities.</div> </li> <li class="blockList"> <h4>cache</h4> <pre>double[][] cache</pre> <div class="block">Column -> Level -> Value.</div> </li> <li class="blockList"> <h4>hierarchies</h4> <pre>int[][][] hierarchies</pre> <div class="block">Column -> Id -> Level -> Output.</div> </li> <li class="blockList"> <h4>rows</h4> <pre>double rows</pre> <div class="block">Num rows</div> </li> <li class="blockListLast"> <h4>rootValues</h4> <pre>int[] rootValues</pre> <div class="block">The root values of all generalization hierarchies or -1 if no single root value exists</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDNUNMEntropy"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDNUNMEntropy.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDNUNMEntropy</a> extends <a href="org/deidentifier/arx/metric/v2/MetricMDNUNMEntropyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">MetricMDNUNMEntropyPrecomputed</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7428794463838685004L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDNUNMEntropyPotentiallyPrecomputed"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDNUNMEntropyPotentiallyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDNUNMEntropyPotentiallyPrecomputed</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricMultiDimensionalPotentiallyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricMultiDimensionalPotentiallyPrecomputed</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-3213516677340712914L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDNUNMEntropyPrecomputed"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDNUNMEntropyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDNUNMEntropyPrecomputed</a> extends <a href="org/deidentifier/arx/metric/v2/MetricMDNUEntropyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">MetricMDNUEntropyPrecomputed</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7428794463838685004L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDNUNMNormalizedEntropy"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDNUNMNormalizedEntropy.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDNUNMNormalizedEntropy</a> extends <a href="org/deidentifier/arx/metric/v2/MetricMDNUNMNormalizedEntropyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">MetricMDNUNMNormalizedEntropyPrecomputed</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>8815423510640657624L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDNUNMNormalizedEntropyPotentiallyPrecomputed"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDNUNMNormalizedEntropyPotentiallyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDNUNMNormalizedEntropyPotentiallyPrecomputed</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricMultiDimensionalPotentiallyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricMultiDimensionalPotentiallyPrecomputed</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-3297238195567701353L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDNUNMNormalizedEntropyPrecomputed"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDNUNMNormalizedEntropyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDNUNMNormalizedEntropyPrecomputed</a> extends <a href="org/deidentifier/arx/metric/v2/MetricMDNUNMEntropyPrecomputed.html" title="class in org.deidentifier.arx.metric.v2">MetricMDNUNMEntropyPrecomputed</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-2384411534214262365L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>upper</h4> <pre>double[] upper</pre> <div class="block">Upper bounds</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDPrecision"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDPrecision.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDPrecision</a> extends <a href="org/deidentifier/arx/metric/v2/MetricMDNMPrecision.html" title="class in org.deidentifier.arx.metric.v2">MetricMDNMPrecision</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>8514706682676049814L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricMDStatic"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricMDStatic.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricMDStatic</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricMultiDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricMultiDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-1436611621616365335L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>_infoloss</h4> <pre>java.util.Map&lt;K,V&gt; _infoloss</pre> <div class="block">The user defined information loss per level, indexed by column name.</div> </li> <li class="blockListLast"> <h4>infoloss</h4> <pre>double[][] infoloss</pre> <div class="block">The pre-calculated information loss.</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricSDAECS"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricSDAECS.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricSDAECS</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricSingleDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricSingleDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>8076459507565472479L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricSDClassification"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricSDClassification.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricSDClassification</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricSingleDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricSingleDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-7940144844158472876L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>responseVariablesNonQI</h4> <pre>int[] responseVariablesNonQI</pre> <div class="block">Indices of response variables in distributions</div> </li> <li class="blockList"> <h4>responseVariablesQI</h4> <pre>int[] responseVariablesQI</pre> <div class="block">Indices of response variables in quasi-identifiers</div> </li> <li class="blockList"> <h4>responseVariablesQIScaleFactors</h4> <pre>double[][] responseVariablesQIScaleFactors</pre> <div class="block">Scale factors for QI target variables</div> </li> <li class="blockList"> <h4>penaltySuppressed</h4> <pre>double penaltySuppressed</pre> <div class="block">Penalty</div> </li> <li class="blockList"> <h4>penaltyInfrequentResponse</h4> <pre>double penaltyInfrequentResponse</pre> <div class="block">Penalty</div> </li> <li class="blockList"> <h4>penaltyNoMajorityResponse</h4> <pre>double penaltyNoMajorityResponse</pre> <div class="block">Penalty</div> </li> <li class="blockList"> <h4>penaltyMax</h4> <pre>double penaltyMax</pre> <div class="block">Maximal penality</div> </li> <li class="blockList"> <h4>penaltyMaxScale</h4> <pre>double penaltyMaxScale</pre> <div class="block">Maximal penality</div> </li> <li class="blockListLast"> <h4>sensitivity</h4> <pre>java.math.BigInteger sensitivity</pre> <div class="block">Sensitivity of the score function</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricSDDiscernability"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricSDDiscernability.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricSDDiscernability</a> extends <a href="org/deidentifier/arx/metric/v2/MetricSDNMDiscernability.html" title="class in org.deidentifier.arx.metric.v2">MetricSDNMDiscernability</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-9156839234909657895L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricSDNMAmbiguity"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricSDNMAmbiguity.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricSDNMAmbiguity</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricSingleDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricSingleDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-4376770864891280340L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>tuples</h4> <pre>java.lang.Double tuples</pre> <div class="block">Total number of tuples, depends on existence of research subset.</div> </li> <li class="blockList"> <h4>shares</h4> <pre><a href="org/deidentifier/arx/metric/v2/DomainShare.html" title="interface in org.deidentifier.arx.metric.v2">DomainShare</a>[] shares</pre> <div class="block">Domain shares for each dimension.</div> </li> <li class="blockListLast"> <h4>max</h4> <pre>java.lang.Double max</pre> <div class="block">Maximum value</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricSDNMDiscernability"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricSDNMDiscernability.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricSDNMDiscernability</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricSingleDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricSingleDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-8573084860566655278L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>numRows</h4> <pre>long numRows</pre> <div class="block">Total number of rows.</div> </li> <li class="blockListLast"> <h4>k</h4> <pre>long k</pre> <div class="block">Minimal size of equivalence classes enforced by the differential privacy model</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricSDNMEntropyBasedInformationLoss"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricSDNMEntropyBasedInformationLoss.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricSDNMEntropyBasedInformationLoss</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricSingleDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricSingleDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-2443537745262162075L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>shares</h4> <pre><a href="org/deidentifier/arx/metric/v2/DomainShare.html" title="interface in org.deidentifier.arx.metric.v2">DomainShare</a>[] shares</pre> <div class="block">Domain shares for each dimension.</div> </li> <li class="blockListLast"> <h4>maxIL</h4> <pre>double maxIL</pre> <div class="block">MaxIL</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricSDNMKLDivergence"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricSDNMKLDivergence.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricSDNMKLDivergence</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricSingleDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricSingleDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-4918601543733931921L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>tuples</h4> <pre>java.lang.Double tuples</pre> <div class="block">Total number of tuples, depends on existence of research subset.</div> </li> <li class="blockList"> <h4>shares</h4> <pre><a href="org/deidentifier/arx/metric/v2/DomainShare.html" title="interface in org.deidentifier.arx.metric.v2">DomainShare</a>[] shares</pre> <div class="block">Domain shares for each dimension.</div> </li> <li class="blockList"> <h4>max</h4> <pre>java.lang.Double max</pre> <div class="block">Maximum value</div> </li> <li class="blockList"> <h4>inputDistribution</h4> <pre>double[] inputDistribution</pre> <div class="block">Distribution</div> </li> <li class="blockListLast"> <h4>maximalArea</h4> <pre>double maximalArea</pre> <div class="block">Maximal area</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.MetricSDNMPublisherPayout"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/MetricSDNMPublisherPayout.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.MetricSDNMPublisherPayout</a> extends <a href="org/deidentifier/arx/metric/v2/AbstractMetricSingleDimensional.html" title="class in org.deidentifier.arx.metric.v2">AbstractMetricSingleDimensional</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>5729454129866471107L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>config</h4> <pre><a href="org/deidentifier/arx/ARXCostBenefitConfiguration.html" title="class in org.deidentifier.arx">ARXCostBenefitConfiguration</a> config</pre> <div class="block">Configuration for the Stackelberg game</div> </li> <li class="blockList"> <h4>shares</h4> <pre><a href="org/deidentifier/arx/metric/v2/DomainShare.html" title="interface in org.deidentifier.arx.metric.v2">DomainShare</a>[] shares</pre> <div class="block">Domain shares for each dimension.</div> </li> <li class="blockList"> <h4>maxIL</h4> <pre>double maxIL</pre> <div class="block">Maximal information loss</div> </li> <li class="blockList"> <h4>modelRisk</h4> <pre><a href="org/deidentifier/arx/risk/RiskModelCostBenefit.html" title="class in org.deidentifier.arx.risk">RiskModelCostBenefit</a> modelRisk</pre> <div class="block">Risk model</div> </li> <li class="blockList"> <h4>journalistAttackerModel</h4> <pre>boolean journalistAttackerModel</pre> <div class="block">Journalist attacker model</div> </li> <li class="blockListLast"> <h4>maximalPayout</h4> <pre><a href="org/deidentifier/arx/metric/v2/QualityMetadata.html" title="class in org.deidentifier.arx.metric.v2">QualityMetadata</a>&lt;<a href="org/deidentifier/arx/metric/v2/QualityMetadata.html" title="type parameter in QualityMetadata">T</a>&gt; maximalPayout</pre> <div class="block">Maximal payout</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.QualityMetadata"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/QualityMetadata.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.QualityMetadata</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>8750896039746232218L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>parameter</h4> <pre>java.lang.String parameter</pre> <div class="block">Parameter</div> </li> <li class="blockListLast"> <h4>value</h4> <pre>java.lang.Object value</pre> <div class="block">Value</div> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="org.deidentifier.arx.metric.v2.TupleMatcher"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/metric/v2/TupleMatcher.html" title="class in org.deidentifier.arx.metric.v2">org.deidentifier.arx.metric.v2.TupleMatcher</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-5081573765755187296L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>hierarchies</h4> <pre>int[][][] hierarchies</pre> <div class="block">Data</div> </li> <li class="blockListLast"> <h4>tuple</h4> <pre>int[] tuple</pre> <div class="block">Data</div> </li> </ul> </li> </ul> </li> </ul> </li> <li class="blockList"> <h2 title="Package">Package&nbsp;org.deidentifier.arx.reliability</h2> <ul class="blockList"> <li class="blockList"><a name="org.deidentifier.arx.reliability.IntervalArithmeticException"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/reliability/IntervalArithmeticException.html" title="class in org.deidentifier.arx.reliability">org.deidentifier.arx.reliability.IntervalArithmeticException</a> extends java.lang.Exception implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-1627573957508498257L</dd> </dl> </li> <li class="blockList"><a name="org.deidentifier.arx.reliability.IntervalDouble"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/reliability/IntervalDouble.html" title="class in org.deidentifier.arx.reliability">org.deidentifier.arx.reliability.IntervalDouble</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>6012504736748464073L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>lower</h4> <pre>double lower</pre> <div class="block">Lower</div> </li> <li class="blockListLast"> <h4>upper</h4> <pre>double upper</pre> <div class="block">Upper</div> </li> </ul> </li> </ul> </li> </ul> </li> <li class="blockList"> <h2 title="Package">Package&nbsp;org.deidentifier.arx.risk</h2> <ul class="blockList"> <li class="blockList"><a name="org.deidentifier.arx.risk.RiskModelCostBenefit"> <!-- --> </a> <h3>Class <a href="org/deidentifier/arx/risk/RiskModelCostBenefit.html" title="class in org.deidentifier.arx.risk">org.deidentifier.arx.risk.RiskModelCostBenefit</a> extends java.lang.Object implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>-6124431335607475931L</dd> </dl> <ul class="blockList"> <li class="blockList"> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockListLast"> <h4>config</h4> <pre><a href="org/deidentifier/arx/ARXCostBenefitConfiguration.html" title="class in org.deidentifier.arx">ARXCostBenefitConfiguration</a> config</pre> <div class="block">The underlying configuration</div> </li> </ul> </li> </ul> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="overview-tree.html">Tree</a></li> <li><a href="deprecated-list.html">Deprecated</a></li> <li><a href="index-files/index-1.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?serialized-form.html" target="_top">Frames</a></li> <li><a href="serialized-form.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
arx-deidentifier/arx
doc/serialized-form.html
HTML
apache-2.0
220,585
'use strict'; var commentLineExp = /^[\s]*<!-- (\/|#) (CE|EE)/; var requireConfExp = /require-conf.js$/; module.exports = function(config, copyConf) { var grunt = config.grunt; var path = require('path'); var now = (new Date()).getTime(); var version = grunt.file.readJSON(path.resolve(__dirname, '../../../../package.json')).version; version = (version.indexOf('-SNAPSHOT') > -1 ? (version +'-'+ now) : version); function prod () { return grunt.config('buildMode') === 'prod'; } function cacheBust(content, srcpath) { if (srcpath.slice(-4) !== 'html') { return content; } return content.split('$GRUNT_CACHE_BUST').join(prod() ? version : now); } function fileProcessing(content, srcpath) { if(prod()) { // removes the template comments content = content .split('\n').filter(function(line) { return !commentLineExp.test(line); }).join('\n'); } content = cacheBust(content, srcpath); return content; } copyConf.cockpit_index = { options: { process: fileProcessing }, files: [ { expand: true, cwd: '<%= pkg.gruntConfig.cockpitSourceDir %>/scripts/', src: [ 'index.html', 'camunda-cockpit-bootstrap.js' ], dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/' } ] }; copyConf.cockpit_assets = { files: [ // custom styles and/or other css files { expand: true, cwd: '<%= pkg.gruntConfig.cockpitSourceDir %>/styles', src: ['*.css'], dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/styles/' }, // images, fonts & stuff { expand: true, cwd: '<%= pkg.gruntConfig.cockpitSourceDir %>/', src: [ '{fonts,images}/**/*.*' ], dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/assets' }, // commons-ui images { expand: true, cwd: '<%= pkg.gruntConfig.commonsUiDir %>/resources/img/', src: [ '*.*' ], dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/assets/images' }, // dojo & dojox { expand: true, cwd: '<%= pkg.gruntConfig.cockpitSourceDir %>/vendor/dojo', src: [ '**/*.*' ], dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/assets/vendor' }, // bootstrap fonts { expand: true, cwd: 'node_modules/bootstrap/fonts', src: [ '*.{eot,ttf,svg,woff,woff2}' ], dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/fonts/' }, // bpmn fonts { expand: true, cwd: 'node_modules/bpmn-font/dist/font', src: [ '*.{eot,ttf,svg,woff}' ], dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/fonts/' }, // open sans { expand: true, cwd: '<%= pkg.gruntConfig.commonsUiDir %>/vendor/fonts', src: ['*.{eot,svg,ttf,woff,woff2}'], dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/fonts/' }, // dmn { expand: true, cwd: 'node_modules/dmn-js/fonts', src: ['*.{eot,svg,ttf,woff,woff2}'], dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/fonts/' }, // placeholder shims { expand: true, cwd: '<%= pkg.gruntConfig.commonsUiDir %>/vendor', src: ['placeholders.*'], dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/scripts/' } ] }; copyConf.cockpit_config = { files: [ { expand: true, cwd: '<%= pkg.gruntConfig.cockpitSourceDir %>/scripts', src: ['config.js'], dest: '<%= pkg.gruntConfig.cockpitBuildTarget %>/scripts/' } ] }; };
xlinur/camunda-bpm-webapp
ui/cockpit/grunt/config/copy.js
JavaScript
apache-2.0
4,012
#ifndef GRAPHICS_MATERIAL_HPP #define GRAPHICS_MATERIAL_HPP #include <map> #include "OE/Graphics/API/UniformsPack.hpp" #include "OE/Graphics/API/Texture.hpp" #include "OE/Graphics/ManagedShader.hpp" #include "OE/Math/Vec3.hpp" #include "OE/Math/Color.hpp" namespace OrbitEngine { namespace Graphics { enum MaterialMapType { ALBEDO = 0, METALLIC, ROUGHNESS, NORMALS }; struct MaterialUniforms { Math::Color4f baseColor = Math::Color4f(1.0f, 1.0f, 1.0f, 1.0f); float metallic = 0.5f; float roughness = 0.5f; float usingAlbedoMap = 0; float usingNormalMap = 0; float usingMetallicMap = 0; float usingRoughnessMap = 0; float pad1, pad2; }; class Material { public: Material(ManagedShader* shader); Shader* use(ShaderDefinitions definitions = {}); void setMap(MaterialMapType mapType, Texture* texture); inline void setBaseColor(Math::Color4f& color) { m_Uniforms.baseColor = color; }; inline void setMetallic(float metallic) { m_Uniforms.metallic = metallic; }; inline void setRoughness(float roughness) { m_Uniforms.roughness = roughness; }; inline Math::Color4f getBaseColor() { return m_Uniforms.baseColor; } inline float getMetallic() { return m_Uniforms.metallic; } inline float getRoughness() { return m_Uniforms.roughness; } static std::string MapTypeToString(MaterialMapType mapType); private: std::map<MaterialMapType, Graphics::Texture*> m_Maps; MaterialUniforms m_Uniforms; ManagedShader* m_Shader; static UniformsPack<MaterialUniforms>* s_MaterialUniformsBuffer; }; } } #endif
mlomb/OrbitEngine
Code/include/OE/Graphics/3D/Material.hpp
C++
apache-2.0
1,558
// ======================================================================== // // Copyright 2009-2018 Intel Corporation // // // // Licensed under the Apache License, Version 2.0 (the "License"); // // you may not use this file except in compliance with the License. // // You may obtain a copy of the License at // // // // http://www.apache.org/licenses/LICENSE-2.0 // // // // Unless required by applicable law or agreed to in writing, software // // distributed under the License is distributed on an "AS IS" BASIS, // // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // // limitations under the License. // // ======================================================================== // #pragma once #include "triangle.h" #include "intersector_epilog.h" /*! This intersector implements a modified version of the Moeller * Trumbore intersector from the paper "Fast, Minimum Storage * Ray-Triangle Intersection". In contrast to the paper we * precalculate some factors and factor the calculations differently * to allow precalculating the cross product e1 x e2. The resulting * algorithm is similar to the fastest one of the paper "Optimizing * Ray-Triangle Intersection via Automated Search". */ namespace embree { namespace isa { template<int M> struct MoellerTrumboreHitM { __forceinline MoellerTrumboreHitM() {} __forceinline MoellerTrumboreHitM(const vbool<M>& valid, const vfloat<M>& U, const vfloat<M>& V, const vfloat<M>& T, const vfloat<M>& absDen, const Vec3vf<M>& Ng) : U(U), V(V), T(T), absDen(absDen), valid(valid), vNg(Ng) {} __forceinline void finalize() { const vfloat<M> rcpAbsDen = rcp(absDen); vt = T * rcpAbsDen; vu = U * rcpAbsDen; vv = V * rcpAbsDen; } __forceinline Vec2f uv (const size_t i) const { return Vec2f(vu[i],vv[i]); } __forceinline float t (const size_t i) const { return vt[i]; } __forceinline Vec3fa Ng(const size_t i) const { return Vec3fa(vNg.x[i],vNg.y[i],vNg.z[i]); } public: vfloat<M> U; vfloat<M> V; vfloat<M> T; vfloat<M> absDen; public: vbool<M> valid; vfloat<M> vu; vfloat<M> vv; vfloat<M> vt; Vec3vf<M> vNg; }; template<int M> struct MoellerTrumboreIntersector1 { __forceinline MoellerTrumboreIntersector1() {} __forceinline MoellerTrumboreIntersector1(const Ray& ray, const void* ptr) {} __forceinline bool intersect(const vbool<M>& valid0, Ray& ray, const Vec3vf<M>& tri_v0, const Vec3vf<M>& tri_e1, const Vec3vf<M>& tri_e2, const Vec3vf<M>& tri_Ng, MoellerTrumboreHitM<M>& hit) const { /* calculate denominator */ vbool<M> valid = valid0; const Vec3vf<M> O = Vec3vf<M>(ray.org); const Vec3vf<M> D = Vec3vf<M>(ray.dir); const Vec3vf<M> C = Vec3vf<M>(tri_v0) - O; const Vec3vf<M> R = cross(C,D); const vfloat<M> den = dot(Vec3vf<M>(tri_Ng),D); const vfloat<M> absDen = abs(den); const vfloat<M> sgnDen = signmsk(den); /* perform edge tests */ const vfloat<M> U = dot(R,Vec3vf<M>(tri_e2)) ^ sgnDen; const vfloat<M> V = dot(R,Vec3vf<M>(tri_e1)) ^ sgnDen; /* perform backface culling */ #if defined(EMBREE_BACKFACE_CULLING) valid &= (den < vfloat<M>(zero)) & (U >= 0.0f) & (V >= 0.0f) & (U+V<=absDen); #else valid &= (den != vfloat<M>(zero)) & (U >= 0.0f) & (V >= 0.0f) & (U+V<=absDen); #endif if (likely(none(valid))) return false; /* perform depth test */ const vfloat<M> T = dot(Vec3vf<M>(tri_Ng),C) ^ sgnDen; valid &= (absDen*vfloat<M>(ray.tnear()) < T) & (T <= absDen*vfloat<M>(ray.tfar)); if (likely(none(valid))) return false; /* update hit information */ new (&hit) MoellerTrumboreHitM<M>(valid,U,V,T,absDen,tri_Ng); return true; } __forceinline bool intersectEdge(Ray& ray, const Vec3vf<M>& tri_v0, const Vec3vf<M>& tri_e1, const Vec3vf<M>& tri_e2, MoellerTrumboreHitM<M>& hit) const { vbool<M> valid = true; const Vec3<vfloat<M>> tri_Ng = cross(tri_e2,tri_e1); return intersect(valid,ray,tri_v0,tri_e1,tri_e2,tri_Ng,hit); } __forceinline bool intersect(Ray& ray, const Vec3vf<M>& v0, const Vec3vf<M>& v1, const Vec3vf<M>& v2, MoellerTrumboreHitM<M>& hit) const { const Vec3vf<M> e1 = v0-v1; const Vec3vf<M> e2 = v2-v0; return intersectEdge(ray,v0,e1,e2,hit); } __forceinline bool intersect(const vbool<M>& valid, Ray& ray, const Vec3vf<M>& v0, const Vec3vf<M>& v1, const Vec3vf<M>& v2, MoellerTrumboreHitM<M>& hit) const { const Vec3vf<M> e1 = v0-v1; const Vec3vf<M> e2 = v2-v0; return intersectEdge(valid,ray,v0,e1,e2,hit); } template<typename Epilog> __forceinline bool intersectEdge(Ray& ray, const Vec3vf<M>& v0, const Vec3vf<M>& e1, const Vec3vf<M>& e2, const Epilog& epilog) const { MoellerTrumboreHitM<M> hit; if (likely(intersectEdge(ray,v0,e1,e2,hit))) return epilog(hit.valid,hit); return false; } template<typename Epilog> __forceinline bool intersect(Ray& ray, const Vec3vf<M>& v0, const Vec3vf<M>& v1, const Vec3vf<M>& v2, const Epilog& epilog) const { MoellerTrumboreHitM<M> hit; if (likely(intersect(ray,v0,v1,v2,hit))) return epilog(hit.valid,hit); return false; } template<typename Epilog> __forceinline bool intersect(const vbool<M>& valid, Ray& ray, const Vec3vf<M>& v0, const Vec3vf<M>& v1, const Vec3vf<M>& v2, const Epilog& epilog) const { MoellerTrumboreHitM<M> hit; if (likely(intersect(valid,ray,v0,v1,v2,hit))) return epilog(hit.valid,hit); return false; } }; template<int K> struct MoellerTrumboreHitK { __forceinline MoellerTrumboreHitK(const vfloat<K>& U, const vfloat<K>& V, const vfloat<K>& T, const vfloat<K>& absDen, const Vec3vf<K>& Ng) : U(U), V(V), T(T), absDen(absDen), Ng(Ng) {} __forceinline std::tuple<vfloat<K>,vfloat<K>,vfloat<K>,Vec3vf<K>> operator() () const { const vfloat<K> rcpAbsDen = rcp(absDen); const vfloat<K> t = T * rcpAbsDen; const vfloat<K> u = U * rcpAbsDen; const vfloat<K> v = V * rcpAbsDen; return std::make_tuple(u,v,t,Ng); } private: const vfloat<K> U; const vfloat<K> V; const vfloat<K> T; const vfloat<K> absDen; const Vec3vf<K> Ng; }; template<int M, int K> struct MoellerTrumboreIntersectorK { __forceinline MoellerTrumboreIntersectorK(const vbool<K>& valid, const RayK<K>& ray) {} /*! Intersects K rays with one of M triangles. */ template<typename Epilog> __forceinline vbool<K> intersectK(const vbool<K>& valid0, //RayK<K>& ray, const Vec3vf<K>& ray_org, const Vec3vf<K>& ray_dir, const vfloat<K>& ray_tnear, const vfloat<K>& ray_tfar, const Vec3vf<K>& tri_v0, const Vec3vf<K>& tri_e1, const Vec3vf<K>& tri_e2, const Vec3vf<K>& tri_Ng, const Epilog& epilog) const { /* calculate denominator */ vbool<K> valid = valid0; const Vec3vf<K> C = tri_v0 - ray_org; const Vec3vf<K> R = cross(C,ray_dir); const vfloat<K> den = dot(tri_Ng,ray_dir); const vfloat<K> absDen = abs(den); const vfloat<K> sgnDen = signmsk(den); /* test against edge p2 p0 */ const vfloat<K> U = dot(tri_e2,R) ^ sgnDen; valid &= U >= 0.0f; if (likely(none(valid))) return false; /* test against edge p0 p1 */ const vfloat<K> V = dot(tri_e1,R) ^ sgnDen; valid &= V >= 0.0f; if (likely(none(valid))) return false; /* test against edge p1 p2 */ const vfloat<K> W = absDen-U-V; valid &= W >= 0.0f; if (likely(none(valid))) return false; /* perform depth test */ const vfloat<K> T = dot(tri_Ng,C) ^ sgnDen; valid &= (absDen*ray_tnear < T) & (T <= absDen*ray_tfar); if (unlikely(none(valid))) return false; /* perform backface culling */ #if defined(EMBREE_BACKFACE_CULLING) valid &= den < vfloat<K>(zero); if (unlikely(none(valid))) return false; #else valid &= den != vfloat<K>(zero); if (unlikely(none(valid))) return false; #endif /* calculate hit information */ MoellerTrumboreHitK<K> hit(U,V,T,absDen,tri_Ng); return epilog(valid,hit); } /*! Intersects K rays with one of M triangles. */ template<typename Epilog> __forceinline vbool<K> intersectK(const vbool<K>& valid0, RayK<K>& ray, const Vec3vf<K>& tri_v0, const Vec3vf<K>& tri_v1, const Vec3vf<K>& tri_v2, const Epilog& epilog) const { const Vec3vf<K> e1 = tri_v0-tri_v1; const Vec3vf<K> e2 = tri_v2-tri_v0; const Vec3vf<K> Ng = cross(e2,e1); return intersectK(valid0,ray.org,ray.dir,ray.tnear(),ray.tfar,tri_v0,e1,e2,Ng,epilog); } /*! Intersects K rays with one of M triangles. */ template<typename Epilog> __forceinline vbool<K> intersectEdgeK(const vbool<K>& valid0, RayK<K>& ray, const Vec3vf<K>& tri_v0, const Vec3vf<K>& tri_e1, const Vec3vf<K>& tri_e2, const Epilog& epilog) const { const Vec3vf<K> tri_Ng = cross(tri_e2,tri_e1); return intersectK(valid0,ray.org,ray.dir,ray.tnear(),ray.tfar,tri_v0,tri_e1,tri_e2,tri_Ng,epilog); } /*! Intersect k'th ray from ray packet of size K with M triangles. */ __forceinline bool intersectEdge(RayK<K>& ray, size_t k, const Vec3vf<M>& tri_v0, const Vec3vf<M>& tri_e1, const Vec3vf<M>& tri_e2, MoellerTrumboreHitM<M>& hit) const { /* calculate denominator */ typedef Vec3vf<M> Vec3vfM; const Vec3vf<M> tri_Ng = cross(tri_e2,tri_e1); const Vec3vfM O = broadcast<vfloat<M>>(ray.org,k); const Vec3vfM D = broadcast<vfloat<M>>(ray.dir,k); const Vec3vfM C = Vec3vfM(tri_v0) - O; const Vec3vfM R = cross(C,D); const vfloat<M> den = dot(Vec3vfM(tri_Ng),D); const vfloat<M> absDen = abs(den); const vfloat<M> sgnDen = signmsk(den); /* perform edge tests */ const vfloat<M> U = dot(Vec3vf<M>(tri_e2),R) ^ sgnDen; const vfloat<M> V = dot(Vec3vf<M>(tri_e1),R) ^ sgnDen; /* perform backface culling */ #if defined(EMBREE_BACKFACE_CULLING) vbool<M> valid = (den < vfloat<M>(zero)) & (U >= 0.0f) & (V >= 0.0f) & (U+V<=absDen); #else vbool<M> valid = (den != vfloat<M>(zero)) & (U >= 0.0f) & (V >= 0.0f) & (U+V<=absDen); #endif if (likely(none(valid))) return false; /* perform depth test */ const vfloat<M> T = dot(Vec3vf<M>(tri_Ng),C) ^ sgnDen; valid &= (absDen*vfloat<M>(ray.tnear()[k]) < T) & (T <= absDen*vfloat<M>(ray.tfar[k])); if (likely(none(valid))) return false; /* calculate hit information */ new (&hit) MoellerTrumboreHitM<M>(valid,U,V,T,absDen,tri_Ng); return true; } __forceinline bool intersectEdge(RayK<K>& ray, size_t k, const BBox<vfloat<M>>& time_range, const Vec3vf<M>& tri_v0, const Vec3vf<M>& tri_e1, const Vec3vf<M>& tri_e2, MoellerTrumboreHitM<M>& hit) const { if (likely(intersect(ray,k,tri_v0,tri_e1,tri_e2,hit))) { hit.valid &= time_range.lower <= vfloat<M>(ray.time[k]); hit.valid &= vfloat<M>(ray.time[k]) < time_range.upper; return any(hit.valid); } return false; } template<typename Epilog> __forceinline bool intersectEdge(RayK<K>& ray, size_t k, const Vec3vf<M>& tri_v0, const Vec3vf<M>& tri_e1, const Vec3vf<M>& tri_e2, const Epilog& epilog) const { MoellerTrumboreHitM<M> hit; if (likely(intersectEdge(ray,k,tri_v0,tri_e1,tri_e2,hit))) return epilog(hit.valid,hit); return false; } template<typename Epilog> __forceinline bool intersectEdge(RayK<K>& ray, size_t k, const BBox<vfloat<M>>& time_range, const Vec3vf<M>& tri_v0, const Vec3vf<M>& tri_e1, const Vec3vf<M>& tri_e2, const Epilog& epilog) const { MoellerTrumboreHitM<M> hit; if (likely(intersectEdge(ray,k,time_range,tri_v0,tri_e1,tri_e2,hit))) return epilog(hit.valid,hit); return false; } template<typename Epilog> __forceinline bool intersect(RayK<K>& ray, size_t k, const Vec3vf<M>& v0, const Vec3vf<M>& v1, const Vec3vf<M>& v2, const Epilog& epilog) const { const Vec3vf<M> e1 = v0-v1; const Vec3vf<M> e2 = v2-v0; return intersectEdge(ray,k,v0,e1,e2,epilog); } template<typename Epilog> __forceinline bool intersect(RayK<K>& ray, size_t k, const BBox<vfloat<M>>& time_range, const Vec3vf<M>& v0, const Vec3vf<M>& v1, const Vec3vf<M>& v2, const Epilog& epilog) const { const Vec3vf<M> e1 = v0-v1; const Vec3vf<M> e2 = v2-v0; return intersectEdge(ray,k,time_range,v0,e1,e2,epilog); } }; } }
RichieSams/lantern
third_party/embree/kernels/geometry/triangle_intersector_moeller.h
C
apache-2.0
17,078
# AUTOGENERATED FILE FROM balenalib/ccimx8x-sbc-pro-fedora:35-build ENV NODE_VERSION 14.18.3 ENV YARN_VERSION 1.22.4 RUN for key in \ 6A010C5166006599AA17F08146C2130DFD2497F5 \ ; do \ gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \ done \ && curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-arm64.tar.gz" \ && echo "2d071ca1bc1d0ea1eb259e79b81ebb4387237b2f77b3cf616806534e0030eaa8 node-v$NODE_VERSION-linux-arm64.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$NODE_VERSION-linux-arm64.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$NODE_VERSION-linux-arm64.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \ && rm -rf /tmp/* CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh" \ && echo "Running test-stack@node" \ && chmod +x test-stack@node.sh \ && bash test-stack@node.sh \ && rm -rf test-stack@node.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Fedora 35 \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v14.18.3, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo $'#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
resin-io-library/base-images
balena-base-images/node/ccimx8x-sbc-pro/fedora/35/14.18.3/build/Dockerfile
Dockerfile
apache-2.0
2,752
/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/ec2/model/ExportToS3Task.h> #include <aws/core/utils/xml/XmlSerializer.h> #include <aws/core/utils/StringUtils.h> #include <aws/core/utils/memory/stl/AWSStringStream.h> #include <utility> using namespace Aws::Utils::Xml; using namespace Aws::Utils; namespace Aws { namespace EC2 { namespace Model { ExportToS3Task::ExportToS3Task() : m_diskImageFormatHasBeenSet(false), m_containerFormatHasBeenSet(false), m_s3BucketHasBeenSet(false), m_s3KeyHasBeenSet(false) { } ExportToS3Task::ExportToS3Task(const XmlNode& xmlNode) : m_diskImageFormatHasBeenSet(false), m_containerFormatHasBeenSet(false), m_s3BucketHasBeenSet(false), m_s3KeyHasBeenSet(false) { *this = xmlNode; } ExportToS3Task& ExportToS3Task::operator =(const XmlNode& xmlNode) { XmlNode resultNode = xmlNode; if(!resultNode.IsNull()) { XmlNode diskImageFormatNode = resultNode.FirstChild("diskImageFormat"); if(!diskImageFormatNode.IsNull()) { m_diskImageFormat = DiskImageFormatMapper::GetDiskImageFormatForName(StringUtils::Trim(diskImageFormatNode.GetText().c_str()).c_str()); m_diskImageFormatHasBeenSet = true; } XmlNode containerFormatNode = resultNode.FirstChild("containerFormat"); if(!containerFormatNode.IsNull()) { m_containerFormat = ContainerFormatMapper::GetContainerFormatForName(StringUtils::Trim(containerFormatNode.GetText().c_str()).c_str()); m_containerFormatHasBeenSet = true; } XmlNode s3BucketNode = resultNode.FirstChild("s3Bucket"); if(!s3BucketNode.IsNull()) { m_s3Bucket = StringUtils::Trim(s3BucketNode.GetText().c_str()); m_s3BucketHasBeenSet = true; } XmlNode s3KeyNode = resultNode.FirstChild("s3Key"); if(!s3KeyNode.IsNull()) { m_s3Key = StringUtils::Trim(s3KeyNode.GetText().c_str()); m_s3KeyHasBeenSet = true; } } return *this; } void ExportToS3Task::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const { if(m_diskImageFormatHasBeenSet) { oStream << location << index << locationValue << ".DiskImageFormat=" << DiskImageFormatMapper::GetNameForDiskImageFormat(m_diskImageFormat) << "&"; } if(m_containerFormatHasBeenSet) { oStream << location << index << locationValue << ".ContainerFormat=" << ContainerFormatMapper::GetNameForContainerFormat(m_containerFormat) << "&"; } if(m_s3BucketHasBeenSet) { oStream << location << index << locationValue << ".S3Bucket=" << StringUtils::URLEncode(m_s3Bucket.c_str()) << "&"; } if(m_s3KeyHasBeenSet) { oStream << location << index << locationValue << ".S3Key=" << StringUtils::URLEncode(m_s3Key.c_str()) << "&"; } } void ExportToS3Task::OutputToStream(Aws::OStream& oStream, const char* location) const { if(m_diskImageFormatHasBeenSet) { oStream << location << ".DiskImageFormat=" << DiskImageFormatMapper::GetNameForDiskImageFormat(m_diskImageFormat) << "&"; } if(m_containerFormatHasBeenSet) { oStream << location << ".ContainerFormat=" << ContainerFormatMapper::GetNameForContainerFormat(m_containerFormat) << "&"; } if(m_s3BucketHasBeenSet) { oStream << location << ".S3Bucket=" << StringUtils::URLEncode(m_s3Bucket.c_str()) << "&"; } if(m_s3KeyHasBeenSet) { oStream << location << ".S3Key=" << StringUtils::URLEncode(m_s3Key.c_str()) << "&"; } } } // namespace Model } // namespace EC2 } // namespace Aws
ambasta/aws-sdk-cpp
aws-cpp-sdk-ec2/source/model/ExportToS3Task.cpp
C++
apache-2.0
4,058
html, body{ font-family: 'Press Start 2P', cursive; height:100%; width:100%; margin:0; padding:0; } body{ padding:30px 0 100px 0; box-sizing: border-box; background: #458AF3; background: -moz-linear-gradient(top, #010c5d 0%, #3867c4 100%); /* FF3.6-15 */ background: -webkit-linear-gradient(top, #010c5d 0%,#3867c4 100%); /* Chrome10-25,Safari5.1-6 */ background: linear-gradient(to bottom, #010c5d 0%,#3867c4 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#010c5d', endColorstr='#3867c4',GradientType=0 ); /* IE6-9 */ } mark { color: white; background-color: #934979; padding: 2px; }
eumendoza/codemotion-monkeySearch
styles.css
CSS
apache-2.0
694
package service import ( "context" "encoding/json" "strconv" "time" "go-common/app/job/main/passport-game-local/model" "go-common/library/log" "go-common/library/queue/databus" ) func (s *Service) asobinlogconsumeproc() { mergeNum := int64(s.c.Group.AsoBinLog.Num) for { msg, ok := <-s.dsAsoBinLogSub.Messages() if !ok { log.Error("asobinlogconsumeproc closed") return } // marked head to first commit m := &message{data: msg} s.mu.Lock() if s.head == nil { s.head = m s.last = m } else { s.last.next = m s.last = m } s.mu.Unlock() bmsg := new(model.BMsg) if err := json.Unmarshal(msg.Value, bmsg); err != nil { log.Error("json.Unmarshal(%s) error(%v)", string(msg.Value), err) continue } mid := int64(0) if bmsg.Table == _asoAccountTable { t := new(model.AsoAccount) if err := json.Unmarshal(bmsg.New, t); err != nil { log.Error("json.Unmarshal(%s) error(%v)", string(bmsg.New), err) } mid = t.Mid m.object = bmsg log.Info("asobinlogconsumeproc table:%s key:%s partition:%d offset:%d", bmsg.Table, msg.Key, msg.Partition, msg.Offset) } else { continue } s.merges[mid%mergeNum] <- m } } func (s *Service) asobinlogcommitproc() { for { done := <-s.done commits := make(map[int32]*databus.Message) for _, d := range done { d.done = true } s.mu.Lock() for ; s.head != nil && s.head.done; s.head = s.head.next { commits[s.head.data.Partition] = s.head.data } s.mu.Unlock() for _, m := range commits { m.Commit() } } } func (s *Service) asobinlogmergeproc(c chan *message) { var ( max = s.c.Group.AsoBinLog.Size merges = make([]*model.BMsg, 0, max) marked = make([]*message, 0, max) ticker = time.NewTicker(time.Duration(s.c.Group.AsoBinLog.Ticker)) ) for { select { case msg, ok := <-c: if !ok { log.Error("asobinlogmergeproc closed") return } p, assertOk := msg.object.(*model.BMsg) if assertOk && p.Action != "" && (p.Table == _asoAccountTable) { merges = append(merges, p) } marked = append(marked, msg) if len(marked) < max && len(merges) < max { continue } case <-ticker.C: } if len(merges) > 0 { s.processAsoAccLogInfo(merges) merges = make([]*model.BMsg, 0, max) } if len(marked) > 0 { s.done <- marked marked = make([]*message, 0, max) } } } func (s *Service) processAsoAccLogInfo(bmsgs []*model.BMsg) { for _, msg := range bmsgs { s.processAsoAccLog(msg) } } func (s *Service) processAsoAccLog(msg *model.BMsg) { aso := new(model.OriginAsoAccount) if err := json.Unmarshal(msg.New, aso); err != nil { log.Error("failed to parse binlog new, json.Unmarshal(%s) error(%v)", string(msg.New), err) return } pmsg := new(model.PMsg) if "update" == msg.Action { old := new(model.AsoAccount) if err := json.Unmarshal(msg.Old, old); err != nil { log.Error("failed to parse binlog new, json.Unmarshal(%s) error(%v)", string(msg.New), err) return } if old.Pwd != aso.Pwd { pmsg.Flag = 1 } } pmsg.Action = msg.Action pmsg.Table = msg.Table pmsg.Data = model.Default(aso) key := strconv.FormatInt(aso.Mid, 10) for { if err := s.dsAsoEncryptTransPub.Send(context.TODO(), key, pmsg); err == nil { return } time.Sleep(time.Second) } }
LQJJ/demo
126-go-common-master/app/job/main/passport-game-local/service/aso_bin_log.go
GO
apache-2.0
3,287
<?php function koneksidatabase() { include('isi/koneksi/koneksi.php'); return $kdb; } $kdb = koneksidatabase(); if(isset($_POST['register_btn'])) { $name = $_POST['nama']; $alamat = $_POST['alamat']; $telp = $_POST['telepon']; $sex = $_POST['jen_kelamin']; $username = $_POST['username']; $password = $_POST['password']; $repassword = $_POST['repassword']; $chapta = $_POST["nilaiCaptcha"]; // Proses Pengecekan Jika terdapat username yang sama $result = "SELECT * FROM member WHERE username='$username'"; $check_user =mysqli_query($kdb,$result) or die(mysql_error()); $fetch_user = mysqli_num_rows($check_user); // Proses pengecekan jika terdapat nama yang sama $result1 = "SELECT * FROM member WHERE nama='$name'"; $check_nama =mysqli_query($kdb,$result1) or die(mysql_error()); $fetch_email = mysqli_num_rows($check_nama); session_start(); if( empty($name) || empty($alamat) || empty($telp) || empty($sex) || empty($username) || empty($password) || empty($repassword) || empty($chapta)) { /*echo "<script>alert('Semua field harus terisi'); window.location = 'formRegistrasi3.php'</script>"; } elseif (!filter_var($name,FILTER_VALIDATE_EMAIL)) { */ echo "<script>alert('Semua field harus terisi'); window.location = 'formRegistrasi3.php'</script>"; }elseif($_SESSION["Captcha"]!=$_POST["nilaiCaptcha"]){ echo "<script>alert('Chapta tidak sesuai'); window.location = 'formRegistrasi3.php'</script>"; }elseif ($password != $repassword) { echo "<script>alert('Password yang anda masukkan tidak sama, mohon koreksi kembali.'); window.location = 'formRegistrasi3.php'</script>"; } elseif ($fetch_user == 1) { echo "<script>alert('Username yang anda kebetulan sudah ada, mohon mencoba yang lainnya!'); window.location = 'formRegistrasi3.php'</script>"; } elseif ($fetch_email == 1) { echo "<script>alert('Email yang anda masukkan saat ini sudah terdaftar pada sistem kami, mohon melanjutkannya.'); window.location = 'formRegistrasi3.php'</script>"; } else { $sql = " insert into `member` (`telepon`,`nama`,`jen_kelamin`,`alamat`, `username`, `password`) values ( '".$_POST["telepon"]."', '".$_POST["nama"]."', '".$_POST["jen_kelamin"]."', '".$_POST["alamat"]."', '".$_POST["username"]."', '".$_POST["password"]."' )"; mysqli_query($kdb, $sql) or die( mysql_error()); if ($sql) { echo "<script>alert('Terima kasih, akun anda telah berhasil dibuat. Selamat Datang! silahkan login'); window.location = 'formlogin.php'</script>"; } else { echo "Terjadi masalah pada sistem kami, mohon mengulangi beberapa saat lagi.<a href='formRegistrasi3.php'>Kembali</a>"; } } } ?>
LubnaAbidah/travel
regis2.php
PHP
apache-2.0
2,670
// Copyright 2009 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. goog.provide('gamebuilder.games.chess.Theme'); goog.require('gamebuilder.games.chess'); /** * Represents the style of the chess board. * * @param {Object} theme The settings describing the theme, including CSS class * names, paths to images for the pieces, etc., with the following required * fields: * {@code tableClass}: CSS class name for the container table, * {@code squareClasses}: square CSS class names, in order: [light, dark]; * {@code numberCellClass}: CSS class name for cells holding numbers; * {@code letterCellClass}: CSS class name for cells holding letters; * {@code imagesRoot}: root path for piece images; * {@code pieceImages}: a 2x8 array with the format: * {{white pieces}, {black pieces}} with the order of pieces: * pawn, knight, bishop, rook, queen, king; * {@code pieceImgClass}: CSS class for piece images. * * @constructor * @export */ gamebuilder.games.chess.Theme = function(theme) { /** * Returns the theme field value for the given name. * Throws an exception of the field is not found in the theme. * * @param {string} field Name of the field to retrieve. */ var getThemeField = function(field) { var value = theme[field]; if (typeof value != "undefined") return value; throw new Error("required field '" + field + "' not found in theme: " + theme); }; var TABLE_CLASS = 'tableClass'; var SQUARE_CLASSES = 'squareClasses'; var NUMBER_CELL_CLASS = 'numberCellClass'; var LETTER_CELL_CLASS = 'letterCellClass'; var IMAGES_ROOT = 'imagesRoot'; var PIECE_IMAGES = 'pieceImages'; var PIECE_IMG_CLASS = 'pieceImgClass'; /** * @type {string} * @private */ this.tableClass_ = getThemeField(TABLE_CLASS); /** * CSS classes for the board squares, in order: [light, dark]. * Must be of size 2. * * @type {Array.<string>} * @private */ this.squareClasses_ = getThemeField(SQUARE_CLASSES); if (this.squareClasses_.length != 2) { throw new Error("`colors' should be an array of size 2"); } /** * CSS class for cells containing row numbers. * * @type {string} * @private */ this.numberCellClass_ = getThemeField(NUMBER_CELL_CLASS); /** * CSS class for cells containing column letters. * * @type {string} * @private */ this.letterCellClass_ = getThemeField(LETTER_CELL_CLASS); /** * Root directory for piece image files. * * @type {string} * @private */ this.imagesRoot_ = getThemeField(IMAGES_ROOT); /** * Array of paths to piece images. * * @type {Array.<Array.<string>>} * @private */ this.pieceImages_ = getThemeField(PIECE_IMAGES); var images = this.pieceImages_; if (images.length != 2) { throw new Error("`images' should be an array of size 2"); } for (var i = 0; i < images.length; ++i) { if (images[i].length != 6) { throw new Error("`images' should be an array of 2x6, is:" + images[i].length); } } /** * CSS class of piece images. * * @type {string} * @private */ this.pieceImageClass_ = getThemeField(PIECE_IMG_CLASS); }; /** * Returns the stored class name for the container table. * * @return {string} the name of the class. */ gamebuilder.games.chess.Theme.prototype.getTableClass = function() { return this.tableClass_; }; /** * Returns the CSS class of a given color. * * @param {gamebuilder.games.chess.SquareColor} color * @return {string} The CSS class of the given color. */ gamebuilder.games.chess.Theme.prototype.getSquareClass = function(color) { switch (color) { case gamebuilder.games.chess.SquareColor.LIGHT: { return this.squareClasses_[0]; } case gamebuilder.games.chess.SquareColor.DARK: { return this.squareClasses_[1]; } default: { throw new Error("Invalid color: " + color); } } }; /** * Returns the stored class name for the number cells. * * @return {string} the name of the class. */ gamebuilder.games.chess.Theme.prototype.getNumberCellClass = function() { return this.numberCellClass_; }; /** * Returns the stored class name for the letter cells. * * @return {string} the name of the class. */ gamebuilder.games.chess.Theme.prototype.getLetterCellClass = function() { return this.letterCellClass_; }; /** * Returns the stored class name for the piece images. * * @return {string} the name of the class. */ gamebuilder.games.chess.Theme.prototype.getPieceImageClass = function() { return this.pieceImageClass_; }; /** * Returns the path to an image file for the given color and piece value. * * @param {gamebuilder.games.chess.PieceColor} color * @param {gamebuilder.games.chess.PieceValue} value */ gamebuilder.games.chess.Theme.prototype.getPieceImage = function(color, value) { var color_index = -1; switch (color) { case gamebuilder.games.chess.PieceColor.WHITE: { color_index = 0; break; } case gamebuilder.games.chess.PieceColor.BLACK: { color_index = 1; break; } default: { throw new Error("Invalid color: " + color.str()); } } var piece_index = -1; switch (value) { case gamebuilder.games.chess.PieceValue.PAWN: { piece_index = 0; break; } case gamebuilder.games.chess.PieceValue.KNIGHT: { piece_index = 1; break; } case gamebuilder.games.chess.PieceValue.BISHOP: { piece_index = 2; break; } case gamebuilder.games.chess.PieceValue.ROOK: { piece_index = 3; break; } case gamebuilder.games.chess.PieceValue.QUEEN: { piece_index = 4; break; } case gamebuilder.games.chess.PieceValue.KING: { piece_index = 5; break; } default: throw new Error('Invalid piece: ' + value.str()); } return this.imagesRoot_ + '/' + this.pieceImages_[color_index][piece_index]; }; /** * @type {gamebuilder.games.chess.Theme} * @export */ gamebuilder.games.chess.Theme.DEFAULT_THEME = null;
mbrukman/gamebuilder
src/js/games/chess/chess_theme.js
JavaScript
apache-2.0
6,601
// // BakeMutton.h // Command // // Created by btw on 15/2/26. // Copyright (c) 2015年 Nihility. All rights reserved. // #import "Command.h" @interface BakeMutton : Command <Command> @end
Nihility-Ming/Design_Patterns_In_Objective-C
行为型模式/命令模式/Example_02/Command/BakeMutton.h
C
apache-2.0
197
package com.waka.workspace.wakapedometer.weather; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.design.widget.Snackbar; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.alibaba.fastjson.JSON; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.Volley; import com.waka.workspace.wakapedometer.Constant; import com.waka.workspace.wakapedometer.R; import com.waka.workspace.wakapedometer.customview.recyclerview_for_scrollview.FullyGridLayoutManager; import com.waka.workspace.wakapedometer.customview.recyclerview_for_scrollview.FullyLinearLayoutManager; import com.waka.workspace.wakapedometer.weather.adapter.DailyForecastAdapter; import com.waka.workspace.wakapedometer.weather.adapter.HourlyForecastAdapter; import com.waka.workspace.wakapedometer.weather.adapter.SuggestionAdapter; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.List; /** * 天气Activity */ public class WeatherActivity extends AppCompatActivity { private static final String TAG = "WeatherActivity"; //toolbar private Toolbar toolbar; //volley网络变量 private RequestQueue mRequestQueue;//Volley请求队列 //天气数据 private JSONObject mWeatherInfoJSON;//天气信息,JSON private WeatherBean mWeatherBean;//天气信息,JavaBean //下拉刷新 private SwipeRefreshLayout swipeRefreshLayout; //TODO //展示数据的View //今天 private TextView tvTemperature;//实时温度 private TextView tvWeatherNowConditionTxt;//天气情况描述 private TextView tvWeatherAirQualityQlty;//空气质量类别 private LinearLayout layoutWeatherAirQuality;//空气质量栏 private ImageView imgWeatherAirQualityArrow;//箭头 //空气质量详情栏 private LinearLayout layoutWeatherAirQualityDetail;//空气质量详情栏 private TextView tvWeatherAirQualityAqi;//空气质量指数 private TextView tvWeatherAirQualityPm25;//PM2.5 private TextView tvWeatherAirQualitySO2;//SO₂ private TextView tvWeatherAirQualityPm10;//PM10 private TextView tvWeatherAirQualityNO2;//NO₂ private TextView tvWeatherAirQualityCO;//CO private TextView tvWeatherAirQualityO3;//O₃ //生活指数,仅限国内城市,国际城市无此字段 private RecyclerView rvSuggestion; private SuggestionAdapter suggestionAdapter; private List<WeatherBean.Suggestion.Level> suggestionDatas; //每三小时天气预报,全能版为每小时预报 private RecyclerView rvHourlyForecast; private HourlyForecastAdapter hourlyForecastAdapter; //7天天气预报 private RecyclerView rvDailyForecast; private DailyForecastAdapter dailyForecastAdapter; //Handler What private static final int WHAT_WEATHER_INFO_FAIL = 0;//获取天气信息失败 private static final int WHAT_WEATHER_INFO_SUCCESS = 1;//获取天气信息成功 // Handler private MyHandler mHandler = new MyHandler(this); /** * 静态Handler内部类,避免内存泄漏 * * @author waka */ private static class MyHandler extends Handler { // 对Handler持有的对象使用弱引用 private WeakReference<WeatherActivity> wrWeatherActivity; public MyHandler(WeatherActivity weatherActivity) { wrWeatherActivity = new WeakReference<WeatherActivity>(weatherActivity); } @Override public void handleMessage(Message msg) { switch (msg.what) { //获取天气信息失败 case WHAT_WEATHER_INFO_FAIL: //如果下拉刷新布局在刷新 if (wrWeatherActivity.get().swipeRefreshLayout.isRefreshing()) { //停止刷新 wrWeatherActivity.get().swipeRefreshLayout.setRefreshing(false); } VolleyError volleyError = (VolleyError) msg.obj; Snackbar.make(wrWeatherActivity.get().toolbar, volleyError.getMessage(), Snackbar.LENGTH_SHORT).show(); break; //获取天气信息成功 case WHAT_WEATHER_INFO_SUCCESS: //如果下拉刷新布局在刷新 if (wrWeatherActivity.get().swipeRefreshLayout.isRefreshing()) { //停止刷新 wrWeatherActivity.get().swipeRefreshLayout.setRefreshing(false); } Snackbar.make(wrWeatherActivity.get().toolbar, "获取天气数据成功!", Snackbar.LENGTH_SHORT).show(); //获得weatherBean wrWeatherActivity.get().mWeatherBean = (WeatherBean) msg.obj; //获得详细数据 WeatherBean weatherBean = wrWeatherActivity.get().mWeatherBean; String temperature = weatherBean.getNow().getTmp();//温度 String aqi = weatherBean.getAqi().getCity().getAqi();//空气质量指数 String quality = weatherBean.getAqi().getCity().getQlty();//空气质量类别 //更新UI wrWeatherActivity.get().updateUI(wrWeatherActivity.get().mWeatherBean); break; default: break; } } } @Override /** * onCreate */ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_weather); initView(); initData(); initEvent(); } /** * initView */ private void initView() { //toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); //下拉刷新布局 swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout); swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_light, android.R.color.holo_red_light, android.R.color.holo_orange_light, android.R.color.holo_green_light);//设置刷新时动画的颜色,可以设置4个 //TODO //展示数据的View //今天 tvTemperature = (TextView) findViewById(R.id.tv_temperature);//实时温度 tvWeatherNowConditionTxt = (TextView) findViewById(R.id.tv_weather_now_condition_txt);//天气情况描述 tvWeatherAirQualityQlty = (TextView) findViewById(R.id.tv_weather_air_quality_qlty);//空气质量类别 layoutWeatherAirQuality = (LinearLayout) findViewById(R.id.layout_weather_air_quality);//空气质量栏 imgWeatherAirQualityArrow = (ImageView) findViewById(R.id.img_weather_air_quality_arrow);//箭头 //空气质量详情栏 layoutWeatherAirQualityDetail = (LinearLayout) findViewById(R.id.layout_weather_air_quality_detail);//空气质量详情栏 tvWeatherAirQualityAqi = (TextView) findViewById(R.id.tv_weather_air_quality_aqi);//空气质量指数 tvWeatherAirQualityPm25 = (TextView) findViewById(R.id.tv_weather_air_quality_pm25);//PM2.5 tvWeatherAirQualitySO2 = (TextView) findViewById(R.id.tv_weather_air_quality_so2);//SO₂ tvWeatherAirQualityPm10 = (TextView) findViewById(R.id.tv_weather_air_quality_pm10);//PM10 tvWeatherAirQualityNO2 = (TextView) findViewById(R.id.tv_weather_air_quality_no2);//NO₂ tvWeatherAirQualityCO = (TextView) findViewById(R.id.tv_weather_air_quality_co);//CO tvWeatherAirQualityO3 = (TextView) findViewById(R.id.tv_weather_air_quality_o3);//O₃ //生活指数,仅限国内城市,国际城市无此字段 rvSuggestion = (RecyclerView) findViewById(R.id.recycler_view_suggestion); //每三小时天气预报,全能版为每小时预报 rvHourlyForecast = (RecyclerView) findViewById(R.id.recycler_view_hourly_forecast); //7天天气预报 rvDailyForecast = (RecyclerView) findViewById(R.id.recycler_view_daily_forecast); } /** * initData */ private void initData() { //初始化网络 mRequestQueue = Volley.newRequestQueue(this);//初始化请求队列 //获取天气信息 getWeatherInfo(); } /** * initEvent */ private void initEvent() { //下拉刷新监听 swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { getWeatherInfoFromInternet("beijing"); } }); //空气质量栏 layoutWeatherAirQuality.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (layoutWeatherAirQualityDetail.getVisibility() == View.GONE) { layoutWeatherAirQualityDetail.setVisibility(View.VISIBLE); imgWeatherAirQualityArrow.setImageResource(R.mipmap.ic_keyboard_arrow_up_white_18dp); } else { layoutWeatherAirQualityDetail.setVisibility(View.GONE); imgWeatherAirQualityArrow.setImageResource(R.mipmap.ic_keyboard_arrow_down_white_18dp); } } }); } /** * 获取天气信息 */ private void getWeatherInfo() { //尝试从PedometerFragment中获取天气数据 Intent intent = getIntent(); if (intent != null) { //如果获取到了 String weatherInfoStr = intent.getStringExtra(Constant.INTENT_FIELD_NAME_WEATHER_INFO_JSON); if (weatherInfoStr != null) { Log.d(TAG, "【getWeatherInfo】 weatherInfoStr = " + weatherInfoStr); try { mWeatherInfoJSON = new JSONObject(weatherInfoStr); new DeserializeWeatherBeanThread(WeatherActivity.this, mWeatherInfoJSON).start(); } catch (JSONException e) { e.printStackTrace(); } } } //否则,直接从网络上获取天气数据 else { getWeatherInfoFromInternet("beijing"); } } /** * 从网络上获取天气信息 * * @param cityName */ private void getWeatherInfoFromInternet(String cityName) { //创建获取天气数据请求 GetWeatherInfoRequest getWeatherInfoRequest = GetWeatherInfoRequest.newInstance(cityName, new Response.Listener<JSONObject>() { @Override //成功监听 public void onResponse(final JSONObject response) { Log.d(TAG, "【getWeatherInfoFromInternet】【onResponse】response = " + response.toString()); mWeatherInfoJSON = response; //新建线程用于反序列化 new DeserializeWeatherBeanThread(WeatherActivity.this, response).start(); } }, new Response.ErrorListener() { @Override //失败监听 public void onErrorResponse(VolleyError error) { Log.e(TAG, "【getWeatherInfoFromInternet】【onErrorResponse】error = " + error.getMessage(), error); //发送失败消息 Message msg = Message.obtain(); msg.what = WHAT_WEATHER_INFO_FAIL; msg.obj = error; mHandler.sendMessage(msg); } }); //添加请求进请求队列 mRequestQueue.add(getWeatherInfoRequest); } /** * 更新UI * * @param weatherBean */ private void updateUI(WeatherBean weatherBean) { if (weatherBean == null) { Log.e(TAG, "【updateUI】 weatherBean == null"); return; } if (weatherBean.getStatus().equals("false")) { Log.e(TAG, "【updateUI】 status == false"); return; } //TODO tvTemperature.setText(weatherBean.getNow().getTmp());//实时温度 tvWeatherNowConditionTxt.setText(weatherBean.getNow().getCond().getTxt());//天气情况描述 tvWeatherAirQualityQlty.setText(weatherBean.getAqi().getCity().getQlty());//空气质量类别 //空气质量详情 tvWeatherAirQualityAqi.setText(weatherBean.getAqi().getCity().getAqi());//空气质量指数 tvWeatherAirQualityPm25.setText(weatherBean.getAqi().getCity().getPm25());//PM2.5 tvWeatherAirQualitySO2.setText(weatherBean.getAqi().getCity().getSo2());//SO₂ tvWeatherAirQualityPm10.setText(weatherBean.getAqi().getCity().getPm10());//PM10 tvWeatherAirQualityNO2.setText(weatherBean.getAqi().getCity().getNo2());//NO₂ tvWeatherAirQualityCO.setText(weatherBean.getAqi().getCity().getCo());//CO tvWeatherAirQualityO3.setText(weatherBean.getAqi().getCity().getO3());//O₃ //生活指数,仅限国内城市,国际城市无此字段 WeatherBean.Suggestion suggestion = weatherBean.getSuggestion(); if (suggestionDatas == null) { suggestionDatas = new ArrayList<>(); } else { suggestionDatas.clear(); } WeatherBean.Suggestion.Level comf = weatherBean.getSuggestion().getComf(); comf.setIconId(R.mipmap.ic_favorite_border_white_48dp); comf.setType("舒适度"); suggestionDatas.add(comf); WeatherBean.Suggestion.Level cw = weatherBean.getSuggestion().getCw(); cw.setIconId(R.mipmap.ic_directions_car_white_48dp); cw.setType("洗车"); suggestionDatas.add(cw); WeatherBean.Suggestion.Level drsg = weatherBean.getSuggestion().getDrsg(); drsg.setIconId(R.mipmap.ic_accessibility_white_48dp); drsg.setType("穿衣"); suggestionDatas.add(drsg); WeatherBean.Suggestion.Level flu = weatherBean.getSuggestion().getFlu(); flu.setIconId(R.mipmap.ic_local_hospital_white_48dp); flu.setType("感冒"); suggestionDatas.add(flu); WeatherBean.Suggestion.Level sport = weatherBean.getSuggestion().getSport(); sport.setIconId(R.mipmap.ic_directions_run_white_48dp); sport.setType("运动"); suggestionDatas.add(sport); WeatherBean.Suggestion.Level trav = weatherBean.getSuggestion().getTrav(); trav.setIconId(R.mipmap.ic_flight_takeoff_white_48dp); trav.setType("旅游"); suggestionDatas.add(trav); WeatherBean.Suggestion.Level uv = weatherBean.getSuggestion().getUv(); uv.setIconId(R.mipmap.ic_flare_white_48dp); uv.setType("紫外线"); suggestionDatas.add(uv); FullyGridLayoutManager gridLayoutManager = new FullyGridLayoutManager(WeatherActivity.this, 3); rvSuggestion.setLayoutManager(gridLayoutManager); if (suggestionAdapter == null) { suggestionAdapter = new SuggestionAdapter(WeatherActivity.this, suggestionDatas); } else { suggestionAdapter.notifyDataSetChanged(); } rvSuggestion.setAdapter(suggestionAdapter); //每三小时天气预报,全能版为每小时预报 FullyLinearLayoutManager linearLayoutManager = new FullyLinearLayoutManager(WeatherActivity.this); linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL); rvHourlyForecast.setLayoutManager(linearLayoutManager); if (hourlyForecastAdapter == null) { hourlyForecastAdapter = new HourlyForecastAdapter(WeatherActivity.this, weatherBean.getHourly_forecast()); } else { hourlyForecastAdapter.notifyDataSetChanged(); } rvHourlyForecast.setAdapter(hourlyForecastAdapter); //7天天气预报 FullyLinearLayoutManager linearLayoutManager2 = new FullyLinearLayoutManager(WeatherActivity.this); linearLayoutManager2.setOrientation(LinearLayoutManager.VERTICAL); rvDailyForecast.setLayoutManager(linearLayoutManager2); if (dailyForecastAdapter == null) { dailyForecastAdapter = new DailyForecastAdapter(WeatherActivity.this, weatherBean.getDaily_forecast()); } else { dailyForecastAdapter.notifyDataSetChanged(); } rvDailyForecast.setAdapter(dailyForecastAdapter); } @Override /** * onDestroy */ protected void onDestroy() { super.onDestroy(); //移除请求队列中所有请求 mRequestQueue.cancelAll(null); //移除消息队列中所有消息 mHandler.removeCallbacksAndMessages(null); } /** * 反序列化线程 */ static class DeserializeWeatherBeanThread extends Thread { //弱引用 private WeakReference<WeatherActivity> wrWeatherActivity; //需要反序列化的JSON private JSONObject mWeatherInfoJSON; public DeserializeWeatherBeanThread(WeatherActivity weatherActivity, JSONObject weatherInfoJSON) { wrWeatherActivity = new WeakReference<WeatherActivity>(weatherActivity); this.mWeatherInfoJSON = weatherInfoJSON; } @Override public void run() { //反序列化 WeatherBean weatherBean = deserializeWeatherBean(mWeatherInfoJSON); if (weatherBean != null) { //发送成功消息 Message msg = Message.obtain(); msg.what = WHAT_WEATHER_INFO_SUCCESS; msg.obj = weatherBean;//把weatherBean放进去 wrWeatherActivity.get().mHandler.sendMessage(msg); } } /** * WeatherBean的反序列化 * * @param weatherInfoJSON * @return WeatherBean */ private WeatherBean deserializeWeatherBean(JSONObject weatherInfoJSON) { try { //从原始JSON中用 "HeWeather data service 3.0" 字段取出一个JSONArray JSONArray jsonArray = null; jsonArray = weatherInfoJSON.getJSONArray(WeatherBean.TOTAL_NAME); //一般来说,第一个就是我们要的可以反序列化的JSON数据了 JSONObject jsonWeather = (JSONObject) jsonArray.get(0); //反序列化 WeatherBean weatherBean = JSON.parseObject(jsonWeather.toString(), WeatherBean.class); return weatherBean; } catch (JSONException e) { e.printStackTrace(); return null; } } } }
BadWaka/WakaPedometer
app/src/main/java/com/waka/workspace/wakapedometer/weather/WeatherActivity.java
Java
apache-2.0
19,506
//Requires var lirc = require("./modules/lirc.js"); var sonybravia = require("./modules/sonybravia.js"); var exec = require('child_process').exec; var alarms = require("./modules/alarms.js").initialize(); var express = require('express'); var app = express(); var fs = require('fs'); var moment = require('moment'); var lpcm16 = require('node-record-lpcm16'); var sprintf = require("sprintf-js").sprintf, vsprintf = require("sprintf-js").vsprintf; var isRecording = false; //var voicecommands = require('./dist/voicecommands.js') eval(fs.readFileSync('./dist/voicecommands.js')+''); var request = require('request'); var basicAuth = require('basic-auth'); var auth = function (req, res, next) { function unauthorized(res) { res.set('WWW-Authenticate', 'Basic realm=Authorization Required'); return res.send(401); }; var user = basicAuth(req); if (/^\/nfc\/[a-z0-9]+$/.test(req.url)) { return next(); } if (/^\/trigger\/[a-z0-9]+\/[a-z0-9]+$/.test(req.url)) { return next(); } if (!user || !user.name || !user.pass) { return unauthorized(res); }; if (user.name === 'rob' && user.pass === 'SuperGeheim123qweASD') { return next(); } else { return unauthorized(res); }; }; //var privateKey = fs.readFileSync('sslcert/server.key', 'utf8'); //var certificate = fs.readFileSync('sslcert/server.crt', 'utf8'); //var credentials = {key: privateKey, cert: certificate}; var http = require('http').Server(app); //var https = require('https').createServer(credentials, app); var io = require('socket.io')(http); var lastLedKey = "unknown"; var _ = require('underscore'); var md5 = require('md5'); spawn = require('child_process').spawn; var tv_volume = 20; var isPi = false; //Config WEBSERVER_PORT = 80; //Listening port TTS_VOICE = 'Graham'; TTS_LANG = 9; /* UK: 9 -> Rachel Graham Lucy US: Sharon Ella (genuine child voice) EmilioEnglish (genuine child voice) Josh (genuine child voice) Karen Kenny (artificial child voice) Laura Micah <- Good male Nelly (artificial child voice) Rod Ryan Saul Scott (genuine teenager voice) Tracy <- Ok ValeriaEnglish (genuine child voice) Will WillBadGuy (emotive voice) <- Cool WillFromAfar (emotive voice) WillHappy (emotive voice) <- Ok WillLittleCreature (emotive voice) WillOldMan (emotive voice) WillSad (emotive voice) WillUpClose (emotive voice) <- Whispering, lol */ exec('export AUDIODEV=hw:1,0; export AUDIODRIVER=alsa;'); app.use('/', auth); app.use(express.static(__dirname + '/public')); io.on('connection', function(socket){ //console.log('a user connected'); socket.on('disconnect', function(){ //console.log('user disconnected'); }); //Emit all local events through (ofcourse identification of devices is still todo) socket.on('localevent', function(data){ io.emit('localevent', data); }); socket.on('restart', function(data) { process.exit(0); }); }); app.get('/send/kaku/:letter/:code/:onoff',auth, function(req, res) { // KlikAanKlikUit remote power thingies var letter = req.params.letter; var code = req.params.code; var onoff = req.params.onoff; KaKu (letter, code, onoff, res); }); app.get('/433/:string',auth, function(req, res) { // KlikAanKlikUit remote power thingies var string = req.params.string; do433 (string, res); }); app.get('/tv/:ircc',auth, function(req, res) { var ircc = req.param.ircc; sonybravia.sendIRCC(ircc); }); app.get('/tvvolume/:volume',auth, function(req, res) { var volume = req.param("volume"); sonybravia.setVolume(volume); }); function textToSpeech(text, lang) { if (lang == undefined) { lang = 'en'; } text = encodeURIComponent(text); console.log('SPEAK: ' + text); text = text + ". ." var filename = md5(text); var playcmd = 'omxplayer'; //ffplay -i var playArgs = ''; //' -v quiet -nodisp -autoexit'; fs.exists('./speech/'+filename+'.mp3', function (exists) { if (exists) { sonybravia.setVolume(0); exec(playcmd+" ./speech/"+filename+".mp3" + playArgs); setTimeout(function(){sonybravia.setVolume(tv_volume);}, text.length*25); } else { /*exec("curl $(curl --data 'MyLanguages=sonid10&MySelectedVoice="+TTS_VOICE+"&MyTextForTTS=" + text + "&t=1&SendToVaaS=' 'http://www.acapela-group.com/demo-tts/DemoHTML5Form_V2.php' | grep -o" + " \"http.*mp3\")\"> ./speech/"+filename+".mp3; "+playcmd+" ./speech/"+filename+".mp3" + playArgs); */ exec("curl $(curl --data 'MyLanguages=sonid"+ TTS_LANG +"&MySelectedVoice="+TTS_VOICE+"&MyTextForTTS=" + text + "&t=1&SendToVaaS=' 'http://www.acapela-group.com/demo-tts/DemoHTML5Form_V2.php' | grep -o \"http.*mp3\") > ./speech/"+filename+".mp3; "+playcmd+" ./speech/"+filename+".mp3" + playArgs); sonybravia.setVolume(0); setTimeout(function(){sonybravia.setVolume(tv_volume);}, text.length*50); } }); } function playSound(file) { var playcmd = 'omxplayer'; //ffplay -i var playArgs = ''; //' -v quiet -nodisp -autoexit'; exec(playcmd + " " + file + playArgs); } function do433(string, res) { console.log('Got 433: ' + string); var command="sudo /var/piestation/dist/433/jeroen/433rgb " + string; exec(command, function(error, stdout, stderr){ if(error) { var msg = 'ERROR:' + error; } else { var msg = "Sent command!" + stdout + stderr; } if (res != undefined) { res.send(msg); } else { console.log(msg); } }); } function KaKu(letter, code, onoff, res) { console.log('Got KAKU: ' + letter + ' ' + code + ' ' + onoff); var command="sudo /var/wiringPi/examples/lights/kaku " + letter + " " + code + " " + onoff; exec(command, function(error, stdout, stderr){ if(error) { var msg = 'ERROR:' + error; } else { var msg = "Sent command!" + stdout + stderr; } if (res != undefined) { res.send(msg); } else { console.log(msg); } }); } app.get('/nfc/:tag', function(req, res) { console.log('NFC: ' + req.param("tag")); res.send("thnx"); }); app.get('/trigger/:user/:type', function(req, res) { console.log('Trigger for ' + req.param("user") + " - " + req.param("type")); res.send("thnx"); }); app.get('/tts/:string/:lang',auth, function(req, res) { textToSpeech(req.param("string"), req.param("lang")); return res.send('Speaking'); }); app.get('/send/:device/:key',auth, function(req, res) { var deviceName = req.param("device"); var key = req.param("key").toUpperCase(); // Make sure that the user has requested a valid device if(!lirc.devices.hasOwnProperty(deviceName)) { res.send("Unknown device"); return; } if (deviceName == 'ledstrip') { lastLedKey = key; } console.log('Got '+deviceName+ ' - ' + key); // Make sure that the user has requested a valid key/button var device = lirc.devices[deviceName]; var deviceKeyFound = false; for(var i = 0; i < device.length; i++) { if(device[i] === key) { deviceKeyFound = true; break; } } if(!deviceKeyFound) { res.send("Invalid key number: "+key); return; } sendLirc(deviceName, key, res); /*if (deviceName != 'ledstrip') { console.log('Sending last led strip key:' + lastLedKey); lirc.exec("irsend SEND_ONCE ledstrip "+lastLedKey, function(error, stdout, stderr){}); }*/ }); function sendLirc(deviceName, key, res) { // send command to irsend console.log('Send IR ' + deviceName + ' - ' + key); var command = "irsend SEND_ONCE "+deviceName+" "+key; lirc.exec(command, function(error, stdout, stderr){ if (res != undefined) { if(error) { res.send("Error sending command"); } else { res.send("Dun send"); } } }); } app.get('/get/devices',auth, function(req, res) { return res.send(lirc.devices); }); lirc.initialize(); http.listen(WEBSERVER_PORT, function(){ console.log('listening on *:'+WEBSERVER_PORT); }); /*https.listen(443, function(){ console.log('listening on *:443'); }); */ app.get('/start-listening',auth, function(req, res) { listenToSpeech(res); return res.send('Listening!'); }); app.get('/stop-listening',auth, function(req, res) { stopListening(); return res.send('Stop listening!'); }); var responses = { notUnderstood: [ "Sorry, I did not understand you.", "Lol, come again?", "Sorry, what was that?", "Sorry, I didn't understand a word of that.", "uh. Not sure what you ment. Can you repeat that?" ], dontKnowWhatToDo: [ "Sorry, I do not know what to do with that. Spank Rob. It is his fault.", "Hmm. No idea what I should do.", "I eh. uhm. Mmm. I don't know what to do now. bye." ] }; function stopListening() { if (isRecording == false) { return; } console.log('Stop recording'); lpcm16.stop(); isRecording = false; sonybravia.setVolume(tv_volume); } function listenToSpeech(res) { if (isRecording == true) { return; } console.log('Recording...'); isRecording = true; sonybravia.setVolume(0); playSound('./dist/homer-hello.ogg'); setTimeout(function() { lpcm16.start({ verbose: false, recordProgram: 'arecord', cmdArgs: ['-D', 'plughw:1,0'] }).pipe(request.post({ 'url' : 'https://api.wit.ai/speech?client=chromium&lang=en-us&output=json', 'headers' : { 'Accept' : 'application/vnd.wit.20160202+json', 'Authorization' : 'Bearer ' + voicecommands.witAiKey, 'Content-Type' : 'audio/wav' } }, function(err,httpResponse,body) { isRecording = false; console.log(body); try { parseSpeech(JSON.parse(body)); } catch (exception) { console.log(exception); } })); setTimeout(function () { stopListening(); }, 5000); }, 1900); } console.log(voicecommands.commands); function parseSpeech(res) { if (res.outcomes == undefined || res.outcomes.length == 0) { //textToSpeech('Lol. Sorry. I did not understand a word of that.'); textToSpeech(responses.notUnderstood[Math.floor(Math.random() * responses.notUnderstood.length)]); console.log('No outcomes.'); return; } _.each(res.outcomes, function(outcome) { if (outcome.confidence < .50) { //textToSpeech('You said ' + outcome._text + '. I am not sure what you ment.'); textToSpeech(responses.notUnderstood[Math.floor(Math.random() * responses.notUnderstood.length)]); return; } var commandFunction = voicecommands.commands[outcome.intent.toLowerCase()]; if (commandFunction != undefined && outcome.entities.length != 0) { commandFunction(outcome.entities); } else { //textToSpeech('Quite sure you said "' + outcome._text + '". But i have no commands assigned to that.'); textToSpeech(responses.dontKnowWhatToDo[Math.floor(Math.random() * responses.dontKnowWhatToDo.length)]); } }); } process.on('uncaughtException', function(err) { if(err.errno === 'EADDRINUSE') { console.log('Listening address on port ' + WEBSERVER_PORT + ' is in use or unavailable.'); process.exit(1); } else { throw err; } });
RobQuistNL/PieStation
app.js
JavaScript
apache-2.0
11,969
![ArangoDB-Logo](https://www.arangodb.com/docs/assets/arangodb_logo_2016_inverted.png) # ArangoDB-PHP - A PHP client for ArangoDB The official ArangoDB PHP Driver. 3.6: [![Build Status](https://api.travis-ci.com/arangodb/arangodb-php.svg?branch=3.6)](https://travis-ci.com/arangodb/arangodb-php) 3.7: [![Build Status](https://api.travis-ci.com/arangodb/arangodb-php.svg?branch=3.7)](https://travis-ci.com/arangodb/arangodb-php) 3.8: [![Build Status](https://api.travis-ci.com/arangodb/arangodb-php.svg?branch=3.8)](https://travis-ci.com/arangodb/arangodb-php) devel: [![Build Status](https://api.travis-ci.com/arangodb/arangodb-php.svg?branch=devel)](https://travis-ci.com/arangodb/arangodb-php) - [Getting Started](https://www.arangodb.com/docs/stable/drivers/php-getting-started.html) - [Tutorial](https://www.arangodb.com/docs/stable/drivers/php-tutorial.html) # More information - More example code, containing some code to create, delete and rename collections, is provided in the [examples](examples) subdirectory that is provided with the library. - [PHPDoc documentation](http://arangodb.github.io/arangodb-php/) for the complete library - [Follow us on Twitter](https://twitter.com/arangodbphp) [@arangodbphp](https://twitter.com/arangodbphp) to receive updates on the PHP driver
arangodb/arangodb-php
README.md
Markdown
apache-2.0
1,307
</div><form action="search.asp" name="form1" id="form1"> <table border="1" id="table1" style="border-collapse: collapse"> <tr> <td height="25" align="center"><span style="font-size: 16px">清</span></td> <td height="25" align="center"><span style="font-size: 16px">公元1890年</span></td> <td height="25" align="center"><span style="font-size: 16px">庚寅</span></td> <td height="25px" align="center"><span style="font-size: 16px">光绪十六年</span></td> </tr> <tr> <td colspan="4"> <table border="0" width="100%"> <tr> <td valign="top"> <b>历史纪事</b> </td> <td> <div>湖北枪炮厂筹建     湖北枪炮厂是清末湖北当局经营的新式军用企业。光绪十四年(1888),两广总督张之洞筹划在广州设立枪炮厂。次年,张之洞调任湖广总督。光绪十六年(1890)便把他筹办的枪炮厂迁至汉阳大别山下,名“湖北枪炮厂”。并添购机器,兴建厂房。光绪二十年(1894)建成,光绪二十一年(1895)正式开工。原与汉阳铁厂合而为一,旋即分开。分炮厂、枪厂、炮架厂、炮弹厂、枪弹厂,雇用工人约一千二百人。设备齐全,规模较大,以生产枪炮弹药为主,旋并入枪炮厂。创办经费七十万两。管理权初由德国人控制,后又落入日本人手中。光绪三十四年(1908)改称“汉阳兵工厂”。 燮昌火柴公司创办     光绪十六年(1890),某商人在上海设立燮昌火柴公司。开办资本五万两,生产木梗硫磺火柴。药品从欧洲进口,梗木、箱材及纸均从日本进口。日产火柴二十余箱,后增至五十大箱(每箱五十大包),质量较差,主要销售于江西、安徽等内地省份。</div></td> </tr> </table> </td> </tr> <tr> <td colspan="4"> <table border="0" width="100%"> <tr> <td valign="top"> <b>文化纪事</b> </td> <td> <div>何又雄逝世   何又雄(1820——1890),字澹如,清同治元年(一八六二)举人,高要县学教谕,授徒省垣,从游者众。间涉绘事,自饶风趣。</div></td> </tr> </table> </td> </tr> <tr> <td colspan="4"> <table border="0" width="100%"> <tr> <td valign="top"> <b>杂谭逸事</b> </td> <td> <div>江南制造局工人罢工     光绪十六年(1890)七月二十一日,江南制造局工人为反对新任总办刘麒祥把每日工时延长一小时,鸣放汽笛,宣布罢工。二千工人无一人上工,坚持到下午,刘麒祥被迫同意增加饭钱,工人方答应复工。 澧州哥老会起事     光绪十五年(1889),澧州哥老会首领徐树堂、陈启元、廖星阶等在周家冈开堂放票,聚众结盟。当地团总声言要报官查办,廖星阶等遂于光绪十六年(1890)八月初四日起事,杀死团总。初六日,驾船赴新州,与前来围捕之差勇发生战斗。初十日,进攻澧州城,被兵勇击败,廖星阶等被捕。光绪十七年(1891)被杀害。</div></td> </tr> </table> </td> </tr> <tr> <td colspan="4"> <table border="0" width="100%"> <tr> <td valign="top"> <b>注释</b></td> <td> <div></div></td> </tr> </table> </td> </tr> <tr> </tr></table>
ilearninging/xxhis
all/2817.html
HTML
apache-2.0
3,299
<?xml version="1.0" encoding="UTF-8"?> <html xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" type="text/css" href="Styles/branding.css"/> <title>Unrestricted Layouts Page</title> <meta name="Microsoft.Help.Locale" content="en-us" /> <meta name="Microsoft.Help.TopicLocale" content="en-us" /> <meta name="Microsoft.Help.SelfBranded" content="true" /> <meta name="Microsoft.Help.Id" content="SPSF_RECIPE_UNSECUREDAPPLICATIONPAGE" /> <meta name="Microsoft.Help.TocParent" content="SPSF_RECIPES_CATEGORY_APPLICATIONPAGES" /> <meta name="Microsoft.Help.TocOrder" content="3" /> <meta name="Microsoft.Help.Keywords" content="Unrestricted Layouts Page" /> <meta name="Microsoft.Help.Category" content="HelpFiles" /> <meta name="Description" content="Add a unsecured layouts page to the project inherited from LayoutsPageBase" /> <style type="text/css"> .OH_TocResize { top: 126px; } </style> </head> <body class="primary-mtps-offline-document" > <div class="OH_topic"> <table class="spsfbannertable" height="93" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="height:93px; background-image: url('ms.help?content/SPSF/store/HelpFiles.mshc;_img/header_background.jpg'); background-repeat: repeat-x;"><img src="./_img/header_left.jpg" /></td><td valign="right" style="height:93px; background-image: url('ms.help?content/SPSF/store/HelpFiles.mshc;_img/header_background.jpg'); background-repeat: repeat-x; text-align: right;"><img src="./_img/header_right.jpg" /></td></tr></table> <div id="mainHeader"> <table> <tbody> <tr> <td> <h1>Unrestricted Layouts Page</h1> </td> </tr> </tbody> </table> </div> </div> <div id="mainSection"> <div id="mainBody"> <div class="introduction"><p>Add a unsecured layouts page to the project inherited from LayoutsPageBase</p></div> <DIV class="OH_CollapsibleAreaRegion"> <DIV class="OH_regiontitle">Screens</DIV> <DIV class="OH_RegionToggle"></DIV> </DIV> <DIV class="OH_clear"></DIV> <p> <span class="spsfscreenshot"><span> <img class="screenshot" src="./Screenshots/UnsecuredApplicationPage/100_Result2010.gif" /> <br /> </span><span> <img class="screenshot" src="./Screenshots/UnsecuredApplicationPage/150_Result2007.gif" /> <br /> </span><span> <img class="screenshot" src="./Screenshots/UnsecuredApplicationPage/200_OpenInBrowser.gif" /> <br /> </span></span> </p> <div class="spsfclear"></div> <DIV class="OH_CollapsibleAreaRegion"> <DIV class="OH_regiontitle">Arguments</DIV> <DIV class="OH_RegionToggle"></DIV> </DIV> <DIV class="OH_clear"></DIV> <p> <div class="tableSection"> <table id="argumentTable" width="100%"> <tr> <th>Name</th> <th>Description</th> </tr> <tr> <td>Page Name</td> <td>Enter name of the application page without extension (.aspx)</td> </tr> <tr> <td>Title</td> <td>Enter the title of page (displayed on top of the page and in the title of the html).</td> </tr> <tr> <td>Description</td> <td>Enter the description of page (displayed on top of the page).</td> </tr> <tr> <td>Allow Anonymous Access</td> <td></td> </tr> </table> </div> </p> <DIV class="OH_CollapsibleAreaRegion"> <DIV class="OH_regiontitle">References</DIV> <DIV class="OH_RegionToggle"></DIV> </DIV> <DIV class="OH_clear"></DIV> <p> <ul> <li> <a href="http://msdn.microsoft.com/en-us/library/ms463449.aspx" target="_new">UnsecuredApplicationPage</a> </li> </ul></p> <DIV class="OH_CollapsibleAreaRegion"> <DIV class="OH_regiontitle">Authors</DIV> <DIV class="OH_RegionToggle"></DIV> </DIV> <DIV class="OH_clear"></DIV> <p> <ul> <li>Torsten Mandelkow</li> </ul> </p> <DIV class="OH_CollapsibleAreaRegion"> <DIV class="OH_regiontitle">Version history</DIV> <DIV class="OH_RegionToggle"></DIV> </DIV> <DIV class="OH_clear"></DIV> <p> <ul> <li>1.0 Initial Recipe</li> </ul> </p> </div> </div> </div> </div> <br /> <table width="100%"> <tr> <td> <div class="OH_feedbacklink"> <b>Disclaimer:</b> The views and opinions expressed in this documentation and in SPSF are those of the <a href="SPSF_OVERVIEW_110_AUTHORS.html">authors</a> and do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. All trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.<br /> SharePoint Software Factory, Version 4.1.3.2705, <a href="ms.help?method=page&amp;id=SPSF_OVERVIEW_800_LICENSE&amp;topicversion=0&amp;topiclocale=&amp;SQM=1&amp;product=VS&amp;productVersion=100&amp;locale=EN-US">GPLv2</a>, see <a href="http://spsf.codeplex.com">http://spsf.codeplex.com</a> for more information </div> <br /> </td> </tr> </table> <br /> </body> </html>
Sowz/SharePoint-Software-Factory
SPALM.SPSF/Help/OutputHelp3/SPSF_RECIPE_UNSECUREDAPPLICATIONPAGE.html
HTML
apache-2.0
5,902
/* * Copyright (c) 2002-2018 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j 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/>. */ package org.neo4j.kernel.impl.util; import org.junit.Rule; import org.junit.Test; import java.io.File; import java.io.IOException; import org.neo4j.test.TargetDirectory; import org.neo4j.test.TargetDirectory.TestDirectory; import static org.junit.Assert.assertArrayEquals; import static org.neo4j.kernel.impl.util.Converters.regexFiles; public class ConvertersTest { public final @Rule TestDirectory directory = TargetDirectory.testDirForTest( getClass() ); @Test public void shouldSortFilesByNumberCleverly() throws Exception { // GIVEN File file1 = existenceOfFile( "file1" ); File file123 = existenceOfFile( "file123" ); File file12 = existenceOfFile( "file12" ); File file2 = existenceOfFile( "file2" ); File file32 = existenceOfFile( "file32" ); // WHEN File[] files = regexFiles( true ).apply( directory.file( "file.*" ).getAbsolutePath() ); // THEN assertArrayEquals( new File[] {file1, file2, file12, file32, file123}, files ); } private File existenceOfFile( String name ) throws IOException { File file = directory.file( name ); file.createNewFile(); return file; } }
HuangLS/neo4j
community/kernel/src/test/java/org/neo4j/kernel/impl/util/ConvertersTest.java
Java
apache-2.0
2,020
# Limnonesis friedrichsthaliana Klotzsch 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/Alismatales/Araceae/Pistia/Pistia stratiotes/ Syn. Limnonesis friedrichsthaliana/README.md
Markdown
apache-2.0
195
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.6.0_27) on Mon Dec 16 23:53:27 EST 2013 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Uses of Class org.apache.hadoop.mapreduce.jobhistory.JobFinishedEvent (hadoop-mapreduce-client-core 2.2.0 API)</title> <meta name="date" content="2013-12-16"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.hadoop.mapreduce.jobhistory.JobFinishedEvent (hadoop-mapreduce-client-core 2.2.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="../../../../../../org/apache/hadoop/mapreduce/jobhistory/JobFinishedEvent.html" title="class in org.apache.hadoop.mapreduce.jobhistory">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?org/apache/hadoop/mapreduce/jobhistory//class-useJobFinishedEvent.html" target="_top">FRAMES</a></li> <li><a href="JobFinishedEvent.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.hadoop.mapreduce.jobhistory.JobFinishedEvent" class="title">Uses of Class<br>org.apache.hadoop.mapreduce.jobhistory.JobFinishedEvent</h2> </div> <div class="classUseContainer">No usage of org.apache.hadoop.mapreduce.jobhistory.JobFinishedEvent</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/hadoop/mapreduce/jobhistory/JobFinishedEvent.html" title="class in org.apache.hadoop.mapreduce.jobhistory">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?org/apache/hadoop/mapreduce/jobhistory//class-useJobFinishedEvent.html" target="_top">FRAMES</a></li> <li><a href="JobFinishedEvent.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2013 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved.</small></p> </body> </html>
arrowli/RsyncHadoop
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/target/org/apache/hadoop/mapreduce/jobhistory/class-use/JobFinishedEvent.html
HTML
apache-2.0
4,673
// -*- coding: us-ascii-unix -*- // Copyright 2013 Lukas Kemmer // // 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. #include <cmath> #include "geo/scale.hh" namespace faint{ Scale::Scale(const NewSize& inNew, const Size& oldSz){ const Size& newSz(inNew.Get()); x = newSz.w / oldSz.w; y = newSz.h / oldSz.h; } Scale invert_x_scale(){ return Scale(-1.0, 1.0); } Scale invert_y_scale(){ return Scale(1.0, -1.0); } Scale abs(const Scale& sc){ return Scale(std::fabs(sc.x), std::fabs(sc.y)); } Size operator*(const Scale& sc, const Size& sz){ return Size(sc.x * sz.w, sc.y * sz.h); } Size operator*(const Size& sz, const Scale& sc){ return Size(sc.x * sz.w, sc.y * sz.h); } Scale inverse(const Scale& sc){ if (sc.x == 0 || sc.y == 0){ return sc; } return Scale(1.0 / sc.x, 1.0 / sc.y); } } // namespace
tectronics/faint-graphics-editor
geo/scale.cpp
C++
apache-2.0
1,336
// Copyright 2017 The Bazel Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.devtools.build.workspace.output; import static com.google.common.truth.Truth.assertThat; import com.google.common.collect.ImmutableList; import com.google.common.io.Files; import com.google.devtools.build.workspace.maven.Rule; import java.io.File; import java.nio.charset.Charset; import org.eclipse.aether.artifact.DefaultArtifact; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** * Test the .bzl output writer. */ @RunWith(JUnit4.class) public class BzlWriterTest { @Test public void writeEmpty() throws Exception { BzlWriter writer = new BzlWriter(new String[]{}, System.getenv("TEST_TMPDIR")); writer.write(ImmutableList.of()); String fileContents = Files.toString( new File(System.getenv("TEST_TMPDIR") + "/generate_workspace.bzl"), Charset.defaultCharset()); assertThat(fileContents).contains("def generated_maven_jars():\n pass\n"); assertThat(fileContents).contains("def generated_java_libraries():\n pass\n"); } @Test public void writeRules() throws Exception { BzlWriter writer = new BzlWriter(new String[]{}, System.getenv("TEST_TMPDIR")); writer.write(ImmutableList.of(new Rule(new DefaultArtifact("x:y:1.2.3")))); String fileContents = Files.toString( new File(System.getenv("TEST_TMPDIR") + "/generate_workspace.bzl"), Charset.defaultCharset()); assertThat(fileContents).contains("def generated_maven_jars():\n native.maven_jar(\n" + " name = \"x_y\",\n" + " artifact = \"x:y:1.2.3\",\n" + " )\n"); assertThat(fileContents).contains("def generated_java_libraries():\n native.java_library(\n" + " name = \"x_y\",\n" + " visibility = [\"//visibility:public\"],\n" + " exports = [\"@x_y//jar\"],\n" + " )\n"); } @Test public void writeAlias() throws Exception { BzlWriter writer = new BzlWriter(new String[]{}, System.getenv("TEST_TMPDIR")); writer.write(ImmutableList.of(new Rule(new DefaultArtifact("x:y:1.2.3"), "z"))); String fileContents = Files.toString( new File(System.getenv("TEST_TMPDIR") + "/generate_workspace.bzl"), Charset.defaultCharset()); assertThat(fileContents).doesNotContain("x:y:1.2.3"); assertThat(fileContents).contains("exports = [\"@z//jar\"],"); } public void writeCommand() throws Exception { BzlWriter writer = new BzlWriter(new String[]{"x", "y", "z"}, System.getenv("TEST_TMPDIR")); writer.write(ImmutableList.of()); String fileContents = Files.toString( new File(System.getenv("TEST_TMPDIR") + "/generate_workspace.bzl"), Charset.defaultCharset()); assertThat(fileContents).contains("# generate_workspace x y z"); } }
petroseskinder/migration-tooling
generate_workspace/src/test/java/com/google/devtools/build/workspace/output/BzlWriterTest.java
Java
apache-2.0
3,400
/* * 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.geode.cache.client.internal; import java.util.List; import org.apache.geode.cache.query.SelectResults; import org.apache.geode.distributed.internal.ServerLocation; /** * Used to send operations from a client to a server. * * @since GemFire 5.7 */ public class ServerProxy { protected final InternalPool pool; /** * Creates a server proxy for the given pool. * * @param pool the pool that this proxy will use to communicate with servers */ public ServerProxy(InternalPool pool) { this.pool = pool; } /** * Returns the pool the proxy is using. */ public InternalPool getPool() { return this.pool; } /** * Release use of this pool */ public void detach() { this.pool.detach(); } /** * Ping the specified server to see if it is still alive * * @param server the server to do the execution on */ public void ping(ServerLocation server) { PingOp.execute(this.pool, server); } /** * Does a query on a server * * @param queryPredicate A query language boolean query predicate * @return A <code>SelectResults</code> containing the values that match the * <code>queryPredicate</code>. */ public SelectResults query(String queryPredicate, Object[] queryParams) { return QueryOp.execute(this.pool, queryPredicate, queryParams); } }
smanvi-pivotal/geode
geode-core/src/main/java/org/apache/geode/cache/client/internal/ServerProxy.java
Java
apache-2.0
2,156
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- *************************GO-LICENSE-START****************************** * Copyright 2014 ThoughtWorks, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *************************GO-LICENSE-END******************************* --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>CCE Dashboard Tests</title> <link rel="stylesheet" type="text/css" href="../css/jsUnitStyle.css"> <link rel="stylesheet" type="text/css" href="../css/jsUnitStyle.css"> <script language="JavaScript" type="text/javascript" src="../app/jsUnitCore.js"></script> <script language="JavaScript" type="text/javascript" src="../app/jsUnitVersionCheck.js"></script> <script language="JavaScript" type="text/javascript" src="../app/jsTestHelper.js"></script> <script language="JavaScript" type="text/javascript" src="../compressed/all.js"></script> <script language="JavaScript" type="text/javascript" src="../compressed/test_helper.js"></script> <script type="text/javascript" src="../app/after_load_enhancements.js"></script> <script language="JavaScript" type="text/javascript"> var orig_write_attribute = Element.writeAttribute; var contextPath = "/dashboard"; var observer; function setUp() { Element.addMethods({writeAttribute : orig_write_attribute}); $('buildoutput_pre').innerHTML = ''; observer = new BuildOutputObserver(1, "project1"); $('container').className = "building_passed"; $('trans_content').update(""); TransMessage.prototype.initialize = Prototype.emptyFunction; } function test_ajax_periodical_refresh_active_build_should_update_css() { $$('.build_detail_summary')[0].ancestors()[0].className = "building_passed" var json = failed_json('project1') observer.update_page(json); assertEquals("failed", $$('.build_detail_summary')[0].ancestors()[0].className); } function test_ajax_periodical_refresh_active_build_output_executer_oncomplete_should_update_output() { var build_output = "Build Failed." observer._update_live_output(build_output) assertEquals("Build Failed.", $('buildoutput_pre').innerHTML.stripTags()); } function test_should_invoke_word_break_to_break_text() { $$WordBreaker.break_text = function() { return "breaked text"; } observer.display_error_message_if_necessary(inactive_json("project1")) assertTrue($('trans_content').innerHTML.indexOf("breaked text") > -1); } </script> </head> <body> <div id="container"> <span class="page_panel"><b class="rtop"><b class="r1"></b> <b class="r2"></b> <b class="r3"></b> <b class="r4"></b></b></span> <div class="build_detail_summary"> <h3>project1 is now <span id="build_status_id" class='build_status'></span></h3> <ul class="summary"> <li><strong>Building since:</strong> $buildSince</li> <li><strong>Elapsed time:</strong> <span id="${projectName}_time_elapsed"><img src="images/spinner.gif"/></span></li> <li><strong>Previous successful build:</strong> $durationToSuccessfulBuild</li> <li><strong>Remaining time:</strong> <span id="${projectName}_time_remaining"><img src="images/spinner.gif"/></span></li> <span id="build_name_status"></span> </ul> </div> <span class="page_panel"><b class="rbottom"><b class="r4"></b> <b class="r3"></b> <b class="r2"></b> <b class="r1"></b></b></span> </div> <span id="buildoutput_pre"></span> <div id="trans_content"></div> </body> </html>
10fish/gocd
server/jsunit/tests/build_detail_observer_test.html
HTML
apache-2.0
4,408
/* * Copyright 2022 Red Hat * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jboss.hal.ballroom.chart; import jsinterop.annotations.JsType; import jsinterop.base.JsPropertyMap; @JsType(isNative = true) class Api { native void load(JsPropertyMap<Object> data); native void resize(JsPropertyMap<Object> dimension); native void destroy(); }
michpetrov/hal.next
ballroom/src/main/java/org/jboss/hal/ballroom/chart/Api.java
Java
apache-2.0
892
package dev.jinkim.snappollandroid.imgur; import android.content.Context; import android.content.SharedPreferences; import android.text.TextUtils; import android.util.Log; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.message.BasicNameValuePair; import org.json.JSONException; import org.json.JSONObject; import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; import java.util.Scanner; import dev.jinkim.snappollandroid.app.App; /** * ImgurAuthorization helper - reference: https://github.com/talklittle/ImgurAPIv3ExampleAndroid */ public class ImgurAuthorization { private static final String TAG = ImgurAuthorization.class.getSimpleName(); private static ImgurAuthorization INSTANCE; static final String SHARED_PREFERENCES_NAME = "imgur_example_auth"; private ImgurAuthorization() { } public static ImgurAuthorization getInstance() { if (INSTANCE == null) INSTANCE = new ImgurAuthorization(); return INSTANCE; } public boolean isLoggedIn() { Context context = App.getInstance().context; SharedPreferences prefs = context.getSharedPreferences(SHARED_PREFERENCES_NAME, 0); return !TextUtils.isEmpty(prefs.getString("access_token", null)); } public void addToHttpURLConnection(HttpURLConnection conn) { Context context = App.getInstance().context; SharedPreferences prefs = context.getSharedPreferences(SHARED_PREFERENCES_NAME, 0); String accessToken = prefs.getString("access_token", null); if (!TextUtils.isEmpty(accessToken)) { conn.setRequestProperty("Authorization", "Bearer " + accessToken); } else { conn.setRequestProperty("Authorization", "Client-ID " + ImgurConstants.MY_IMGUR_CLIENT_ID); } } public void saveRefreshToken(String refreshToken, String accessToken, long expiresIn) { Context context = App.getInstance().context; context.getSharedPreferences(SHARED_PREFERENCES_NAME, 0) .edit() .putString("access_token", accessToken) .putString("refresh_token", refreshToken) .putLong("expires_in", expiresIn) .commit(); } public String requestNewAccessToken() { Context context = App.getInstance().context; SharedPreferences prefs = context.getSharedPreferences(SHARED_PREFERENCES_NAME, 0); String refreshToken = prefs.getString("refresh_token", null); if (refreshToken == null) { Log.w(TAG, "refresh token is null; cannot request access token. login first."); return null; } // clear previous access token prefs.edit().remove("access_token").commit(); HttpURLConnection conn = null; try { conn = (HttpURLConnection) new URL("https://api.imgur.com/oauth2/token").openConnection(); conn.setDoOutput(true); conn.setRequestProperty("Authorization", "Client-ID " + ImgurConstants.MY_IMGUR_CLIENT_ID); ArrayList<NameValuePair> nvps = new ArrayList<NameValuePair>(); nvps.add(new BasicNameValuePair("refresh_token", refreshToken)); nvps.add(new BasicNameValuePair("client_id", ImgurConstants.MY_IMGUR_CLIENT_ID)); nvps.add(new BasicNameValuePair("client_secret", ImgurConstants.MY_IMGUR_CLIENT_SECRET)); nvps.add(new BasicNameValuePair("grant_type", "refresh_token")); UrlEncodedFormEntity entity = new UrlEncodedFormEntity(nvps); OutputStream out = conn.getOutputStream(); entity.writeTo(out); out.flush(); out.close(); if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { InputStream in = conn.getInputStream(); handleAccessTokenResponse(in); in.close(); } else { Log.i(TAG, "responseCode=" + conn.getResponseCode()); InputStream errorStream = conn.getErrorStream(); StringBuilder sb = new StringBuilder(); Scanner scanner = new Scanner(errorStream); while (scanner.hasNext()) { sb.append(scanner.next()); } Log.i(TAG, "error response: " + sb.toString()); errorStream.close(); } return prefs.getString("access_token", null); } catch (Exception ex) { Log.e(TAG, "Could not request new access token", ex); return null; } finally { try { conn.disconnect(); } catch (Exception ignore) { } } } private void handleAccessTokenResponse(InputStream in) throws JSONException { StringBuilder sb = new StringBuilder(); Scanner scanner = new Scanner(in); while (scanner.hasNext()) { sb.append(scanner.next()); } JSONObject root = new JSONObject(sb.toString()); String accessToken = root.getString("access_token"); String refreshToken = root.getString("refresh_token"); long expiresIn = root.getLong("expires_in"); String tokenType = root.getString("token_type"); String accountUsername = root.getString("account_username"); Context context = App.getInstance().context; context.getSharedPreferences(SHARED_PREFERENCES_NAME, 0) .edit() .putString("access_token", accessToken) .putString("refresh_token", refreshToken) .putLong("expires_in", expiresIn) .putString("token_type", tokenType) .putString("account_username", accountUsername) .commit(); } public void logout() { Context context = App.getInstance().context; context.getSharedPreferences(SHARED_PREFERENCES_NAME, 0) .edit() .clear() .commit(); } }
jinkim608/SnapPoll
SnapPollAndroidClient/app/src/main/java/dev/jinkim/snappollandroid/imgur/ImgurAuthorization.java
Java
apache-2.0
6,167
package de.otto.rx.composer.content; import static de.otto.rx.composer.content.Headers.emptyHeaders; /** * Static Content that may be used as fallback content. */ public class StaticTextContent extends SingleContent { private final String source; private final String text; private final Position position; private StaticTextContent(final String source, final Position position, final String text) { this.source = source; this.position = position; this.text = text; } public static StaticTextContent staticTextContent(final Position position, final String text) { return new StaticTextContent("Static Text", position, text); } public static StaticTextContent staticTextContent(final String source, final Position position, final String text) { return new StaticTextContent(source, position, text); } @Override public String getSource() { return source; } @Override public Position getPosition() { return position; } @Override public boolean isAvailable() { return !text.isEmpty(); } @Override public String getBody() { return text; } @Override public Headers getHeaders() { return emptyHeaders(); } @Override public long getStartedTs() { return 0L; } @Override public long getCompletedTs() { return 0L; } @Override public String toString() { return "StaticTextContent{" + "source='" + source + '\'' + ", text='" + text + '\'' + ", position=" + position + '}'; } }
gsteinacker/rx-composer
composer-core/src/main/java/de/otto/rx/composer/content/StaticTextContent.java
Java
apache-2.0
1,901
'use strict'; let Joi = require('joi'); class RequestVaildator { getListParameterValidator() { return { type: Joi.any().valid(process.env.TEMPLATE_PARTS.split(',')) } } getListQueryValidator() { return { page: Joi.number().min(1), limit: Joi.number().min(parseInt(process.env.PAGINATION_LIMIT)) } } getPostValidator() { return { name: Joi.string().min(5).max(35).required(), group: Joi.any().valid(process.env.TEMPLATE_PARTS.split(',')).required(), subgroup: Joi.string().min(3).max(35), content: Joi.object().keys({ html: Joi.string().required(), css: Joi.string(), js: Joi.string(), engine: Joi.string() }).required(), viewareas: Joi.array() } } getUpdateValidator() { let updateValidator = this.getPostValidator(); updateValidator.id = Joi.string().alphanum().min(24); return updateValidator; } } module.exports = new RequestVaildator();
omrsmeh/fuse-cloud
server/api/template/validators/request.validator.js
JavaScript
apache-2.0
990
/* * Copyright 2000-2013 JetBrains s.r.o. * * 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.intellij.util.containers; import com.intellij.openapi.util.Comparing; import org.jetbrains.annotations.NotNull; import java.util.AbstractList; import java.util.Iterator; import java.util.NoSuchElementException; /** * Immutable list in functional style */ public class FList<E> extends AbstractList<E> { private static final FList<?> EMPTY_LIST = new FList<>(null, null, 0); private final E myHead; private final FList<E> myTail; private final int mySize; private FList(E head, FList<E> tail, int size) { myHead = head; myTail = tail; mySize = size; } @Override public E get(int index) { if (index < 0 || index >= mySize) { throw new IndexOutOfBoundsException("index = " + index + ", size = " + mySize); } FList<E> current = this; while (index > 0) { current = current.myTail; index--; } return current.myHead; } public E getHead() { return myHead; } public FList<E> prepend(E elem) { return new FList<>(elem, this, mySize + 1); } public FList<E> without(E elem) { FList<E> front = emptyList(); FList<E> current = this; while (!current.isEmpty()) { if (elem == null ? current.myHead == null : current.myHead.equals(elem)) { FList<E> result = current.myTail; while (!front.isEmpty()) { result = result.prepend(front.myHead); front = front.myTail; } return result; } front = front.prepend(current.myHead); current = current.myTail; } return this; } @NotNull @Override public Iterator<E> iterator() { return new Iterator<E>() { private FList<E> list = FList.this; @Override public boolean hasNext() { return list.size() > 0; } @Override public E next() { if (list.size() == 0) throw new NoSuchElementException(); E res = list.myHead; list = list.getTail(); assert list != null; return res; } @Override public void remove() { throw new UnsupportedOperationException(); } }; } public FList<E> getTail() { return myTail; } @Override public int size() { return mySize; } @Override public boolean equals(Object o) { if (this == o) return true; if (o instanceof FList) { FList list1 = this; FList list2 = (FList)o; if (mySize != list2.mySize) return false; while (list1 != null) { if (!Comparing.equal(list1.myHead, list2.myHead)) return false; list1 = list1.getTail(); list2 = list2.getTail(); if (list1 == list2) return true; } return true; } return super.equals(o); } @Override public int hashCode() { int result = 1; FList each = this; while (each != null) { result = result * 31 + (each.myHead != null ? each.myHead.hashCode() : 0); each = each.getTail(); } return result; } public static <E> FList<E> emptyList() { //noinspection unchecked return (FList<E>)EMPTY_LIST; } /** * Creates an FList object with the elements of the given sequence in the reversed order, i.e. the last element of {@code from} will be the result's {@link #getHead()} */ public static <E> FList<E> createFromReversed(Iterable<? extends E> from) { FList<E> result = emptyList(); for (E e : from) { result = result.prepend(e); } return result; } }
leafclick/intellij-community
platform/util/src/com/intellij/util/containers/FList.java
Java
apache-2.0
4,095
/* * Copyright (c) 2017 Aniket Divekar * * 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 pinterest4j.config; import java.io.Serializable; /** * Interface to represent configurations for the Pinterest APIs * * Created by Aniket Divekar. */ public interface Configuration extends Serializable { String getRestBaseUrl(); String getUsersRestBaseUrl(); String getBoardsRestBaseUrl(); String getMeRestBaseUrl(); String getPinsRestBaseUrl(); }
Codigami/pinterest4j
src/main/java/pinterest4j/config/Configuration.java
Java
apache-2.0
991
/* * Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U. * * 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 es.tid.cosmos.infinity.common.fs import java.net.URL import java.util.Date import es.tid.cosmos.infinity.common.permissions.PermissionsMask /** Fields that any metadata object should have. */ sealed trait AbstractMetadata { val path: Path val `type`: PathType val metadata: URL val owner: String val group: String val modificationTime: Date val accessTime: Option[Date] val permissions: PermissionsMask val replication: Short val blockSize: Long val size: Long def isDirectory: Boolean = `type` == PathType.Directory } /** Metadata of either a file or a directory. */ sealed trait PathMetadata extends AbstractMetadata case class FileMetadata( override val path: Path, override val metadata: URL, content: URL, override val owner: String, override val group: String, override val modificationTime: Date, override val accessTime: Option[Date], override val permissions: PermissionsMask, override val replication: Short, override val blockSize: Long, override val size: Long) extends PathMetadata { override val `type` = PathType.File def this( path: String, metadata: String, content: String, owner: String, group: String, modificationTime: Date, accessTime: Date, permissions: String, replication: Short, blockSize: Long, size: Long) = this(Path.absolute(path), new URL(metadata), new URL(content), owner, group, modificationTime, Some(accessTime), PermissionsMask.fromOctal(permissions), replication, blockSize, size) require(replication >= 0, s"Replication must be non-negative but was $replication") require(blockSize > 0, s"Block size must be positive but was $blockSize") require(size >= 0, s"File size must be non-negative but was $size") } /** Metadata of a directory including an entry per child path. */ case class DirectoryMetadata( override val path: Path, override val metadata: URL, content: Seq[DirectoryEntry], override val owner: String, override val group: String, override val modificationTime: Date, override val permissions: PermissionsMask) extends PathMetadata { override val `type` = PathType.Directory override val accessTime = None override val replication = DirectoryMetadata.Replication override val blockSize = DirectoryMetadata.BlockSize override val size = DirectoryMetadata.Size def this(path: String, metadata: String, content: Seq[DirectoryEntry], owner: String, group: String, modificationTime: Date, permissions: String) = this(Path.absolute(path), new URL(metadata), content, owner, group, modificationTime, PermissionsMask.fromOctal(permissions)) } object DirectoryMetadata { val Replication: Short = 0 val BlockSize: Long = 0L val Size: Long = 0L } /** Metadata for every directory entry, without the content field to avoid recursion. */ case class DirectoryEntry ( override val path: Path, override val `type`: PathType, override val metadata: URL, override val owner: String, override val group: String, override val modificationTime: Date, override val accessTime: Option[Date], override val permissions: PermissionsMask, override val replication: Short, override val blockSize: Long, override val size: Long) extends AbstractMetadata { require(size >= 0, s"File size must be non-negative but was $size") def this(path: String, `type`: String, metadata: String, owner: String, group: String, modificationTime: Date, accessTime: Option[Date], permissions: String, replication: Short, blockSize: Long, size: Long) = this(Path.absolute(path), PathType.valueOf(`type`), new URL(metadata), owner, group, modificationTime, accessTime, PermissionsMask.fromOctal(permissions), replication, blockSize, size) } object DirectoryEntry { def file(path: Path, metadata: URL, owner: String, group: String, modificationTime: Date, accessTime: Date, permissions: PermissionsMask, replication: Short, blockSize: Long, size: Long) = DirectoryEntry( path, PathType.File, metadata, owner, group, modificationTime, Some(accessTime), permissions, replication, blockSize, size) def directory(path: Path, metadata: URL, owner: String, group: String, modificationTime: Date, permissions: PermissionsMask) = DirectoryEntry( path, PathType.Directory, metadata, owner, group, modificationTime, None, permissions, DirectoryMetadata.Replication, DirectoryMetadata.BlockSize, DirectoryMetadata.Size) }
telefonicaid/fiware-cosmos-platform
infinity/common/src/main/scala/es/tid/cosmos/infinity/common/fs/PathMetadata.scala
Scala
apache-2.0
5,192
package egovframework.com.cop.smt.sdm.service; import java.util.List; import java.util.Map; import egovframework.com.cmm.ComDefaultVO; /** * 부서일정관리를 처리하는 Service Class 구현 * @author 공통서비스 장동한 * @since 2009.04.10 * @version 1.0 * @see * * <pre> * << 개정이력(Modification Information) >> * * 수정일 수정자 수정내용 * ------- -------- --------------------------- * 2009.04.10 장동한 최초 생성 * * </pre> */ public interface EgovDeptSchdulManageService { /** * 메인페이지/부서일정관리조회 * @param map * @return List * @throws Exception */ public List selectDeptSchdulManageMainList(Map map) throws Exception; /** * 부서일정 목록을 조회한다. * @param map * @return List * @throws Exception */ public List selectDeptSchdulManageRetrieve(Map map) throws Exception; /** * 부서일정 목록을 VO(model)형식으로 조회한다. * @param deptSchdulManageVO * @return List * @throws Exception */ public DeptSchdulManageVO selectDeptSchdulManageDetailVO(DeptSchdulManageVO deptSchdulManageVO) throws Exception; /** * 부서일정 목록을 조회한다. * @param searchVO * @return List * @throws Exception */ public List selectDeptSchdulManageList(ComDefaultVO searchVO) throws Exception; /** * 부서일정를(을) 상세조회 한다. * @param deptSchdulManageVO * @return List * @throws Exception */ public List selectDeptSchdulManageDetail(DeptSchdulManageVO deptSchdulManageVO) throws Exception; /** * 부서일정를(을) 목록 전체 건수를(을) 조회한다. * @param searchVO * @return int * @throws Exception */ public int selectDeptSchdulManageListCnt(ComDefaultVO searchVO) throws Exception; /** * 부서일정을 등록한다. * @param deptSchdulManageVO * @throws Exception */ void insertDeptSchdulManage(DeptSchdulManageVO deptSchdulManageVO) throws Exception; /** * 부서일정를(을) 수정한다. * @param deptSchdulManageVO * @throws Exception */ void updateDeptSchdulManage(DeptSchdulManageVO deptSchdulManageVO) throws Exception; /** * 부서일정를(을) 삭제한다. * @param deptSchdulManageVO * @throws Exception */ void deleteDeptSchdulManage(DeptSchdulManageVO deptSchdulManageVO) throws Exception; }
dasomel/egovframework
common-component/v2.3.2/src/main/java/egovframework/com/cop/smt/sdm/service/EgovDeptSchdulManageService.java
Java
apache-2.0
2,497
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>帮助 - Bootstrap后台管理系统模版Ace下载</title> <meta name="keywords" content="Bootstrap模版,Bootstrap模版下载,Bootstrap教程,Bootstrap中文" /> <meta name="description" content="站长素材提供Bootstrap模版,Bootstrap教程,Bootstrap中文翻译等相关Bootstrap插件下载" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <!-- basic styles --> <link href="assets/css/bootstrap.min.css" rel="stylesheet" /> <link rel="stylesheet" href="assets/css/font-awesome.min.css" /> <!--[if IE 7]> <link rel="stylesheet" href="assets/css/font-awesome-ie7.min.css" /> <![endif]--> <!-- page specific plugin styles --> <link rel="stylesheet" href="assets/css/jquery-ui-1.10.3.custom.min.css" /> <!-- fonts --> <link rel="stylesheet" href="assets\css\cyrillic.css" /> <!-- ace styles --> <link rel="stylesheet" href="assets/css/ace.min.css" /> <link rel="stylesheet" href="assets/css/ace-rtl.min.css" /> <link rel="stylesheet" href="assets/css/ace-skins.min.css" /> <!--[if lte IE 8]> <link rel="stylesheet" href="assets/css/ace-ie.min.css" /> <![endif]--> <!-- inline styles related to this page --> <!-- ace settings handler --> <script src="assets/js/ace-extra.min.js"></script> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="assets/js/html5shiv.js"></script> <script src="assets/js/respond.min.js"></script> <![endif]--> </head> <body> <div class="navbar navbar-default" id="navbar"> <script type="text/javascript"> try{ace.settings.check('navbar' , 'fixed')}catch(e){} </script> <div class="navbar-container" id="navbar-container"> <div class="navbar-header pull-left"> <a href="#" class="navbar-brand"> <small> <i class="icon-leaf"></i> Ace Admin </small> </a><!-- /.brand --> </div><!-- /.navbar-header --> <div class="navbar-header pull-right" role="navigation"> <ul class="nav ace-nav"> <li class="grey"> <a data-toggle="dropdown" class="dropdown-toggle" href="#"> <i class="icon-tasks"></i> <span class="badge badge-grey">4</span> </a> <ul class="pull-right dropdown-navbar dropdown-menu dropdown-caret dropdown-close"> <li class="dropdown-header"> <i class="icon-ok"></i> 4 Tasks to complete </li> <li> <a href="#"> <div class="clearfix"> <span class="pull-left">Software Update</span> <span class="pull-right">65%</span> </div> <div class="progress progress-mini "> <div style="width:65%" class="progress-bar "></div> </div> </a> </li> <li> <a href="#"> <div class="clearfix"> <span class="pull-left">Hardware Upgrade</span> <span class="pull-right">35%</span> </div> <div class="progress progress-mini "> <div style="width:35%" class="progress-bar progress-bar-danger"></div> </div> </a> </li> <li> <a href="#"> <div class="clearfix"> <span class="pull-left">Unit Testing</span> <span class="pull-right">15%</span> </div> <div class="progress progress-mini "> <div style="width:15%" class="progress-bar progress-bar-warning"></div> </div> </a> </li> <li> <a href="#"> <div class="clearfix"> <span class="pull-left">Bug Fixes</span> <span class="pull-right">90%</span> </div> <div class="progress progress-mini progress-striped active"> <div style="width:90%" class="progress-bar progress-bar-success"></div> </div> </a> </li> <li> <a href="#"> See tasks with details <i class="icon-arrow-right"></i> </a> </li> </ul> </li> <li class="purple"> <a data-toggle="dropdown" class="dropdown-toggle" href="#"> <i class="icon-bell-alt icon-animated-bell"></i> <span class="badge badge-important">8</span> </a> <ul class="pull-right dropdown-navbar navbar-pink dropdown-menu dropdown-caret dropdown-close"> <li class="dropdown-header"> <i class="icon-warning-sign"></i> 8 Notifications </li> <li> <a href="#"> <div class="clearfix"> <span class="pull-left"> <i class="btn btn-xs no-hover btn-pink icon-comment"></i> New Comments </span> <span class="pull-right badge badge-info">+12</span> </div> </a> </li> <li> <a href="#"> <i class="btn btn-xs btn-primary icon-user"></i> Bob just signed up as an editor ... </a> </li> <li> <a href="#"> <div class="clearfix"> <span class="pull-left"> <i class="btn btn-xs no-hover btn-success icon-shopping-cart"></i> New Orders </span> <span class="pull-right badge badge-success">+8</span> </div> </a> </li> <li> <a href="#"> <div class="clearfix"> <span class="pull-left"> <i class="btn btn-xs no-hover btn-info icon-twitter"></i> Followers </span> <span class="pull-right badge badge-info">+11</span> </div> </a> </li> <li> <a href="#"> See all notifications <i class="icon-arrow-right"></i> </a> </li> </ul> </li> <li class="green"> <a data-toggle="dropdown" class="dropdown-toggle" href="#"> <i class="icon-envelope icon-animated-vertical"></i> <span class="badge badge-success">5</span> </a> <ul class="pull-right dropdown-navbar dropdown-menu dropdown-caret dropdown-close"> <li class="dropdown-header"> <i class="icon-envelope-alt"></i> 5 Messages </li> <li> <a href="#"> <img src="assets/avatars/avatar.png" class="msg-photo" alt="Alex's Avatar" /> <span class="msg-body"> <span class="msg-title"> <span class="blue">Alex:</span> Ciao sociis natoque penatibus et auctor ... </span> <span class="msg-time"> <i class="icon-time"></i> <span>a moment ago</span> </span> </span> </a> </li> <li> <a href="#"> <img src="assets/avatars/avatar3.png" class="msg-photo" alt="Susan's Avatar" /> <span class="msg-body"> <span class="msg-title"> <span class="blue">Susan:</span> Vestibulum id ligula porta felis euismod ... </span> <span class="msg-time"> <i class="icon-time"></i> <span>20 minutes ago</span> </span> </span> </a> </li> <li> <a href="#"> <img src="assets/avatars/avatar4.png" class="msg-photo" alt="Bob's Avatar" /> <span class="msg-body"> <span class="msg-title"> <span class="blue">Bob:</span> Nullam quis risus eget urna mollis ornare ... </span> <span class="msg-time"> <i class="icon-time"></i> <span>3:15 pm</span> </span> </span> </a> </li> <li> <a href="inbox.html"> See all messages <i class="icon-arrow-right"></i> </a> </li> </ul> </li> <li class="light-blue"> <a data-toggle="dropdown" href="#" class="dropdown-toggle"> <img class="nav-user-photo" src="assets/avatars/user.jpg" alt="Jason's Photo" /> <span class="user-info"> <small>Welcome,</small> Jason </span> <i class="icon-caret-down"></i> </a> <ul class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close"> <li> <a href="#"> <i class="icon-cog"></i> Settings </a> </li> <li> <a href="#"> <i class="icon-user"></i> Profile </a> </li> <li class="divider"></li> <li> <a href="#"> <i class="icon-off"></i> Logout </a> </li> </ul> </li> </ul><!-- /.ace-nav --> </div><!-- /.navbar-header --> </div><!-- /.container --> </div> <div class="main-container" id="main-container"> <script type="text/javascript"> try{ace.settings.check('main-container' , 'fixed')}catch(e){} </script> <div class="main-container-inner"> <a class="menu-toggler" id="menu-toggler" href="#"> <span class="menu-text"></span> </a> <div class="sidebar" id="sidebar"> <script type="text/javascript"> try{ace.settings.check('sidebar' , 'fixed')}catch(e){} </script> <div class="sidebar-shortcuts" id="sidebar-shortcuts"> <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large"> <button class="btn btn-success"> <i class="icon-signal"></i> </button> <button class="btn btn-info"> <i class="icon-pencil"></i> </button> <button class="btn btn-warning"> <i class="icon-group"></i> </button> <button class="btn btn-danger"> <i class="icon-cogs"></i> </button> </div> <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini"> <span class="btn btn-success"></span> <span class="btn btn-info"></span> <span class="btn btn-warning"></span> <span class="btn btn-danger"></span> </div> </div><!-- #sidebar-shortcuts --> <ul class="nav nav-list"> <li class="active"> <a href="index.html"> <i class="icon-dashboard"></i> <span class="menu-text"> 控制台 </span> </a> </li> <li> <a href="typography.html"> <i class="icon-text-width"></i> <span class="menu-text"> 文字排版 </span> </a> </li> <li> <a href="#" class="dropdown-toggle"> <i class="icon-desktop"></i> <span class="menu-text"> UI 组件 </span> <b class="arrow icon-angle-down"></b> </a> <ul class="submenu"> <li> <a href="elements.html"> <i class="icon-double-angle-right"></i> 组件 </a> </li> <li> <a href="buttons.html"> <i class="icon-double-angle-right"></i> 按钮 &amp; 图表 </a> </li> <li> <a href="treeview.html"> <i class="icon-double-angle-right"></i> 树菜单 </a> </li> <li> <a href="jquery-ui.html"> <i class="icon-double-angle-right"></i> jQuery UI </a> </li> <li> <a href="nestable-list.html"> <i class="icon-double-angle-right"></i> 可拖拽列表 </a> </li> <li> <a href="#" class="dropdown-toggle"> <i class="icon-double-angle-right"></i> 三级菜单 <b class="arrow icon-angle-down"></b> </a> <ul class="submenu"> <li> <a href="#"> <i class="icon-leaf"></i> 第一级 </a> </li> <li> <a href="#" class="dropdown-toggle"> <i class="icon-pencil"></i> 第四级 <b class="arrow icon-angle-down"></b> </a> <ul class="submenu"> <li> <a href="#"> <i class="icon-plus"></i> 添加产品 </a> </li> <li> <a href="#"> <i class="icon-eye-open"></i> 查看商品 </a> </li> </ul> </li> </ul> </li> </ul> </li> <li> <a href="#" class="dropdown-toggle"> <i class="icon-list"></i> <span class="menu-text"> 表格 </span> <b class="arrow icon-angle-down"></b> </a> <ul class="submenu"> <li> <a href="tables.html"> <i class="icon-double-angle-right"></i> 简单 &amp; 动态 </a> </li> <li> <a href="jqgrid.html"> <i class="icon-double-angle-right"></i> jqGrid plugin </a> </li> </ul> </li> <li> <a href="#" class="dropdown-toggle"> <i class="icon-edit"></i> <span class="menu-text"> 表单 </span> <b class="arrow icon-angle-down"></b> </a> <ul class="submenu"> <li> <a href="form-elements.html"> <i class="icon-double-angle-right"></i> 表单组件 </a> </li> <li> <a href="form-wizard.html"> <i class="icon-double-angle-right"></i> 向导提示 &amp; 验证 </a> </li> <li> <a href="wysiwyg.html"> <i class="icon-double-angle-right"></i> 编辑器 </a> </li> <li> <a href="dropzone.html"> <i class="icon-double-angle-right"></i> 文件上传 </a> </li> </ul> </li> <li> <a href="widgets.html"> <i class="icon-list-alt"></i> <span class="menu-text"> 插件 </span> </a> </li> <li> <a href="calendar.html"> <i class="icon-calendar"></i> <span class="menu-text"> 日历 <span class="badge badge-transparent tooltip-error" title="2&nbsp;Important&nbsp;Events"> <i class="icon-warning-sign red bigger-130"></i> </span> </span> </a> </li> <li> <a href="gallery.html"> <i class="icon-picture"></i> <span class="menu-text"> 相册 </span> </a> </li> <li> <a href="#" class="dropdown-toggle"> <i class="icon-tag"></i> <span class="menu-text"> 更多页面 </span> <b class="arrow icon-angle-down"></b> </a> <ul class="submenu"> <li> <a href="profile.html"> <i class="icon-double-angle-right"></i> 用户信息 </a> </li> <li> <a href="inbox.html"> <i class="icon-double-angle-right"></i> 收件箱 </a> </li> <li> <a href="pricing.html"> <i class="icon-double-angle-right"></i> 售价单 </a> </li> <li> <a href="invoice.html"> <i class="icon-double-angle-right"></i> 购物车 </a> </li> <li> <a href="timeline.html"> <i class="icon-double-angle-right"></i> 时间轴 </a> </li> <li> <a href="login.html"> <i class="icon-double-angle-right"></i> 登录 &amp; 注册 </a> </li> </ul> </li> <li class="active open"> <a href="#" class="dropdown-toggle"> <i class="icon-file-alt"></i> <span class="menu-text"> 其他页面 <span class="badge badge-primary ">5</span> </span> <b class="arrow icon-angle-down"></b> </a> <ul class="submenu"> <li class="active"> <a href="faq.html"> <i class="icon-double-angle-right"></i> 帮助 </a> </li> <li> <a href="error-404.html"> <i class="icon-double-angle-right"></i> 404错误页面 </a> </li> <li> <a href="error-500.html"> <i class="icon-double-angle-right"></i> 500错误页面 </a> </li> <li> <a href="grid.html"> <i class="icon-double-angle-right"></i> 网格 </a> </li> <li> <a href="blank.html"> <i class="icon-double-angle-right"></i> 空白页面 </a> </li> </ul> </li> </ul><!-- /.nav-list --> <div class="sidebar-collapse" id="sidebar-collapse"> <i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i> </div> <script type="text/javascript"> try{ace.settings.check('sidebar' , 'collapsed')}catch(e){} </script> </div> <div class="main-content"> <div class="breadcrumbs" id="breadcrumbs"> <script type="text/javascript"> try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){} </script> <ul class="breadcrumb"> <li> <i class="icon-home home-icon"></i> <a href="#">Home</a> </li> <li> <a href="#">Other Pages</a> </li> <li class="active">FAQ</li> </ul><!-- .breadcrumb --> <div class="nav-search" id="nav-search"> <form class="form-search"> <span class="input-icon"> <input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" /> <i class="icon-search nav-search-icon"></i> </span> </form> </div><!-- #nav-search --> </div> <div class="page-content"> <div class="page-header"> <h1> FAQ <small> <i class="icon-double-angle-right"></i> frequently asked questions using tabs and accordions </small> </h1> </div><!-- /.page-header --> <div class="row"> <div class="col-xs-12"> <!-- PAGE CONTENT BEGINS --> <div class="tabbable"> <ul class="nav nav-tabs padding-18 tab-size-bigger" id="myTab"> <li class="active"> <a data-toggle="tab" href="#faq-tab-1"> <i class="blue icon-question-sign bigger-120"></i> General </a> </li> <li> <a data-toggle="tab" href="#faq-tab-2"> <i class="green icon-user bigger-120"></i> Account </a> </li> <li> <a data-toggle="tab" href="#faq-tab-3"> <i class="orange icon-credit-card bigger-120"></i> Payments </a> </li> <li class="dropdown"> <a data-toggle="dropdown" class="dropdown-toggle" href="#"> <i class="purple icon-magic bigger-120"></i> Misc <i class="icon-caret-down"></i> </a> <ul class="dropdown-menu dropdown-lighter dropdown-125"> <li> <a data-toggle="tab" href="#faq-tab-4"> Affiliates </a> </li> <li> <a data-toggle="tab" href="#faq-tab-4"> Merchants </a> </li> </ul> </li><!-- /.dropdown --> </ul> <div class="tab-content no-border padding-24"> <div id="faq-tab-1" class="tab-pane fade in active"> <h4 class="blue"> <i class="icon-ok bigger-110"></i> General Questions </h4> <div class="space-8"></div> <div id="faq-list-1" class="panel-group accordion-style1 accordion-style2"> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-1-1" data-parent="#faq-list-1" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-chevron-left pull-right" data-icon-hide="icon-chevron-down" data-icon-show="icon-chevron-left"></i> <i class="icon-user bigger-130"></i> &nbsp; High life accusamus terry richardson ad squid? </a> </div> <div class="panel-collapse collapse" id="faq-1-1"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-1-2" data-parent="#faq-list-1" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-chevron-left pull-right" data-icon-hide="icon-chevron-down" data-icon-show="icon-chevron-left"></i> <i class="icon-sort-by-attributes-alt"></i> &nbsp; Can I have nested questions? </a> </div> <div class="panel-collapse collapse" id="faq-1-2"> <div class="panel-body"> <div id="faq-list-nested-1" class="panel-group accordion-style1 accordion-style2"> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-list-1-sub-1" data-parent="#faq-list-nested-1" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-plus smaller-80 middle" data-icon-hide="icon-minus" data-icon-show="icon-plus"></i> &nbsp; Enim eiusmod high life accusamus terry? </a> </div> <div class="panel-collapse collapse" id="faq-list-1-sub-1"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-list-1-sub-2" data-parent="#faq-list-nested-1" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-plus smaller-80 middle" data-icon-hide="icon-minus" data-icon-show="icon-plus"></i> &nbsp; Food truck quinoa nesciunt laborum eiusmod? </a> </div> <div class="panel-collapse collapse" id="faq-list-1-sub-2"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-list-1-sub-3" data-parent="#faq-list-nested-1" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-plus smaller-80 middle" data-icon-hide="icon-minus" data-icon-show="icon-plus"></i> &nbsp; Cupidatat skateboard dolor brunch? </a> </div> <div class="panel-collapse collapse" id="faq-list-1-sub-3"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-1-3" data-parent="#faq-list-1" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-chevron-left pull-right" data-icon-hide="icon-chevron-down" data-icon-show="icon-chevron-left"></i> <i class="icon-credit-card bigger-130"></i> &nbsp; Single-origin coffee nulla assumenda shoreditch et? </a> </div> <div class="panel-collapse collapse" id="faq-1-3"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-1-4" data-parent="#faq-list-1" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-chevron-left pull-right" data-icon-hide="icon-chevron-down" data-icon-show="icon-chevron-left"></i> <i class="icon-copy bigger-130"></i> &nbsp; Sunt aliqua put a bird on it squid? </a> </div> <div class="panel-collapse collapse" id="faq-1-4"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-1-5" data-parent="#faq-list-1" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-chevron-left pull-right" data-icon-hide="icon-chevron-down" data-icon-show="icon-chevron-left"></i> <i class="icon-cog bigger-130"></i> &nbsp; Brunch 3 wolf moon tempor sunt aliqua put? </a> </div> <div class="panel-collapse collapse" id="faq-1-5"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> </div> </div> <div id="faq-tab-2" class="tab-pane fade"> <h4 class="blue"> <i class="green icon-user bigger-110"></i> Account Questions </h4> <div class="space-8"></div> <div id="faq-list-2" class="panel-group accordion-style1 accordion-style2"> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-2-1" data-parent="#faq-list-2" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-chevron-right smaller-80" data-icon-hide="icon-chevron-down align-top" data-icon-show="icon-chevron-right"></i> &nbsp; Enim eiusmod high life accusamus terry richardson? </a> </div> <div class="panel-collapse collapse" id="faq-2-1"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-2-2" data-parent="#faq-list-2" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-chevron-right smaller-80" data-icon-hide="icon-chevron-down align-top" data-icon-show="icon-chevron-right"></i> &nbsp; Single-origin coffee nulla assumenda shoreditch et? </a> </div> <div class="panel-collapse collapse" id="faq-2-2"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-2-3" data-parent="#faq-list-2" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-chevron-right middle smaller-80" data-icon-hide="icon-chevron-down align-top" data-icon-show="icon-chevron-right"></i> &nbsp; Sunt aliqua put a bird on it squid? </a> </div> <div class="panel-collapse collapse" id="faq-2-3"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-2-4" data-parent="#faq-list-2" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-chevron-right smaller-80" data-icon-hide="icon-chevron-down align-top" data-icon-show="icon-chevron-right"></i> &nbsp; Brunch 3 wolf moon tempor sunt aliqua put? </a> </div> <div class="panel-collapse collapse" id="faq-2-4"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> </div> </div> <div id="faq-tab-3" class="tab-pane fade"> <h4 class="blue"> <i class="orange icon-credit-card bigger-110"></i> Payment Questions </h4> <div class="space-8"></div> <div id="faq-list-3" class="panel-group accordion-style1 accordion-style2"> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-3-1" data-parent="#faq-list-3" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-plus smaller-80" data-icon-hide="icon-minus" data-icon-show="icon-plus"></i> &nbsp; Enim eiusmod high life accusamus terry richardson? </a> </div> <div class="panel-collapse collapse" id="faq-3-1"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-3-2" data-parent="#faq-list-3" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-plus smaller-80" data-icon-hide="icon-minus" data-icon-show="icon-plus"></i> &nbsp; Single-origin coffee nulla assumenda shoreditch et? </a> </div> <div class="panel-collapse collapse" id="faq-3-2"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-3-3" data-parent="#faq-list-3" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-plus smaller-80" data-icon-hide="icon-minus" data-icon-show="icon-plus"></i> &nbsp; Sunt aliqua put a bird on it squid? </a> </div> <div class="panel-collapse collapse" id="faq-3-3"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-3-4" data-parent="#faq-list-3" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-plus smaller-80" data-icon-hide="icon-minus" data-icon-show="icon-plus"></i> &nbsp; Brunch 3 wolf moon tempor sunt aliqua put? </a> </div> <div class="panel-collapse collapse" id="faq-3-4"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> </div> </div> <div id="faq-tab-4" class="tab-pane fade"> <h4 class="blue"> <i class="purple icon-magic bigger-110"></i> Miscellaneous Questions </h4> <div class="space-8"></div> <div id="faq-list-4" class="panel-group accordion-style1 accordion-style2"> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-4-1" data-parent="#faq-list-4" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-hand-right" data-icon-hide="icon-hand-down" data-icon-show="icon-hand-right"></i> &nbsp; Enim eiusmod high life accusamus terry richardson? </a> </div> <div class="panel-collapse collapse" id="faq-4-1"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-4-2" data-parent="#faq-list-4" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-frown bigger-120" data-icon-hide="icon-smile" data-icon-show="icon-frown"></i> &nbsp; Single-origin coffee nulla assumenda shoreditch et? </a> </div> <div class="panel-collapse collapse" id="faq-4-2"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-4-3" data-parent="#faq-list-4" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-plus smaller-80" data-icon-hide="icon-minus" data-icon-show="icon-plus"></i> &nbsp; Sunt aliqua put a bird on it squid? </a> </div> <div class="panel-collapse collapse" id="faq-4-3"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <a href="#faq-4-4" data-parent="#faq-list-4" data-toggle="collapse" class="accordion-toggle collapsed"> <i class="icon-plus smaller-80" data-icon-hide="icon-minus" data-icon-show="icon-plus"></i> &nbsp; Brunch 3 wolf moon tempor sunt aliqua put? </a> </div> <div class="panel-collapse collapse" id="faq-4-4"> <div class="panel-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. </div> </div> </div> </div> </div> </div> </div> <!-- PAGE CONTENT ENDS --> </div><!-- /.col --> </div><!-- /.row --> </div><!-- /.page-content --> </div><!-- /.main-content --> <div class="ace-settings-container" id="ace-settings-container"> <div class="btn btn-app btn-xs btn-warning ace-settings-btn" id="ace-settings-btn"> <i class="icon-cog bigger-150"></i> </div> <div class="ace-settings-box" id="ace-settings-box"> <div> <div class="pull-left"> <select id="skin-colorpicker" class="hide"> <option data-skin="default" value="#438EB9">#438EB9</option> <option data-skin="skin-1" value="#222A2D">#222A2D</option> <option data-skin="skin-2" value="#C6487E">#C6487E</option> <option data-skin="skin-3" value="#D0D0D0">#D0D0D0</option> </select> </div> <span>&nbsp; Choose Skin</span> </div> <div> <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-navbar" /> <label class="lbl" for="ace-settings-navbar"> Fixed Navbar</label> </div> <div> <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-sidebar" /> <label class="lbl" for="ace-settings-sidebar"> Fixed Sidebar</label> </div> <div> <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-breadcrumbs" /> <label class="lbl" for="ace-settings-breadcrumbs"> Fixed Breadcrumbs</label> </div> <div> <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-rtl" /> <label class="lbl" for="ace-settings-rtl"> Right To Left (rtl)</label> </div> <div> <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-add-container" /> <label class="lbl" for="ace-settings-add-container"> Inside <b>.container</b> </label> </div> </div> </div><!-- /#ace-settings-container --> </div><!-- /.main-container-inner --> <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse"> <i class="icon-double-angle-up icon-only bigger-110"></i> </a> </div><!-- /.main-container --> <!-- basic scripts --> <!--[if !IE]> --> <script src="assets\js\jquery-2.0.3.min.js"></script> <!-- <![endif]--> <!--[if IE]> <script src="assets\js\jquery-1.10.2.min.js"></script> <![endif]--> <!--[if !IE]> --> <script type="text/javascript"> window.jQuery || document.write("<script src='assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>"); </script> <!-- <![endif]--> <!--[if IE]> <script type="text/javascript"> window.jQuery || document.write("<script src='assets/js/jquery-1.10.2.min.js'>"+"<"+"/script>"); </script> <![endif]--> <script type="text/javascript"> if("ontouchend" in document) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>"); </script> <script src="assets/js/bootstrap.min.js"></script> <script src="assets/js/typeahead-bs2.min.js"></script> <!-- page specific plugin scripts --> <script src="assets/js/jquery-ui-1.10.3.custom.min.js"></script> <script src="assets/js/jquery.ui.touch-punch.min.js"></script> <script src="assets/js/jquery.slimscroll.min.js"></script> <!-- ace scripts --> <script src="assets/js/ace-elements.min.js"></script> <script src="assets/js/ace.min.js"></script> <!-- inline scripts related to this page --> <script type="text/javascript"> jQuery(function($) { $('.accordion').on('hide', function (e) { $(e.target).prev().children(0).addClass('collapsed'); }) $('.accordion').on('show', function (e) { $(e.target).prev().children(0).removeClass('collapsed'); }) }); </script> </body> </html> <script>var _hmt = _hmt || [];(function(){var hm=document.createElement("script");hm.src = "//hm.baidu.com/hm.js?a43c39da34531f4da694d4499c5614d4";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();</script>
liwanzhang/learning-zwl
learning-bootstrap/src/main/webapp/static/ace/faq.html
HTML
apache-2.0
44,389
package cn.changhong.ancare import cn.changhong.ancare.util.{AncareTools, SMSUtil} import com.flashbird.http.framework.request.DynamicPathParamsRequest import com.flashbird.http.framework.{HttpControllerFilter, DefaultResponseCode, DefaultResponseContent, Controller} import com.flashbird.http.framework.authorization.{ Authorization} import com.flashbird.http.util.{RedisProvider, Tools, FlashBirdConfig, SqlProvider} import Controller._ import com.twitter.finagle.httpx.Request import com.flashbird.http.util.UserDefinedGetResult._ /** * Created by yangguo on 15/10/28. */ case class Account(phone:String,password:String) case class RegisterStep2Request(phone:String,verifyCode:String) case class RegisterStep3Request(phone:String,verifyCode:String,password:String) case class ChangePasswordBean(id:String,oldPwd:String,newPwd:String) case class FeedBack(user_id:String,remark:String,tag:String) class AccountService extends Controller(Some("/account")){ override def defaultIsNeedAuth: Boolean = true private val prefix_register_key="register" private def generatorKey(str:String)=prefix_register_key+"_"+str val authProvider:Authorization=FlashBirdConfig.getAuthProvider() post("/login",false){account:Account=> login((account.phone),(account.password)) } private def login(phone:String,password:String)={ val sql=s"select id,phone,icon,sex,nick,age,area,job from tb_user where phone='${SqlProvider.checkUnSafeWord(phone)}' and password='${Tools.md5(password)}'" try { val list=SqlProvider.noTransactionExec[Map[String, AnyRef]](sql) if(list!=null&&list.size>0){ val user=list(0) user.get("id") match{ case Some(id)=> { val token=authProvider.creatorToken(id.toString) val userFamilySql=s"select * from tb_familymember where user_id='${id}'" val familys=SqlProvider.noTransactionExec[Map[String,AnyRef]](userFamilySql) val bean=user+("token"->token)+("familyInfos"->familys) DefaultResponseContent(DefaultResponseCode.succeed._1,bean) } case None=>DefaultResponseContent(DefaultResponseCode.db_executor_error._1,DefaultResponseCode.db_executor_error._2) } }else{ DefaultResponseContent(DefaultResponseCode.user_not_exit._1,DefaultResponseCode.user_not_exit._2) } }catch{ case ex:Throwable=>{ ex.printStackTrace() DefaultResponseContent(DefaultResponseCode.db_executor_error._1,DefaultResponseCode.db_executor_error._2) } } } /** * phone number */ post("/register/step1",false){phone:String=> sendSMSVerifyCode(SqlProvider.checkUnSafeWord(phone)) } private def sendSMSVerifyCode(phone:String)={ val verifyCode=SMSUtil.generatorRandomNumber(6) val timeOut=2 val msg=s"${verifyCode}为你本次验证码,10分钟内有效!" if(SMSUtil(msg,phone)){ RedisProvider.redisCommand{client=> val key=generatorKey(phone) client.set(key,verifyCode.toString) client.expire(key,timeOut+2) } DefaultResponseContent(DefaultResponseCode.succeed._1,"成功") }else{ DefaultResponseContent(DefaultResponseCode.method_was_closed._1,DefaultResponseCode.method_was_closed._2) } } /** * phone and verifyCode */ post("/register/step2",false) { request: RegisterStep2Request => RedisProvider.redisCommand { client => val _code = client.get(generatorKey(request.phone)) if (_code != null && _code.equals(request.verifyCode)) { DefaultResponseContent(DefaultResponseCode.succeed._1, "成功") } else { DefaultResponseContent(DefaultResponseCode.invalid_token._1, "验证码错误或者无效") } } } /** * phone number,verify code,password */ post("/register/step3",false){request:RegisterStep3Request=> RedisProvider.redisCommand { client => val _code = client.get(generatorKey(request.phone)) if (_code != null && _code.equals(request.verifyCode)) { val insertSql=s"insert into tb_user(phone,password,creation) values('${request.phone}','${Tools.md5(request.password)}','${System.currentTimeMillis()}')" SqlProvider.noTransactionExec[Int](insertSql) match{ case item::list=>{ if(item>0){ login(request.phone,request.password) } } } } else { DefaultResponseContent(DefaultResponseCode.invalid_token._1, "验证码错误或者无效") } } } post("/changeInfo"){request:Request=> val id=request.headerMap.getOrElse(FlashBirdConfig.key_access_token_info,"-1") val map=AncareTools.multiPartFormRequestDecoder(request).filter(kv=>kv._1!="password"&&kv._1!="creation"&&kv._1!="id") AncareTools.update(map,"tb_user",s"id='$id'") } /** * oldPassword,newPassword,id, */ post("/changepwd"){request:DynamicPathParamsRequest[ChangePasswordBean]=> val currentUserId=request.underlying.headerMap.getOrElse(FlashBirdConfig.key_access_token_info,"-1") try{ request.content match { case Some(bean)=>{ if(currentUserId.equals(bean.id)){ val updateSql=s"update tb_user set password='${Tools.md5(bean.newPwd)}' where id='${SqlProvider.checkUnSafeWord(bean.id)}' and password='${Tools.md5(bean.oldPwd)}'" SqlProvider.noTransactionExec[Int](updateSql) match{ case item::list if item>0=>DefaultResponseContent(DefaultResponseCode.succeed._1,"修改密码成功") } } } } }catch{ case ex:Throwable=>{ ex.printStackTrace() DefaultResponseContent(DefaultResponseCode.user_not_exit._1,"密码错误") } } } post("/findpwd",false){request:RegisterStep3Request=> RedisProvider.redisCommand { client => val _code = client.get(generatorKey(request.phone)) if (_code != null && _code.equals(request.verifyCode)) { val updateSql=s"update tb_user set password='${Tools.md5(request.password)}' where phone='${SqlProvider.checkUnSafeWord(request.phone)}'" SqlProvider.noTransactionExec[Int](updateSql) match{ case item::list=>{ if(item>0){ login(request.phone,request.password) } } } } else { DefaultResponseContent(DefaultResponseCode.invalid_token._1, "验证码错误或者无效") } } } post("/feedback"){fb:Map[String,String]=> val kvs:Map[String,String]=fb+("creation"->(System.currentTimeMillis()+"")) AncareTools.insert(kvs,"tb_feedback") } }
guoyang2011/ancare
src/main/scala-2.10/cn/changhong/ancare/AccountService.scala
Scala
apache-2.0
6,605
package com.communote.plugins.api.rest.resource.validation; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @author Communote GmbH - <a href="http://www.communote.com/">http://www.communote.com/</a> */ public class ValidationHelper { /** * @param source * string to be checked * @param regEx * regular expression * @return list of errors */ public static List<ParameterValidationError> checkAgainstRegularExpression(String source, String regEx) { List<ParameterValidationError> errors = new ArrayList<ParameterValidationError>(); Pattern p = Pattern.compile(regEx); Matcher m = p.matcher(source); if (!m.matches()) { ParameterValidationError error = new ParameterValidationError(); error.setSource("nameIdentifier"); error.setMessageKey("string.validation.no.regex.matches"); errors.add(error); } return errors; } /** * @param source * string to be checked * @param maxLength * max length * @return list of errors */ public static List<ParameterValidationError> checkMaxStringLengthLimit(String source, int maxLength) { List<ParameterValidationError> errors = new ArrayList<ParameterValidationError>(); if (source.length() > maxLength) { ParameterValidationError error = new ParameterValidationError(); error.setMessageKey("string.validation.length.greater.max"); errors.add(error); } return errors; } /** * @param source * string to be checked * @param minLength * max length * @return list of errors */ public static List<ParameterValidationError> checkMinStringLengthLimit(String source, int minLength) { List<ParameterValidationError> errors = new ArrayList<ParameterValidationError>(); if (source.length() < minLength) { ParameterValidationError error = new ParameterValidationError(); error.setMessageKey("string.validation.length.smaller.min"); errors.add(error); } return errors; } /** * */ private ValidationHelper() { } }
Communote/communote-server
communote/plugins/rest-api/1.3/implementation/src/main/java/com/communote/plugins/api/rest/resource/validation/ValidationHelper.java
Java
apache-2.0
2,475
<div class="row" ng-controller="VirusCtrl as vc"> &NonBreakingSpace; <h4><b>MD5</b>: {{ vc.viruses[0].MD5 }}</h4> <div class="row"> <ul ng-init="tab = 1"> <li ng-class="{active:tab===1}"> <a href class="btn btn-primary" ng-click="tab = 1">General Information</a> </li> <li ng-class="{active:tab===2}"> <a href class="btn btn-primary" ng-click="tab = 2">Virus Scan Results</a> </li> <br><br> <div ng-show="tab===1"> <table id="virus_list" class="table table-striped"> <tr> <td>SHA1</td> <td>{{ vc.viruses[0].SHA1 }}</td> </tr> <tr> <td>SHA256</td> <td>{{ vc.viruses[0].SHA256 }}</td> </tr> <tr> <td>SSDeep</td> <td>{{ vc.viruses[0].SSDeep }}</td> </tr> <tr> <td>Time Stamp</td> <td>{{ vc.viruses[0].time_stamp }}</td> </tr> <tr> <td>Size</td> <td>{{ vc.viruses[0].file_information.size }}</td> </tr> <tr> <td>File Type</td> <td>{{ vc.viruses[0].file_information.file_type }}</td> </tr> <tr> <td>MIME Type</td> <td>{{ vc.viruses[0].file_information.mime_type }}</td> </tr> <tr> <td>Description</td> <td>{{ vc.viruses[0].file_information.description }}</td> </tr> <tr> <td>Code Size</td> <td>{{ vc.viruses[0].file_information.code_size }}</td> </tr> </table> </div> <div ng-show="tab===2"> <table id="virus_list" class="table table-striped"> <thead> <th>Anti-Virus Software</th> <th>Virus Classification</th> </thead> <tbody> <tr ng-repeat="(key,val) in vc.viruses[0].av_scans"> <td>{{ key }}</td> <td>{{ val }}</td> </tr> </tbody> </table> </div> </ul> <!-- <hr> <h4>Debug:</h4> <pre>{{ vc.viruses | json }}</pre>--> <a ng-href="/#/virus/update/{{ vc.viruses[0].MD5 }}" id="btn_update" class="btn btn-primary pull-right">Update Virus Information</a> </div> </div>
PSUPing/CS575-Final-Project
public/partials/virus.html
HTML
apache-2.0
2,610
// RUN: %clang_cc1 -verify -fopenmp %s // RUN: %clang_cc1 -verify -fopenmp-simd %s typedef void **omp_allocator_handle_t; extern const omp_allocator_handle_t omp_default_mem_alloc; extern const omp_allocator_handle_t omp_large_cap_mem_alloc; extern const omp_allocator_handle_t omp_const_mem_alloc; extern const omp_allocator_handle_t omp_high_bw_mem_alloc; extern const omp_allocator_handle_t omp_low_lat_mem_alloc; extern const omp_allocator_handle_t omp_cgroup_mem_alloc; extern const omp_allocator_handle_t omp_pteam_mem_alloc; extern const omp_allocator_handle_t omp_thread_mem_alloc; void foo() { } bool foobool(int argc) { return argc; } struct S1; // expected-note {{declared here}} expected-note {{forward declaration of 'S1'}} extern S1 a; class S2 { mutable int a; public: S2():a(0) { } static float S2s; // expected-note {{predetermined as shared}} }; const S2 b; const S2 ba[5]; class S3 { int a; public: S3():a(0) { } }; const S3 c; // expected-note {{'c' defined here}} const S3 ca[5]; // expected-note {{'ca' defined here}} extern const int f; // expected-note {{'f' declared here}} class S4 { int a; S4(); // expected-note {{implicitly declared private here}} public: S4(int v):a(v) { } }; class S5 { int a; S5():a(0) {} // expected-note {{implicitly declared private here}} public: S5(int v):a(v) { } }; S3 h; #pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}} int main(int argc, char **argv) { const int d = 5; // expected-note {{'d' defined here}} const int da[5] = { 0 }; // expected-note {{'da' defined here}} S4 e(4); S5 g(5); int i; int &j = i; #pragma omp target teams distribute parallel for private // expected-error {{expected '(' after 'private'}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private () // expected-error {{expected expression}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private (S1) // expected-error {{'S1' does not refer to a value}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private (a, b, c, d, f) // expected-error {{private variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be private}} expected-error 2 {{const-qualified variable cannot be private}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private (argv[1]) // expected-error {{expected variable name}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private(ba) for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private(ca) // expected-error {{const-qualified variable without mutable fields cannot be private}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private(da) // expected-error {{const-qualified variable cannot be private}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private(S2::S2s) // expected-error {{shared variable cannot be private}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for private(h) // expected-error {{threadprivate or thread local variable cannot be private}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for shared(i) for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for firstprivate(i), private(i) // expected-error {{firstprivate variable cannot be private}} expected-note {{defined as firstprivate}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for allocate(omp_thread_mem_alloc: j) private(j) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute parallel for' directive}} for (int k = 0; k < argc; ++k) ++k; #pragma omp target teams distribute parallel for reduction(+:i) for (int k = 0; k < argc; ++k) ++k; #pragma omp distribute private(i) for (int k = 0; k < 10; ++k) { #pragma omp target teams distribute parallel for private(i) for (int x = 0; x < 10; ++x) foo(); } #pragma omp target teams distribute parallel for firstprivate(i) for (int k = 0; k < 10; ++k) { } return 0; }
apple/swift-clang
test/OpenMP/target_teams_distribute_parallel_for_private_messages.cpp
C++
apache-2.0
5,884
//package io.skysail.core.server.routes // //import akka.http.scaladsl.server.Directives._ //import akka.http.scaladsl.server.{PathMatcher, _} //import akka.http.scaladsl.testkit.ScalatestRouteTest //import org.junit.runner.RunWith //import org.scalatest.junit.JUnitRunner //import org.scalatest.{Matchers, WordSpec, _} //import org.slf4j.LoggerFactory // //@RunWith(classOf[JUnitRunner]) //class PathMatcherFactorySpec extends WordSpec with BeforeAndAfterEach with Matchers with ScalatestRouteTest { // // private val log = LoggerFactory.getLogger(this.getClass) // // "The PathMatcherFactory" should { // // "create a pathMatcher matching an 'empty path' definition for an app without version" in { // val testedRoute = testRouteForPath("appPath", "") // expectFailureFor(testedRoute, "/") // expectSuccessFor(testedRoute, "/appPath") // } // // "create a pathMatcher matching an 'empty path' definition for an app with version" in { // val testedRoute = testRouteForPath("appPath/v1", "") // expectFailureFor(testedRoute, "/") // expectFailureFor(testedRoute, "/appPath") // expectSuccessFor(testedRoute, "/appPath/v1") // } // // "leave GET requests to other paths unhandled for app without version" in { // val testedRoute = testRouteForPath("appPath", "") // expectSuccessFor(testedRoute, "/appPath") // expectFailureFor(testedRoute, "/kermit") // } // // "leave GET requests to other paths unhandled for app with version" in { // val testedRoute = testRouteForPath("appPath/v1", "") // expectSuccessFor(testedRoute, "/appPath/v1") // expectFailureFor(testedRoute, "/kermit") // } // // "create a pathMatcher matching a 'slash path' definition for an app without version" in { // val testedRoute = testRouteForPath("appPath", "/") // expectSuccessFor(testedRoute, "/appPath/") // expectFailureFor(testedRoute, "/appPath/more") // } // // "create a pathMatcher matching a 'slash path' definition for an app with version" in { // val testedRoute = testRouteForPath("appPath/v1", "/") // expectFailureFor(testedRoute, "/appPath/") // expectFailureFor(testedRoute, "/appPath/v1") // expectSuccessFor(testedRoute, "/appPath/v1/") // expectFailureFor(testedRoute, "/appPath/more") // } // // "create a pathMatcher matching a 'simple path' definition for an app without version" in { // val testedRoute = testRouteForPath("appPath", "/sub") // expectSuccessFor(testedRoute, "/appPath/sub") // } // // "create a pathMatcher matching a 'simple path' definition for an app with version" in { // val testedRoute = testRouteForPath("appPath/v1", "/sub") // expectFailureFor(testedRoute, "/appPath/sub") // expectSuccessFor(testedRoute, "/appPath/v1/sub") // } // // "create a pathMatcher matching a path definition with segments for an app without version" in { // val testedRoute = testRouteForPath("appPath", "/seg1/seg2") // expectSuccessFor(testedRoute, "/appPath/seg1/seg2") // expectFailureFor(testedRoute, "/appPath/seg1/seg2/") // expectFailureFor(testedRoute, "/appPath/seg1/seg2/test") // } // // "create a pathMatcher matching a path definition with segments for an app with version" in { // val testedRoute = testRouteForPath("appPath/v1", "/seg1/seg2") // expectFailureFor(testedRoute, "/appPath/seg1/seg2") // expectSuccessFor(testedRoute, "/appPath/v1/seg1/seg2") // expectFailureFor(testedRoute, "/appPath/v1/seg1/seg2/") // expectFailureFor(testedRoute, "/appPath/v1/seg1/seg2/test") // } // // "create a pathMatcher matching a path definition with placeholder for an app without version" in { // expectSuccessFor(testRouteForPath("appPath", "/seg1/:id"), "/appPath/seg1/76dbbd1c-6242") // expectSuccessFor(testRouteForPath("appPath", "/seg1/:id/"), "/appPath/seg1/76dbbd1c-6242/") // expectSuccessFor(testRouteForPath("appPath", "/seg1/:id/seg2"), "/appPath/seg1/76dbbd1c-6242/seg2") // } // // "create a pathMatcher matching a path definition with placeholder for an app with version" in { // expectFailureFor(testRouteForPath("appPath/v1", "/seg1/:id"), "/appPath/seg1/76dbbd1c-6242-498f-a064-55a2f6ad3d41") // // expectSuccessFor(testRouteForPath("appPath/v1", "/seg1/:id"), "/appPath/v1/seg1/76dbbd1c") // expectSuccessFor(testRouteForPath("appPath/v1", "/seg1/:id/"), "/appPath/v1/seg1/76dbbd1c/") // } // // "create a pathMatcher matching a 'catchAll path' definition" in { // val testedRoute = testRouteForPath("appPath", "/catchAll/*") // expectFailureFor(testedRoute, "/appPath/catch") // expectSuccessFor(testedRoute, "/appPath/catchAll") // expectSuccessFor(testedRoute, "/appPath/catchAll/") // expectSuccessFor(testedRoute, "/appPath/catchAll/test") // expectSuccessFor(testedRoute, "/appPath/catchAll/test/") // expectSuccessFor(testedRoute, "/appPath/catchAll/test/sub") // expectSuccessFor(testedRoute, "/appPath/catchAll/test/sub/") // } // // } // // "The PathMatcherFactory also" should { // // "create a pathMatcher matching a path containing a parameter" in { // val testedRoute = testRouteForPath("appPath", "/contact/:id") // expectSuccessFor(testedRoute, "/appPath/contact/0") // } // // } // // private def expectSuccessFor(testedRoute: Route, testPath: String): Unit = { // log info s" - testing '$testPath' against route definition, expecting success" // Get(testPath) ~> testedRoute ~> check { // successfulCall(testPath) // } // } // // private def expectFailureFor(testedRoute: Route, testPath: String): Unit = { // //log info s" - testing '${testPath}' against route definition, expecting failure" // Get(testPath) ~> testedRoute ~> check { // rejectedCall() // } // } // // private def successfulCall(path: String) = { // responseAs[String] shouldEqual s"successfully matched" // '${path}'" // } // // private def rejectedCall() = { // handled shouldBe false // } // // private def testRouteForPath(appPath: String, path: String): Route = { // val m = if (appPath.contains("/")) { // //appPath.split("/").fold(PathMatchers.E)((a,b) => a / b).toString() // PathMatcherFactory.matcherFor("appPath" / "v1", path) // } else { // PathMatcherFactory.matcherFor(appPath, path) // } // m match { // case (pm: Any, Unit) => get { // pathPrefix(pm.asInstanceOf[PathMatcher[Unit]]) { // complete { // s"successfully matched" // } // } // } // case (pm: Any, e: Class[Tuple1[_]]) => get { // println(s"hier: ${pm.getClass.getName}") // if (pm.isInstanceOf[PathMatcher[Tuple1[List[String]]]]) { // pathPrefix(pm.asInstanceOf[PathMatcher[Tuple1[List[String]]]]) { i => // complete { // log info s"matched(1) ${i}" // s"successfully matched" // } // } // } else { // pathPrefix(pm.asInstanceOf[PathMatcher[Tuple1[String]]]) { i => // complete { // log info s"matched(1) ${i}" // s"successfully matched" // } // } // } // // } // case (pm: Any, e: Tuple2[_, _]) => get { // pathPrefix(pm.asInstanceOf[PathMatcher[Tuple1[String]]]) { i => // complete { // log info s"matched(2) ${i}" // s"successfully matched" // } // } // } // case (first: Any, second: Any) => println(s"Unmatched! First '$first', Second ${second}"); // get { // pathPrefix("") { // complete { // "error" // } // } // } // } // } // //}
evandor/skysail-core
skysail.core/test/io/skysail/core/server/routes/PathMatcherFactorySpec.scala
Scala
apache-2.0
7,809
package com.bn.picpanel; import javax.swing.JFrame; import com.bn.picpanel.JAddPicPanel; public class JAddPicFrame extends JFrame { /** * */ private static final long serialVersionUID = 1L; JAddPicPanel jpic; public JAddPicFrame() { jpic=new JAddPicPanel(); this.setTitle("Ìí¼ÓͼƬ"); this.add(jpic); this.setBounds(250,100,850,500); this.setVisible(true); } }
roubofenyong/bnmusic1
Mymusic/src/com/bn/picpanel/JAddPicFrame.java
Java
apache-2.0
392
package com.sfl.pms.api.internal.facade.order.impl; import com.sfl.pms.api.internal.facade.test.AbstractFacadeUnitTest; import com.sfl.pms.core.api.internal.model.common.result.ErrorType; import com.sfl.pms.core.api.internal.model.common.result.ResultResponseModel; import com.sfl.pms.core.api.internal.model.customer.CustomerModel; import com.sfl.pms.core.api.internal.model.order.OrderModel; import com.sfl.pms.core.api.internal.model.order.OrderPaymentRequestStateClientType; import com.sfl.pms.core.api.internal.model.order.OrderRequestRedirectPaymentMethodModel; import com.sfl.pms.core.api.internal.model.order.OrderStateClientType; import com.sfl.pms.core.api.internal.model.order.request.CreateOrderRequest; import com.sfl.pms.core.api.internal.model.order.request.GetOrderPaymentRequestStatusRequest; import com.sfl.pms.core.api.internal.model.order.request.RePayOrderRequest; import com.sfl.pms.core.api.internal.model.order.response.CreateOrderPaymentResponse; import com.sfl.pms.core.api.internal.model.order.response.GetOrderPaymentRequestStatusResponse; import com.sfl.pms.services.currency.model.Currency; import com.sfl.pms.services.customer.CustomerService; import com.sfl.pms.services.customer.dto.CustomerDto; import com.sfl.pms.services.customer.model.Customer; import com.sfl.pms.services.order.OrderService; import com.sfl.pms.services.order.dto.OrderDto; import com.sfl.pms.services.order.model.Order; import com.sfl.pms.services.order.model.OrderState; import com.sfl.pms.services.payment.common.dto.order.request.OrderPaymentRequestDto; import com.sfl.pms.services.payment.common.dto.order.request.OrderRequestRedirectPaymentMethodDto; import com.sfl.pms.services.payment.common.event.order.StartOrderPaymentRequestProcessingCommandEvent; import com.sfl.pms.services.payment.common.model.order.OrderPayment; import com.sfl.pms.services.payment.common.model.order.request.OrderPaymentRequest; import com.sfl.pms.services.payment.common.model.order.request.OrderPaymentRequestState; import com.sfl.pms.services.payment.common.order.request.OrderPaymentRequestService; import com.sfl.pms.services.payment.method.model.PaymentMethodType; import com.sfl.pms.services.payment.provider.model.PaymentProviderType; import com.sfl.pms.services.system.event.ApplicationEventDistributionService; import org.easymock.Mock; import org.easymock.TestSubject; import org.junit.Test; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.UUID; import static org.easymock.EasyMock.*; import static org.junit.Assert.*; /** * User: Ruben Dilanyan * Company: SFL LLC * Date: 1/19/16 * Time: 3:14 PM */ public class OrderPaymentFacadeImplTest extends AbstractFacadeUnitTest { /* Test subject and mocks */ @TestSubject private OrderPaymentFacadeImpl orderPaymentFacade = new OrderPaymentFacadeImpl(); @Mock private CustomerService customerService; @Mock private OrderService orderService; @Mock private OrderPaymentRequestService orderPaymentRequestService; @Mock private ApplicationEventDistributionService applicationEventDistributionService; /* Constructors */ public OrderPaymentFacadeImplTest() { } /* Test methods */ @Test public void testRePayOrderWithInvalidArguments() { // Reset resetAll(); // Replay replayAll(); // Run test scenario try { orderPaymentFacade.rePayOrder(null); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { // Expected } // Verify verifyAll(); } @Test public void testRePayOrderWithValidationErrorsForEmptyRequest() { // Test data final RePayOrderRequest rePayOrderRequest = new RePayOrderRequest(); // Reset resetAll(); // Replay replayAll(); // Run test scenario final ResultResponseModel<CreateOrderPaymentResponse> result = orderPaymentFacade.rePayOrder(rePayOrderRequest); assertNotNull(result); assertValidationErrors(result.getErrors(), new HashSet<>(Arrays.asList( ErrorType.ORDER_MISSING_UUID, ErrorType.ORDER_PAYMENT_MISSING_METHOD, ErrorType.ORDER_PAYMENT_MISSING_STORE_METHOD) )); // Verify verifyAll(); } @Test public void testRePayOrderWithValidationErrorsForEmptyRedirectPaymentMethod() { // Request final RePayOrderRequest request = getFacadeImplTestHelper().createRePayPaymentRequest(); request.setPaymentMethod(new OrderRequestRedirectPaymentMethodModel()); // Reset resetAll(); // Replay replayAll(); // Run test scenario final ResultResponseModel<CreateOrderPaymentResponse> result = orderPaymentFacade.rePayOrder(request); assertNotNull(result); assertNull(result.getResponse()); assertValidationErrors(result.getErrors(), Collections.singleton(ErrorType.ORDER_PAYMENT_METHOD_MISSING_PROVIDER_TYPE)); // Verify verifyAll(); } @Test public void testRePayOrderWithValidationErrorsForAlreadyPaidOrder() { // Test data final Long orderId = 1L; final Order order = getFacadeImplTestHelper().createOrder(); order.setId(orderId); // Request final RePayOrderRequest request = getFacadeImplTestHelper().createRePayPaymentRequest(); final OrderRequestRedirectPaymentMethodModel paymentMethodModel = getFacadeImplTestHelper().createRequestRedirectPaymentMethodModel(); request.setPaymentMethod(paymentMethodModel); // Reset resetAll(); // Expectations expect(orderService.getOrderByUuId(eq(request.getOrderUuId()))).andReturn(order).once(); expect(orderService.checkIfOrderIsPaid(eq(orderId))).andReturn(true).once(); // Replay replayAll(); // Run test scenario final ResultResponseModel<CreateOrderPaymentResponse> result = orderPaymentFacade.rePayOrder(request); assertNotNull(result); assertNull(result.getResponse()); assertValidationErrors(result.getErrors(), Collections.singleton(ErrorType.ORDER_PAYMENT_ALREADY_PAID)); // Verify verifyAll(); } @Test public void testRePayOrderWithRedirectPaymentMethod() { // Test data final RePayOrderRequest request = getFacadeImplTestHelper().createRePayPaymentRequest(); // Order request payment method final OrderRequestRedirectPaymentMethodModel requestPaymentMethodModel = getFacadeImplTestHelper().createRequestRedirectPaymentMethodModel(); request.setPaymentMethod(requestPaymentMethodModel); final OrderRequestRedirectPaymentMethodDto orderRequestRedirectPaymentMethodDto = new OrderRequestRedirectPaymentMethodDto(PaymentMethodType.valueOf(requestPaymentMethodModel.getPaymentMethodType().name()), PaymentProviderType.valueOf(requestPaymentMethodModel.getPaymentProviderType().name())); // Order final Long orderId = 2L; final Order order = getFacadeImplTestHelper().createOrder(); order.setId(orderId); // Order payment request final OrderPaymentRequestDto orderPaymentRequestDto = new OrderPaymentRequestDto(request.getClientIpAddress(), request.getStorePaymentMethod()); final Long orderPaymentRequestId = 3L; final OrderPaymentRequest orderPaymentRequest = getFacadeImplTestHelper().createOrderPaymentRequest(orderPaymentRequestDto); orderPaymentRequest.setId(orderPaymentRequestId); // Reset resetAll(); // Expectations expect(orderService.getOrderByUuId(eq(request.getOrderUuId()))).andReturn(order).once(); expect(orderService.checkIfOrderIsPaid(eq(orderId))).andReturn(false).once(); expect(orderPaymentRequestService.createOrderPaymentRequest(eq(orderId), eq(orderPaymentRequestDto), eq(orderRequestRedirectPaymentMethodDto))).andReturn(orderPaymentRequest).once(); applicationEventDistributionService.publishAsynchronousEvent(new StartOrderPaymentRequestProcessingCommandEvent(orderPaymentRequestId)); expectLastCall().once(); // Replay replayAll(); // Run test scenario final ResultResponseModel<CreateOrderPaymentResponse> result = orderPaymentFacade.rePayOrder(request); assertNotNull(result); assertNotNull(result.getResponse()); assertEquals(0, result.getErrors().size()); final CreateOrderPaymentResponse response = result.getResponse(); assertEquals(orderPaymentRequest.getUuId(), response.getOrderPaymentRequestUuId()); // Verify verifyAll(); } @Test public void testGetOrderPaymentRequestStatusWithInvalidArguments() { // Reset resetAll(); // Replay replayAll(); // Run test scenario try { orderPaymentFacade.getOrderPaymentRequestStatus(null); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { // Expected } // Verify verifyAll(); } @Test public void testGetOrderPaymentRequestStatusWithValidationErrors() { // Test data final GetOrderPaymentRequestStatusRequest request = new GetOrderPaymentRequestStatusRequest(); // Reset resetAll(); // Replay replayAll(); // Run test scenario final ResultResponseModel<GetOrderPaymentRequestStatusResponse> result = orderPaymentFacade.getOrderPaymentRequestStatus(request); assertNotNull(result); assertNull(result.getResponse()); assertEquals(1, result.getErrors().size()); assertValidationErrors(result.getErrors(), Collections.singleton(ErrorType.ORDER_PAYMENT_REQUEST_MISSING_UUID)); // Verify verifyAll(); } @Test public void testGetOrderPaymentRequestStatus() { // Test data final GetOrderPaymentRequestStatusRequest request = getFacadeImplTestHelper().createGetOrderPaymentRequestStatusRequest(); // Order payment request final Long orderPaymentRequestId = 1L; final OrderPaymentRequest orderPaymentRequest = getFacadeImplTestHelper().createOrderPaymentRequest(); orderPaymentRequest.setId(orderPaymentRequestId); orderPaymentRequest.setState(OrderPaymentRequestState.PROCESSED); orderPaymentRequest.setPaymentRedirectUrl(UUID.randomUUID().toString()); // Order final OrderState orderState = OrderState.PAID; final Long orderId = 2L; final Order order = getFacadeImplTestHelper().createOrder(); order.setId(orderId); order.setLastState(orderState); orderPaymentRequest.setOrder(order); // Create order payment final Long orderPaymentId = 3L; final OrderPayment orderPayment = getFacadeImplTestHelper().createOrderPayment(); orderPayment.setId(orderPaymentId); orderPaymentRequest.setOrderPayment(orderPayment); // Reset resetAll(); // Expectations expect(orderPaymentRequestService.getOrderPaymentRequestByUuId(eq(request.getOrderPaymentRequestUuid()))).andReturn(orderPaymentRequest).once(); // Replay replayAll(); // Run test scenario final ResultResponseModel<GetOrderPaymentRequestStatusResponse> result = orderPaymentFacade.getOrderPaymentRequestStatus(request); assertNotNull(result); assertNotNull(result.getResponse()); assertEquals(0, result.getErrors().size()); // Grab response final GetOrderPaymentRequestStatusResponse response = result.getResponse(); assertEquals(orderPaymentRequest.getUuId(), response.getOrderPaymentRequestUuId()); assertEquals(order.getUuId(), response.getOrderUuId()); assertEquals(OrderStateClientType.valueOf(order.getLastState().name()), response.getOrderState()); assertEquals(OrderPaymentRequestStateClientType.valueOf(orderPaymentRequest.getState().name()), response.getRequestState()); assertEquals(orderPaymentRequest.getPaymentRedirectUrl(), response.getPaymentRedirectUrl()); assertEquals(orderPayment.getUuId(), response.getPaymentUuId()); // Verify verifyAll(); } @Test public void testCreateOrderWithInvalidArguments() { // Reset resetAll(); // Replay replayAll(); // Run test scenario try { orderPaymentFacade.createOrder(null); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { // Expected } // Verify verifyAll(); } @Test public void testCreateOrderWithValidationErrorsForEmptyRequest() { // Request final CreateOrderRequest request = new CreateOrderRequest(); // Reset resetAll(); // Replay replayAll(); // Run test scenario final ResultResponseModel<CreateOrderPaymentResponse> result = orderPaymentFacade.createOrder(request); assertNotNull(result); assertNull(result.getResponse()); assertEquals(4, result.getErrors().size()); assertValidationErrors(result.getErrors(), new HashSet<>(Arrays.asList( ErrorType.ORDER_PAYMENT_MISSING_CUSTOMER, ErrorType.ORDER_PAYMENT_MISSING_ORDER, ErrorType.ORDER_PAYMENT_MISSING_METHOD, ErrorType.ORDER_PAYMENT_MISSING_STORE_METHOD) )); // Verify verifyAll(); } @Test public void testCreateOrderWithValidationErrorsForEmptyCustomer() { // Request final CreateOrderRequest request = getFacadeImplTestHelper().createCreateOrderPaymentRequest(); request.setCustomer(new CustomerModel()); request.setPaymentMethod(getFacadeImplTestHelper().createRequestRedirectPaymentMethodModel()); // Reset resetAll(); // Replay replayAll(); // Run test scenario final ResultResponseModel<CreateOrderPaymentResponse> result = orderPaymentFacade.createOrder(request); assertNotNull(result); assertNull(result.getResponse()); assertEquals(2, result.getErrors().size()); assertValidationErrors(result.getErrors(), new HashSet<>(Arrays.asList( ErrorType.CUSTOMER_MISSING_UUID, ErrorType.CUSTOMER_MISSING_EMAIL ))); // Verify verifyAll(); } @Test public void testCreateOrderWithValidationErrorsForEmptyOrder() { // Request final CreateOrderRequest request = getFacadeImplTestHelper().createCreateOrderPaymentRequest(); request.setOrder(new OrderModel()); request.setPaymentMethod(getFacadeImplTestHelper().createRequestRedirectPaymentMethodModel()); // Reset resetAll(); // Replay replayAll(); // Run test scenario final ResultResponseModel<CreateOrderPaymentResponse> result = orderPaymentFacade.createOrder(request); assertNotNull(result); assertNull(result.getResponse()); assertEquals(3, result.getErrors().size()); assertValidationErrors(result.getErrors(), new HashSet<>(Arrays.asList( ErrorType.ORDER_MISSING_UUID, ErrorType.ORDER_MISSING_PAYMENT_TOTAL_WITH_VAT, ErrorType.ORDER_MISSING_CURRENCY ))); // Verify verifyAll(); } @Test public void testCreateOrderWithValidationErrorsForEmptyRedirectPaymentMethod() { // Request final CreateOrderRequest request = getFacadeImplTestHelper().createCreateOrderPaymentRequest(); request.setPaymentMethod(new OrderRequestRedirectPaymentMethodModel()); // Reset resetAll(); // Replay replayAll(); // Run test scenario final ResultResponseModel<CreateOrderPaymentResponse> result = orderPaymentFacade.createOrder(request); assertNotNull(result); assertNull(result.getResponse()); assertEquals(1, result.getErrors().size()); assertValidationErrors(result.getErrors(), Collections.singleton(ErrorType.ORDER_PAYMENT_METHOD_MISSING_PROVIDER_TYPE)); // Verify verifyAll(); } @Test public void testCreateOrderWithRedirectPaymentMethod() { // Test data final CreateOrderRequest request = getFacadeImplTestHelper().createCreateOrderPaymentRequest(); // Order request payment method final OrderRequestRedirectPaymentMethodModel requestPaymentMethodModel = getFacadeImplTestHelper().createRequestRedirectPaymentMethodModel(); request.setPaymentMethod(requestPaymentMethodModel); final OrderRequestRedirectPaymentMethodDto orderRequestRedirectPaymentMethodDto = new OrderRequestRedirectPaymentMethodDto(PaymentMethodType.valueOf(requestPaymentMethodModel.getPaymentMethodType().name()), PaymentProviderType.valueOf(requestPaymentMethodModel.getPaymentProviderType().name())); // Create customer final CustomerDto customerDto = new CustomerDto(request.getCustomer().getUuId(), request.getCustomer().getEmail()); final Long customerId = 1L; final Customer customer = getFacadeImplTestHelper().createCustomer(customerDto); customer.setId(customerId); // Order final OrderDto orderDto = new OrderDto(request.getOrder().getUuId(), request.getOrder().getPaymentTotalWithVat(), Currency.valueOf(request.getOrder().getCurrency().name())); final Long orderId = 2L; final Order order = getFacadeImplTestHelper().createOrder(orderDto); order.setId(orderId); // Order payment request final OrderPaymentRequestDto orderPaymentRequestDto = new OrderPaymentRequestDto(request.getClientIpAddress(), request.getStorePaymentMethod()); final Long orderPaymentRequestId = 3L; final OrderPaymentRequest orderPaymentRequest = getFacadeImplTestHelper().createOrderPaymentRequest(orderPaymentRequestDto); orderPaymentRequest.setId(orderPaymentRequestId); // Reset resetAll(); // Expectations expect(customerService.getOrCreateCustomerForUuId(eq(customerDto))).andReturn(customer).once(); expect(orderService.createOrder(eq(customerId), eq(orderDto))).andReturn(order).once(); expect(orderPaymentRequestService.createOrderPaymentRequest(eq(orderId), eq(orderPaymentRequestDto), eq(orderRequestRedirectPaymentMethodDto))).andReturn(orderPaymentRequest).once(); applicationEventDistributionService.publishAsynchronousEvent(new StartOrderPaymentRequestProcessingCommandEvent(orderPaymentRequestId)); expectLastCall().once(); // Replay replayAll(); // Run test scenario final ResultResponseModel<CreateOrderPaymentResponse> result = orderPaymentFacade.createOrder(request); assertNotNull(result); assertNotNull(result.getResponse()); assertEquals(0, result.getErrors().size()); final CreateOrderPaymentResponse response = result.getResponse(); assertEquals(orderPaymentRequest.getUuId(), response.getOrderPaymentRequestUuId()); // Verify verifyAll(); } }
sflpro/ms_payment
api/api_internal/api_internal_facade/src/test/java/com/sfl/pms/api/internal/facade/order/impl/OrderPaymentFacadeImplTest.java
Java
apache-2.0
19,460
var express = require('express'); var path = require('path'); var favicon = require('static-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var routes = require('./routes/index'); var users = require('./routes/users'); var app = express(); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'jade'); app.use(favicon()); app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded()); app.use(cookieParser()); app.use(require('less-middleware')({ src: path.join(__dirname, 'public') })); app.use(express.static(path.join(__dirname, 'public'))); app.use('/', routes); app.use('/users', users); /// catch 404 and forward to error handler app.use(function(req, res, next) { var err = new Error('Not Found'); err.status = 404; next(err); }); /// error handlers // development error handler // will print stacktrace if (app.get('env') === 'development') { app.use(function(err, req, res, next) { res.status(err.status || 500); res.render('error', { message: err.message, error: err }); }); } // production error handler // no stacktraces leaked to user app.use(function(err, req, res, next) { res.status(err.status || 500); res.render('error', { message: err.message, error: {} }); }); module.exports = app;
rgbkrk/bot-in-a-bottle
app.js
JavaScript
apache-2.0
1,454
/* * Copyright 2014 - 2017 Cognizant Technology Solutions * * 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.cognizant.cognizantits.extension.logger; import java.io.File; import java.io.IOException; import java.util.logging.FileHandler; import java.util.logging.Level; import java.util.logging.Logger; import java.util.logging.SimpleFormatter; /** * * @author 394173 */ public class LogUtil { public static Logger getLogger(String className) { init(); Logger log = Logger.getLogger(className); log.addHandler(handler); return log; } private final static Logger LOG = Logger.getLogger(LogUtil.class.getName()); private static FileHandler handler; static void init() { try { if (handler == null) { new File("logs" + File.separator + "extension").mkdirs(); handler = new FileHandler("logs" + File.separator + "extension" + File.separator + "log-%g.txt", 4096 * 1024, 100, true); handler.setFormatter(new SimpleFormatter()); LOG.addHandler(handler); } } catch (IOException | SecurityException ex) { LOG.log(Level.SEVERE, "Error creating log", ex); } } }
CognizantQAHub/Cognizant-Intelligent-Test-Scripter
ExtensionConnect/src/main/java/com/cognizant/cognizantits/extension/logger/LogUtil.java
Java
apache-2.0
1,762
/******************************************************************************* * (c) Copyright 2017 Hewlett-Packard Development Company, L.P. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Apache License v2.0 which accompany this distribution. * * The Apache License is available at * http://www.apache.org/licenses/LICENSE-2.0 * *******************************************************************************/ package io.cloudslang.content.vmware.entities.http; import io.cloudslang.content.vmware.utils.InputUtils; /** * Created by Mihai Tusa. * 1/6/2016. */ public class HttpInputs { private static final int DEFAULT_HTTPS_PORT = 443; private String host; private int port; private String protocol; private String username; private String password; private boolean trustEveryone; public HttpInputs(HttpInputsBuilder builder) { this.host = builder.host; this.port = builder.port; this.protocol = builder.protocol; this.username = builder.username; this.password = builder.password; this.trustEveryone = builder.trustEveryone; } public String getHost() { return host; } public Integer getPort() { return port; } public String getProtocol() { return protocol; } public String getUsername() { return username; } public String getPassword() { return password; } public Boolean isTrustEveryone() { return trustEveryone; } public static class HttpInputsBuilder { private String host; private int port; private String protocol; private String username; private String password; private boolean trustEveryone; public HttpInputs build() { return new HttpInputs(this); } public HttpInputsBuilder withHost(String inputValue) { host = inputValue; return this; } public HttpInputsBuilder withPort(String inputValue) { port = InputUtils.getIntInput(inputValue, DEFAULT_HTTPS_PORT); return this; } public HttpInputsBuilder withProtocol(String inputValue) throws Exception { protocol = Protocol.getValue(inputValue); return this; } public HttpInputsBuilder withUsername(String inputValue) throws Exception { username = inputValue; return this; } public HttpInputsBuilder withPassword(String inputValue) throws Exception { password = inputValue; return this; } public HttpInputsBuilder withTrustEveryone(String inputValue) throws Exception { trustEveryone = Boolean.parseBoolean(inputValue); return this; } } }
robert-sandor/cs-actions
cs-vmware/src/main/java/io/cloudslang/content/vmware/entities/http/HttpInputs.java
Java
apache-2.0
2,895
/* * Autopsy Forensic Browser * * Copyright 2011-2017 Basis Technology Corp. * Contact: carrier <at> sleuthkit <dot> org * * 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.sleuthkit.autopsy.directorytree; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.logging.Level; import javax.swing.Action; import org.openide.nodes.FilterNode; import org.openide.nodes.Node; import org.openide.util.NbBundle; import org.openide.util.lookup.Lookups; import org.openide.util.lookup.ProxyLookup; import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.datamodel.AbstractContentNode; import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.RunIngestModulesAction; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Directory; import org.sleuthkit.datamodel.Image; import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskData; import org.sleuthkit.datamodel.VirtualDirectory; /** * A node filter (decorator) that sets the actions for a node in the tree view * and wraps the Children object of the wrapped node with a * DirectoryTreeFilterChildren. */ class DirectoryTreeFilterNode extends FilterNode { private static final Logger logger = Logger.getLogger(DirectoryTreeFilterNode.class.getName()); private static final Action collapseAllAction = new CollapseAction(NbBundle.getMessage(DirectoryTreeFilterNode.class, "DirectoryTreeFilterNode.action.collapseAll.text")); /** * Constructs node filter (decorator) that sets the actions for a node in * the tree view and wraps the Children object of the wrapped node with a * DirectoryTreeFilterChildren. * * @param nodeToWrap The node to wrap. * @param createChildren Whether to create the children of the wrapped node * or treat it a a leaf node. */ DirectoryTreeFilterNode(Node nodeToWrap, boolean createChildren) { super(nodeToWrap, DirectoryTreeFilterChildren.createInstance(nodeToWrap, createChildren), new ProxyLookup(Lookups.singleton(nodeToWrap), nodeToWrap.getLookup())); } /** * Gets the display name for the wrapped node, possibly including a child * count in parentheses. * * @return The display name for the node. */ @Override public String getDisplayName() { final Node orig = getOriginal(); String name = orig.getDisplayName(); if (orig instanceof AbstractContentNode) { AbstractFile file = getLookup().lookup(AbstractFile.class); if (file != null) { try { int numVisibleChildren = getVisibleChildCount(file); /* * Left-to-right marks here are necessary to keep the count * and parens together for mixed right-to-left and * left-to-right names. */ name = name + " \u200E(\u200E" + numVisibleChildren + ")\u200E"; //NON-NLS } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Error getting children count to display for file: " + file, ex); //NON-NLS } } } return name; } /** * Gets the number of visible children for a tree view node representing an * AbstractFile. Depending on the user preferences, known and/or slack files * will either be included or purged in the count. * * @param file The AbstractFile object whose children will be counted. * * @return The number of visible children. */ private int getVisibleChildCount(AbstractFile file) throws TskCoreException { List<Content> childList = file.getChildren(); int numVisibleChildren = file.getChildrenCount(); boolean purgeKnownFiles = UserPreferences.hideKnownFilesInDataSourcesTree(); boolean purgeSlackFiles = UserPreferences.hideSlackFilesInDataSourcesTree(); if (purgeKnownFiles || purgeSlackFiles) { // Purge known and/or slack files from the file count for (int i = 0; i < childList.size(); i++) { AbstractFile childFile = (AbstractFile) childList.get(i); if ((purgeKnownFiles && childFile.getKnown() == TskData.FileKnown.KNOWN) || (purgeSlackFiles && childFile.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.SLACK)) { numVisibleChildren--; } } } return numVisibleChildren; } /** * Gets the context mneu (right click menu) actions for the wrapped node. * * @param context Whether to find actions for context meaning or for the * node itself. * * @return */ @Override public Action[] getActions(boolean context) { List<Action> actions = new ArrayList<>(); final Content content = this.getLookup().lookup(Content.class); if (content != null) { actions.addAll(ExplorerNodeActionVisitor.getActions(content)); Directory dir = this.getLookup().lookup(Directory.class); if (dir != null) { actions.add(ExtractAction.getInstance()); actions.add(new RunIngestModulesAction(dir)); } final Image img = this.getLookup().lookup(Image.class); final VirtualDirectory virtualDirectory = this.getLookup().lookup(VirtualDirectory.class); boolean isRootVD = false; if (virtualDirectory != null) { try { if (virtualDirectory.getParent() == null) { isRootVD = true; } } catch (TskCoreException ex) { logger.log(Level.WARNING, "Error determining the parent of the virtual directory", ex); // NON-NLS } } if (img != null || isRootVD) { actions.add(new FileSearchAction(NbBundle.getMessage(this.getClass(), "DirectoryTreeFilterNode.action.openFileSrcByAttr.text"))); actions.add(new RunIngestModulesAction(Collections.<Content>singletonList(content))); } } actions.add(collapseAllAction); return actions.toArray(new Action[actions.size()]); } /** * Get the wrapped node. * * @return */ @Override public Node getOriginal() { return super.getOriginal(); } }
narfindustries/autopsy
Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeFilterNode.java
Java
apache-2.0
7,184
const path = require('path'); const fs = require('fs'); const morgan = require('morgan'); const morganDebug = require('morgan-debug'); const rfs = require('rotating-file-stream'); const config = require(path.join(__dirname, '..', 'logging')); module.exports = function () { if (!config.enabled) { return; } const directory = path.join('../..', 'logs'); if (!fs.existsSync(directory)) { fs.mkdirSync(directory); } const accessStream = rfs('access.log', { interval: '1d', path: directory }); this.use(morgan('combined', { stream: accessStream })); this.use(morganDebug('morten.js:access', 'common')); };
Mrtenz/morten.js
config/initializers/01-logging.js
JavaScript
apache-2.0
686
<!-- THIS IS AUTO-GENERATED CONTENT. DO NOT MANUALLY EDIT. --> This image is part of the [balena.io][balena] base image series for IoT devices. The image is optimized for use with [balena.io][balena] and [balenaOS][balena-os], but can be used in any Docker environment running on the appropriate architecture. ![balenalogo](https://avatars2.githubusercontent.com/u/6157842?s=200&v=4). Some notable features in `balenalib` base images: - Helpful package installer script called `install_packages` that abstracts away the specifics of the underlying package managers. It will install the named packages with smallest number of dependencies (ignore optional dependencies), clean up the package manager medata and retry if package install fails. - Working with dynamically plugged devices: each `balenalib` base image has a default `ENTRYPOINT` which is defined as `ENTRYPOINT ["/usr/bin/entry.sh"]`, it checks if the `UDEV` flag is set to true or not (by adding `ENV UDEV=1`) and if true, it will start `udevd` daemon and the relevant device nodes in the container /dev will appear. For more details, please check the [features overview](https://www.balena.io/docs/reference/base-images/base-images/#features-overview) in our documentation. # [Image Variants][variants] The `balenalib` images come in many flavors, each designed for a specific use case. ## `:<version>` or `:<version>-run` This is the defacto image. The `run` variant is designed to be a slim and minimal variant with only runtime essentials packaged into it. ## `:<version>-build` The build variant is a heavier image that includes many of the tools required for building from source. This reduces the number of packages that you will need to manually install in your Dockerfile, thus reducing the overall size of all images on your system. [variants]: https://www.balena.io/docs/reference/base-images/base-images/#run-vs-build?ref=dockerhub # How to use this image with Balena This [guide][getting-started] can help you get started with using this base image with balena, there are also some cool [example projects][example-projects] that will give you an idea what can be done with balena. # What is Python? Python is an interpreted, interactive, object-oriented, open-source programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. Python combines remarkable power with very clear syntax. It has interfaces to many system calls and libraries, as well as to various window systems, and is extensible in C or C++. It is also usable as an extension language for applications that need a programmable interface. Finally, Python is portable: it runs on many Unix variants, on the Mac, and on Windows 2000 and later. > [wikipedia.org/wiki/Python_(programming_language)](https://en.wikipedia.org/wiki/Python_%28programming_language%29) ![logo](https://raw.githubusercontent.com/docker-library/docs/01c12653951b2fe592c1f93a13b4e289ada0e3a1/python/logo.png). # Supported versions and respective `Dockerfile` links : [&#x60;3.10.2 (latest)&#x60;,&#x60;3.9.10&#x60;, &#x60;3.8.12&#x60;, &#x60;3.7.12&#x60;, &#x60;3.6.15&#x60;](https://github.com/balena-io-library/base-images/tree/master/balena-base-images/python/up-core/ubuntu/) For more information about this image and its history, please see the [relevant manifest file (`up-core-ubuntu-python`)](https://github.com/balena-io-library/official-images/blob/master/library/up-core-ubuntu-python) in the [`balena-io-library/official-images` GitHub repo](https://github.com/balena-io-library/official-images). # How to use this image ## Create a `Dockerfile` in your Python app project ```dockerfile FROM balenalib/up-core-ubuntu-python:latest WORKDIR /usr/src/app COPY requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt COPY . . CMD [ "python", "./your-daemon-or-script.py" ] ``` You can then build and run the Docker image: ```console $ docker build -t my-python-app . $ docker run -it --rm --name my-running-app my-python-app ``` ## Run a single Python script For many simple, single file projects, you may find it inconvenient to write a complete `Dockerfile`. In such cases, you can run a Python script by using the Python Docker image directly: ```console $ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp balenalib/up-core-ubuntu-python:latest python your-daemon-or-script.py ``` [example-projects]: https://www.balena.io/docs/learn/getting-started/up-core/python/#example-projects?ref=dockerhub [getting-started]: https://www.balena.io/docs/learn/getting-started/up-core/python/?ref=dockerhub # User Feedback ## Issues If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/balena-io-library/base-images/issues). ## Contributing You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can. Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/balena-io-library/base-images/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing. ## Documentation Documentation for this image is stored in the [base images documentation][docs]. Check it out for list of all of our base images including many specialised ones for e.g. node, python, go, smaller images, etc. You can also find more details about new features in `balenalib` base images in this [blog post][migration-docs] [docs]: https://www.balena.io/docs/reference/base-images/base-images/#balena-base-images?ref=dockerhub [variants]: https://www.balena.io/docs/reference/base-images/base-images/#run-vs-build?ref=dockerhub [migration-docs]: https://www.balena.io/blog/new-year-new-balena-base-images/?ref=dockerhub [balena]: https://balena.io/?ref=dockerhub [balena-os]: https://www.balena.io/os/?ref=dockerhub
resin-io-library/base-images
balena-base-images/docs/dockerhub/up-core-ubuntu-python-full-description.md
Markdown
apache-2.0
6,160
/* * Copyright 2000-2014 JetBrains s.r.o. * * 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.intellij.openapi.vcs.changes.committed; import com.intellij.concurrency.JobScheduler; import com.intellij.lifecycle.PeriodicalTasksCloser; import com.intellij.openapi.Disposable; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.components.StoragePathMacros; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.ProgressManagerQueue; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MessageType; import com.intellij.openapi.util.Computable; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.Ref; import com.intellij.openapi.vcs.*; import com.intellij.openapi.vcs.changes.Change; import com.intellij.openapi.vcs.impl.ProjectLevelVcsManagerImpl; import com.intellij.openapi.vcs.impl.VcsInitObject; import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier; import com.intellij.openapi.vcs.update.UpdatedFiles; import com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings; import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.Consumer; import com.intellij.util.MessageBusUtil; import com.intellij.util.NotNullFunction; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.MultiMap; import com.intellij.util.messages.MessageBus; import com.intellij.util.messages.MessageBusConnection; import com.intellij.util.messages.Topic; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.TestOnly; import java.io.File; import java.io.IOException; import java.util.*; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; /** * @author yole */ @State( name = "CommittedChangesCache", storages = {@Storage(file = StoragePathMacros.WORKSPACE_FILE)} ) public class CommittedChangesCache implements PersistentStateComponent<CommittedChangesCache.State> { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.changes.committed.CommittedChangesCache"); private final Project myProject; private final MessageBus myBus; private final ProgressManagerQueue myTaskQueue; private final MessageBusConnection myConnection; private boolean myRefreshingIncomingChanges = false; private int myPendingUpdateCount = 0; private State myState = new State(); private ScheduledFuture myFuture; private List<CommittedChangeList> myCachedIncomingChangeLists; private final Set<CommittedChangeList> myNewIncomingChanges = new LinkedHashSet<CommittedChangeList>(); private final ProjectLevelVcsManager myVcsManager; public static final Change[] ALL_CHANGES = new Change[0]; private MyRefreshRunnable myRefresnRunnable; private final Map<String, Pair<Long, List<CommittedChangeList>>> myExternallyLoadedChangeLists; private final CachesHolder myCachesHolder; private final RepositoryLocationCache myLocationCache; public static class State { private int myInitialCount = 500; private int myInitialDays = 90; private int myRefreshInterval = 30; private boolean myRefreshEnabled = false; public int getInitialCount() { return myInitialCount; } public void setInitialCount(final int initialCount) { myInitialCount = initialCount; } public int getInitialDays() { return myInitialDays; } public void setInitialDays(final int initialDays) { myInitialDays = initialDays; } public int getRefreshInterval() { return myRefreshInterval; } public void setRefreshInterval(final int refreshInterval) { myRefreshInterval = refreshInterval; } public boolean isRefreshEnabled() { return myRefreshEnabled; } public void setRefreshEnabled(final boolean refreshEnabled) { myRefreshEnabled = refreshEnabled; } } public static final Topic<CommittedChangesListener> COMMITTED_TOPIC = new Topic<CommittedChangesListener>("committed changes updates", CommittedChangesListener.class); public static CommittedChangesCache getInstance(Project project) { return PeriodicalTasksCloser.getInstance().safeGetComponent(project, CommittedChangesCache.class); } public CommittedChangesCache(final Project project, final MessageBus bus, final ProjectLevelVcsManager vcsManager) { myProject = project; myBus = bus; myConnection = myBus.connect(); final VcsListener vcsListener = new VcsListener() { @Override public void directoryMappingChanged() { myLocationCache.reset(); refreshAllCachesAsync(false, true); refreshIncomingChangesAsync(); myTaskQueue.run(new Runnable() { @Override public void run() { final List<ChangesCacheFile> files = myCachesHolder.getAllCaches(); for (ChangesCacheFile file : files) { final RepositoryLocation location = file.getLocation(); fireChangesLoaded(location, Collections.<CommittedChangeList>emptyList()); } fireIncomingReloaded(); } }); } }; myLocationCache = new RepositoryLocationCache(project); myCachesHolder = new CachesHolder(project, myLocationCache); myTaskQueue = new ProgressManagerQueue(project, VcsBundle.message("committed.changes.refresh.progress")); ((ProjectLevelVcsManagerImpl) vcsManager).addInitializationRequest(VcsInitObject.COMMITTED_CHANGES_CACHE, new Runnable() { @Override public void run() { ApplicationManager.getApplication().runReadAction(new Runnable() { @Override public void run() { if (myProject.isDisposed()) return; myTaskQueue.start(); myConnection.subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED, vcsListener); myConnection.subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED_IN_PLUGIN, vcsListener); } }); } }); myVcsManager = vcsManager; Disposer.register(project, new Disposable() { @Override public void dispose() { cancelRefreshTimer(); myConnection.disconnect(); } }); myExternallyLoadedChangeLists = ContainerUtil.newConcurrentMap(); } public MessageBus getMessageBus() { return myBus; } @Override public State getState() { return myState; } @Override public void loadState(State state) { myState = state; updateRefreshTimer(); } @Nullable public CommittedChangesProvider getProviderForProject() { final AbstractVcs[] vcss = myVcsManager.getAllActiveVcss(); List<AbstractVcs> vcsWithProviders = new ArrayList<AbstractVcs>(); for(AbstractVcs vcs: vcss) { if (vcs.getCommittedChangesProvider() != null) { vcsWithProviders.add(vcs); } } if (vcsWithProviders.isEmpty()) { return null; } if (vcsWithProviders.size() == 1) { return vcsWithProviders.get(0).getCommittedChangesProvider(); } return new CompositeCommittedChangesProvider(myProject, vcsWithProviders.toArray(new AbstractVcs[vcsWithProviders.size()])); } public boolean isMaxCountSupportedForProject() { for(AbstractVcs vcs: myVcsManager.getAllActiveVcss()) { final CommittedChangesProvider provider = vcs.getCommittedChangesProvider(); if (provider instanceof CachingCommittedChangesProvider) { final CachingCommittedChangesProvider cachingProvider = (CachingCommittedChangesProvider)provider; if (!cachingProvider.isMaxCountSupported()) { return false; } } } return true; } private class MyProjectChangesLoader implements Runnable { private final ChangeBrowserSettings mySettings; private final int myMaxCount; private final boolean myCacheOnly; private final Consumer<List<CommittedChangeList>> myConsumer; private final Consumer<List<VcsException>> myErrorConsumer; private final LinkedHashSet<CommittedChangeList> myResult = new LinkedHashSet<CommittedChangeList>(); private final List<VcsException> myExceptions = new ArrayList<VcsException>(); private boolean myDisposed = false; private MyProjectChangesLoader(ChangeBrowserSettings settings, int maxCount, boolean cacheOnly, Consumer<List<CommittedChangeList>> consumer, Consumer<List<VcsException>> errorConsumer) { mySettings = settings; myMaxCount = maxCount; myCacheOnly = cacheOnly; myConsumer = consumer; myErrorConsumer = errorConsumer; } @Override public void run() { for(AbstractVcs vcs: myVcsManager.getAllActiveVcss()) { final CommittedChangesProvider provider = vcs.getCommittedChangesProvider(); if (provider == null) continue; final VcsCommittedListsZipper vcsZipper = provider.getZipper(); CommittedListsSequencesZipper zipper = null; if (vcsZipper != null) { zipper = new CommittedListsSequencesZipper(vcsZipper); } boolean zipSupported = zipper != null; final Map<VirtualFile, RepositoryLocation> map = myCachesHolder.getAllRootsUnderVcs(vcs); for (VirtualFile root : map.keySet()) { if (myProject.isDisposed()) return; final RepositoryLocation location = map.get(root); try { final List<CommittedChangeList> lists = getChanges(mySettings, root, vcs, myMaxCount, myCacheOnly, provider, location); if (lists != null) { if (zipSupported) { zipper.add(location, lists); } else { myResult.addAll(lists); } } } catch (VcsException e) { myExceptions.add(e); } catch(ProcessCanceledException e) { myDisposed = true; } } if (zipSupported) { myResult.addAll(zipper.execute()); } } ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { LOG.info("FINISHED CommittedChangesCache.getProjectChangesAsync - execution in queue"); if (myProject.isDisposed()) { return; } if (myExceptions.size() > 0) { myErrorConsumer.consume(myExceptions); } else if (!myDisposed) { myConsumer.consume(new ArrayList<CommittedChangeList>(myResult)); } } }, ModalityState.NON_MODAL); } } public void getProjectChangesAsync(final ChangeBrowserSettings settings, final int maxCount, final boolean cacheOnly, final Consumer<List<CommittedChangeList>> consumer, final Consumer<List<VcsException>> errorConsumer) { final MyProjectChangesLoader loader = new MyProjectChangesLoader(settings, maxCount, cacheOnly, consumer, errorConsumer); myTaskQueue.run(loader); } @Nullable public List<CommittedChangeList> getChanges(ChangeBrowserSettings settings, final VirtualFile file, @NotNull final AbstractVcs vcs, final int maxCount, final boolean cacheOnly, final CommittedChangesProvider provider, final RepositoryLocation location) throws VcsException { if (settings instanceof CompositeCommittedChangesProvider.CompositeChangeBrowserSettings) { settings = ((CompositeCommittedChangesProvider.CompositeChangeBrowserSettings) settings).get(vcs); } if (provider instanceof CachingCommittedChangesProvider) { try { if (cacheOnly) { ChangesCacheFile cacheFile = myCachesHolder.getCacheFile(vcs, file, location); if (!cacheFile.isEmpty()) { final RepositoryLocation fileLocation = cacheFile.getLocation(); fileLocation.onBeforeBatch(); final List<CommittedChangeList> committedChangeLists = cacheFile.readChanges(settings, maxCount); fileLocation.onAfterBatch(); return committedChangeLists; } return null; } else { if (canGetFromCache(vcs, settings, file, location, maxCount)) { return getChangesWithCaching(vcs, settings, file, location, maxCount); } } } catch (IOException e) { LOG.info(e); } } //noinspection unchecked return provider.getCommittedChanges(settings, location, maxCount); } private boolean canGetFromCache(final AbstractVcs vcs, final ChangeBrowserSettings settings, final VirtualFile root, final RepositoryLocation location, final int maxCount) throws IOException { ChangesCacheFile cacheFile = myCachesHolder.getCacheFile(vcs, root, location); if (cacheFile.isEmpty()) { return true; // we'll initialize the cache and check again after that } if (settings.USE_DATE_BEFORE_FILTER && !settings.USE_DATE_AFTER_FILTER) { return cacheFile.hasCompleteHistory(); } if (settings.USE_CHANGE_BEFORE_FILTER && !settings.USE_CHANGE_AFTER_FILTER) { return cacheFile.hasCompleteHistory(); } boolean hasDateFilter = settings.USE_DATE_AFTER_FILTER || settings.USE_DATE_BEFORE_FILTER || settings.USE_CHANGE_AFTER_FILTER || settings.USE_CHANGE_BEFORE_FILTER; boolean hasNonDateFilter = settings.isNonDateFilterSpecified(); if (!hasDateFilter && hasNonDateFilter) { return cacheFile.hasCompleteHistory(); } if (settings.USE_DATE_AFTER_FILTER && settings.getDateAfter().getTime() < cacheFile.getFirstCachedDate().getTime()) { return cacheFile.hasCompleteHistory(); } if (settings.USE_CHANGE_AFTER_FILTER && settings.getChangeAfterFilter().longValue() < cacheFile.getFirstCachedChangelist()) { return cacheFile.hasCompleteHistory(); } return true; } public void hasCachesForAnyRoot(@Nullable final Consumer<Boolean> continuation) { myTaskQueue.run(new Runnable() { @Override public void run() { final Ref<Boolean> success = new Ref<Boolean>(); try { success.set(hasCachesWithEmptiness(false)); } catch (ProcessCanceledException e) { success.set(true); } ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { continuation.consume(success.get()); } }, myProject.getDisposed()); } }); } public boolean hasEmptyCaches() { try { return hasCachesWithEmptiness(true); } catch (ProcessCanceledException e) { return false; } } private boolean hasCachesWithEmptiness(final boolean emptiness) { final Ref<Boolean> resultRef = new Ref<Boolean>(Boolean.FALSE); myCachesHolder.iterateAllCaches(new NotNullFunction<ChangesCacheFile, Boolean>() { @Override @NotNull public Boolean fun(final ChangesCacheFile changesCacheFile) { try { if (changesCacheFile.isEmpty() == emptiness) { resultRef.set(true); return true; } } catch (IOException e) { LOG.info(e); } return false; } }); return resultRef.get(); } @Nullable public Iterator<ChangesBunch> getBackBunchedIterator(final AbstractVcs vcs, final VirtualFile root, final RepositoryLocation location, final int bunchSize) { final ChangesCacheFile cacheFile = myCachesHolder.getCacheFile(vcs, root, location); try { if (! cacheFile.isEmpty()) { return cacheFile.getBackBunchedIterator(bunchSize); } } catch (IOException e) { LOG.error(e); } return null; } private List<CommittedChangeList> getChangesWithCaching(final AbstractVcs vcs, final ChangeBrowserSettings settings, final VirtualFile root, final RepositoryLocation location, final int maxCount) throws VcsException, IOException { ChangesCacheFile cacheFile = myCachesHolder.getCacheFile(vcs, root, location); if (cacheFile.isEmpty()) { List<CommittedChangeList> changes = initCache(cacheFile); if (canGetFromCache(vcs, settings, root, location, maxCount)) { settings.filterChanges(changes); return trimToSize(changes, maxCount); } //noinspection unchecked return cacheFile.getProvider().getCommittedChanges(settings, location, maxCount); } else { // we take location instance that would be used for deserialization final RepositoryLocation fileLocation = cacheFile.getLocation(); fileLocation.onBeforeBatch(); final List<CommittedChangeList> changes = cacheFile.readChanges(settings, maxCount); fileLocation.onAfterBatch(); List<CommittedChangeList> newChanges = refreshCache(cacheFile); settings.filterChanges(newChanges); changes.addAll(newChanges); return trimToSize(changes, maxCount); } } @TestOnly public void refreshAllCaches() throws IOException, VcsException { final Collection<ChangesCacheFile> files = myCachesHolder.getAllCaches(); for(ChangesCacheFile file: files) { if (file.isEmpty()) { initCache(file); } else { refreshCache(file); } } } private List<CommittedChangeList> initCache(final ChangesCacheFile cacheFile) throws VcsException, IOException { debug("Initializing cache for " + cacheFile.getLocation()); final CachingCommittedChangesProvider provider = cacheFile.getProvider(); final RepositoryLocation location = cacheFile.getLocation(); final ChangeBrowserSettings settings = provider.createDefaultSettings(); int maxCount = 0; if (isMaxCountSupportedForProject()) { maxCount = myState.getInitialCount(); } else { settings.USE_DATE_AFTER_FILTER = true; Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DAY_OF_YEAR, -myState.getInitialDays()); settings.setDateAfter(calendar.getTime()); } //noinspection unchecked final List<CommittedChangeList> changes = provider.getCommittedChanges(settings, location, maxCount); // when initially initializing cache, assume all changelists are locally available writeChangesInReadAction(cacheFile, changes); // this sorts changes in chronological order if (maxCount > 0 && changes.size() < myState.getInitialCount()) { cacheFile.setHaveCompleteHistory(true); } if (changes.size() > 0) { fireChangesLoaded(location, changes); } return changes; } private void fireChangesLoaded(final RepositoryLocation location, final List<CommittedChangeList> changes) { MessageBusUtil.invokeLaterIfNeededOnSyncPublisher(myProject, COMMITTED_TOPIC, new Consumer<CommittedChangesListener>() { @Override public void consume(CommittedChangesListener listener) { listener.changesLoaded(location, changes); } }); } private void fireIncomingReloaded() { MessageBusUtil.invokeLaterIfNeededOnSyncPublisher(myProject, COMMITTED_TOPIC, new Consumer<CommittedChangesListener>() { @Override public void consume(CommittedChangesListener listener) { listener.incomingChangesUpdated(Collections.<CommittedChangeList>emptyList()); } }); } // todo: fix - would externally loaded nesseccerily for file? i.e. just not efficient now private List<CommittedChangeList> refreshCache(final ChangesCacheFile cacheFile) throws VcsException, IOException { final List<CommittedChangeList> newLists = new ArrayList<CommittedChangeList>(); final CachingCommittedChangesProvider provider = cacheFile.getProvider(); final RepositoryLocation location = cacheFile.getLocation(); final Pair<Long, List<CommittedChangeList>> externalLists = myExternallyLoadedChangeLists.get(location.getKey()); final long latestChangeList = getLatestListForFile(cacheFile); if ((externalLists != null) && (latestChangeList == externalLists.first.longValue())) { newLists.addAll(appendLoadedChanges(cacheFile, location, externalLists.second)); myExternallyLoadedChangeLists.clear(); } final ChangeBrowserSettings defaultSettings = provider.createDefaultSettings(); int maxCount = 0; if (provider.refreshCacheByNumber()) { final long number = cacheFile.getLastCachedChangelist(); debug("Refreshing cache for " + location + " since #" + number); if (number >= 0) { defaultSettings.CHANGE_AFTER = Long.toString(number); defaultSettings.USE_CHANGE_AFTER_FILTER = true; } else { maxCount = myState.getInitialCount(); } } else { final Date date = cacheFile.getLastCachedDate(); debug("Refreshing cache for " + location + " since " + date); defaultSettings.setDateAfter(date); defaultSettings.USE_DATE_AFTER_FILTER = true; } final List<CommittedChangeList> newChanges = provider.getCommittedChanges(defaultSettings, location, maxCount); debug("Loaded " + newChanges.size() + " new changelists"); newLists.addAll(appendLoadedChanges(cacheFile, location, newChanges)); return newLists; } private static void debug(@NonNls String message) { LOG.debug(message); } private List<CommittedChangeList> appendLoadedChanges(final ChangesCacheFile cacheFile, final RepositoryLocation location, final List<CommittedChangeList> newChanges) throws IOException { final List<CommittedChangeList> savedChanges = writeChangesInReadAction(cacheFile, newChanges); if (savedChanges.size() > 0) { fireChangesLoaded(location, savedChanges); } return savedChanges; } private static List<CommittedChangeList> writeChangesInReadAction(final ChangesCacheFile cacheFile, final List<CommittedChangeList> newChanges) throws IOException { // ensure that changes are loaded before taking read action, to avoid stalling UI for(CommittedChangeList changeList: newChanges) { changeList.getChanges(); } final Ref<IOException> ref = new Ref<IOException>(); final List<CommittedChangeList> savedChanges = ApplicationManager.getApplication().runReadAction(new Computable<List<CommittedChangeList>>() { @Override public List<CommittedChangeList> compute() { try { return cacheFile.writeChanges(newChanges); // skip duplicates; } catch (IOException e) { ref.set(e); return null; } } }); if (!ref.isNull()) { throw ref.get(); } return savedChanges; } private static List<CommittedChangeList> trimToSize(final List<CommittedChangeList> changes, final int maxCount) { if (maxCount > 0) { while(changes.size() > maxCount) { changes.remove(0); } } return changes; } public List<CommittedChangeList> loadIncomingChanges(boolean inBackground) { final List<CommittedChangeList> result = new ArrayList<CommittedChangeList>(); final Collection<ChangesCacheFile> caches = myCachesHolder.getAllCaches(); final MultiMap<AbstractVcs, Pair<RepositoryLocation, List<CommittedChangeList>>> byVcs = new MultiMap<AbstractVcs, Pair<RepositoryLocation, List<CommittedChangeList>>>(); for(ChangesCacheFile cache: caches) { try { if (inBackground && (! cache.getVcs().isVcsBackgroundOperationsAllowed(cache.getRootPath().getVirtualFile()))) continue; if (!cache.isEmpty()) { debug("Loading incoming changes for " + cache.getLocation()); final List<CommittedChangeList> incomingChanges = cache.loadIncomingChanges(); byVcs.putValue(cache.getVcs(), Pair.create(cache.getLocation(), incomingChanges)); } } catch (IOException e) { LOG.error(e); } } for (AbstractVcs vcs : byVcs.keySet()) { final CommittedChangesProvider committedChangesProvider = vcs.getCommittedChangesProvider(); VcsCommittedListsZipper vcsZipper = committedChangesProvider.getZipper(); if (vcsZipper != null) { final VcsCommittedListsZipper incomingZipper = new IncomingListsZipper(vcsZipper); final CommittedListsSequencesZipper zipper = new CommittedListsSequencesZipper(incomingZipper); for (Pair<RepositoryLocation, List<CommittedChangeList>> pair : byVcs.get(vcs)) { zipper.add(pair.getFirst(), pair.getSecond()); } result.addAll(zipper.execute()); } else { for (Pair<RepositoryLocation, List<CommittedChangeList>> pair : byVcs.get(vcs)) { result.addAll(pair.getSecond()); } } } myCachedIncomingChangeLists = result; debug("Incoming changes loaded"); notifyIncomingChangesUpdated(result); return result; } private static class IncomingListsZipper extends VcsCommittedListsZipperAdapter { private final VcsCommittedListsZipper myVcsZipper; private IncomingListsZipper(final VcsCommittedListsZipper vcsZipper) { super(null); myVcsZipper = vcsZipper; } @Override public Pair<List<RepositoryLocationGroup>, List<RepositoryLocation>> groupLocations(final List<RepositoryLocation> in) { return myVcsZipper.groupLocations(in); } @Override public CommittedChangeList zip(final RepositoryLocationGroup group, final List<CommittedChangeList> lists) { if (lists.size() == 1) { return lists.get(0); } final CommittedChangeList victim = ReceivedChangeList.unwrap(lists.get(0)); final ReceivedChangeList result = new ReceivedChangeList(victim); result.setForcePartial(false); final Set<Change> baseChanges = new HashSet<Change>(); for (CommittedChangeList list : lists) { baseChanges.addAll(ReceivedChangeList.unwrap(list).getChanges()); final Collection<Change> changes = list.getChanges(); for (Change change : changes) { if (! result.getChanges().contains(change)) { result.addChange(change); } } } result.setForcePartial(baseChanges.size() != result.getChanges().size()); return result; } @Override public long getNumber(final CommittedChangeList list) { return myVcsZipper.getNumber(list); } } public void commitMessageChanged(final AbstractVcs vcs, final RepositoryLocation location, final long number, final String newMessage) { myTaskQueue.run(new Runnable() { @Override public void run() { final ChangesCacheFile file = myCachesHolder.haveCache(location); if (file != null) { try { if (file.isEmpty()) return; file.editChangelist(number, newMessage); loadIncomingChanges(true); fireChangesLoaded(location, Collections.<CommittedChangeList>emptyList()); } catch (IOException e) { VcsBalloonProblemNotifier.showOverChangesView(myProject, "Didn't update Repository changes with new message due to error: " + e.getMessage(), MessageType.ERROR); } } } }); } public void loadIncomingChangesAsync(@Nullable final Consumer<List<CommittedChangeList>> consumer, final boolean inBackground) { debug("Loading incoming changes"); final Runnable task = new Runnable() { @Override public void run() { final List<CommittedChangeList> list = loadIncomingChanges(inBackground); if (consumer != null) { consumer.consume(new ArrayList<CommittedChangeList>(list)); } } }; myTaskQueue.run(task); } public void clearCaches(final Runnable continuation) { myTaskQueue.run(new Runnable() { @Override public void run() { myCachesHolder.clearAllCaches(); myCachedIncomingChangeLists = null; continuation.run(); MessageBusUtil.invokeLaterIfNeededOnSyncPublisher(myProject, COMMITTED_TOPIC, new Consumer<CommittedChangesListener>() { @Override public void consume(CommittedChangesListener listener) { listener.changesCleared(); } }); } }); } @Nullable public List<CommittedChangeList> getCachedIncomingChanges() { return myCachedIncomingChangeLists; } public void processUpdatedFiles(final UpdatedFiles updatedFiles) { processUpdatedFiles(updatedFiles, null); } public void processUpdatedFiles(final UpdatedFiles updatedFiles, @Nullable final Consumer<List<CommittedChangeList>> incomingChangesConsumer) { final Runnable task = new Runnable() { @Override public void run() { debug("Processing updated files"); final Collection<ChangesCacheFile> caches = myCachesHolder.getAllCaches(); myPendingUpdateCount += caches.size(); for(final ChangesCacheFile cache: caches) { try { if (cache.isEmpty()) { pendingUpdateProcessed(incomingChangesConsumer); continue; } debug("Processing updated files in " + cache.getLocation()); boolean needRefresh = cache.processUpdatedFiles(updatedFiles, myNewIncomingChanges); if (needRefresh) { debug("Found unaccounted files, requesting refresh"); // todo do we need double-queueing here??? processUpdatedFilesAfterRefresh(cache, updatedFiles, incomingChangesConsumer); } else { debug("Clearing cached incoming changelists"); myCachedIncomingChangeLists = null; pendingUpdateProcessed(incomingChangesConsumer); } } catch (IOException e) { LOG.error(e); } } } }; myTaskQueue.run(task); } private void pendingUpdateProcessed(@Nullable Consumer<List<CommittedChangeList>> incomingChangesConsumer) { myPendingUpdateCount--; if (myPendingUpdateCount == 0) { notifyIncomingChangesUpdated(myNewIncomingChanges); if (incomingChangesConsumer != null) { incomingChangesConsumer.consume(ContainerUtil.newArrayList(myNewIncomingChanges)); } myNewIncomingChanges.clear(); } } private void processUpdatedFilesAfterRefresh(final ChangesCacheFile cache, final UpdatedFiles updatedFiles, @Nullable final Consumer<List<CommittedChangeList>> incomingChangesConsumer) { refreshCacheAsync(cache, false, new RefreshResultConsumer() { @Override public void receivedChanges(final List<CommittedChangeList> committedChangeLists) { try { debug("Processing updated files after refresh in " + cache.getLocation()); boolean result = true; if (committedChangeLists.size() > 0) { // received some new changelists, try to process updated files again result = cache.processUpdatedFiles(updatedFiles, myNewIncomingChanges); } debug(result ? "Still have unaccounted files" : "No more unaccounted files"); // for svn, we won't get exact revision numbers in updatedFiles, so we have to double-check by // checking revisions we have locally if (result) { cache.refreshIncomingChanges(); debug("Clearing cached incoming changelists"); myCachedIncomingChangeLists = null; } pendingUpdateProcessed(incomingChangesConsumer); } catch (IOException e) { LOG.error(e); } catch(VcsException e) { notifyRefreshError(e); } } @Override public void receivedError(VcsException ex) { notifyRefreshError(ex); } }); } private void fireIncomingChangesUpdated(final List<CommittedChangeList> lists) { MessageBusUtil.invokeLaterIfNeededOnSyncPublisher(myProject, COMMITTED_TOPIC, new Consumer<CommittedChangesListener>() { @Override public void consume(CommittedChangesListener listener) { listener.incomingChangesUpdated(new ArrayList<CommittedChangeList>(lists)); } }); } private void notifyIncomingChangesUpdated(@Nullable final Collection<CommittedChangeList> receivedChanges) { final Collection<CommittedChangeList> changes = receivedChanges == null ? myCachedIncomingChangeLists : receivedChanges; if (changes == null) { final Application application = ApplicationManager.getApplication(); final Runnable runnable = new Runnable() { @Override public void run() { final List<CommittedChangeList> lists = loadIncomingChanges(true); fireIncomingChangesUpdated(lists); } }; if (application.isDispatchThread()) { myTaskQueue.run(runnable); } else { runnable.run(); } return; } final ArrayList<CommittedChangeList> listCopy = new ArrayList<CommittedChangeList>(changes); fireIncomingChangesUpdated(listCopy); } private void notifyRefreshError(final VcsException e) { MessageBusUtil.invokeLaterIfNeededOnSyncPublisher(myProject, COMMITTED_TOPIC, new Consumer<CommittedChangesListener>() { @Override public void consume(CommittedChangesListener listener) { listener.refreshErrorStatusChanged(e); } }); } private CommittedChangesListener getPublisher(final Consumer<CommittedChangesListener> listener) { return ApplicationManager.getApplication().runReadAction(new Computable<CommittedChangesListener>() { @Override public CommittedChangesListener compute() { if (myProject.isDisposed()) throw new ProcessCanceledException(); return myBus.syncPublisher(COMMITTED_TOPIC); } }); } public boolean isRefreshingIncomingChanges() { return myRefreshingIncomingChanges; } public boolean refreshIncomingChanges() { boolean hasChanges = false; final Collection<ChangesCacheFile> caches = myCachesHolder.getAllCaches(); for(ChangesCacheFile file: caches) { try { if (file.isEmpty()) { continue; } debug("Refreshing incoming changes for " + file.getLocation()); boolean changesForCache = file.refreshIncomingChanges(); hasChanges |= changesForCache; } catch (IOException e) { LOG.error(e); } catch(VcsException e) { notifyRefreshError(e); } } return hasChanges; } public void refreshIncomingChangesAsync() { debug("Refreshing incoming changes in background"); myRefreshingIncomingChanges = true; final Runnable task = new Runnable() { @Override public void run() { refreshIncomingChanges(); refreshIncomingUi(); } }; myTaskQueue.run(task); } private void refreshIncomingUi() { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { myRefreshingIncomingChanges = false; debug("Incoming changes refresh complete, clearing cached incoming changes"); notifyReloadIncomingChanges(); } }, ModalityState.NON_MODAL, myProject.getDisposed()); } public void refreshAllCachesAsync(final boolean initIfEmpty, final boolean inBackground) { final Runnable task = new Runnable() { @Override public void run() { final List<ChangesCacheFile> files = myCachesHolder.getAllCaches(); final RefreshResultConsumer notifyConsumer = new RefreshResultConsumer() { private VcsException myError = null; private int myCount = 0; private int totalChangesCount = 0; @Override public void receivedChanges(List<CommittedChangeList> changes) { totalChangesCount += changes.size(); checkDone(); } @Override public void receivedError(VcsException ex) { myError = ex; checkDone(); } private void checkDone() { myCount++; if (myCount == files.size()) { myTaskQueue.run(new Runnable() { @Override public void run() { if (totalChangesCount > 0) { notifyReloadIncomingChanges(); } else { myProject.getMessageBus().syncPublisher(CommittedChangesTreeBrowser.ITEMS_RELOADED).emptyRefresh(); } } }); notifyRefreshError(myError); } } }; for(ChangesCacheFile file: files) { if ((! inBackground) || file.getVcs().isVcsBackgroundOperationsAllowed(file.getRootPath().getVirtualFile())) { refreshCacheAsync(file, initIfEmpty, notifyConsumer, false); } } } }; myTaskQueue.run(task); } private void notifyReloadIncomingChanges() { myCachedIncomingChangeLists = null; notifyIncomingChangesUpdated(null); } private void refreshCacheAsync(final ChangesCacheFile cache, final boolean initIfEmpty, @Nullable final RefreshResultConsumer consumer) { refreshCacheAsync(cache, initIfEmpty, consumer, true); } private void refreshCacheAsync(final ChangesCacheFile cache, final boolean initIfEmpty, @Nullable final RefreshResultConsumer consumer, final boolean asynch) { try { if (!initIfEmpty && cache.isEmpty()) { return; } } catch (IOException e) { LOG.error(e); return; } final Runnable task = new Runnable() { @Override public void run() { try { final List<CommittedChangeList> list; if (initIfEmpty && cache.isEmpty()) { list = initCache(cache); } else { list = refreshCache(cache); } if (consumer != null) { consumer.receivedChanges(list); } } catch(ProcessCanceledException ex) { // ignore } catch (IOException e) { LOG.error(e); } catch (VcsException e) { if (consumer != null) { consumer.receivedError(e); } } } }; if (asynch) { myTaskQueue.run(task); } else { task.run(); } } private void updateRefreshTimer() { cancelRefreshTimer(); if (myState.isRefreshEnabled()) { myRefresnRunnable = new MyRefreshRunnable(this); // if "schedule with fixed rate" is used, then after waking up from stand-by mode, events are generated for inactive period // it does not make sense myFuture = JobScheduler.getScheduler().scheduleWithFixedDelay(myRefresnRunnable, myState.getRefreshInterval()*60, myState.getRefreshInterval()*60, TimeUnit.SECONDS); } } private void cancelRefreshTimer() { if (myRefresnRunnable != null) { myRefresnRunnable.cancel(); myRefresnRunnable = null; } if (myFuture != null) { myFuture.cancel(false); myFuture = null; } } @Nullable public Pair<CommittedChangeList, Change> getIncomingChangeList(final VirtualFile file) { if (myCachedIncomingChangeLists != null) { File ioFile = new File(file.getPath()); for(CommittedChangeList changeList: myCachedIncomingChangeLists) { for(Change change: changeList.getChanges()) { if (change.affectsFile(ioFile)) { return Pair.create(changeList, change); } } } } return null; } private long getLatestListForFile(final ChangesCacheFile file) { try { if ((file == null) || (file.isEmpty())) { return -1; } return file.getLastCachedChangelist(); } catch (IOException e) { return -1; } } public CachesHolder getCachesHolder() { return myCachesHolder; } public void submitExternallyLoaded(final RepositoryLocation location, final long myLastCl, final List<CommittedChangeList> lists) { myExternallyLoadedChangeLists.put(location.getKey(), new Pair<Long, List<CommittedChangeList>>(myLastCl, lists)); } private interface RefreshResultConsumer { void receivedChanges(List<CommittedChangeList> changes); void receivedError(VcsException ex); } private static class MyRefreshRunnable implements Runnable { private CommittedChangesCache myCache; private MyRefreshRunnable(final CommittedChangesCache cache) { myCache = cache; } private void cancel() { myCache = null; } @Override public void run() { final CommittedChangesCache cache = myCache; if (cache == null) return; cache.refreshAllCachesAsync(false, true); final List<ChangesCacheFile> list = cache.getCachesHolder().getAllCaches(); for(ChangesCacheFile file: list) { if (file.getVcs().isVcsBackgroundOperationsAllowed(file.getRootPath().getVirtualFile())) { if (file.getProvider().refreshIncomingWithCommitted()) { cache.refreshIncomingChangesAsync(); break; } } } } } public RepositoryLocationCache getLocationCache() { return myLocationCache; } }
ernestp/consulo
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesCache.java
Java
apache-2.0
43,213
#!/usr/bin/env python """ conference.py -- Udacity conference server-side Python App Engine API; uses Google Cloud Endpoints $Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $ created by wesc on 2014 apr 21 """ __author__ = 'wesc+api@google.com (Wesley Chun)' from datetime import datetime import endpoints from protorpc import messages from protorpc import message_types from protorpc import remote from google.appengine.api import memcache from google.appengine.api import taskqueue from google.appengine.ext import ndb from models import ConflictException from models import Profile from models import ProfileMiniForm from models import ProfileForm from models import StringMessage from models import BooleanMessage from models import Conference from models import ConferenceForm from models import ConferenceForms from models import ConferenceQueryForm from models import ConferenceQueryForms from models import TeeShirtSize #Added from models import Session from models import SessionForm from models import SessionForms from settings import WEB_CLIENT_ID from settings import ANDROID_CLIENT_ID from settings import IOS_CLIENT_ID from settings import ANDROID_AUDIENCE from utils import getUserId EMAIL_SCOPE = endpoints.EMAIL_SCOPE API_EXPLORER_CLIENT_ID = endpoints.API_EXPLORER_CLIENT_ID MEMCACHE_ANNOUNCEMENTS_KEY = "RECENT_ANNOUNCEMENTS" ANNOUNCEMENT_TPL = ('Last chance to attend! The following conferences ' 'are nearly sold out: %s') # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DEFAULTS = { "city": "Default City", "maxAttendees": 0, "seatsAvailable": 0, "topics": [ "Default", "Topic" ], } SESSION_DEFAULTS = { "description": '', "highlights": ["Default"], "duration": 0.0, "users": [] } OPERATORS = { 'EQ': '=', 'GT': '>', 'GTEQ': '>=', 'LT': '<', 'LTEQ': '<=', 'NE': '!=' } FIELDS = { 'CITY': 'city', 'TOPIC': 'topics', 'MONTH': 'month', 'MAX_ATTENDEES': 'maxAttendees', } CONF_GET_REQUEST = endpoints.ResourceContainer( message_types.VoidMessage, websafeConferenceKey=messages.StringField(1), ) CONF_POST_REQUEST = endpoints.ResourceContainer( ConferenceForm, websafeConferenceKey=messages.StringField(1), ) ## create Resource container for post request with Sessions SESSION_POST_REQUEST = endpoints.ResourceContainer( SessionForm, websafeConferenceKey=messages.StringField(1) ) ## and for a GET Session request SESSION_GET_REQUEST = endpoints.ResourceContainer( message_types.VoidMessage, websafeConferenceKey=messages.StringField(1) ) SESSION_GETBYNAME = endpoints.ResourceContainer( message_types.VoidMessage, speaker=messages.StringField(1) ) SESSION_GETBYTYPE = endpoints.ResourceContainer( message_types.VoidMessage, sessionType=messages.StringField(1), websafeConferenceKey=messages.StringField(2) ) USERWISHLIST = endpoints.ResourceContainer( message_types.VoidMessage, sessionKey = messages.StringField(1) ) GET_FEATURED_SPEAKER = endpoints.ResourceContainer( speaker = messages.StringField(1) ) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @endpoints.api(name='conference', version='v1', audiences=[ANDROID_AUDIENCE], allowed_client_ids=[WEB_CLIENT_ID, API_EXPLORER_CLIENT_ID, ANDROID_CLIENT_ID, IOS_CLIENT_ID], scopes=[EMAIL_SCOPE]) class ConferenceApi(remote.Service): """Conference API v0.1""" # Task 1.) # Sessions # - - - Conference objects - - - - - - - - - - - - - - - - - def _copySessionToForm(self, session): """Copy relevant fields from Conference to ConferenceForm.""" sf = SessionForm() for field in sf.all_fields(): if hasattr(session, field.name): if field.name == 'date': setattr(sf, field.name, str(getattr(session, field.name))) else: setattr(sf, field.name, getattr(session, field.name)) sf.check_initialized() return sf def _createSessionObject(self, request): """Create or update Session object, returning SessionForm/request.""" # preload necessary data items user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') user_id = getUserId(user) if not request.name: raise endpoints.BadRequestException("Session 'name' field required") # get the conf that the session should be added to conf = ndb.Key(urlsafe=request.websafeConferenceKey).get() if not conf: raise endpoints.UnauthorizedException("There must be a valid conference to add the sessions to") if not request.speaker: raise endpoints.BadRequestException("Session 'speaker' field required") if not request.speaker: raise endpoints.BadRequestException("Session 'type' field required") # copy SessionForm/ProtoRPC Message into dict data = {field.name: getattr(request, field.name) for field in request.all_fields()} del data["websafeConferenceKey"] ## Check to see if valid start time. Must be between 1-12 am and 1-12 pm ## The format should be 00:xx ex: 09:am if data['startTime']: hour = int(data['startTime'][0:2]) ampm = data['startTime'][3:] print ampm if not (hour <= 12 and hour >= 1): raise endpoints.BadRequestException("Start time must be between 1 and 12") if not (ampm == 'am' or ampm == 'AM' or ampm == 'pm' or ampm == 'PM'): raise endpoints.BadRequestException("Start time must be either am or pm") else: raise endpoints.BadRequestException("We need to know the start time of the session") # add default values for those missing (both data model & outbound Message) # convert dates from strings to Date objects; set month based on start_date if data['date']: data['date'] = datetime.strptime(data['date'][:10], "%Y-%m-%d").date() else: raise endpoints.BadRequestException("Session start date required") for df in SESSION_DEFAULTS: if data[df] in (None, []): data[df] = SESSION_DEFAULTS[df] setattr(request, df, SESSION_DEFAULTS[df]) # if there is a refrence to the Conference that the session is for then # make the session a child of that Conference. # creating the session key s_id = Session.allocate_ids(size=1, parent=conf.key)[0] s_key = ndb.Key(Session, s_id, parent=conf.key) data["key"] = s_key Session(**data).put() ## Additions for Task 4 ## first get current featured speaker curr_speaker = data["speaker"] taskqueue.add(params={'speaker':curr_speaker, 'websafeConferenceKey': conf.key.urlsafe()}, url='/tasks/setFeaturedSpeaker') return self._copySessionToForm(request) # Task 4 Endpoint for getting the current featured speaker @endpoints.method(message_types.VoidMessage,StringMessage,path='featuredspeaker', http_method='GET', name='getFeaturedSpeaker') def getFeaturedSpeaker(self,request): """Return the featured speaker for the session """ featured_speaker = memcache.get("featured_speaker") # if there is not speaker then tell the 'user' there is no speaker if featured_speaker == None: featured_speaker = "There is no current featured speaker" # using the string message class from models.py string_message = StringMessage() setattr(string_message,"data",featured_speaker) return string_message # Task 1 Enpoint for creating a session @endpoints.method(SESSION_POST_REQUEST,SessionForm,path='session/{websafeConferenceKey}', http_method='POST', name='createSession') def createSession(self,request): """Create new session """ return self._createSessionObject(request) # Task 1 Endpoint for fetching a list of all current sessions of a conference @endpoints.method(SESSION_GET_REQUEST,SessionForms,path='session/{websafeConferenceKey}', http_method='GET', name='getSessions') def getSessions(self,request): """Create new session """ conf = ndb.Key(urlsafe=request.websafeConferenceKey).get() if not conf: raise endpoints.NotFoundException( 'No conference found with key: %s' % request.websafeConferenceKey) sessions = Session.query(ancestor=conf.key) return SessionForms( items = [self._copySessionToForm(session) for session in sessions] ) # Task 1 Endpoint for getting all sessions of a speaker @endpoints.method(SESSION_GETBYNAME, SessionForms, path='session/{speaker}', http_method='GET', name='getSessionsBySpeaker') def getSessionsBySpeaker(self, request): """Return requested session (by username).""" # get Conference object from request; bail if not found if not request.speaker: raise endpoints.BadRequestException("You must pass the name of the speaker") # the speaker can have more than one session sessions = Session.query(Session.speaker == request.speaker) # return SessionForm return SessionForms( items = [self._copySessionToForm(session) for session in sessions] ) # Task 1 Enpoint for getting all sessions of a given type @endpoints.method(SESSION_GETBYTYPE, SessionForms, path='session', http_method='GET', name='getSessionByType') def getSessionByType(self, request): """Return requested session (by type).""" # get Conference object from request; bail if not found if not request.sessionType: raise endpoints.BadRequestException("You must pass the type of the session") if not request.websafeConferenceKey: raise endpoints.BadRequestException("You must pass a conference key") conf = ndb.Key(urlsafe=request.websafeConferenceKey).get() if not conf: raise endpoints.NotFoundException( 'No conference found with key: %s' % request.websafeConferenceKey) sessions = Session.query(Session.sessionType == request.sessionType, ancestor=conf.key) # return SessionForm return SessionForms( items = [self._copySessionToForm(session) for session in sessions] ) # Task 2.) ## --- User wish list MEthods # add a wishlist to a given session for the current user @endpoints.method(USERWISHLIST,SessionForm,path='wishlist/{sessionKey}', http_method='POST', name='addToWishList') def addToWishList(self,request): if not request.sessionKey: raise BadRequestException("You must pass a session key") user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') user_id = getUserId(user) # append the current user to the wishlist property session_key = ndb.Key(urlsafe=request.sessionKey) session = session_key.get() ## Only add the user if he does not currently have the session in his wishlist if user_id in session.users: raise BadRequestException("You are already in this session") else: session.users.append(user_id) session.put() return self._copySessionToForm(session) # Task 2 endpoint delete current user from given wish list @endpoints.method(USERWISHLIST,SessionForm,path='deleteWishlist/{sessionKey}', http_method='POST', name='deleteFromWishList') def deleteFromWishList(self,request): if not request.sessionKey: raise BadRequestException("You must pass a session key") user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') user_id = getUserId(user) session_key = ndb.Key(urlsafe=request.sessionKey) session = session_key.get() # refrencing the session users property call the python remove function # to remove user from the current users list # only remove from the users list if the user is in it otherwise return a error if user_id in session.users: session.users.remove(user_id) else: raise BadRequestException("You do not have this session in your wishlist") session.put() return self._copySessionToForm(session) # Task 2 endpoint that returns the full wishlist of the current user @endpoints.method(message_types.VoidMessage,SessionForms,path='wishlist', http_method='GET', name='getCurrentWishList') def getCurrentWishList(self,request): user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') user_id = getUserId(user) sessions = Session.query(Session.users.IN([user_id])) return SessionForms( items = [self._copySessionToForm(session) for session in sessions] ) # FOR Task 3 # query wishlist for a given conference @endpoints.method(SESSION_GET_REQUEST,SessionForms,path='wishlistByConference/{websafeConferenceKey}', http_method='GET',name='getWishListByConference') def getWishListByConference(self,request): user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') user_id = getUserId(user) conf = ndb.Key(urlsafe=request.websafeConferenceKey).get() if not conf: raise endpoints.NotFoundException( 'No conference found with key: %s' % request.websafeConferenceKey) sessions = Session.query(ndb.AND(Session.users.IN([user_id]),ancestor=conf.key)) return SessionForms( items = [self._copySessionToForm(session) for session in sessions] ) # query Sessions that start at a specific time @endpoints.method(SESSION_GET_REQUEST,SessionForms,path="sessionsByStartTime", http_method='GET',name='getSessionsByTime') def getSessionsByTime(self,request): user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') user_id = getUserId(user) if not request.startTime: raise BadRequestException("You must pass a startime in the format 12:am") # Since we are not quering on a specif sessions = Session.query(startime=request.startTime).get() return SessionForms( items = [self._copySessionToForm(session) for session in sessions] ) ## ------- Conference MEthods def _copyConferenceToForm(self, conf, displayName): """Copy relevant fields from Conference to ConferenceForm.""" cf = ConferenceForm() for field in cf.all_fields(): if hasattr(conf, field.name): # convert Date to date string; just copy others if field.name.endswith('Date'): setattr(cf, field.name, str(getattr(conf, field.name))) else: setattr(cf, field.name, getattr(conf, field.name)) elif field.name == "websafeKey": setattr(cf, field.name, conf.key.urlsafe()) if displayName: setattr(cf, 'organizerDisplayName', displayName) cf.check_initialized() return cf def _createConferenceObject(self, request): """Create or update Conference object, returning ConferenceForm/request.""" # preload necessary data items user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') user_id = getUserId(user) if not request.name: raise endpoints.BadRequestException("Conference 'name' field required") # copy ConferenceForm/ProtoRPC Message into dict data = {field.name: getattr(request, field.name) for field in request.all_fields()} del data['websafeKey'] del data['organizerDisplayName'] # add default values for those missing (both data model & outbound Message) for df in DEFAULTS: if data[df] in (None, []): data[df] = DEFAULTS[df] setattr(request, df, DEFAULTS[df]) # convert dates from strings to Date objects; set month based on start_date if data['startDate']: data['startDate'] = datetime.strptime(data['startDate'][:10], "%Y-%m-%d").date() data['month'] = data['startDate'].month else: data['month'] = 0 if data['endDate']: data['endDate'] = datetime.strptime(data['endDate'][:10], "%Y-%m-%d").date() # set seatsAvailable to be same as maxAttendees on creation if data["maxAttendees"] > 0: data["seatsAvailable"] = data["maxAttendees"] # generate Profile Key based on user ID and Conference # ID based on Profile key get Conference key from ID p_key = ndb.Key(Profile, user_id) c_id = Conference.allocate_ids(size=1, parent=p_key)[0] c_key = ndb.Key(Conference, c_id, parent=p_key) data['key'] = c_key data['organizerUserId'] = request.organizerUserId = user_id # create Conference, send email to organizer confirming # creation of Conference & return (modified) ConferenceForm Conference(**data).put() taskqueue.add(params={'email': user.email(), 'conferenceInfo': repr(request)}, url='/tasks/send_confirmation_email' ) return request @ndb.transactional() def _updateConferenceObject(self, request): user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') user_id = getUserId(user) # copy ConferenceForm/ProtoRPC Message into dict data = {field.name: getattr(request, field.name) for field in request.all_fields()} # update existing conference conf = ndb.Key(urlsafe=request.websafeConferenceKey).get() # check that conference exists if not conf: raise endpoints.NotFoundException( 'No conference found with key: %s' % request.websafeConferenceKey) # check that user is owner if user_id != conf.organizerUserId: raise endpoints.ForbiddenException( 'Only the owner can update the conference.') # Not getting all the fields, so don't create a new object; just # copy relevant fields from ConferenceForm to Conference object for field in request.all_fields(): data = getattr(request, field.name) # only copy fields where we get data if data not in (None, []): # special handling for dates (convert string to Date) if field.name in ('startDate', 'endDate'): data = datetime.strptime(data, "%Y-%m-%d").date() if field.name == 'startDate': conf.month = data.month # write to Conference object setattr(conf, field.name, data) conf.put() prof = ndb.Key(Profile, user_id).get() return self._copyConferenceToForm(conf, getattr(prof, 'displayName')) @endpoints.method(ConferenceForm, ConferenceForm, path='conference', http_method='POST', name='createConference') def createConference(self, request): """Create new conference.""" return self._createConferenceObject(request) @endpoints.method(CONF_POST_REQUEST, ConferenceForm, path='conference/{websafeConferenceKey}', http_method='PUT', name='updateConference') def updateConference(self, request): """Update conference w/provided fields & return w/updated info.""" return self._updateConferenceObject(request) @endpoints.method(CONF_GET_REQUEST, ConferenceForm, path='conference/{websafeConferenceKey}', http_method='GET', name='getConference') def getConference(self, request): """Return requested conference (by websafeConferenceKey).""" # get Conference object from request; bail if not found conf = ndb.Key(urlsafe=request.websafeConferenceKey).get() if not conf: raise endpoints.NotFoundException( 'No conference found with key: %s' % request.websafeConferenceKey) prof = conf.key.parent().get() # return ConferenceForm return self._copyConferenceToForm(conf, getattr(prof, 'displayName')) @endpoints.method(message_types.VoidMessage, ConferenceForms, path='getConferencesCreated', http_method='POST', name='getConferencesCreated') def getConferencesCreated(self, request): """Return conferences created by user.""" # make sure user is authed user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') user_id = getUserId(user) # create ancestor query for all key matches for this user confs = Conference.query(ancestor=ndb.Key(Profile, user_id)) prof = ndb.Key(Profile, user_id).get() # return set of ConferenceForm objects per Conference return ConferenceForms( items=[self._copyConferenceToForm(conf, getattr(prof, 'displayName')) for conf in confs] ) def _getQuery(self, request): """Return formatted query from the submitted filters.""" q = Conference.query() inequality_filter, filters = self._formatFilters(request.filters) # If exists, sort on inequality filter first if not inequality_filter: q = q.order(Conference.name) else: q = q.order(ndb.GenericProperty(inequality_filter)) q = q.order(Conference.name) for filtr in filters: if filtr["field"] in ["month", "maxAttendees"]: filtr["value"] = int(filtr["value"]) formatted_query = ndb.query.FilterNode(filtr["field"], filtr["operator"], filtr["value"]) q = q.filter(formatted_query) return q def _formatFilters(self, filters): """Parse, check validity and format user supplied filters.""" formatted_filters = [] inequality_field = None for f in filters: filtr = {field.name: getattr(f, field.name) for field in f.all_fields()} try: filtr["field"] = FIELDS[filtr["field"]] filtr["operator"] = OPERATORS[filtr["operator"]] except KeyError: raise endpoints.BadRequestException("Filter contains invalid field or operator.") # Every operation except "=" is an inequality if filtr["operator"] != "=": # check if inequality operation has been used in previous filters # disallow the filter if inequality was performed on a different field before # track the field on which the inequality operation is performed if inequality_field and inequality_field != filtr["field"]: raise endpoints.BadRequestException("Inequality filter is allowed on only one field.") else: inequality_field = filtr["field"] formatted_filters.append(filtr) return (inequality_field, formatted_filters) @endpoints.method(ConferenceQueryForms, ConferenceForms, path='queryConferences', http_method='POST', name='queryConferences') def queryConferences(self, request): """Query for conferences.""" conferences = self._getQuery(request) # need to fetch organiser displayName from profiles # get all keys and use get_multi for speed organisers = [(ndb.Key(Profile, conf.organizerUserId)) for conf in conferences] profiles = ndb.get_multi(organisers) # put display names in a dict for easier fetching names = {} for profile in profiles: names[profile.key.id()] = profile.displayName # return individual ConferenceForm object per Conference return ConferenceForms( items=[self._copyConferenceToForm(conf, names[conf.organizerUserId]) for conf in \ conferences] ) # - - - Profile objects - - - - - - - - - - - - - - - - - - - def _copyProfileToForm(self, prof): """Copy relevant fields from Profile to ProfileForm.""" # copy relevant fields from Profile to ProfileForm pf = ProfileForm() for field in pf.all_fields(): if hasattr(prof, field.name): # convert t-shirt string to Enum; just copy others if field.name == 'teeShirtSize': setattr(pf, field.name, getattr(TeeShirtSize, getattr(prof, field.name))) else: setattr(pf, field.name, getattr(prof, field.name)) pf.check_initialized() return pf def _getProfileFromUser(self): """Return user Profile from datastore, creating new one if non-existent.""" # make sure user is authed user = endpoints.get_current_user() if not user: raise endpoints.UnauthorizedException('Authorization required') # get Profile from datastore user_id = getUserId(user) p_key = ndb.Key(Profile, user_id) profile = p_key.get() # create new Profile if not there if not profile: profile = Profile( key = p_key, displayName = user.nickname(), mainEmail= user.email(), teeShirtSize = str(TeeShirtSize.NOT_SPECIFIED), ) profile.put() return profile # return Profile def _doProfile(self, save_request=None): """Get user Profile and return to user, possibly updating it first.""" # get user Profile prof = self._getProfileFromUser() # if saveProfile(), process user-modifyable fields if save_request: for field in ('displayName', 'teeShirtSize'): if hasattr(save_request, field): val = getattr(save_request, field) if val: setattr(prof, field, str(val)) #if field == 'teeShirtSize': # setattr(prof, field, str(val).upper()) #else: # setattr(prof, field, val) prof.put() # return ProfileForm return self._copyProfileToForm(prof) @endpoints.method(message_types.VoidMessage, ProfileForm, path='profile', http_method='GET', name='getProfile') def getProfile(self, request): """Return user profile.""" return self._doProfile() @endpoints.method(ProfileMiniForm, ProfileForm, path='profile', http_method='POST', name='saveProfile') def saveProfile(self, request): """Update & return user profile.""" return self._doProfile(request) # - - - Announcements - - - - - - - - - - - - - - - - - - - - @staticmethod def _cacheAnnouncement(): """Create Announcement & assign to memcache; used by memcache cron job & putAnnouncement(). """ confs = Conference.query(ndb.AND( Conference.seatsAvailable <= 5, Conference.seatsAvailable > 0) ).fetch(projection=[Conference.name]) if confs: # If there are almost sold out conferences, # format announcement and set it in memcache announcement = ANNOUNCEMENT_TPL % ( ', '.join(conf.name for conf in confs)) memcache.set(MEMCACHE_ANNOUNCEMENTS_KEY, announcement) else: # If there are no sold out conferences, # delete the memcache announcements entry announcement = "" memcache.delete(MEMCACHE_ANNOUNCEMENTS_KEY) return announcement @endpoints.method(message_types.VoidMessage, StringMessage, path='conference/announcement/get', http_method='GET', name='getAnnouncement') def getAnnouncement(self, request): """Return Announcement from memcache.""" return StringMessage(data=memcache.get(MEMCACHE_ANNOUNCEMENTS_KEY) or "") # - - - Registration - - - - - - - - - - - - - - - - - - - - @ndb.transactional(xg=True) def _conferenceRegistration(self, request, reg=True): """Register or unregister user for selected conference.""" retval = None prof = self._getProfileFromUser() # get user Profile # check if conf exists given websafeConfKey # get conference; check that it exists wsck = request.websafeConferenceKey conf = ndb.Key(urlsafe=wsck).get() if not conf: raise endpoints.NotFoundException( 'No conference found with key: %s' % wsck) # register if reg: # check if user already registered otherwise add if wsck in prof.conferenceKeysToAttend: raise ConflictException( "You have already registered for this conference") # check if seats avail if conf.seatsAvailable <= 0: raise ConflictException( "There are no seats available.") # register user, take away one seat prof.conferenceKeysToAttend.append(wsck) conf.seatsAvailable -= 1 retval = True # unregister else: # check if user already registered if wsck in prof.conferenceKeysToAttend: # unregister user, add back one seat prof.conferenceKeysToAttend.remove(wsck) conf.seatsAvailable += 1 retval = True else: retval = False # write things back to the datastore & return prof.put() conf.put() return BooleanMessage(data=retval) @endpoints.method(message_types.VoidMessage, ConferenceForms, path='conferences/attending', http_method='GET', name='getConferencesToAttend') def getConferencesToAttend(self, request): """Get list of conferences that user has registered for.""" prof = self._getProfileFromUser() # get user Profile conf_keys = [ndb.Key(urlsafe=wsck) for wsck in prof.conferenceKeysToAttend] conferences = ndb.get_multi(conf_keys) # get organizers organisers = [ndb.Key(Profile, conf.organizerUserId) for conf in conferences] profiles = ndb.get_multi(organisers) # put display names in a dict for easier fetching names = {} for profile in profiles: names[profile.key.id()] = profile.displayName # return set of ConferenceForm objects per Conference return ConferenceForms(items=[self._copyConferenceToForm(conf, names[conf.organizerUserId])\ for conf in conferences] ) @endpoints.method(CONF_GET_REQUEST, BooleanMessage, path='conference/{websafeConferenceKey}', http_method='POST', name='registerForConference') def registerForConference(self, request): """Register user for selected conference.""" return self._conferenceRegistration(request) @endpoints.method(CONF_GET_REQUEST, BooleanMessage, path='conference/{websafeConferenceKey}', http_method='DELETE', name='unregisterFromConference') def unregisterFromConference(self, request): """Unregister user for selected conference.""" return self._conferenceRegistration(request, reg=False) @endpoints.method(message_types.VoidMessage, ConferenceForms, path='filterPlayground', http_method='GET', name='filterPlayground') def filterPlayground(self, request): """Filter Playground""" q = Conference.query() # field = "city" # operator = "=" # value = "London" # f = ndb.query.FilterNode(field, operator, value) # q = q.filter(f) q = q.filter(Conference.city=="London") q = q.filter(Conference.topics=="Medical Innovations") q = q.filter(Conference.month==6) return ConferenceForms( items=[self._copyConferenceToForm(conf, "") for conf in q] ) api = endpoints.api_server([ConferenceApi]) # register API
befeltingu/UdacityFinalProject4
conference.py
Python
apache-2.0
33,399
namespace Stripe.Client.Sdk.Constants { public static class TransferFailureCodes { public const string AccountClosed = "account_closed"; public const string AccountFrozen = "account_frozen"; public const string BankAccountRestricted = "bank_account_restricted"; public const string BankOwnershipChanged = "bank_ownership_changed"; public const string CouldNotProcess = "could_not_process"; public const string DebitNotAuthorized = "debit_not_authorized"; public const string InsufficientFunds = "insufficient_funds"; public const string InvalidAccountNumber = "invalid_account_number"; public const string InvalidCurrency = "invalid_currency"; public const string NoAccount = "no_account"; } }
smiggleworth/Stripe.Client
src/Stripe.Client.Sdk/Constants/TransferFailureCodes.cs
C#
apache-2.0
788
# Gloniella clavatispora Steinke & K.D. Hyde, 1997 SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in Mycoscience 38(1): 7 (1997) #### Original name Gloniella clavatispora Steinke & K.D. Hyde, 1997 ### Remarks null
mdoering/backbone
life/Fungi/Ascomycota/Dothideomycetes/Hysteriales/Hysteriaceae/Gloniella/Gloniella clavatispora/README.md
Markdown
apache-2.0
273
#include <iostream> #include <string> #include "DepthStat.h" #include "Annotate.h" #include "RegionGet.h" #include "RegionCount.h" #include "version.h" static void PrintUsage(const char* progname) { std::cout << "\n" "Program: Crabber catches crabs :P\n" "Version: " << VERSION << "\n" "\n" "Usage: " << progname << " <command> [options]\n" "\n" "Commands:\n" " depth-stat stat coverage depth\n" " region-get extract sequences in regions\n" " region-count count bases in regions\n" " annotate annotate genetic mutations\n" << std::endl; } int main(int argc, char* const argv[]) { if (argc < 2) { PrintUsage(argv[0]); return 1; } std::string cmd(argv[1]); if (cmd == "depth-stat") { return DepthStat_main(argc - 1, argv + 1); } else if (cmd == "region-get") { return RegionGet_main(argc - 1, argv + 1); } else if (cmd == "region-count") { return RegionCount_main(argc - 1, argv + 1); } else if (cmd == "annotate") { return Annotate_main(argc - 1, argv + 1); } else { std::cerr << "Error: Unknown command '" << argv[1] << "'!\n" << std::endl; PrintUsage(argv[0]); return 1; } }
yanlinlin82/crabber
main.cpp
C++
apache-2.0
1,157
package org.datavec.api.transform.schema.conversion; import org.datavec.api.writable.Writable; public class TypeConversion { private static TypeConversion SINGLETON = new TypeConversion(); private TypeConversion() {} public static TypeConversion getInstance() { return SINGLETON; } public int convertInt(Object o) { if(o instanceof Writable) { Writable writable = (Writable) o; return convertInt(writable); } else { return convertInt(o.toString()); } } public int convertInt(Writable writable) { return writable.toInt(); } public int convertInt(String o) { return Integer.parseInt(o); } public double convertDouble(Writable writable) { return writable.toDouble(); } public double convertDouble(String o) { return Double.parseDouble(o); } public double convertDouble(Object o) { if(o instanceof Writable) { Writable writable = (Writable) o; return convertDouble(writable); } else { return convertDouble(o.toString()); } } public float convertFloat(Writable writable) { return writable.toFloat(); } public float convertFloat(String o) { return Float.parseFloat(o); } public float convertFloat(Object o) { if(o instanceof Writable) { Writable writable = (Writable) o; return convertFloat(writable); } else { return convertFloat(o.toString()); } } public long convertLong(Writable writable) { return writable.toLong(); } public long convertLong(String o) { return Long.parseLong(o); } public long convertLong(Object o) { if(o instanceof Writable) { Writable writable = (Writable) o; return convertLong(writable); } else { return convertLong(o.toString()); } } public String convertString(Writable writable) { return writable.toString(); } public String convertString(String s) { return s; } public String convertString(Object o) { if(o instanceof Writable) { Writable writable = (Writable) o; return convertString(writable); } else { return convertString(o.toString()); } } }
deeplearning4j/DataVec
datavec-api/src/main/java/org/datavec/api/transform/schema/conversion/TypeConversion.java
Java
apache-2.0
2,462
import { LightningElement } from 'lwc'; export default class Example1 extends LightningElement { }
forcedotcom/aura
aura-modules/src/test/modules/moduletest/examplesDoc/__examples__/example1/example1.js
JavaScript
apache-2.0
101
#!/bin/bash SRV=client.radosgw if [ $(find /var/run/ceph/ -name "ceph-${SRV}*asok" | wc -l) -ne 1 ];then echo "ERROR - zero or more then one ceph-${SRV} socket? Dunno if this is right, would expect exactly one" echo '>> find /var/run/ceph/ -name "ceph-${SRV}*asok"' find /var/run/ceph/ -name "ceph-${SRV}*asok" exit 1 else ceph_socket=$(find /var/run/ceph/ -name "ceph-${SRV}*asok") fi ceph --admin-daemon ${ceph_socket} config show | jq .name
qnib/docker-ceph-mono
opt/qnib/ceph/radosgw/bin/isok.sh
Shell
apache-2.0
461
using System; using OxyPlot; namespace OxyPlotWpfTests { public class CustomTooltipProvider { public Func<TrackerHitResult, string> GetCustomTooltip { set; get; } } }
VahidN/OxyPlotWpfTests
OxyPlotWpfTests/CustomTooltipProvider.cs
C#
apache-2.0
187
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 require 'spec_helper' describe TwitterCldr::Transforms::TransformId do describe '.find' do it 'finds a transformer when given two locales' do id = described_class.find('cs', 'ja') expect(id.source).to eq('cs') expect(id.target).to eq('ja') expect(id.to_s).to eq('cs-ja') end it 'finds a script-based transformer when given two locales' do id = described_class.find('ar', 'en') expect(id.source).to eq('Arabic') expect(id.target).to eq('Latin') expect(id.to_s).to eq('Arabic-Latin') end it 'finds a transformer when given two scripts' do id = described_class.find('Cyrillic', 'Latin') expect(id.source).to eq('Cyrillic') expect(id.target).to eq('Latin') expect(id.to_s).to eq('Cyrillic-Latin') end it 'finds a transformer when given one script and one locale' do id = described_class.find('Cyrillic', 'en') expect(id.source).to eq('Cyrillic') expect(id.target).to eq('Latin') expect(id.to_s).to eq('Cyrillic-Latin') id = described_class.find('ru', 'Latin') expect(id.source).to eq('Cyrillic') expect(id.target).to eq('Latin') expect(id.to_s).to eq('Cyrillic-Latin') end it 'handles abbreviated scripts' do id = described_class.find('Cyrl', 'Latn') expect(id.source).to eq('Cyrillic') expect(id.target).to eq('Latin') expect(id.to_s).to eq('Cyrillic-Latin') end it 'returns nil when no transformer can be found' do expect(described_class.find('foo', 'bar')).to be_nil end end describe '.parse' do it 'normalizes and parses the given id string' do id = described_class.parse('Bengali-Telugu') expect(id.source).to eq('Bengali') expect(id.target).to eq('Telugu') expect(id.variant).to be_nil expect(id.to_s).to eq('Bengali-Telugu') end it 'works with variants' do id = described_class.parse('Bulgarian-Latin/BGN') expect(id.source).to eq('Bulgarian') expect(id.target).to eq('Latin') expect(id.variant).to eq('BGN') expect(id.to_s).to eq('Bulgarian-Latin/BGN') end it 'allows looking up IDs by their aliases' do id = described_class.parse('Bulgarian-Latin/BGN') aliass = described_class.parse('bg-bg_Latn-bgn') expect(aliass.file_name).to eq(id.file_name) end it 'raises an error if no transformer can be found' do expect { described_class.parse('foo-bar') }.to( raise_error(TwitterCldr::Transforms::InvalidTransformIdError) ) end end describe '.split' do it 'splits the given string into source, target, and variant' do expect(described_class.split('foo-bar/baz')).to eq( %w(foo bar baz) ) end end describe '.join' do it 'joins the given source, target, and variant' do expect(described_class.join('foo', 'bar', 'baz')).to eq('foo-bar/baz') end end describe '#has_variant?' do it 'returns true if the transform id contains a variant' do id = described_class.new('source', 'target', 'variant') expect(id.variant).to eq('variant') expect(id).to have_variant end it 'returns false if the transform id does not contain a variant' do id = described_class.new('source', 'target') expect(id).to_not have_variant end end describe '#reverse' do it 'reverses the transform id' do id = described_class.new('source', 'target').reverse expect(id.source).to eq('target') expect(id.target).to eq('source') end it 'keeps the variant' do id = described_class.new('source', 'target', 'variant').reverse expect(id.source).to eq('target') expect(id.target).to eq('source') expect(id.variant).to eq('variant') end end describe '#file_name' do it 'finds the resource file name' do id = described_class.new('Katakana', 'Latin', 'BGN') expect(id.file_name).to eq('Katakana-Latin-BGN') end it 'finds no file name if no resource exists' do id = described_class.new('source', 'target') expect(id.file_name).to eq(nil) end end describe '#to_s' do it 'stringifies the source and target' do id = described_class.new('source', 'target') expect(id.to_s).to eq('source-target') end it 'stringifies the source, target, and variant' do id = described_class.new('source', 'target', 'variant') expect(id.to_s).to eq('source-target/variant') end end end
twitter/twitter-cldr-rb
spec/transforms/transform_id_spec.rb
Ruby
apache-2.0
4,615
/* * Copyright 2013 Thomas Hoffmann * * 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 de.j4velin.pedometer; import android.app.AlarmManager; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Build; import android.os.IBinder; import java.text.NumberFormat; import java.util.Date; import java.util.Locale; import de.j4velin.pedometer.ui.Activity_Main; import de.j4velin.pedometer.util.API23Wrapper; import de.j4velin.pedometer.util.API26Wrapper; import de.j4velin.pedometer.util.Logger; import de.j4velin.pedometer.util.Util; import de.j4velin.pedometer.widget.WidgetUpdateService; /** * Background service which keeps the step-sensor listener alive to always get * the number of steps since boot. * <p/> * This service won't be needed any more if there is a way to read the * step-value without waiting for a sensor event */ public class SensorListener extends Service implements SensorEventListener { public final static int NOTIFICATION_ID = 1; private final static long MICROSECONDS_IN_ONE_MINUTE = 60000000; private final static long SAVE_OFFSET_TIME = AlarmManager.INTERVAL_HOUR; private final static int SAVE_OFFSET_STEPS = 500; private static int steps; private static int lastSaveSteps; private static long lastSaveTime; private final BroadcastReceiver shutdownReceiver = new ShutdownRecevier(); @Override public void onAccuracyChanged(final Sensor sensor, int accuracy) { // nobody knows what happens here: step value might magically decrease // when this method is called... if (BuildConfig.DEBUG) Logger.log(sensor.getName() + " accuracy changed: " + accuracy); } @Override public void onSensorChanged(final SensorEvent event) { if (event.values[0] > Integer.MAX_VALUE) { if (BuildConfig.DEBUG) Logger.log("probably not a real value: " + event.values[0]); return; } else { steps = (int) event.values[0]; updateIfNecessary(); } } /** * @return true, if notification was updated */ private boolean updateIfNecessary() { if (steps > lastSaveSteps + SAVE_OFFSET_STEPS || (steps > 0 && System.currentTimeMillis() > lastSaveTime + SAVE_OFFSET_TIME)) { if (BuildConfig.DEBUG) Logger.log( "saving steps: steps=" + steps + " lastSave=" + lastSaveSteps + " lastSaveTime=" + new Date(lastSaveTime)); Database db = Database.getInstance(this); if (db.getSteps(Util.getToday()) == Integer.MIN_VALUE) { int pauseDifference = steps - getSharedPreferences("pedometer", Context.MODE_PRIVATE) .getInt("pauseCount", steps); db.insertNewDay(Util.getToday(), steps - pauseDifference); if (pauseDifference > 0) { // update pauseCount for the new day getSharedPreferences("pedometer", Context.MODE_PRIVATE).edit() .putInt("pauseCount", steps).commit(); } } db.saveCurrentSteps(steps); db.close(); lastSaveSteps = steps; lastSaveTime = System.currentTimeMillis(); showNotification(); // update notification WidgetUpdateService.enqueueUpdate(this); return true; } else { return false; } } private void showNotification() { if (Build.VERSION.SDK_INT >= 26) { startForeground(NOTIFICATION_ID, getNotification(this)); } else if (getSharedPreferences("pedometer", Context.MODE_PRIVATE) .getBoolean("notification", true)) { ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)) .notify(NOTIFICATION_ID, getNotification(this)); } } @Override public IBinder onBind(final Intent intent) { return null; } @Override public int onStartCommand(final Intent intent, int flags, int startId) { reRegisterSensor(); registerBroadcastReceiver(); if (!updateIfNecessary()) { showNotification(); } // restart service every hour to save the current step count long nextUpdate = Math.min(Util.getTomorrow(), System.currentTimeMillis() + AlarmManager.INTERVAL_HOUR); if (BuildConfig.DEBUG) Logger.log("next update: " + new Date(nextUpdate).toLocaleString()); AlarmManager am = (AlarmManager) getApplicationContext().getSystemService(Context.ALARM_SERVICE); PendingIntent pi = PendingIntent .getService(getApplicationContext(), 2, new Intent(this, SensorListener.class), PendingIntent.FLAG_UPDATE_CURRENT); if (Build.VERSION.SDK_INT >= 23) { API23Wrapper.setAlarmWhileIdle(am, AlarmManager.RTC, nextUpdate, pi); } else { am.set(AlarmManager.RTC, nextUpdate, pi); } return START_STICKY; } @Override public void onCreate() { super.onCreate(); if (BuildConfig.DEBUG) Logger.log("SensorListener onCreate"); } @Override public void onTaskRemoved(final Intent rootIntent) { super.onTaskRemoved(rootIntent); if (BuildConfig.DEBUG) Logger.log("sensor service task removed"); // Restart service in 500 ms ((AlarmManager) getSystemService(Context.ALARM_SERVICE)) .set(AlarmManager.RTC, System.currentTimeMillis() + 500, PendingIntent .getService(this, 3, new Intent(this, SensorListener.class), 0)); } @Override public void onDestroy() { super.onDestroy(); if (BuildConfig.DEBUG) Logger.log("SensorListener onDestroy"); try { SensorManager sm = (SensorManager) getSystemService(SENSOR_SERVICE); sm.unregisterListener(this); } catch (Exception e) { if (BuildConfig.DEBUG) Logger.log(e); e.printStackTrace(); } } public static Notification getNotification(final Context context) { if (BuildConfig.DEBUG) Logger.log("getNotification"); SharedPreferences prefs = context.getSharedPreferences("pedometer", Context.MODE_PRIVATE); int goal = prefs.getInt("goal", 10000); Database db = Database.getInstance(context); int today_offset = db.getSteps(Util.getToday()); if (steps == 0) steps = db.getCurrentSteps(); // use saved value if we haven't anything better db.close(); Notification.Builder notificationBuilder = Build.VERSION.SDK_INT >= 26 ? API26Wrapper.getNotificationBuilder(context) : new Notification.Builder(context); if (steps > 0) { if (today_offset == Integer.MIN_VALUE) today_offset = -steps; NumberFormat format = NumberFormat.getInstance(Locale.getDefault()); notificationBuilder.setProgress(goal, today_offset + steps, false).setContentText( today_offset + steps >= goal ? context.getString(R.string.goal_reached_notification, format.format((today_offset + steps))) : context.getString(R.string.notification_text, format.format((goal - today_offset - steps)))).setContentTitle( format.format(today_offset + steps) + " " + context.getString(R.string.steps)); } else { // still no step value? notificationBuilder.setContentText( context.getString(R.string.your_progress_will_be_shown_here_soon)) .setContentTitle(context.getString(R.string.notification_title)); } notificationBuilder.setPriority(Notification.PRIORITY_MIN).setShowWhen(false) .setContentIntent(PendingIntent .getActivity(context, 0, new Intent(context, Activity_Main.class), PendingIntent.FLAG_UPDATE_CURRENT)) .setSmallIcon(R.drawable.ic_notification).setOngoing(true); return notificationBuilder.build(); } private void registerBroadcastReceiver() { if (BuildConfig.DEBUG) Logger.log("register broadcastreceiver"); IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_SHUTDOWN); registerReceiver(shutdownReceiver, filter); } private void reRegisterSensor() { if (BuildConfig.DEBUG) Logger.log("re-register sensor listener"); SensorManager sm = (SensorManager) getSystemService(SENSOR_SERVICE); try { sm.unregisterListener(this); } catch (Exception e) { if (BuildConfig.DEBUG) Logger.log(e); e.printStackTrace(); } if (BuildConfig.DEBUG) { Logger.log("step sensors: " + sm.getSensorList(Sensor.TYPE_STEP_COUNTER).size()); if (sm.getSensorList(Sensor.TYPE_STEP_COUNTER).size() < 1) return; // emulator Logger.log("default: " + sm.getDefaultSensor(Sensor.TYPE_STEP_COUNTER).getName()); } // enable batching with delay of max 5 min sm.registerListener(this, sm.getDefaultSensor(Sensor.TYPE_STEP_COUNTER), SensorManager.SENSOR_DELAY_NORMAL, (int) (5 * MICROSECONDS_IN_ONE_MINUTE)); } }
j4velin/Pedometer
src/main/java/de/j4velin/pedometer/SensorListener.java
Java
apache-2.0
10,492
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="it_IT"> <context> <name>ConfigureOSC</name> <message> <location filename="configureosc.ui" line="14"/> <source>Configure OSC Plugin</source> <translation>Configurazione plugin OSC</translation> </message> <message> <location filename="configureosc.ui" line="20"/> <location filename="configureosc.ui" line="84"/> <location filename="configureosc.ui" line="155"/> <location filename="configureosc.ui" line="162"/> <source>Output address:</source> <translation>Indirizzo di uscita:</translation> </message> <message> <location filename="configureosc.ui" line="37"/> <location filename="configureosc.ui" line="60"/> <location filename="configureosc.ui" line="108"/> <location filename="configureosc.ui" line="135"/> <source>Input port:</source> <oldsource>Port:</oldsource> <translation>Porta di ingresso:</translation> </message> <message> <location filename="configureosc.ui" line="70"/> <source>OSC Network 2</source> <translation>Rete OSC 2</translation> </message> <message> <location filename="configureosc.ui" line="101"/> <source>OSC Network 1</source> <translation>Rete OSC 1</translation> </message> <message> <location filename="configureosc.ui" line="186"/> <source>OSC Network 3</source> <translation>Rete OSC 3</translation> </message> <message> <location filename="configureosc.ui" line="193"/> <source>OSC Network 4</source> <translation>Rete OSC 4</translation> </message> </context> <context> <name>OSCPlugin</name> <message> <location filename="oscplugin.cpp" line="102"/> <source>This plugin provides input for devices supporting the OSC transmission protocol.</source> <translation>Questa plugin permette la ricezione di segnale da dispositivi che supportano il protocollo OSC.</translation> </message> <message> <location filename="oscplugin.cpp" line="188"/> <location filename="oscplugin.cpp" line="288"/> <source>OSC Network</source> <translation>Rete OSC</translation> </message> <message> <location filename="oscplugin.cpp" line="199"/> <source>Output</source> <translation>Uscita</translation> </message> <message> <location filename="oscplugin.cpp" line="202"/> <location filename="oscplugin.cpp" line="302"/> <source>Status: Not ready</source> <oldsource>Status: Not open</oldsource> <translation>Stato: Non pronto</translation> </message> <message> <location filename="oscplugin.cpp" line="205"/> <source>Address: </source> <translation>Indirizzo: </translation> </message> <message> <location filename="oscplugin.cpp" line="208"/> <location filename="oscplugin.cpp" line="305"/> <source>Status: Ready</source> <translation>Stato: Pronto</translation> </message> <message> <location filename="oscplugin.cpp" line="299"/> <source>Input</source> <translation>Ingresso</translation> </message> </context> </TS>
bjlupo/rcva_qlcplus
plugins/osc/OSC_it_IT.ts
TypeScript
apache-2.0
3,361
/* * Copyright 2010-2016 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.datapipeline.model; import java.io.Serializable; /** * <p> * A comparision that is used to determine whether a query should return this * object. * </p> */ public class Selector implements Serializable, Cloneable { /** * <p> * The name of the field that the operator will be applied to. The field * name is the "key" portion of the field definition in the pipeline * definition syntax that is used by the AWS Data Pipeline API. If the field * is not set on the object, the condition fails. * </p> */ private String fieldName; private Operator operator; /** * <p> * The name of the field that the operator will be applied to. The field * name is the "key" portion of the field definition in the pipeline * definition syntax that is used by the AWS Data Pipeline API. If the field * is not set on the object, the condition fails. * </p> * * @param fieldName * The name of the field that the operator will be applied to. The * field name is the "key" portion of the field definition in the * pipeline definition syntax that is used by the AWS Data Pipeline * API. If the field is not set on the object, the condition fails. */ public void setFieldName(String fieldName) { this.fieldName = fieldName; } /** * <p> * The name of the field that the operator will be applied to. The field * name is the "key" portion of the field definition in the pipeline * definition syntax that is used by the AWS Data Pipeline API. If the field * is not set on the object, the condition fails. * </p> * * @return The name of the field that the operator will be applied to. The * field name is the "key" portion of the field definition in the * pipeline definition syntax that is used by the AWS Data Pipeline * API. If the field is not set on the object, the condition fails. */ public String getFieldName() { return this.fieldName; } /** * <p> * The name of the field that the operator will be applied to. The field * name is the "key" portion of the field definition in the pipeline * definition syntax that is used by the AWS Data Pipeline API. If the field * is not set on the object, the condition fails. * </p> * * @param fieldName * The name of the field that the operator will be applied to. The * field name is the "key" portion of the field definition in the * pipeline definition syntax that is used by the AWS Data Pipeline * API. If the field is not set on the object, the condition fails. * @return Returns a reference to this object so that method calls can be * chained together. */ public Selector withFieldName(String fieldName) { setFieldName(fieldName); return this; } /** * @param operator */ public void setOperator(Operator operator) { this.operator = operator; } /** * @return */ public Operator getOperator() { return this.operator; } /** * @param operator * @return Returns a reference to this object so that method calls can be * chained together. */ public Selector withOperator(Operator operator) { setOperator(operator); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getFieldName() != null) sb.append("FieldName: " + getFieldName() + ","); if (getOperator() != null) sb.append("Operator: " + getOperator()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Selector == false) return false; Selector other = (Selector) obj; if (other.getFieldName() == null ^ this.getFieldName() == null) return false; if (other.getFieldName() != null && other.getFieldName().equals(this.getFieldName()) == false) return false; if (other.getOperator() == null ^ this.getOperator() == null) return false; if (other.getOperator() != null && other.getOperator().equals(this.getOperator()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getFieldName() == null) ? 0 : getFieldName().hashCode()); hashCode = prime * hashCode + ((getOperator() == null) ? 0 : getOperator().hashCode()); return hashCode; } @Override public Selector clone() { try { return (Selector) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }
trasa/aws-sdk-java
aws-java-sdk-datapipeline/src/main/java/com/amazonaws/services/datapipeline/model/Selector.java
Java
apache-2.0
6,176
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.ComponentModel.Design; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Packaging; using Microsoft.CodeAnalysis.Remote; using Microsoft.CodeAnalysis.SymbolSearch; using Microsoft.VisualStudio.ComponentModelHost; using Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem; using Microsoft.VisualStudio.LanguageServices.Packaging; using Microsoft.VisualStudio.LanguageServices.Remote; using Microsoft.VisualStudio.LanguageServices.SymbolSearch; using Microsoft.VisualStudio.Shell.Interop; namespace Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService { internal abstract partial class AbstractPackage<TPackage, TLanguageService> : AbstractPackage where TPackage : AbstractPackage<TPackage, TLanguageService> where TLanguageService : AbstractLanguageService<TPackage, TLanguageService> { private TLanguageService _languageService; private MiscellaneousFilesWorkspace _miscellaneousFilesWorkspace; private PackageInstallerService _packageInstallerService; private VisualStudioSymbolSearchService _symbolSearchService; public VisualStudioWorkspaceImpl Workspace { get; private set; } protected AbstractPackage() { } protected override void Initialize() { base.Initialize(); foreach (var editorFactory in CreateEditorFactories()) { RegisterEditorFactory(editorFactory); } RegisterLanguageService(typeof(TLanguageService), () => { // Create the language service, tell it to set itself up, then store it in a field // so we can notify it that it's time to clean up. _languageService = CreateLanguageService(); _languageService.Setup(); return _languageService.ComAggregate; }); var shell = (IVsShell)this.GetService(typeof(SVsShell)); // Okay, this is also a bit strange. We need to get our Interop dll into our process, // but we're in the GAC. Ask the base Roslyn Package to load, and it will take care of // it for us. // * NOTE * workspace should never be created before loading roslyn package since roslyn package // installs a service roslyn visual studio workspace requires shell.LoadPackage(Guids.RoslynPackageId, out var setupPackage); _miscellaneousFilesWorkspace = this.ComponentModel.GetService<MiscellaneousFilesWorkspace>(); if (_miscellaneousFilesWorkspace != null) { // make sure solution crawler start once everything has been setup. _miscellaneousFilesWorkspace.StartSolutionCrawler(); } RegisterMiscellaneousFilesWorkspaceInformation(_miscellaneousFilesWorkspace); this.Workspace = this.CreateWorkspace(); if (IsInIdeMode(this.Workspace)) { // make sure solution crawler start once everything has been setup. // this also should be started before any of workspace events start firing this.Workspace.StartSolutionCrawler(); // start remote host EnableRemoteHostClientService(); Workspace.AdviseSolutionEvents((IVsSolution)GetService(typeof(SVsSolution))); } // Ensure services that must be created on the UI thread have been. HACK_AbstractCreateServicesOnUiThread.CreateServicesOnUIThread(ComponentModel, RoslynLanguageName); LoadComponentsInUIContextOnceSolutionFullyLoaded(); } protected override void LoadComponentsInUIContext() { ForegroundObject.AssertIsForeground(); // Ensure the nuget package services are initialized after we've loaded // the solution. _packageInstallerService = Workspace.Services.GetService<IPackageInstallerService>() as PackageInstallerService; _symbolSearchService = Workspace.Services.GetService<ISymbolSearchService>() as VisualStudioSymbolSearchService; _packageInstallerService?.Connect(this.RoslynLanguageName); _symbolSearchService?.Connect(this.RoslynLanguageName); HACK_AbstractCreateServicesOnUiThread.CreateServicesOnUIThread(ComponentModel, RoslynLanguageName); } protected abstract VisualStudioWorkspaceImpl CreateWorkspace(); internal IComponentModel ComponentModel { get { ForegroundObject.AssertIsForeground(); return (IComponentModel)GetService(typeof(SComponentModel)); } } protected abstract void RegisterMiscellaneousFilesWorkspaceInformation(MiscellaneousFilesWorkspace miscellaneousFilesWorkspace); protected abstract IEnumerable<IVsEditorFactory> CreateEditorFactories(); protected abstract TLanguageService CreateLanguageService(); protected void RegisterService<T>(Func<T> serviceCreator) { ((IServiceContainer)this).AddService(typeof(T), (container, type) => serviceCreator(), promote: true); } // When registering a language service, we need to take its ComAggregate wrapper. protected void RegisterLanguageService(Type t, Func<object> serviceCreator) { ((IServiceContainer)this).AddService(t, (container, type) => serviceCreator(), promote: true); } protected override void Dispose(bool disposing) { if (_miscellaneousFilesWorkspace != null) { _miscellaneousFilesWorkspace.StopSolutionCrawler(); } if (IsInIdeMode(this.Workspace)) { this.Workspace.StopSolutionCrawler(); DisableRemoteHostClientService(); } // If we've created the language service then tell it it's time to clean itself up now. if (_languageService != null) { _languageService.TearDown(); _languageService = null; } base.Dispose(disposing); } protected abstract string RoslynLanguageName { get; } private bool IsInIdeMode(Workspace workspace) { return workspace != null && !IsInCommandLineMode(); } private bool IsInCommandLineMode() { var shell = (IVsShell)this.GetService(typeof(SVsShell)); if (ErrorHandler.Succeeded(shell.GetProperty((int)__VSSPROPID.VSSPROPID_IsInCommandLineMode, out var result))) { return (bool)result; } return false; } private void EnableRemoteHostClientService() { ((RemoteHostClientServiceFactory.RemoteHostClientService)this.Workspace.Services.GetService<IRemoteHostClientService>()).Enable(); } private void DisableRemoteHostClientService() { ((RemoteHostClientServiceFactory.RemoteHostClientService)this.Workspace.Services.GetService<IRemoteHostClientService>()).Disable(); } } }
TyOverby/roslyn
src/VisualStudio/Core/Def/Implementation/LanguageService/AbstractPackage`2.cs
C#
apache-2.0
7,493
# Opuntia corrugata subsp. corrugata SUBSPECIES #### Status ACCEPTED #### According to NUB Generator [autonym] #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Cactaceae/Opuntia/Opuntia corrugata/Opuntia corrugata corrugata/README.md
Markdown
apache-2.0
179
package logh import ( "encoding/json" "net/http" "net/http/httptest" "net/url" "testing" "time" "github.com/dilfish/tools/io" ) func TestRequestToInfo(t *testing.T) { var req http.Request tx := time.Now() req.Method = "POST" req.URL = &url.URL{} req.URL.Path = "/test" req.RemoteAddr = "1.1.1.1" ri := RequestToInfo(&req, tx) if ri.Time != tx { t.Error("requestinfo.t error", ri.Time, t) } if ri.ClientIP != "1.1.1.1" { t.Error("bad clientip", ri.ClientIP, "1.1.1.1") } if ri.Path != req.URL.Path { t.Error("bad path", ri.Path, req.URL.Path) } if ri.Method != req.Method { t.Error("bad method", ri.Method, req.Method) } req.RemoteAddr = "1.1.1.1:2222" ri = RequestToInfo(&req, tx) if ri.ClientIP != "1.1.1.1" { t.Error("bad ip:port", ri.ClientIP, "1.1.1.1") } } func TestNewRequestLogger(t *testing.T) { get := "/get" post := "/post" rl := NewRequestLogger(post, get) if rl.PostUrl != post || rl.GetUrl != get { t.Error("bad get/post", rl, get, post) } var ei ErrInfo ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { bt, err := json.Marshal(ei) if err != nil { t.Error("marshal error:", err) } w.Write(bt) })) defer ts.Close() rl.PostUrl = ts.URL + "/post" req, err := http.NewRequest("POST", ts.URL+"/post", nil) if err != nil { t.Error("new request error:", err) } err = rl.PostOne(req) if err != nil { t.Error("post one error:", err) } rl.GetUrl = ts.URL + "/get" _, err = rl.GetStat(time.Now().Add(-time.Second), time.Now().Add(time.Second)) if err != nil { t.Error("get stat", err) } rl.PostUrl = "/post" rl.GetUrl = "/get" err = rl.PostOne(req) if err == nil { t.Error("bad post one", err) } _, err = rl.GetStat(time.Now().Add(-time.Second), time.Now().Add(time.Second)) if err == nil { t.Error("bad get one", err) } } func TestOpenReqLogDB(t *testing.T) { var conf MgoConfig err := io.ReadConfig("testdata/mongo.conf", &conf) if err != nil { t.Error("no such mgo config", err) } db := OpenReqLogDB(conf) if db == nil { t.Error("open mongo db error") } db.Close() conf.Username = "root" conf.Password = "ititititititiitiititititii" db = OpenReqLogDB(conf) if db != nil { t.Error("fake db open good:", db) } } func TestRequestLogger(t *testing.T) { var conf MgoConfig err := io.ReadConfig("testdata/mongo.conf", &conf) if err != nil { t.Error("read config error", err) } s := NewServeRequestLogger(conf) if s == nil { t.Error("new serve request error", err) } now := time.Now() var r RequestInfo r.Name = "test" r.Method = "POST" r.Path = "/do" r.ClientIP = "1.1.1.1" r.Time = now err = s.OneRequest(&r) if err != nil { t.Error("one request error", err) } _, err = s.GetStat(now.Add(-time.Second), now.Add(time.Second)) if err != nil { t.Error("get state error:", err) } }
dilfish/tools
logh/loghttp_test.go
GO
apache-2.0
2,858
# Chiloglottis chlorantha D.L.Jones SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Chiloglottis/Chiloglottis chlorantha/README.md
Markdown
apache-2.0
191
// Copyright 2020 The gVisor Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package testbench has utilities to send and receive packets, and also command // the DUT to run POSIX functions. It is the packetimpact test API. package testbench import ( "encoding/json" "flag" "fmt" "math/rand" "net" "testing" "time" ) var ( // Native indicates that the test is being run natively. Native = false // RPCKeepalive is the gRPC keepalive. RPCKeepalive = 10 * time.Second // dutInfosJSON is the json string that describes information about all the // duts available to use. dutInfosJSON string // dutInfo is the pool among which the testbench can choose a DUT to work // with. dutInfo chan *DUTInfo ) // DUTInfo has both network and uname information about the DUT. type DUTInfo struct { Uname *DUTUname Net *DUTTestNet } // DUTUname contains information about the DUT from uname. type DUTUname struct { Machine string KernelName string KernelRelease string KernelVersion string OperatingSystem string } // IsLinux returns true if the DUT is running Linux. func (n *DUTUname) IsLinux() bool { return Native && n.OperatingSystem == "GNU/Linux" } // IsGvisor returns true if the DUT is running gVisor. func (*DUTUname) IsGvisor() bool { return !Native } // IsFuchsia returns true if the DUT is running Fuchsia. func (n *DUTUname) IsFuchsia() bool { return Native && n.OperatingSystem == "Fuchsia" } // DUTTestNet describes the test network setup on dut and how the testbench // should connect with an existing DUT. type DUTTestNet struct { // LocalMAC is the local MAC address on the test network. LocalMAC net.HardwareAddr // RemoteMAC is the DUT's MAC address on the test network. RemoteMAC net.HardwareAddr // LocalIPv4 is the local IPv4 address on the test network. LocalIPv4 net.IP // RemoteIPv4 is the DUT's IPv4 address on the test network. RemoteIPv4 net.IP // IPv4PrefixLength is the network prefix length of the IPv4 test network. IPv4PrefixLength int // LocalIPv6 is the local IPv6 address on the test network. LocalIPv6 net.IP // RemoteIPv6 is the DUT's IPv6 address on the test network. RemoteIPv6 net.IP // LocalDevID is the ID of the local interface on the test network. LocalDevID uint32 // RemoteDevID is the ID of the remote interface on the test network. RemoteDevID uint32 // LocalDevName is the device that testbench uses to inject traffic. LocalDevName string // RemoteDevName is the device name on the DUT, individual tests can // use the name to construct tests. RemoteDevName string // The following two fields on actually on the control network instead // of the test network, including them for convenience. // POSIXServerIP is the POSIX server's IP address on the control network. POSIXServerIP net.IP // POSIXServerPort is the UDP port the POSIX server is bound to on the // control network. POSIXServerPort uint16 } // SubnetBroadcast returns the test network's subnet broadcast address. func (n *DUTTestNet) SubnetBroadcast() net.IP { addr := append([]byte(nil), n.RemoteIPv4...) mask := net.CIDRMask(n.IPv4PrefixLength, net.IPv4len*8) for i := range addr { addr[i] |= ^mask[i] } return addr } // registerFlags defines flags and associates them with the package-level // exported variables above. It should be called by tests in their init // functions. func registerFlags(fs *flag.FlagSet) { fs.BoolVar(&Native, "native", Native, "whether the test is running natively") fs.DurationVar(&RPCKeepalive, "rpc_keepalive", RPCKeepalive, "gRPC keepalive") fs.StringVar(&dutInfosJSON, "dut_infos_json", dutInfosJSON, "json that describes the DUTs") } // Initialize initializes the testbench, it parse the flags and sets up the // pool of test networks for testbench's later use. func Initialize(fs *flag.FlagSet) { testing.Init() registerFlags(fs) flag.Parse() if err := loadDUTInfos(); err != nil { panic(err) } } // loadDUTInfos loads available DUT test infos from the json file, it // must be called after flag.Parse(). func loadDUTInfos() error { var dutInfos []DUTInfo if err := json.Unmarshal([]byte(dutInfosJSON), &dutInfos); err != nil { return fmt.Errorf("failed to unmarshal JSON: %w", err) } if got, want := len(dutInfos), 1; got < want { return fmt.Errorf("got %d DUTs, the test requires at least %d DUTs", got, want) } // Using a buffered channel as semaphore dutInfo = make(chan *DUTInfo, len(dutInfos)) for i := range dutInfos { dutInfos[i].Net.LocalIPv4 = dutInfos[i].Net.LocalIPv4.To4() dutInfos[i].Net.RemoteIPv4 = dutInfos[i].Net.RemoteIPv4.To4() dutInfo <- &dutInfos[i] } return nil } // GenerateRandomPayload generates a random byte slice of the specified length, // causing a fatal test failure if it is unable to do so. func GenerateRandomPayload(t *testing.T, n int) []byte { t.Helper() buf := make([]byte, n) if _, err := rand.Read(buf); err != nil { t.Fatalf("rand.Read(buf) failed: %s", err) } return buf } // getDUTInfo returns information about an available DUT from the pool. If no // DUT is readily available, getDUTInfo blocks until one becomes available. func getDUTInfo() *DUTInfo { return <-dutInfo } // release returns the DUTInfo back to the pool. func (info *DUTInfo) release() { dutInfo <- info }
google/gvisor
test/packetimpact/testbench/testbench.go
GO
apache-2.0
5,814
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.23 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from kubernetes.client.configuration import Configuration class V1ServerAddressByClientCIDR(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ openapi_types = { 'client_cidr': 'str', 'server_address': 'str' } attribute_map = { 'client_cidr': 'clientCIDR', 'server_address': 'serverAddress' } def __init__(self, client_cidr=None, server_address=None, local_vars_configuration=None): # noqa: E501 """V1ServerAddressByClientCIDR - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration self._client_cidr = None self._server_address = None self.discriminator = None self.client_cidr = client_cidr self.server_address = server_address @property def client_cidr(self): """Gets the client_cidr of this V1ServerAddressByClientCIDR. # noqa: E501 The CIDR with which clients can match their IP to figure out the server address that they should use. # noqa: E501 :return: The client_cidr of this V1ServerAddressByClientCIDR. # noqa: E501 :rtype: str """ return self._client_cidr @client_cidr.setter def client_cidr(self, client_cidr): """Sets the client_cidr of this V1ServerAddressByClientCIDR. The CIDR with which clients can match their IP to figure out the server address that they should use. # noqa: E501 :param client_cidr: The client_cidr of this V1ServerAddressByClientCIDR. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_validation and client_cidr is None: # noqa: E501 raise ValueError("Invalid value for `client_cidr`, must not be `None`") # noqa: E501 self._client_cidr = client_cidr @property def server_address(self): """Gets the server_address of this V1ServerAddressByClientCIDR. # noqa: E501 Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port. # noqa: E501 :return: The server_address of this V1ServerAddressByClientCIDR. # noqa: E501 :rtype: str """ return self._server_address @server_address.setter def server_address(self, server_address): """Sets the server_address of this V1ServerAddressByClientCIDR. Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port. # noqa: E501 :param server_address: The server_address of this V1ServerAddressByClientCIDR. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_validation and server_address is None: # noqa: E501 raise ValueError("Invalid value for `server_address`, must not be `None`") # noqa: E501 self._server_address = server_address def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items() )) else: result[attr] = value return result def to_str(self): """Returns the string representation of the model""" return pprint.pformat(self.to_dict()) def __repr__(self): """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, V1ServerAddressByClientCIDR): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" if not isinstance(other, V1ServerAddressByClientCIDR): return True return self.to_dict() != other.to_dict()
kubernetes-client/python
kubernetes/client/models/v1_server_address_by_client_cidr.py
Python
apache-2.0
5,238
/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // identity function for calling harmony imports with the correct context /******/ __webpack_require__.i = function(value) { return value; }; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 4); /******/ }) /************************************************************************/ /******/ ([ /* 0 */, /* 1 */, /* 2 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 3 */, /* 4 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(2); /***/ }) /******/ ]); //# sourceMappingURL=Bootstrap.js.map
DBosley/BOOTSTRA.386
dist/Bootstrap.js
JavaScript
apache-2.0
2,853
<!DOCTYPE html> <html lang="en"> <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="format-detection" content="telephone=no"/> <title>北京纵横马术-北京马术|北京儿童骑马|北京儿童马术</title> <meta name="keywords" content="北京马术,北京儿童骑马,北京儿童马术"> <meta name="description" content="北京纵横马术俱乐部专注于北京儿童马术,青少年马术培训"> <link rel="icon" href="/favicon.png" type="image/png"> <link rel="shortcut icon" href="/favicon.ico" type="img/x-icon"> <!-- Bootstrap --> <link href="/css/bootstrap.min.css" rel="stylesheet"> <link href="/css/font-awesome.min.css" rel="stylesheet"> <link href="/css/animate.min.css" rel="stylesheet"> <link href="/css/prettyPhoto.css" rel="stylesheet"> <link href="/css/style.css" rel="stylesheet"/> </head> <body> <header> <nav class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse.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="brand"> <a href="/"><img src="/images/logo.png" align="left"> <h3><span></span>北京纵横马术</h3></a> </div> </div> <div class="navbar-collapse collapse"> <div class="menu"> <ul class="nav nav-tabs" role="tablist"> <!--轮播图,马场,教练,新闻 等综合信息 展示--> <li role="presentation"><a href="/" data-toggle="collapse" data-target=".navbar-collapse.collapse.in">&nbsp;&nbsp;首&nbsp;&nbsp;页&nbsp;&nbsp;&nbsp;</a> </li> <!--俱乐部,马场介绍,教练团队--> <li role="presentation"><a href="/html/farms.html" data-toggle="collapse" data-target=".navbar-collapse.collapse.in">马场介绍</a></li> <li role="presentation"><a href="/html/coach/coach_fengtai.html" data-toggle="collapse" data-target=".navbar-collapse.collapse.in">教练团队</a></li> <li role="presentation"><a href="/html/show/show_vip.html" data-toggle="collapse" data-target=".navbar-collapse.collapse.in">会员风采</a></li> <li role="presentation"><a href="/html/vip.html" data-toggle="collapse" data-target=".navbar-collapse.collapse.in">会员价格</a></li> <li role="presentation"><a href="/html/contact.html" data-toggle="collapse" data-target=".navbar-collapse.collapse.in">联系我们</a></li> </ul> </div> </div> </div> </div> </nav> </header> <section id="main-slider" class="no-margin"> <div class="carousel slide"> <div class="carousel-inner"> <div class="item active" style="background-image: url(https://caoxile.oss-cn-beijing.aliyuncs.com/zhmsclub/images/background.jpg);"> <!--<div class="container">--> <!--<div class="row slide-margin">--> <!--<div class="col-sm-8">--> <!--<div class="carousel-content">--> <!--</div>--> <!--</div>--> <!--</div>--> <!--</div>--> </div><!--/.item--> </div><!--/.carousel-inner--> </div><!--/.carousel--> </section><!--/#main-slider--> <section id="portfolio" ng-controller="showDiaryController"> <div class="container"> <div class="text-center header-top"> <ul class="pagination pagination-lg"> <li><a href="/html/show/show_vip.html">精彩会员</a></li> <li><a href="/html/show/show_video.html">马术视频</a></li> <li class="active"><a href="/html/show/show_diary.html">会员日记</a></li> </ul><!--/.pagination--> </div> </div> <div class="container"> <div class="row diary-list diary-row"> <div class="diary-content"> <div class="col-md-4 col-sm-4 col-xs-4 diary-left"> <a href="/html/show/diaries/20170701.html"><img class="img-responsive" src="/images/diary/20170701/1.jpg"/></a> </div> <div class="col-md-8 col-sm-8 col-xs-8 diary-right"> <div class="title"><a href="/html/show/diaries/20170701.html">花钱给孩子练体育,美国家长是怎么说的</a></div> 一位叫Dave Fulk的企业家、作家上个月在Linkdedin领英网络上发了一个帖子,解释为什么花那么多钱让孩子学体育项目。帖子很快获得上百评论,上千个赞。各位家长可以看看是否和您想的一样。 </div> </div> </div> <div class="row diary-list diary-row"> <div class="diary-content"> <div class="col-md-4 col-sm-4 col-xs-4 diary-left"> <a href="/html/show/diaries/20170702.html"><img class="img-responsive" src="/images/diary/20170702/1.jpg"/></a> </div> <div class="col-md-8 col-sm-8 col-xs-8 diary-right"> <div class="title"><a href="/html/show/diaries/20170702.html">马术成名校敲门砖</a></div> 最近5-10年来,马术运动在中国呈现了爆发式的增长,特别是在一二线城市,越来越多的家长送孩子去学马术,越来越多的马术俱乐部也涌现出来,据不完全统计,国内目前已有900多家马术俱乐部,马术这项原本被视为贵族运动的体育项目,正在逐渐走进更多中国家庭。 </div> </div> </div> <div class="row diary-list diary-row"> <div class="diary-content"> <div class="col-md-4 col-sm-4 col-xs-4 diary-left"> <a href="/html/show/diaries/20170801.html"><img class="img-responsive" src="/images/diary/20170801/0.jpg"/></a> </div> <div class="col-md-8 col-sm-8 col-xs-8 diary-right"> <div class="title"><a href="/html/show/diaries/20170801.html">马术夏令营大揭秘——食宿篇</a></div> 由纵横马术主办的超豪华五星级马术夏令营将于7月16日正式开营。<br> 当孩子结束了一天的马术学习,最大的愿望一定是回到住处好好休息一番。我们特意选择了位于马场不远处的南宫温泉度假酒店,舒适的环境、一流的服务,让孩子们住的开心,家长们放心。 </div> </div> </div> <div class="row diary-list diary-row"> <div class="diary-content"> <div class="col-md-4 col-sm-4 col-xs-4 diary-left"> <a href="/html/show/diaries/20170802.html"><img class="img-responsive" src="/images/diary/20170802/1.jpg"/></a> </div> <div class="col-md-8 col-sm-8 col-xs-8 diary-right"> <div class="title"><a href="/html/show/diaries/20170802.html">马术,我的最爱——纵横会员George奇</a></div> 在我很小的时候,爸爸妈妈就曾带着我去草原骑马,从那时起我对马就有一种天生的亲近与喜爱。但是,对于生活在城市的孩子而言,去草原骑马是只有在假期中才能享受的乐趣,这让我苦恼不堪... </div> </div> </div> <div class="row diary-list diary-row"> <div class="diary-content"> <div class="col-md-4 col-sm-4 col-xs-4 diary-left"> <a href="/html/show/diaries/20170803.html"><img class="img-responsive" src="/images/diary/20170803/1.jpeg"/></a> </div> <div class="col-md-8 col-sm-8 col-xs-8 diary-right"> <div class="title"><a href="/html/show/diaries/20170803.html">2017年“未来之星”纵横的成绩单</a></div> “未来之星”马术大赛创办于2014年,致力于为中国潜力骑手(青少年)与潜力马(5-7岁)打造专属年轻人马的国际交流平台,已在北京连续三年举办过总决赛。为了促进中外优秀骑手的交流与学习,“未来之星”马术大赛已经邀请过逾20名外国青少年... </div> </div> </div> <div class="row diary-list diary-row"> <div class="diary-content"> <div class="col-md-4 col-sm-4 col-xs-4 diary-left"> <a href="/html/show/diaries/20170901.html"><img class="img-responsive" src="/images/diary/20170901/1.jpeg"/></a> </div> <div class="col-md-8 col-sm-8 col-xs-8 diary-right"> <div class="title"><a href="/html/show/diaries/20170901.html">异地马术情——纵横会员遥遥</a></div> 阳光明媚,万里无云 微风徐徐,绿树成荫 此刻的我正坐在马背上,享受着骑马的快乐。马儿在场地上一圈圈地快步着,而我坐在马背上随着马儿运动做出“起坐”的动作。迎着徐徐微风,伴着暖暖阳光,此刻的心情,妙不可言。 </div> </div> </div> <div class="row diary-list diary-row"> <div class="diary-content"> <div class="col-md-4 col-sm-4 col-xs-4 diary-left"> <a href="/html/show/diaries/20170902.html"><img class="img-responsive" src="/images/diary/20170902/15.jpeg"/></a> </div> <div class="col-md-8 col-sm-8 col-xs-8 diary-right"> <div class="title"><a href="/html/show/diaries/20170902.html">马术进校园——我们来上马术课了</a></div> 马术进校园,小骑士展风采 九月,阳光温馨恬静,微风和煦轻柔,蓝天白云飘逸.来自北京实验二小怡海分校CISA学员踏进纵横马术俱乐部参加每周一次的马术课程学习。 到达俱乐部后,同学们井然有序地取装备穿装备,进行骑马前的准备工作。 </div> </div> </div> <div class="row diary-list diary-row"> <div class="diary-content"> <div class="col-md-4 col-sm-4 col-xs-4 diary-left"> <a href="/html/show/diaries/20170903.html"><img class="img-responsive" src="/images/diary/20170903/1.jpeg"/></a> </div> <div class="col-md-8 col-sm-8 col-xs-8 diary-right"> <div class="title"><a href="/html/show/diaries/20170903.html">黄金周,共享马术盛宴</a></div> 浪琴表国际马联(FEI)场地障碍世界杯-中国联赛由国际马术联合会(FEI)、国家体育总局自行车击剑运动管理中心、中国马术协会、中国国际文化交流中心、北京市体育总会主办,华夏新国际体育娱乐(北京)有限公司连续七年倾力打造的国际马联CSI三星级赛事。 </div> </div> </div> <div class="row diary-list diary-row"> <div class="diary-content"> <div class="col-md-4 col-sm-4 col-xs-4 diary-left"> <a href="/html/show/diaries/20180201.html"><img class="img-responsive" src="/images/diary/20180201/1.jpeg"/></a> </div> <div class="col-md-8 col-sm-8 col-xs-8 diary-right"> <div class="title"><a href="/html/show/diaries/20180201.html">马术"初见"</a></div> 冬去春来的暖意,纵使迎风,亦是融融的和煦。浅春三月,依旧草色如烟,凉风习习,从冬到春,守候的方向,是心的方向,琉璃剔透.若念春,便是草长莺飞,它在我低眉的那一瞬间,轻轻的,轻轻的,栖上了窗外的枝头,太阳升起的时刻,我将以最和煦的方式,悄悄向你靠近,待春风吹绿了柳岸,吹红了枝头,让我们一起看春暖花开 </div> </div> </div> <div class="row diary-list diary-row"> <div class="diary-content"> <div class="col-md-4 col-sm-4 col-xs-4 diary-left"> <a href="/html/show/diaries/20180301.html"><img class="img-responsive" src="/images/diary/20180301/1.jpeg"/></a> </div> <div class="col-md-8 col-sm-8 col-xs-8 diary-right"> <div class="title"><a href="/html/show/diaries/20180301.html">怎样确保学习马术的孩子们的安全?</a></div> 这些年,随着社会经济的发展,国内学习马术的人越来越多,青少年马术也是蓬勃发展,但是有一个问题是青少年马术发展中必须严肃面对的,那就是安全问题,怎么样确保青少年学习马术时的安全? </div> </div> </div> </div> <div class="container"> <div class="text-center"> <ul class="pagination pagination-lg"> <li><a href="/html/show/show_diary_2.html">上一页</a></li> <li><a href="/html/show/show_diary.html">1</a></li> <li><a href="/html/show/show_diary_2.html">2</a></li> <li class="active"><a href="/html/show/show_diary_3.html">3</a></li> <li><a href="/html/show/show_diary_4.html">4</a></li> <li><a href="/html/show/show_diary_5.html">5</a></li> <li><a href="/html/show/show_diary_5.html">下一页</a></li> </ul><!--/.pagination--> </div> </div> </section><!--/#portfolio-item--> <section id="conatcat-info"> <div class="container"> <div class="row"> <div class="col-sm-8 col-md-offset-1"> <div class="wow fadeInDown" data-wow-duration="1000ms" data-wow-delay="600ms"> <div class="col-md-5" align="center"> <a href="#" data-target="#contactmodal" data-toggle="modal"> <img align="center" src="/images/kefu.png"> </a> </div> <div class="col-md-6 col-md-offset-1"> <div class="contact-info-bottom phone clearfix"> <h4><i class="fa fa-phone"></i>电话:</h4> <span><a href="tel:18610520903">18610520903</a></span> </div> <div class="contact-info-bottom hours clearfix"> <h4><i class="fa fa-weibo"></i>微博:</h4> <span><a href="https://weibo.com/caoxile">北京纵横马术</a></span> </div> <div class="contact-info-bottom email clearfix"> <h4><i class="fa fa-weixin"></i>微信:</h4> <span>18610520903</span> </div> </div> </div> </div> </div> </div><!--/.container--> <footer> <hr style="border:0;background-color:#665544;height:1px;"> <div class="footer"> <div class="container"> <div class="inner-font" align="center"> &copy; Copyright(c)2018 纵横百年(北京)马术有限公司版权所有 </div> </div> <div class="side-left"> <div class="side-box"><img src="/images/logo/phone.png"><a href="tel:18610520903">18610520903(拨打)</a> </div> </div> <div class="side-right"> <a href="#" data-target="#contactmodal" data-toggle="modal"> <div class="side-box">免费体验</div> </a> </div> <div class="pull-right"> <!--<a href="#home" class="scrollup"><i class="fa fa-angle-up fa-3x"></i></a>--> </div> </div> </footer> </section><!--/#conatcat-info--> <!--Modal--> <div class="modal fade" id="ajax" role="basic" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> </div> </div> </div> <!--/Modal--> <!--image Modal--> <div class="modal fade" id="imagemodal" role="basic" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h6 class="modal-title">&nbsp;</h6> </div> <div class="modal-body"> <img id="imagepreview" src="" class="img-responsive"> </div> </div> </div> </div> <!--/image Modal--> <!--appointment Modal--> <div class="modal fade" id="contactmodal" role="basic" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h5 class="modal-title">&nbsp;<b>免费体验</b></h5></div> <div class="modal-body"> <!-- send contact form --> <form> <div class="panel panel-body login-form"> <div class="text-center"><h5><b>恭喜您获得一次免费的马术体验机会!</b></h5> <br></div> <div><b>体验说明</b></div> <div>年龄: 3~60岁</div> <div>时间: 50分钟左右</div> <div>活动: 马房参观,马儿互动,马背骑乘,马术讲解</div> <div>安全: 马场提供专业马术装备,一对一教练指导</div> <br> <div class="form-group has-feedback has-feedback-left"><input type="text" class="form-control" placeholder="姓名" name="user_name"> <div class="form-control-feedback"><i class="fa fa-user text-muted"></i></div> </div> <div class="form-group has-feedback has-feedback-left"><input type="text" class="form-control" placeholder="电话(必填)" name="user_phone"> <div class="form-control-feedback"><i class="fa fa-phone text-muted"></i></div> </div> <div class="form-group has-feedback has-feedback-left"><input type="text" class="form-control" placeholder="年龄(骑乘人)" name="user_age"> <div class="form-control-feedback"><i class="fa fa-child text-muted"></i></div> </div> <div class="form-group"> <button id="sendMail" type="button" class="btn btn-primary btn-block base-background">预 约 </button> </div> </div> </form> <!-- /send contact form --> </div> </div> </div> </div><!--/appointment Modal--> </body> <!--js--> <script src="/js/jquery.min.js"></script> <script src="/js/jquery.isotope.min.js"></script> <script src="/js/jquery.prettyPhoto.js"></script> <script src="/js/bootstrap.min.js"></script> <script src="/js/functions.js"></script> <!--/js--> </html>
caoxile/QslmClub
html/show/show_diary_3.html
HTML
apache-2.0
21,853
// // 이 파일은 JAXB(JavaTM Architecture for XML Binding) 참조 구현 2.2.6 버전을 통해 생성되었습니다. // <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>를 참조하십시오. // 이 파일을 수정하면 소스 스키마를 재컴파일할 때 수정 사항이 손실됩니다. // 생성 날짜: 2012.09.05 시간 05:10:33 PM KST // package com.athena.chameleon.engine.entity.xml.webapp.v2_3; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlID; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "listenerClass" }) @XmlRootElement(name = "listener") public class Listener { @XmlAttribute(name = "id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID protected String id; @XmlElement(name = "listener-class", required = true) protected ListenerClass listenerClass; /** * id 속성의 값을 가져옵니다. * * @return * possible object is * {@link String } * */ public String getId() { return id; } /** * id 속성의 값을 설정합니다. * * @param value * allowed object is * {@link String } * */ public void setId(String value) { this.id = value; } /** * listenerClass 속성의 값을 가져옵니다. * * @return * possible object is * {@link ListenerClass } * */ public ListenerClass getListenerClass() { return listenerClass; } /** * listenerClass 속성의 값을 설정합니다. * * @param value * allowed object is * {@link ListenerClass } * */ public void setListenerClass(ListenerClass value) { this.listenerClass = value; } }
OpenSourceConsulting/athena-chameleon
src/main/java/com/athena/chameleon/engine/entity/xml/webapp/v2_3/Listener.java
Java
apache-2.0
2,334
/* * Copyright © 2013-2018 camunda services GmbH and various authors (info@camunda.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.camunda.bpm.engine.rest.spi.impl; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.camunda.bpm.engine.CaseService; import org.camunda.bpm.engine.ExternalTaskService; import org.camunda.bpm.engine.FilterService; import org.camunda.bpm.engine.FormService; import org.camunda.bpm.engine.HistoryService; import org.camunda.bpm.engine.IdentityService; import org.camunda.bpm.engine.ManagementService; import org.camunda.bpm.engine.ProcessEngine; import org.camunda.bpm.engine.ProcessEngineConfiguration; import org.camunda.bpm.engine.RepositoryService; import org.camunda.bpm.engine.RuntimeService; import org.camunda.bpm.engine.TaskService; import org.camunda.bpm.engine.impl.variable.ValueTypeResolverImpl; import org.camunda.bpm.engine.rest.helper.MockProvider; import org.camunda.bpm.engine.rest.spi.ProcessEngineProvider; import org.camunda.bpm.engine.variable.type.ValueTypeResolver; public class MockedProcessEngineProvider implements ProcessEngineProvider { private static ProcessEngine cachedDefaultProcessEngine; private static Map<String, ProcessEngine> cachedEngines = new HashMap<String, ProcessEngine>(); public void resetEngines() { cachedDefaultProcessEngine = null; cachedEngines = new HashMap<String, ProcessEngine>(); } private ProcessEngine mockProcessEngine(String engineName) { ProcessEngine engine = mock(ProcessEngine.class); when(engine.getName()).thenReturn(engineName); mockServices(engine); mockProcessEngineConfiguration(engine); return engine; } private void mockServices(ProcessEngine engine) { RepositoryService repoService = mock(RepositoryService.class); IdentityService identityService = mock(IdentityService.class); TaskService taskService = mock(TaskService.class); RuntimeService runtimeService = mock(RuntimeService.class); FormService formService = mock(FormService.class); HistoryService historyService = mock(HistoryService.class); ManagementService managementService = mock(ManagementService.class); CaseService caseService = mock(CaseService.class); FilterService filterService = mock(FilterService.class); ExternalTaskService externalTaskService = mock(ExternalTaskService.class); when(engine.getRepositoryService()).thenReturn(repoService); when(engine.getIdentityService()).thenReturn(identityService); when(engine.getTaskService()).thenReturn(taskService); when(engine.getRuntimeService()).thenReturn(runtimeService); when(engine.getFormService()).thenReturn(formService); when(engine.getHistoryService()).thenReturn(historyService); when(engine.getManagementService()).thenReturn(managementService); when(engine.getCaseService()).thenReturn(caseService); when(engine.getFilterService()).thenReturn(filterService); when(engine.getExternalTaskService()).thenReturn(externalTaskService); } protected void mockProcessEngineConfiguration(ProcessEngine engine) { ProcessEngineConfiguration configuration = mock(ProcessEngineConfiguration.class); when(configuration.getValueTypeResolver()).thenReturn(mockValueTypeResolver()); when(engine.getProcessEngineConfiguration()).thenReturn(configuration); } protected ValueTypeResolver mockValueTypeResolver() { // no true mock here, but the impl class is a simple container and should be safe to use return new ValueTypeResolverImpl(); } @Override public ProcessEngine getDefaultProcessEngine() { if (cachedDefaultProcessEngine == null) { cachedDefaultProcessEngine = mockProcessEngine("default"); } return cachedDefaultProcessEngine; } @Override public ProcessEngine getProcessEngine(String name) { if (name.equals(MockProvider.NON_EXISTING_PROCESS_ENGINE_NAME)) { return null; } if (name.equals("default")) { return getDefaultProcessEngine(); } if (cachedEngines.get(name) == null) { ProcessEngine mock = mockProcessEngine(name); cachedEngines.put(name, mock); } return cachedEngines.get(name); } @Override public Set<String> getProcessEngineNames() { Set<String> result = new HashSet<String>(); result.add(MockProvider.EXAMPLE_PROCESS_ENGINE_NAME); result.add(MockProvider.ANOTHER_EXAMPLE_PROCESS_ENGINE_NAME); return result; } }
xasx/camunda-bpm-platform
engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/spi/impl/MockedProcessEngineProvider.java
Java
apache-2.0
5,092
using Sputnik.Selenium; namespace Sputnik.Core.Commands { public class GotoCommand { /// <summary> /// Will navigate to the Url set on a page's Url property /// </summary> /// <param name="Url">The Url to navigate to</param> public void ByUrl(string Url) { Driver.Instance.Navigate().GoToUrl(Url); } } }
JotaAlava/Sputnik
Sputnik/Commands/GotoCommand.cs
C#
apache-2.0
388
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @author Alexey A. Petrenko */ package com.google.code.appengine.awt; import com.google.code.appengine.awt.Shape; /** * Stroke * */ public interface Stroke { public Shape createStrokedShape(Shape p); }
mike10004/appengine-imaging
gaecompat-awt-imaging/src/awt/com/google/code/appengine/awt/Stroke.java
Java
apache-2.0
1,061
/** * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.facebook.buck.artifact_cache.thrift; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) @javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") public class ArtifactMetadata implements org.apache.thrift.TBase<ArtifactMetadata, ArtifactMetadata._Fields>, java.io.Serializable, Cloneable, Comparable<ArtifactMetadata> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ArtifactMetadata"); private static final org.apache.thrift.protocol.TField RULE_KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("ruleKeys", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("metadata", org.apache.thrift.protocol.TType.MAP, (short)2); private static final org.apache.thrift.protocol.TField BUILD_TARGET_FIELD_DESC = new org.apache.thrift.protocol.TField("buildTarget", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField REPOSITORY_FIELD_DESC = new org.apache.thrift.protocol.TField("repository", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField ARTIFACT_PAYLOAD_CRC32_FIELD_DESC = new org.apache.thrift.protocol.TField("artifactPayloadCrc32", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField SCHEDULE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scheduleType", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.protocol.TField ARTIFACT_PAYLOAD_MD5_FIELD_DESC = new org.apache.thrift.protocol.TField("artifactPayloadMd5", org.apache.thrift.protocol.TType.STRING, (short)7); private static final org.apache.thrift.protocol.TField DISTRIBUTED_BUILD_MODE_ENABLED_FIELD_DESC = new org.apache.thrift.protocol.TField("distributedBuildModeEnabled", org.apache.thrift.protocol.TType.BOOL, (short)8); private static final org.apache.thrift.protocol.TField PRODUCER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("producerId", org.apache.thrift.protocol.TType.STRING, (short)9); private static final org.apache.thrift.protocol.TField BUILD_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("buildTimeMs", org.apache.thrift.protocol.TType.I64, (short)10); private static final org.apache.thrift.protocol.TField PRODUCER_HOSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("producerHostname", org.apache.thrift.protocol.TType.STRING, (short)11); private static final org.apache.thrift.protocol.TField SIZE_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("sizeBytes", org.apache.thrift.protocol.TType.I64, (short)12); private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.STRING, (short)13); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ArtifactMetadataStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ArtifactMetadataTupleSchemeFactory(); public @org.apache.thrift.annotation.Nullable java.util.List<RuleKey> ruleKeys; // optional public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> metadata; // optional public @org.apache.thrift.annotation.Nullable java.lang.String buildTarget; // optional public @org.apache.thrift.annotation.Nullable java.lang.String repository; // optional public @org.apache.thrift.annotation.Nullable java.lang.String artifactPayloadCrc32; // optional public @org.apache.thrift.annotation.Nullable java.lang.String scheduleType; // optional public @org.apache.thrift.annotation.Nullable java.lang.String artifactPayloadMd5; // optional public boolean distributedBuildModeEnabled; // optional public @org.apache.thrift.annotation.Nullable java.lang.String producerId; // optional public long buildTimeMs; // optional public @org.apache.thrift.annotation.Nullable java.lang.String producerHostname; // optional public long sizeBytes; // optional public @org.apache.thrift.annotation.Nullable java.lang.String configuration; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { RULE_KEYS((short)1, "ruleKeys"), METADATA((short)2, "metadata"), BUILD_TARGET((short)3, "buildTarget"), REPOSITORY((short)4, "repository"), ARTIFACT_PAYLOAD_CRC32((short)5, "artifactPayloadCrc32"), SCHEDULE_TYPE((short)6, "scheduleType"), ARTIFACT_PAYLOAD_MD5((short)7, "artifactPayloadMd5"), DISTRIBUTED_BUILD_MODE_ENABLED((short)8, "distributedBuildModeEnabled"), PRODUCER_ID((short)9, "producerId"), BUILD_TIME_MS((short)10, "buildTimeMs"), PRODUCER_HOSTNAME((short)11, "producerHostname"), SIZE_BYTES((short)12, "sizeBytes"), CONFIGURATION((short)13, "configuration"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // RULE_KEYS return RULE_KEYS; case 2: // METADATA return METADATA; case 3: // BUILD_TARGET return BUILD_TARGET; case 4: // REPOSITORY return REPOSITORY; case 5: // ARTIFACT_PAYLOAD_CRC32 return ARTIFACT_PAYLOAD_CRC32; case 6: // SCHEDULE_TYPE return SCHEDULE_TYPE; case 7: // ARTIFACT_PAYLOAD_MD5 return ARTIFACT_PAYLOAD_MD5; case 8: // DISTRIBUTED_BUILD_MODE_ENABLED return DISTRIBUTED_BUILD_MODE_ENABLED; case 9: // PRODUCER_ID return PRODUCER_ID; case 10: // BUILD_TIME_MS return BUILD_TIME_MS; case 11: // PRODUCER_HOSTNAME return PRODUCER_HOSTNAME; case 12: // SIZE_BYTES return SIZE_BYTES; case 13: // CONFIGURATION return CONFIGURATION; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; private final java.lang.String _fieldName; _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final int __DISTRIBUTEDBUILDMODEENABLED_ISSET_ID = 0; private static final int __BUILDTIMEMS_ISSET_ID = 1; private static final int __SIZEBYTES_ISSET_ID = 2; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.RULE_KEYS,_Fields.METADATA,_Fields.BUILD_TARGET,_Fields.REPOSITORY,_Fields.ARTIFACT_PAYLOAD_CRC32,_Fields.SCHEDULE_TYPE,_Fields.ARTIFACT_PAYLOAD_MD5,_Fields.DISTRIBUTED_BUILD_MODE_ENABLED,_Fields.PRODUCER_ID,_Fields.BUILD_TIME_MS,_Fields.PRODUCER_HOSTNAME,_Fields.SIZE_BYTES,_Fields.CONFIGURATION}; 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.RULE_KEYS, new org.apache.thrift.meta_data.FieldMetaData("ruleKeys", org.apache.thrift.TFieldRequirementType.OPTIONAL, 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, RuleKey.class)))); tmpMap.put(_Fields.METADATA, new org.apache.thrift.meta_data.FieldMetaData("metadata", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); tmpMap.put(_Fields.BUILD_TARGET, new org.apache.thrift.meta_data.FieldMetaData("buildTarget", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.REPOSITORY, new org.apache.thrift.meta_data.FieldMetaData("repository", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.ARTIFACT_PAYLOAD_CRC32, new org.apache.thrift.meta_data.FieldMetaData("artifactPayloadCrc32", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.SCHEDULE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("scheduleType", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.ARTIFACT_PAYLOAD_MD5, new org.apache.thrift.meta_data.FieldMetaData("artifactPayloadMd5", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DISTRIBUTED_BUILD_MODE_ENABLED, new org.apache.thrift.meta_data.FieldMetaData("distributedBuildModeEnabled", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.PRODUCER_ID, new org.apache.thrift.meta_data.FieldMetaData("producerId", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.BUILD_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("buildTimeMs", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.PRODUCER_HOSTNAME, new org.apache.thrift.meta_data.FieldMetaData("producerHostname", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.SIZE_BYTES, new org.apache.thrift.meta_data.FieldMetaData("sizeBytes", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ArtifactMetadata.class, metaDataMap); } public ArtifactMetadata() { } /** * Performs a deep copy on <i>other</i>. */ public ArtifactMetadata(ArtifactMetadata other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetRuleKeys()) { java.util.List<RuleKey> __this__ruleKeys = new java.util.ArrayList<RuleKey>(other.ruleKeys.size()); for (RuleKey other_element : other.ruleKeys) { __this__ruleKeys.add(new RuleKey(other_element)); } this.ruleKeys = __this__ruleKeys; } if (other.isSetMetadata()) { java.util.Map<java.lang.String,java.lang.String> __this__metadata = new java.util.HashMap<java.lang.String,java.lang.String>(other.metadata); this.metadata = __this__metadata; } if (other.isSetBuildTarget()) { this.buildTarget = other.buildTarget; } if (other.isSetRepository()) { this.repository = other.repository; } if (other.isSetArtifactPayloadCrc32()) { this.artifactPayloadCrc32 = other.artifactPayloadCrc32; } if (other.isSetScheduleType()) { this.scheduleType = other.scheduleType; } if (other.isSetArtifactPayloadMd5()) { this.artifactPayloadMd5 = other.artifactPayloadMd5; } this.distributedBuildModeEnabled = other.distributedBuildModeEnabled; if (other.isSetProducerId()) { this.producerId = other.producerId; } this.buildTimeMs = other.buildTimeMs; if (other.isSetProducerHostname()) { this.producerHostname = other.producerHostname; } this.sizeBytes = other.sizeBytes; if (other.isSetConfiguration()) { this.configuration = other.configuration; } } public ArtifactMetadata deepCopy() { return new ArtifactMetadata(this); } @Override public void clear() { this.ruleKeys = null; this.metadata = null; this.buildTarget = null; this.repository = null; this.artifactPayloadCrc32 = null; this.scheduleType = null; this.artifactPayloadMd5 = null; setDistributedBuildModeEnabledIsSet(false); this.distributedBuildModeEnabled = false; this.producerId = null; setBuildTimeMsIsSet(false); this.buildTimeMs = 0; this.producerHostname = null; setSizeBytesIsSet(false); this.sizeBytes = 0; this.configuration = null; } public int getRuleKeysSize() { return (this.ruleKeys == null) ? 0 : this.ruleKeys.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator<RuleKey> getRuleKeysIterator() { return (this.ruleKeys == null) ? null : this.ruleKeys.iterator(); } public void addToRuleKeys(RuleKey elem) { if (this.ruleKeys == null) { this.ruleKeys = new java.util.ArrayList<RuleKey>(); } this.ruleKeys.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List<RuleKey> getRuleKeys() { return this.ruleKeys; } public ArtifactMetadata setRuleKeys(@org.apache.thrift.annotation.Nullable java.util.List<RuleKey> ruleKeys) { this.ruleKeys = ruleKeys; return this; } public void unsetRuleKeys() { this.ruleKeys = null; } /** Returns true if field ruleKeys is set (has been assigned a value) and false otherwise */ public boolean isSetRuleKeys() { return this.ruleKeys != null; } public void setRuleKeysIsSet(boolean value) { if (!value) { this.ruleKeys = null; } } public int getMetadataSize() { return (this.metadata == null) ? 0 : this.metadata.size(); } public void putToMetadata(java.lang.String key, java.lang.String val) { if (this.metadata == null) { this.metadata = new java.util.HashMap<java.lang.String,java.lang.String>(); } this.metadata.put(key, val); } @org.apache.thrift.annotation.Nullable public java.util.Map<java.lang.String,java.lang.String> getMetadata() { return this.metadata; } public ArtifactMetadata setMetadata(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> metadata) { this.metadata = metadata; return this; } public void unsetMetadata() { this.metadata = null; } /** Returns true if field metadata is set (has been assigned a value) and false otherwise */ public boolean isSetMetadata() { return this.metadata != null; } public void setMetadataIsSet(boolean value) { if (!value) { this.metadata = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getBuildTarget() { return this.buildTarget; } public ArtifactMetadata setBuildTarget(@org.apache.thrift.annotation.Nullable java.lang.String buildTarget) { this.buildTarget = buildTarget; return this; } public void unsetBuildTarget() { this.buildTarget = null; } /** Returns true if field buildTarget is set (has been assigned a value) and false otherwise */ public boolean isSetBuildTarget() { return this.buildTarget != null; } public void setBuildTargetIsSet(boolean value) { if (!value) { this.buildTarget = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getRepository() { return this.repository; } public ArtifactMetadata setRepository(@org.apache.thrift.annotation.Nullable java.lang.String repository) { this.repository = repository; return this; } public void unsetRepository() { this.repository = null; } /** Returns true if field repository is set (has been assigned a value) and false otherwise */ public boolean isSetRepository() { return this.repository != null; } public void setRepositoryIsSet(boolean value) { if (!value) { this.repository = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getArtifactPayloadCrc32() { return this.artifactPayloadCrc32; } public ArtifactMetadata setArtifactPayloadCrc32(@org.apache.thrift.annotation.Nullable java.lang.String artifactPayloadCrc32) { this.artifactPayloadCrc32 = artifactPayloadCrc32; return this; } public void unsetArtifactPayloadCrc32() { this.artifactPayloadCrc32 = null; } /** Returns true if field artifactPayloadCrc32 is set (has been assigned a value) and false otherwise */ public boolean isSetArtifactPayloadCrc32() { return this.artifactPayloadCrc32 != null; } public void setArtifactPayloadCrc32IsSet(boolean value) { if (!value) { this.artifactPayloadCrc32 = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getScheduleType() { return this.scheduleType; } public ArtifactMetadata setScheduleType(@org.apache.thrift.annotation.Nullable java.lang.String scheduleType) { this.scheduleType = scheduleType; return this; } public void unsetScheduleType() { this.scheduleType = null; } /** Returns true if field scheduleType is set (has been assigned a value) and false otherwise */ public boolean isSetScheduleType() { return this.scheduleType != null; } public void setScheduleTypeIsSet(boolean value) { if (!value) { this.scheduleType = null; } } @org.apache.thrift.annotation.Nullable public java.lang.String getArtifactPayloadMd5() { return this.artifactPayloadMd5; } public ArtifactMetadata setArtifactPayloadMd5(@org.apache.thrift.annotation.Nullable java.lang.String artifactPayloadMd5) { this.artifactPayloadMd5 = artifactPayloadMd5; return this; } public void unsetArtifactPayloadMd5() { this.artifactPayloadMd5 = null; } /** Returns true if field artifactPayloadMd5 is set (has been assigned a value) and false otherwise */ public boolean isSetArtifactPayloadMd5() { return this.artifactPayloadMd5 != null; } public void setArtifactPayloadMd5IsSet(boolean value) { if (!value) { this.artifactPayloadMd5 = null; } } public boolean isDistributedBuildModeEnabled() { return this.distributedBuildModeEnabled; } public ArtifactMetadata setDistributedBuildModeEnabled(boolean distributedBuildModeEnabled) { this.distributedBuildModeEnabled = distributedBuildModeEnabled; setDistributedBuildModeEnabledIsSet(true); return this; } public void unsetDistributedBuildModeEnabled() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DISTRIBUTEDBUILDMODEENABLED_ISSET_ID); } /** Returns true if field distributedBuildModeEnabled is set (has been assigned a value) and false otherwise */ public boolean isSetDistributedBuildModeEnabled() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DISTRIBUTEDBUILDMODEENABLED_ISSET_ID); } public void setDistributedBuildModeEnabledIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DISTRIBUTEDBUILDMODEENABLED_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getProducerId() { return this.producerId; } public ArtifactMetadata setProducerId(@org.apache.thrift.annotation.Nullable java.lang.String producerId) { this.producerId = producerId; return this; } public void unsetProducerId() { this.producerId = null; } /** Returns true if field producerId is set (has been assigned a value) and false otherwise */ public boolean isSetProducerId() { return this.producerId != null; } public void setProducerIdIsSet(boolean value) { if (!value) { this.producerId = null; } } public long getBuildTimeMs() { return this.buildTimeMs; } public ArtifactMetadata setBuildTimeMs(long buildTimeMs) { this.buildTimeMs = buildTimeMs; setBuildTimeMsIsSet(true); return this; } public void unsetBuildTimeMs() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BUILDTIMEMS_ISSET_ID); } /** Returns true if field buildTimeMs is set (has been assigned a value) and false otherwise */ public boolean isSetBuildTimeMs() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BUILDTIMEMS_ISSET_ID); } public void setBuildTimeMsIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BUILDTIMEMS_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getProducerHostname() { return this.producerHostname; } public ArtifactMetadata setProducerHostname(@org.apache.thrift.annotation.Nullable java.lang.String producerHostname) { this.producerHostname = producerHostname; return this; } public void unsetProducerHostname() { this.producerHostname = null; } /** Returns true if field producerHostname is set (has been assigned a value) and false otherwise */ public boolean isSetProducerHostname() { return this.producerHostname != null; } public void setProducerHostnameIsSet(boolean value) { if (!value) { this.producerHostname = null; } } public long getSizeBytes() { return this.sizeBytes; } public ArtifactMetadata setSizeBytes(long sizeBytes) { this.sizeBytes = sizeBytes; setSizeBytesIsSet(true); return this; } public void unsetSizeBytes() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SIZEBYTES_ISSET_ID); } /** Returns true if field sizeBytes is set (has been assigned a value) and false otherwise */ public boolean isSetSizeBytes() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SIZEBYTES_ISSET_ID); } public void setSizeBytesIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SIZEBYTES_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getConfiguration() { return this.configuration; } public ArtifactMetadata setConfiguration(@org.apache.thrift.annotation.Nullable java.lang.String configuration) { this.configuration = configuration; return this; } public void unsetConfiguration() { this.configuration = null; } /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ public boolean isSetConfiguration() { return this.configuration != null; } public void setConfigurationIsSet(boolean value) { if (!value) { this.configuration = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case RULE_KEYS: if (value == null) { unsetRuleKeys(); } else { setRuleKeys((java.util.List<RuleKey>)value); } break; case METADATA: if (value == null) { unsetMetadata(); } else { setMetadata((java.util.Map<java.lang.String,java.lang.String>)value); } break; case BUILD_TARGET: if (value == null) { unsetBuildTarget(); } else { setBuildTarget((java.lang.String)value); } break; case REPOSITORY: if (value == null) { unsetRepository(); } else { setRepository((java.lang.String)value); } break; case ARTIFACT_PAYLOAD_CRC32: if (value == null) { unsetArtifactPayloadCrc32(); } else { setArtifactPayloadCrc32((java.lang.String)value); } break; case SCHEDULE_TYPE: if (value == null) { unsetScheduleType(); } else { setScheduleType((java.lang.String)value); } break; case ARTIFACT_PAYLOAD_MD5: if (value == null) { unsetArtifactPayloadMd5(); } else { setArtifactPayloadMd5((java.lang.String)value); } break; case DISTRIBUTED_BUILD_MODE_ENABLED: if (value == null) { unsetDistributedBuildModeEnabled(); } else { setDistributedBuildModeEnabled((java.lang.Boolean)value); } break; case PRODUCER_ID: if (value == null) { unsetProducerId(); } else { setProducerId((java.lang.String)value); } break; case BUILD_TIME_MS: if (value == null) { unsetBuildTimeMs(); } else { setBuildTimeMs((java.lang.Long)value); } break; case PRODUCER_HOSTNAME: if (value == null) { unsetProducerHostname(); } else { setProducerHostname((java.lang.String)value); } break; case SIZE_BYTES: if (value == null) { unsetSizeBytes(); } else { setSizeBytes((java.lang.Long)value); } break; case CONFIGURATION: if (value == null) { unsetConfiguration(); } else { setConfiguration((java.lang.String)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case RULE_KEYS: return getRuleKeys(); case METADATA: return getMetadata(); case BUILD_TARGET: return getBuildTarget(); case REPOSITORY: return getRepository(); case ARTIFACT_PAYLOAD_CRC32: return getArtifactPayloadCrc32(); case SCHEDULE_TYPE: return getScheduleType(); case ARTIFACT_PAYLOAD_MD5: return getArtifactPayloadMd5(); case DISTRIBUTED_BUILD_MODE_ENABLED: return isDistributedBuildModeEnabled(); case PRODUCER_ID: return getProducerId(); case BUILD_TIME_MS: return getBuildTimeMs(); case PRODUCER_HOSTNAME: return getProducerHostname(); case SIZE_BYTES: return getSizeBytes(); case CONFIGURATION: return getConfiguration(); } 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 RULE_KEYS: return isSetRuleKeys(); case METADATA: return isSetMetadata(); case BUILD_TARGET: return isSetBuildTarget(); case REPOSITORY: return isSetRepository(); case ARTIFACT_PAYLOAD_CRC32: return isSetArtifactPayloadCrc32(); case SCHEDULE_TYPE: return isSetScheduleType(); case ARTIFACT_PAYLOAD_MD5: return isSetArtifactPayloadMd5(); case DISTRIBUTED_BUILD_MODE_ENABLED: return isSetDistributedBuildModeEnabled(); case PRODUCER_ID: return isSetProducerId(); case BUILD_TIME_MS: return isSetBuildTimeMs(); case PRODUCER_HOSTNAME: return isSetProducerHostname(); case SIZE_BYTES: return isSetSizeBytes(); case CONFIGURATION: return isSetConfiguration(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof ArtifactMetadata) return this.equals((ArtifactMetadata)that); return false; } public boolean equals(ArtifactMetadata that) { if (that == null) return false; if (this == that) return true; boolean this_present_ruleKeys = true && this.isSetRuleKeys(); boolean that_present_ruleKeys = true && that.isSetRuleKeys(); if (this_present_ruleKeys || that_present_ruleKeys) { if (!(this_present_ruleKeys && that_present_ruleKeys)) return false; if (!this.ruleKeys.equals(that.ruleKeys)) return false; } boolean this_present_metadata = true && this.isSetMetadata(); boolean that_present_metadata = true && that.isSetMetadata(); if (this_present_metadata || that_present_metadata) { if (!(this_present_metadata && that_present_metadata)) return false; if (!this.metadata.equals(that.metadata)) return false; } boolean this_present_buildTarget = true && this.isSetBuildTarget(); boolean that_present_buildTarget = true && that.isSetBuildTarget(); if (this_present_buildTarget || that_present_buildTarget) { if (!(this_present_buildTarget && that_present_buildTarget)) return false; if (!this.buildTarget.equals(that.buildTarget)) return false; } boolean this_present_repository = true && this.isSetRepository(); boolean that_present_repository = true && that.isSetRepository(); if (this_present_repository || that_present_repository) { if (!(this_present_repository && that_present_repository)) return false; if (!this.repository.equals(that.repository)) return false; } boolean this_present_artifactPayloadCrc32 = true && this.isSetArtifactPayloadCrc32(); boolean that_present_artifactPayloadCrc32 = true && that.isSetArtifactPayloadCrc32(); if (this_present_artifactPayloadCrc32 || that_present_artifactPayloadCrc32) { if (!(this_present_artifactPayloadCrc32 && that_present_artifactPayloadCrc32)) return false; if (!this.artifactPayloadCrc32.equals(that.artifactPayloadCrc32)) return false; } boolean this_present_scheduleType = true && this.isSetScheduleType(); boolean that_present_scheduleType = true && that.isSetScheduleType(); if (this_present_scheduleType || that_present_scheduleType) { if (!(this_present_scheduleType && that_present_scheduleType)) return false; if (!this.scheduleType.equals(that.scheduleType)) return false; } boolean this_present_artifactPayloadMd5 = true && this.isSetArtifactPayloadMd5(); boolean that_present_artifactPayloadMd5 = true && that.isSetArtifactPayloadMd5(); if (this_present_artifactPayloadMd5 || that_present_artifactPayloadMd5) { if (!(this_present_artifactPayloadMd5 && that_present_artifactPayloadMd5)) return false; if (!this.artifactPayloadMd5.equals(that.artifactPayloadMd5)) return false; } boolean this_present_distributedBuildModeEnabled = true && this.isSetDistributedBuildModeEnabled(); boolean that_present_distributedBuildModeEnabled = true && that.isSetDistributedBuildModeEnabled(); if (this_present_distributedBuildModeEnabled || that_present_distributedBuildModeEnabled) { if (!(this_present_distributedBuildModeEnabled && that_present_distributedBuildModeEnabled)) return false; if (this.distributedBuildModeEnabled != that.distributedBuildModeEnabled) return false; } boolean this_present_producerId = true && this.isSetProducerId(); boolean that_present_producerId = true && that.isSetProducerId(); if (this_present_producerId || that_present_producerId) { if (!(this_present_producerId && that_present_producerId)) return false; if (!this.producerId.equals(that.producerId)) return false; } boolean this_present_buildTimeMs = true && this.isSetBuildTimeMs(); boolean that_present_buildTimeMs = true && that.isSetBuildTimeMs(); if (this_present_buildTimeMs || that_present_buildTimeMs) { if (!(this_present_buildTimeMs && that_present_buildTimeMs)) return false; if (this.buildTimeMs != that.buildTimeMs) return false; } boolean this_present_producerHostname = true && this.isSetProducerHostname(); boolean that_present_producerHostname = true && that.isSetProducerHostname(); if (this_present_producerHostname || that_present_producerHostname) { if (!(this_present_producerHostname && that_present_producerHostname)) return false; if (!this.producerHostname.equals(that.producerHostname)) return false; } boolean this_present_sizeBytes = true && this.isSetSizeBytes(); boolean that_present_sizeBytes = true && that.isSetSizeBytes(); if (this_present_sizeBytes || that_present_sizeBytes) { if (!(this_present_sizeBytes && that_present_sizeBytes)) return false; if (this.sizeBytes != that.sizeBytes) return false; } boolean this_present_configuration = true && this.isSetConfiguration(); boolean that_present_configuration = true && that.isSetConfiguration(); if (this_present_configuration || that_present_configuration) { if (!(this_present_configuration && that_present_configuration)) return false; if (!this.configuration.equals(that.configuration)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetRuleKeys()) ? 131071 : 524287); if (isSetRuleKeys()) hashCode = hashCode * 8191 + ruleKeys.hashCode(); hashCode = hashCode * 8191 + ((isSetMetadata()) ? 131071 : 524287); if (isSetMetadata()) hashCode = hashCode * 8191 + metadata.hashCode(); hashCode = hashCode * 8191 + ((isSetBuildTarget()) ? 131071 : 524287); if (isSetBuildTarget()) hashCode = hashCode * 8191 + buildTarget.hashCode(); hashCode = hashCode * 8191 + ((isSetRepository()) ? 131071 : 524287); if (isSetRepository()) hashCode = hashCode * 8191 + repository.hashCode(); hashCode = hashCode * 8191 + ((isSetArtifactPayloadCrc32()) ? 131071 : 524287); if (isSetArtifactPayloadCrc32()) hashCode = hashCode * 8191 + artifactPayloadCrc32.hashCode(); hashCode = hashCode * 8191 + ((isSetScheduleType()) ? 131071 : 524287); if (isSetScheduleType()) hashCode = hashCode * 8191 + scheduleType.hashCode(); hashCode = hashCode * 8191 + ((isSetArtifactPayloadMd5()) ? 131071 : 524287); if (isSetArtifactPayloadMd5()) hashCode = hashCode * 8191 + artifactPayloadMd5.hashCode(); hashCode = hashCode * 8191 + ((isSetDistributedBuildModeEnabled()) ? 131071 : 524287); if (isSetDistributedBuildModeEnabled()) hashCode = hashCode * 8191 + ((distributedBuildModeEnabled) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetProducerId()) ? 131071 : 524287); if (isSetProducerId()) hashCode = hashCode * 8191 + producerId.hashCode(); hashCode = hashCode * 8191 + ((isSetBuildTimeMs()) ? 131071 : 524287); if (isSetBuildTimeMs()) hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(buildTimeMs); hashCode = hashCode * 8191 + ((isSetProducerHostname()) ? 131071 : 524287); if (isSetProducerHostname()) hashCode = hashCode * 8191 + producerHostname.hashCode(); hashCode = hashCode * 8191 + ((isSetSizeBytes()) ? 131071 : 524287); if (isSetSizeBytes()) hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(sizeBytes); hashCode = hashCode * 8191 + ((isSetConfiguration()) ? 131071 : 524287); if (isSetConfiguration()) hashCode = hashCode * 8191 + configuration.hashCode(); return hashCode; } @Override public int compareTo(ArtifactMetadata other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.valueOf(isSetRuleKeys()).compareTo(other.isSetRuleKeys()); if (lastComparison != 0) { return lastComparison; } if (isSetRuleKeys()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleKeys, other.ruleKeys); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.valueOf(isSetMetadata()).compareTo(other.isSetMetadata()); if (lastComparison != 0) { return lastComparison; } if (isSetMetadata()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadata, other.metadata); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.valueOf(isSetBuildTarget()).compareTo(other.isSetBuildTarget()); if (lastComparison != 0) { return lastComparison; } if (isSetBuildTarget()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.buildTarget, other.buildTarget); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.valueOf(isSetRepository()).compareTo(other.isSetRepository()); if (lastComparison != 0) { return lastComparison; } if (isSetRepository()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.repository, other.repository); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.valueOf(isSetArtifactPayloadCrc32()).compareTo(other.isSetArtifactPayloadCrc32()); if (lastComparison != 0) { return lastComparison; } if (isSetArtifactPayloadCrc32()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.artifactPayloadCrc32, other.artifactPayloadCrc32); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.valueOf(isSetScheduleType()).compareTo(other.isSetScheduleType()); if (lastComparison != 0) { return lastComparison; } if (isSetScheduleType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scheduleType, other.scheduleType); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.valueOf(isSetArtifactPayloadMd5()).compareTo(other.isSetArtifactPayloadMd5()); if (lastComparison != 0) { return lastComparison; } if (isSetArtifactPayloadMd5()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.artifactPayloadMd5, other.artifactPayloadMd5); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.valueOf(isSetDistributedBuildModeEnabled()).compareTo(other.isSetDistributedBuildModeEnabled()); if (lastComparison != 0) { return lastComparison; } if (isSetDistributedBuildModeEnabled()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.distributedBuildModeEnabled, other.distributedBuildModeEnabled); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.valueOf(isSetProducerId()).compareTo(other.isSetProducerId()); if (lastComparison != 0) { return lastComparison; } if (isSetProducerId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.producerId, other.producerId); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.valueOf(isSetBuildTimeMs()).compareTo(other.isSetBuildTimeMs()); if (lastComparison != 0) { return lastComparison; } if (isSetBuildTimeMs()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.buildTimeMs, other.buildTimeMs); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.valueOf(isSetProducerHostname()).compareTo(other.isSetProducerHostname()); if (lastComparison != 0) { return lastComparison; } if (isSetProducerHostname()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.producerHostname, other.producerHostname); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.valueOf(isSetSizeBytes()).compareTo(other.isSetSizeBytes()); if (lastComparison != 0) { return lastComparison; } if (isSetSizeBytes()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sizeBytes, other.sizeBytes); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); if (lastComparison != 0) { return lastComparison; } if (isSetConfiguration()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration); if (lastComparison != 0) { return lastComparison; } } return 0; } @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { scheme(oprot).write(oprot, this); } @Override public java.lang.String toString() { java.lang.StringBuilder sb = new java.lang.StringBuilder("ArtifactMetadata("); boolean first = true; if (isSetRuleKeys()) { sb.append("ruleKeys:"); if (this.ruleKeys == null) { sb.append("null"); } else { sb.append(this.ruleKeys); } first = false; } if (isSetMetadata()) { if (!first) sb.append(", "); sb.append("metadata:"); if (this.metadata == null) { sb.append("null"); } else { sb.append(this.metadata); } first = false; } if (isSetBuildTarget()) { if (!first) sb.append(", "); sb.append("buildTarget:"); if (this.buildTarget == null) { sb.append("null"); } else { sb.append(this.buildTarget); } first = false; } if (isSetRepository()) { if (!first) sb.append(", "); sb.append("repository:"); if (this.repository == null) { sb.append("null"); } else { sb.append(this.repository); } first = false; } if (isSetArtifactPayloadCrc32()) { if (!first) sb.append(", "); sb.append("artifactPayloadCrc32:"); if (this.artifactPayloadCrc32 == null) { sb.append("null"); } else { sb.append(this.artifactPayloadCrc32); } first = false; } if (isSetScheduleType()) { if (!first) sb.append(", "); sb.append("scheduleType:"); if (this.scheduleType == null) { sb.append("null"); } else { sb.append(this.scheduleType); } first = false; } if (isSetArtifactPayloadMd5()) { if (!first) sb.append(", "); sb.append("artifactPayloadMd5:"); if (this.artifactPayloadMd5 == null) { sb.append("null"); } else { sb.append(this.artifactPayloadMd5); } first = false; } if (isSetDistributedBuildModeEnabled()) { if (!first) sb.append(", "); sb.append("distributedBuildModeEnabled:"); sb.append(this.distributedBuildModeEnabled); first = false; } if (isSetProducerId()) { if (!first) sb.append(", "); sb.append("producerId:"); if (this.producerId == null) { sb.append("null"); } else { sb.append(this.producerId); } first = false; } if (isSetBuildTimeMs()) { if (!first) sb.append(", "); sb.append("buildTimeMs:"); sb.append(this.buildTimeMs); first = false; } if (isSetProducerHostname()) { if (!first) sb.append(", "); sb.append("producerHostname:"); if (this.producerHostname == null) { sb.append("null"); } else { sb.append(this.producerHostname); } first = false; } if (isSetSizeBytes()) { if (!first) sb.append(", "); sb.append("sizeBytes:"); sb.append(this.sizeBytes); first = false; } if (isSetConfiguration()) { if (!first) sb.append(", "); sb.append("configuration:"); if (this.configuration == null) { sb.append("null"); } else { sb.append(this.configuration); } first = false; } sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // 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 { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class ArtifactMetadataStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ArtifactMetadataStandardScheme getScheme() { return new ArtifactMetadataStandardScheme(); } } private static class ArtifactMetadataStandardScheme extends org.apache.thrift.scheme.StandardScheme<ArtifactMetadata> { public void read(org.apache.thrift.protocol.TProtocol iprot, ArtifactMetadata 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: // RULE_KEYS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); struct.ruleKeys = new java.util.ArrayList<RuleKey>(_list0.size); @org.apache.thrift.annotation.Nullable RuleKey _elem1; for (int _i2 = 0; _i2 < _list0.size; ++_i2) { _elem1 = new RuleKey(); _elem1.read(iprot); struct.ruleKeys.add(_elem1); } iprot.readListEnd(); } struct.setRuleKeysIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // METADATA if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map3 = iprot.readMapBegin(); struct.metadata = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map3.size); @org.apache.thrift.annotation.Nullable java.lang.String _key4; @org.apache.thrift.annotation.Nullable java.lang.String _val5; for (int _i6 = 0; _i6 < _map3.size; ++_i6) { _key4 = iprot.readString(); _val5 = iprot.readString(); struct.metadata.put(_key4, _val5); } iprot.readMapEnd(); } struct.setMetadataIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // BUILD_TARGET if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.buildTarget = iprot.readString(); struct.setBuildTargetIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // REPOSITORY if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.repository = iprot.readString(); struct.setRepositoryIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // ARTIFACT_PAYLOAD_CRC32 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.artifactPayloadCrc32 = iprot.readString(); struct.setArtifactPayloadCrc32IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // SCHEDULE_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.scheduleType = iprot.readString(); struct.setScheduleTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // ARTIFACT_PAYLOAD_MD5 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.artifactPayloadMd5 = iprot.readString(); struct.setArtifactPayloadMd5IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // DISTRIBUTED_BUILD_MODE_ENABLED if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.distributedBuildModeEnabled = iprot.readBool(); struct.setDistributedBuildModeEnabledIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 9: // PRODUCER_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.producerId = iprot.readString(); struct.setProducerIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 10: // BUILD_TIME_MS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.buildTimeMs = iprot.readI64(); struct.setBuildTimeMsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 11: // PRODUCER_HOSTNAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.producerHostname = iprot.readString(); struct.setProducerHostnameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 12: // SIZE_BYTES if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.sizeBytes = iprot.readI64(); struct.setSizeBytesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 13: // CONFIGURATION if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.configuration = iprot.readString(); struct.setConfigurationIsSet(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, ArtifactMetadata struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.ruleKeys != null) { if (struct.isSetRuleKeys()) { oprot.writeFieldBegin(RULE_KEYS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.ruleKeys.size())); for (RuleKey _iter7 : struct.ruleKeys) { _iter7.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } } if (struct.metadata != null) { if (struct.isSetMetadata()) { oprot.writeFieldBegin(METADATA_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.metadata.size())); for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter8 : struct.metadata.entrySet()) { oprot.writeString(_iter8.getKey()); oprot.writeString(_iter8.getValue()); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } } if (struct.buildTarget != null) { if (struct.isSetBuildTarget()) { oprot.writeFieldBegin(BUILD_TARGET_FIELD_DESC); oprot.writeString(struct.buildTarget); oprot.writeFieldEnd(); } } if (struct.repository != null) { if (struct.isSetRepository()) { oprot.writeFieldBegin(REPOSITORY_FIELD_DESC); oprot.writeString(struct.repository); oprot.writeFieldEnd(); } } if (struct.artifactPayloadCrc32 != null) { if (struct.isSetArtifactPayloadCrc32()) { oprot.writeFieldBegin(ARTIFACT_PAYLOAD_CRC32_FIELD_DESC); oprot.writeString(struct.artifactPayloadCrc32); oprot.writeFieldEnd(); } } if (struct.scheduleType != null) { if (struct.isSetScheduleType()) { oprot.writeFieldBegin(SCHEDULE_TYPE_FIELD_DESC); oprot.writeString(struct.scheduleType); oprot.writeFieldEnd(); } } if (struct.artifactPayloadMd5 != null) { if (struct.isSetArtifactPayloadMd5()) { oprot.writeFieldBegin(ARTIFACT_PAYLOAD_MD5_FIELD_DESC); oprot.writeString(struct.artifactPayloadMd5); oprot.writeFieldEnd(); } } if (struct.isSetDistributedBuildModeEnabled()) { oprot.writeFieldBegin(DISTRIBUTED_BUILD_MODE_ENABLED_FIELD_DESC); oprot.writeBool(struct.distributedBuildModeEnabled); oprot.writeFieldEnd(); } if (struct.producerId != null) { if (struct.isSetProducerId()) { oprot.writeFieldBegin(PRODUCER_ID_FIELD_DESC); oprot.writeString(struct.producerId); oprot.writeFieldEnd(); } } if (struct.isSetBuildTimeMs()) { oprot.writeFieldBegin(BUILD_TIME_MS_FIELD_DESC); oprot.writeI64(struct.buildTimeMs); oprot.writeFieldEnd(); } if (struct.producerHostname != null) { if (struct.isSetProducerHostname()) { oprot.writeFieldBegin(PRODUCER_HOSTNAME_FIELD_DESC); oprot.writeString(struct.producerHostname); oprot.writeFieldEnd(); } } if (struct.isSetSizeBytes()) { oprot.writeFieldBegin(SIZE_BYTES_FIELD_DESC); oprot.writeI64(struct.sizeBytes); oprot.writeFieldEnd(); } if (struct.configuration != null) { if (struct.isSetConfiguration()) { oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); oprot.writeString(struct.configuration); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class ArtifactMetadataTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ArtifactMetadataTupleScheme getScheme() { return new ArtifactMetadataTupleScheme(); } } private static class ArtifactMetadataTupleScheme extends org.apache.thrift.scheme.TupleScheme<ArtifactMetadata> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ArtifactMetadata struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetRuleKeys()) { optionals.set(0); } if (struct.isSetMetadata()) { optionals.set(1); } if (struct.isSetBuildTarget()) { optionals.set(2); } if (struct.isSetRepository()) { optionals.set(3); } if (struct.isSetArtifactPayloadCrc32()) { optionals.set(4); } if (struct.isSetScheduleType()) { optionals.set(5); } if (struct.isSetArtifactPayloadMd5()) { optionals.set(6); } if (struct.isSetDistributedBuildModeEnabled()) { optionals.set(7); } if (struct.isSetProducerId()) { optionals.set(8); } if (struct.isSetBuildTimeMs()) { optionals.set(9); } if (struct.isSetProducerHostname()) { optionals.set(10); } if (struct.isSetSizeBytes()) { optionals.set(11); } if (struct.isSetConfiguration()) { optionals.set(12); } oprot.writeBitSet(optionals, 13); if (struct.isSetRuleKeys()) { { oprot.writeI32(struct.ruleKeys.size()); for (RuleKey _iter9 : struct.ruleKeys) { _iter9.write(oprot); } } } if (struct.isSetMetadata()) { { oprot.writeI32(struct.metadata.size()); for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter10 : struct.metadata.entrySet()) { oprot.writeString(_iter10.getKey()); oprot.writeString(_iter10.getValue()); } } } if (struct.isSetBuildTarget()) { oprot.writeString(struct.buildTarget); } if (struct.isSetRepository()) { oprot.writeString(struct.repository); } if (struct.isSetArtifactPayloadCrc32()) { oprot.writeString(struct.artifactPayloadCrc32); } if (struct.isSetScheduleType()) { oprot.writeString(struct.scheduleType); } if (struct.isSetArtifactPayloadMd5()) { oprot.writeString(struct.artifactPayloadMd5); } if (struct.isSetDistributedBuildModeEnabled()) { oprot.writeBool(struct.distributedBuildModeEnabled); } if (struct.isSetProducerId()) { oprot.writeString(struct.producerId); } if (struct.isSetBuildTimeMs()) { oprot.writeI64(struct.buildTimeMs); } if (struct.isSetProducerHostname()) { oprot.writeString(struct.producerHostname); } if (struct.isSetSizeBytes()) { oprot.writeI64(struct.sizeBytes); } if (struct.isSetConfiguration()) { oprot.writeString(struct.configuration); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, ArtifactMetadata struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(13); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list11 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.ruleKeys = new java.util.ArrayList<RuleKey>(_list11.size); @org.apache.thrift.annotation.Nullable RuleKey _elem12; for (int _i13 = 0; _i13 < _list11.size; ++_i13) { _elem12 = new RuleKey(); _elem12.read(iprot); struct.ruleKeys.add(_elem12); } } struct.setRuleKeysIsSet(true); } if (incoming.get(1)) { { org.apache.thrift.protocol.TMap _map14 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.metadata = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map14.size); @org.apache.thrift.annotation.Nullable java.lang.String _key15; @org.apache.thrift.annotation.Nullable java.lang.String _val16; for (int _i17 = 0; _i17 < _map14.size; ++_i17) { _key15 = iprot.readString(); _val16 = iprot.readString(); struct.metadata.put(_key15, _val16); } } struct.setMetadataIsSet(true); } if (incoming.get(2)) { struct.buildTarget = iprot.readString(); struct.setBuildTargetIsSet(true); } if (incoming.get(3)) { struct.repository = iprot.readString(); struct.setRepositoryIsSet(true); } if (incoming.get(4)) { struct.artifactPayloadCrc32 = iprot.readString(); struct.setArtifactPayloadCrc32IsSet(true); } if (incoming.get(5)) { struct.scheduleType = iprot.readString(); struct.setScheduleTypeIsSet(true); } if (incoming.get(6)) { struct.artifactPayloadMd5 = iprot.readString(); struct.setArtifactPayloadMd5IsSet(true); } if (incoming.get(7)) { struct.distributedBuildModeEnabled = iprot.readBool(); struct.setDistributedBuildModeEnabledIsSet(true); } if (incoming.get(8)) { struct.producerId = iprot.readString(); struct.setProducerIdIsSet(true); } if (incoming.get(9)) { struct.buildTimeMs = iprot.readI64(); struct.setBuildTimeMsIsSet(true); } if (incoming.get(10)) { struct.producerHostname = iprot.readString(); struct.setProducerHostnameIsSet(true); } if (incoming.get(11)) { struct.sizeBytes = iprot.readI64(); struct.setSizeBytesIsSet(true); } if (incoming.get(12)) { struct.configuration = iprot.readString(); struct.setConfigurationIsSet(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(); } }
zpao/buck
src-gen/com/facebook/buck/artifact_cache/thrift/ArtifactMetadata.java
Java
apache-2.0
64,697