text
stringlengths
6
99.5k
meta
dict
/* * 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.stanbol.entityhub.web.reader; import java.io.IOException; import java.io.InputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import javax.servlet.ServletContext; import javax.ws.rs.Consumes; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import javax.ws.rs.ext.MessageBodyReader; import javax.ws.rs.ext.Provider; import org.apache.clerezza.commons.rdf.Graph; import org.apache.clerezza.commons.rdf.BlankNodeOrIRI; import org.apache.clerezza.commons.rdf.Triple; import org.apache.clerezza.commons.rdf.IRI; import org.apache.clerezza.rdf.core.serializedform.Parser; import org.apache.clerezza.rdf.core.serializedform.SupportedFormat; import org.apache.clerezza.rdf.core.serializedform.UnsupportedParsingFormatException; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Property; import org.apache.felix.scr.annotations.Reference; import org.apache.felix.scr.annotations.Service; import org.apache.stanbol.commons.indexedgraph.IndexedGraph; import org.apache.stanbol.entityhub.jersey.utils.JerseyUtils; import org.apache.stanbol.entityhub.jersey.utils.MessageBodyReaderUtils; import org.apache.stanbol.entityhub.jersey.utils.MessageBodyReaderUtils.RequestData; import org.apache.stanbol.entityhub.model.clerezza.RdfValueFactory; import org.apache.stanbol.entityhub.servicesapi.model.Representation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Provides support for reading Representation form Requests. This implementation * supports all RDF supports as well as {@link MediaType#APPLICATION_FORM_URLENCODED} * - in case the data are sent from an HTML form - and * {@link MediaType#MULTIPART_FORM_DATA} - mime encoded data. * In case of an HTML form the encoding need to be specified by the parameter * "encoding" for the entity data the parameters "entity" or "content" can be * used. * @author Rupert Westenthaler * */ @Component @Service(Object.class) @Property(name="javax.ws.rs", boolValue=true) @Provider @Consumes({ //First the data types directly supported for parsing representations MediaType.APPLICATION_JSON, SupportedFormat.N3, SupportedFormat.N_TRIPLE, SupportedFormat.RDF_XML, SupportedFormat.TURTLE, SupportedFormat.X_TURTLE, SupportedFormat.RDF_JSON, //finally this also supports sending the data as form and mime multipart MediaType.APPLICATION_FORM_URLENCODED, MediaType.MULTIPART_FORM_DATA}) public class RepresentationReader implements MessageBodyReader<Map<String,Representation>> { private static final Logger log = LoggerFactory.getLogger(RepresentationReader.class); public static final Set<String> supportedMediaTypes; private static final MediaType DEFAULT_ACCEPTED_MEDIA_TYPE = MediaType.TEXT_PLAIN_TYPE; static { Set<String> types = new HashSet<String>(); //ensure everything is lower case types.add(MediaType.APPLICATION_JSON.toLowerCase()); types.add(SupportedFormat.N3.toLowerCase()); types.add(SupportedFormat.N_TRIPLE.toLowerCase()); types.add(SupportedFormat.RDF_JSON.toLowerCase()); types.add(SupportedFormat.RDF_XML.toLowerCase()); types.add(SupportedFormat.TURTLE.toLowerCase()); types.add(SupportedFormat.X_TURTLE.toLowerCase()); supportedMediaTypes = Collections.unmodifiableSet(types); } @Reference private Parser parser; @Override public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { String mediaTypeWithoutParameter = mediaType.getType().toLowerCase()+'/'+ mediaType.getSubtype().toLowerCase(); log.debug("isreadable: [genericType: {}| mediaType {}]", genericType,mediaTypeWithoutParameter); //second the media type boolean mediaTypeOK = (//the MimeTypes of Representations supportedMediaTypes.contains(mediaTypeWithoutParameter) || //as well as URL encoded MediaType.APPLICATION_FORM_URLENCODED.equals(mediaTypeWithoutParameter) || //and mime multipart MediaType.MULTIPART_FORM_DATA.equals(mediaTypeWithoutParameter)); boolean typeOk = JerseyUtils.testParameterizedType(Map.class, new Class[]{String.class,Representation.class}, genericType); log.debug("type is {} for {} against Map<String,Representation>", typeOk ? "compatible" : "incompatible" ,genericType); return typeOk && mediaTypeOK; } @Override public Map<String,Representation> readFrom(Class<Map<String,Representation>> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException { log.info("Read Representations from Request Data"); long start = System.currentTimeMillis(); //(1) get the charset and the acceptedMediaType String charset = "UTF-8"; if(mediaType.getParameters().containsKey("charset")){ charset = mediaType.getParameters().get("charset"); } MediaType acceptedMediaType = getAcceptedMediaType(httpHeaders); log.info("readFrom: mediaType {} | accepted {} | charset {}", new Object[]{mediaType,acceptedMediaType,charset}); // (2) read the Content from the request (this needs to deal with // MediaType.APPLICATION_FORM_URLENCODED_TYPE and // MediaType.MULTIPART_FORM_DATA_TYPE requests! RequestData content; if(mediaType.isCompatible(MediaType.APPLICATION_FORM_URLENCODED_TYPE)) { try { content = MessageBodyReaderUtils.formForm(entityStream, charset, "encoding",Arrays.asList("entity","content")); } catch (IllegalArgumentException e) { log.info("Bad Request: {}",e); throw new WebApplicationException( Response.status(Status.BAD_REQUEST).entity(e.toString()). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } if(content.getMediaType() == null){ String message = String.format( "Missing parameter %s used to specify the media type" + "(supported values: %s", "encoding",supportedMediaTypes); log.info("Bad Request: {}",message); throw new WebApplicationException( Response.status(Status.BAD_REQUEST).entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } if(!isSupported(content.getMediaType())){ String message = String.format( "Unsupported Content-Type specified by parameter " + "encoding=%s (supported: %s)", content.getMediaType().toString(),supportedMediaTypes); log.info("Bad Request: {}",message); throw new WebApplicationException( Response.status(Status.BAD_REQUEST). entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } } else if(mediaType.isCompatible(MediaType.MULTIPART_FORM_DATA_TYPE)){ log.info("read from MimeMultipart"); List<RequestData> contents; try { contents = MessageBodyReaderUtils.fromMultipart(entityStream, mediaType); } catch (IllegalArgumentException e) { log.info("Bad Request: {}",e.toString()); throw new WebApplicationException( Response.status(Status.BAD_REQUEST).entity(e.toString()). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } if(contents.isEmpty()){ String message = "Request does not contain any Mime BodyParts."; log.info("Bad Request: {}",message); throw new WebApplicationException( Response.status(Status.BAD_REQUEST).entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } else if(contents.size()>1){ //print warnings about ignored parts log.warn("{} Request contains more than one Parts: others than " + "the first will be ignored", MediaType.MULTIPART_FORM_DATA_TYPE); for(int i=1;i<contents.size();i++){ RequestData ignored = contents.get(i); log.warn(" ignore Content {}: Name {}| MediaType {}", new Object[] {i+1,ignored.getName(),ignored.getMediaType()}); } } content = contents.get(0); if(content.getMediaType() == null){ String message = String.format( "MediaType not specified for mime body part for file %s. " + "The media type must be one of the supported values: %s", content.getName(), supportedMediaTypes); log.info("Bad Request: {}",message); throw new WebApplicationException( Response.status(Status.BAD_REQUEST).entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } if(!isSupported(content.getMediaType())){ String message = String.format( "Unsupported Content-Type %s specified for mime body part " + "for file %s (supported: %s)", content.getMediaType(),content.getName(),supportedMediaTypes); log.info("Bad Request: {}",message); throw new WebApplicationException( Response.status(Status.BAD_REQUEST). entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } } else { content = new RequestData(mediaType, null, entityStream); } long readingCompleted = System.currentTimeMillis(); log.info(" ... reading request data {}ms",readingCompleted-start); Map<String,Representation> parsed = parseFromContent(content,acceptedMediaType); long parsingCompleted = System.currentTimeMillis(); log.info(" ... parsing data {}ms",parsingCompleted-readingCompleted); return parsed; } public Map<String,Representation> parseFromContent(RequestData content, MediaType acceptedMediaType){ // (3) Parse the Representtion(s) form the entity stream if(content.getMediaType().isCompatible(MediaType.APPLICATION_JSON_TYPE)){ //parse from json throw new UnsupportedOperationException("Parsing of JSON not yet implemented :("); } else if(isSupported(content.getMediaType())){ //from RDF serialisation RdfValueFactory valueFactory = RdfValueFactory.getInstance(); Map<String,Representation> representations = new HashMap<String,Representation>(); Set<BlankNodeOrIRI> processed = new HashSet<BlankNodeOrIRI>(); Graph graph = new IndexedGraph(); try { parser.parse(graph,content.getEntityStream(), content.getMediaType().toString()); } catch (UnsupportedParsingFormatException e) { //String acceptedMediaType = httpHeaders.getFirst("Accept"); //throw an internal server Error, because we check in //isReadable(..) for supported types and still we get here a //unsupported format -> therefore it looks like an configuration //error the server (e.g. a missing Bundle with the required bundle) String message = "Unable to create the Parser for the supported format" +content.getMediaType()+" ("+e+")"; log.error(message,e); throw new WebApplicationException( Response.status(Status.INTERNAL_SERVER_ERROR). entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } catch (RuntimeException e){ //NOTE: Clerezza seams not to provide specific exceptions on // parsing errors. Hence the catch for all RuntimeException String message = "Unable to parse the provided RDF data (format: " +content.getMediaType()+", message: "+e.getMessage()+")"; log.error(message,e); throw new WebApplicationException( Response.status(Status.BAD_REQUEST). entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } for(Iterator<Triple> st = graph.iterator();st.hasNext();){ BlankNodeOrIRI resource = st.next().getSubject(); if(resource instanceof IRI && processed.add(resource)){ //build a new representation representations.put(((IRI)resource).getUnicodeString(), valueFactory.createRdfRepresentation((IRI)resource, graph)); } } return representations; } else { //unsupported media type String message = String.format( "Parsed Content-Type '%s' is not one of the supported %s", content.getMediaType(),supportedMediaTypes); log.info("Bad Request: {}",message); throw new WebApplicationException( Response.status(Status.BAD_REQUEST). entity(message). header(HttpHeaders.ACCEPT, acceptedMediaType).build()); } } /** * Internally used to get the accepted media type used when returning * {@link WebApplicationException}s. * @param httpHeaders * @param acceptedMediaType * @return */ private static MediaType getAcceptedMediaType(MultivaluedMap<String,String> httpHeaders) { MediaType acceptedMediaType; String acceptedMediaTypeString = httpHeaders.getFirst("Accept"); if(acceptedMediaTypeString != null){ try { acceptedMediaType = MediaType.valueOf(acceptedMediaTypeString); if(acceptedMediaType.isWildcardType()){ acceptedMediaType = DEFAULT_ACCEPTED_MEDIA_TYPE; } } catch (IllegalArgumentException e) { acceptedMediaType = DEFAULT_ACCEPTED_MEDIA_TYPE; } } else { acceptedMediaType = DEFAULT_ACCEPTED_MEDIA_TYPE; } return acceptedMediaType; } /** * Converts the type and the subtype of the parsed media type to the * string representation as stored in {@link #supportedMediaTypes} and than * checks if the parsed media type is contained in this list. * @param mediaType the MediaType instance to check * @return <code>true</code> if the parsed media type is not * <code>null</code> and supported. */ private boolean isSupported(MediaType mediaType){ return mediaType == null ? false : supportedMediaTypes.contains( mediaType.getType().toLowerCase()+'/'+ mediaType.getSubtype().toLowerCase()); } }
{ "pile_set_name": "Github" }
// Copyright 2000-2020 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.openapi.vcs.impl import com.intellij.ProjectTopics import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.service import com.intellij.openapi.extensions.ExtensionNotApplicableException import com.intellij.openapi.module.Module import com.intellij.openapi.module.ModuleManager import com.intellij.openapi.project.ModuleListener import com.intellij.openapi.project.Project import com.intellij.openapi.project.rootManager import com.intellij.openapi.roots.ModuleRootEvent import com.intellij.openapi.roots.ModuleRootListener import com.intellij.openapi.startup.StartupActivity import com.intellij.openapi.vcs.AbstractVcs import com.intellij.openapi.vcs.ProjectLevelVcsManager import com.intellij.openapi.vcs.VcsDirectoryMapping import com.intellij.openapi.vfs.VirtualFile internal class ModuleVcsDetector(private val project: Project) { private val vcsManager by lazy(LazyThreadSafetyMode.NONE) { (ProjectLevelVcsManager.getInstance(project) as ProjectLevelVcsManagerImpl) } internal class MyPostStartUpActivity : StartupActivity.DumbAware { init { if (ApplicationManager.getApplication().isUnitTestMode) { throw ExtensionNotApplicableException.INSTANCE } } override fun runActivity(project: Project) { val vcsDetector = project.service<ModuleVcsDetector>() val listener = vcsDetector.MyModulesListener() val busConnection = project.messageBus.connect() busConnection.subscribe(ProjectTopics.MODULES, listener) busConnection.subscribe(ProjectTopics.PROJECT_ROOTS, listener) if (vcsDetector.vcsManager.needAutodetectMappings()) { vcsDetector.autoDetectVcsMappings(true) } } } private inner class MyModulesListener : ModuleRootListener, ModuleListener { private val myMappingsForRemovedModules: MutableList<VcsDirectoryMapping> = mutableListOf() override fun beforeRootsChange(event: ModuleRootEvent) { myMappingsForRemovedModules.clear() } override fun rootsChanged(event: ModuleRootEvent) { myMappingsForRemovedModules.forEach { mapping -> vcsManager.removeDirectoryMapping(mapping) } // the check calculates to true only before user has done any change to mappings, i.e. in case modules are detected/added automatically // on start etc (look inside) if (vcsManager.needAutodetectMappings()) { autoDetectVcsMappings(false) } } override fun moduleAdded(project: Project, module: Module) { myMappingsForRemovedModules.removeAll(getMappings(module)) autoDetectModuleVcsMapping(module) } override fun beforeModuleRemoved(project: Project, module: Module) { myMappingsForRemovedModules.addAll(getMappings(module)) } } private fun autoDetectVcsMappings(tryMapPieces: Boolean) { if (vcsManager.haveDefaultMapping() != null) return val usedVcses = mutableSetOf<AbstractVcs?>() val detectedRoots = mutableSetOf<Pair<VirtualFile, AbstractVcs>>() val roots = ModuleManager.getInstance(project).modules.flatMap { it.rootManager.contentRoots.asIterable() }.distinct() for (root in roots) { val moduleVcs = vcsManager.findVersioningVcs(root) if (moduleVcs != null) { detectedRoots.add(Pair(root, moduleVcs)) } usedVcses.add(moduleVcs) // put 'null' for unmapped module } val commonVcs = usedVcses.singleOrNull() if (commonVcs != null) { // Remove existing mappings that will duplicate added <Project> mapping. val rootPaths = roots.map { it.path }.toSet() val additionalMappings = vcsManager.directoryMappings.filter { it.directory !in rootPaths } vcsManager.setAutoDirectoryMappings(additionalMappings + VcsDirectoryMapping.createDefault(commonVcs.name)) } else if (tryMapPieces) { val newMappings = detectedRoots.map { (root, vcs) -> VcsDirectoryMapping(root.path, vcs.name) } vcsManager.setAutoDirectoryMappings(vcsManager.directoryMappings + newMappings) } } private fun autoDetectModuleVcsMapping(module: Module) { if (vcsManager.haveDefaultMapping() != null) return val newMappings = mutableListOf<VcsDirectoryMapping>() for (file in module.rootManager.contentRoots) { val vcs = vcsManager.findVersioningVcs(file) if (vcs != null && vcs !== vcsManager.getVcsFor(file)) { newMappings.add(VcsDirectoryMapping(file.path, vcs.name)) } } if (newMappings.isNotEmpty()) { vcsManager.setAutoDirectoryMappings(vcsManager.directoryMappings + newMappings) } } private fun getMappings(module: Module): List<VcsDirectoryMapping> { return module.rootManager.contentRoots .mapNotNull { root -> vcsManager.directoryMappings.firstOrNull { it.directory == root.path } } } }
{ "pile_set_name": "Github" }
package io.gitlab.arturbosch.detekt.generator.collection import io.gitlab.arturbosch.detekt.api.DetektVisitor import io.gitlab.arturbosch.detekt.generator.collection.exception.InvalidDocumentationException import io.gitlab.arturbosch.detekt.rules.isOverride import org.jetbrains.kotlin.psi.KtCallExpression import org.jetbrains.kotlin.psi.KtClassOrObject import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.psi.KtProperty import org.jetbrains.kotlin.psi.KtReferenceExpression import org.jetbrains.kotlin.psi.KtSuperTypeList import org.jetbrains.kotlin.psi.KtValueArgumentList import org.jetbrains.kotlin.psi.psiUtil.containingClass import org.jetbrains.kotlin.psi.psiUtil.referenceExpression data class MultiRule( val name: String, val rules: List<String> = listOf() ) { operator fun contains(ruleName: String) = ruleName in this.rules } private val multiRule = io.gitlab.arturbosch.detekt.api.MultiRule::class.simpleName ?: "" class MultiRuleCollector : Collector<MultiRule> { override val items = mutableListOf<MultiRule>() override fun visit(file: KtFile) { val visitor = MultiRuleVisitor() file.accept(visitor) if (visitor.containsMultiRule) { items.add(visitor.getMultiRule()) } } } class MultiRuleVisitor : DetektVisitor() { val containsMultiRule get() = classesMap.any { it.value } private var classesMap = mutableMapOf<String, Boolean>() private var name = "" private val rulesVisitor = RuleListVisitor() private val properties: MutableMap<String, String> = mutableMapOf() fun getMultiRule(): MultiRule { val rules = mutableListOf<String>() val ruleProperties = rulesVisitor.ruleProperties .mapNotNull { properties[it] } rules.addAll(ruleProperties) rules.addAll(rulesVisitor.ruleNames) if (name.isEmpty()) { throw InvalidDocumentationException("MultiRule without name found.") } if (rules.isEmpty()) { throw InvalidDocumentationException("MultiRule $name contains no rules.") } return MultiRule(name, rules) } override fun visitSuperTypeList(list: KtSuperTypeList) { val isMultiRule = list.entries ?.mapNotNull { it.typeAsUserType?.referencedName } ?.any { it == multiRule } ?: false val containingClass = list.containingClass() val className = containingClass?.name if (containingClass != null && className != null && !classesMap.containsKey(className)) { classesMap[className] = isMultiRule } super.visitSuperTypeList(list) } override fun visitClassOrObject(classOrObject: KtClassOrObject) { super.visitClassOrObject(classOrObject) if (classesMap[classOrObject.name] != true) { return } name = classOrObject.name?.trim() ?: "" } override fun visitProperty(property: KtProperty) { super.visitProperty(property) if (classesMap[property.containingClass()?.name] != true) { return } if (property.isOverride() && property.name != null && property.name == "rules") { property.accept(rulesVisitor) } else { val name = property.name val initializer = property.initializer?.referenceExpression()?.text if (name != null && initializer != null) { properties[name] = initializer } } } } class RuleListVisitor : DetektVisitor() { var ruleNames: MutableSet<String> = mutableSetOf() private set var ruleProperties: MutableSet<String> = mutableSetOf() private set override fun visitValueArgumentList(list: KtValueArgumentList) { super.visitValueArgumentList(list) val argumentExpressions = list.arguments.map { it.getArgumentExpression() } // Call Expression = Constructor of rule ruleNames.addAll(argumentExpressions .filterIsInstance<KtCallExpression>() .map { it.calleeExpression?.text ?: "" }) // Reference Expression = variable we need to search for ruleProperties.addAll(argumentExpressions .filterIsInstance<KtReferenceExpression>() .map { it.text ?: "" }) } }
{ "pile_set_name": "Github" }
# Project-wide Gradle settings. # IDE (e.g. Android Studio) users: # Gradle settings configured through the IDE *will override* # any settings specified in this file. # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx1024m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true
{ "pile_set_name": "Github" }
<html> <body> <h1>Directory listing</h1> <hr/> <pre> <a href="management-core-3.0.4-javadoc.jar">management-core-3.0.4-javadoc.jar</a> <a href="management-core-3.0.4-javadoc.jar.md5">management-core-3.0.4-javadoc.jar.md5</a> <a href="management-core-3.0.4-javadoc.jar.sha1">management-core-3.0.4-javadoc.jar.sha1</a> <a href="management-core-3.0.4-sources.jar">management-core-3.0.4-sources.jar</a> <a href="management-core-3.0.4-sources.jar.md5">management-core-3.0.4-sources.jar.md5</a> <a href="management-core-3.0.4-sources.jar.sha1">management-core-3.0.4-sources.jar.sha1</a> <a href="management-core-3.0.4.jar">management-core-3.0.4.jar</a> <a href="management-core-3.0.4.jar.md5">management-core-3.0.4.jar.md5</a> <a href="management-core-3.0.4.jar.sha1">management-core-3.0.4.jar.sha1</a> <a href="management-core-3.0.4.pom">management-core-3.0.4.pom</a> <a href="management-core-3.0.4.pom.md5">management-core-3.0.4.pom.md5</a> <a href="management-core-3.0.4.pom.sha1">management-core-3.0.4.pom.sha1</a> </pre> </body> </html>
{ "pile_set_name": "Github" }
package com.android.inputmethodcommon; class InputMethodSettingsInterface { } class InputMethodSettingsImpl { int mContext; int mImi; int mImm; int mSubtypeEnablerIcon; int mSubtypeEnablerIconRes; int mSubtypeEnablerTitle; int mSubtypeEnablerTitleRes; int mInputMethodSettingsCategoryTitle; int mInputMethodSettingsCategoryTitleRes; int mSubtypeEnablerPreference; } class InputMethodSettingsFragment { int mSettings; } class InputMethodSettingsActivity { int mSettings; }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/appBackground" android:foreground="?android:attr/selectableItemBackground" android:gravity="center_vertical" android:orientation="horizontal" android:paddingBottom="15dp" android:paddingLeft="10dp" android:paddingRight="10dp" android:paddingTop="15dp"> <ImageView android:id="@+id/song_item_img" android:layout_width="50dp" android:layout_height="50dp" android:layout_weight="0" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="15dp" android:layout_weight="1" android:orientation="vertical"> <TextView android:id="@+id/song_item_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:textColor="#000" android:textSize="16sp" /> <TextView android:id="@+id/song_item_artist" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:textColor="#989898" android:textSize="14sp" /> </LinearLayout> <ImageView android:id="@+id/song_item_menu" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="5dp" android:layout_weight="0" android:background="@drawable/unbounded_ripple" android:foregroundTint="#434343" android:padding="5dp" android:src="@drawable/abc_ic_menu_moreoverflow_mtrl_alpha" android:theme="@style/Theme.AppCompat.Light" /> </LinearLayout>
{ "pile_set_name": "Github" }
/*####################################################### * Copyright (c) 2014 Jeff Martin * Copyright (c) 2015 Pedro Lafuente * Copyright (c) 2017-2019 Gregor Santner * * Licensed under the MIT license. * You can get a copy of the license text here: * https://opensource.org/licenses/MIT ###########################################################*/ package other.writeily.ui; import android.app.Dialog; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.DialogFragment; import android.support.v7.app.AlertDialog; import android.text.TextUtils; import net.gsantner.markor.R; import net.gsantner.markor.util.AppSettings; import java.io.Serializable; public class WrConfirmDialog extends DialogFragment { public static final String FRAGMENT_TAG = "WrConfirmDialog"; private static final String EXTRA_TITLE = "EXTRA_TITLE"; private static final String EXTRA_MESSAGE = "EXTRA_MESSAGE"; public static final String EXTRA_DATA = "EXTRA_DATA"; private Serializable _data; private ConfirmDialogCallback[] _callbacks; private String _summary; public static WrConfirmDialog newInstance(String title, String message, Serializable data, ConfirmDialogCallback... callbacks) { WrConfirmDialog confirmDialog = new WrConfirmDialog(); Bundle args = new Bundle(); args.putSerializable(EXTRA_DATA, data); args.putString(EXTRA_TITLE, title); args.putString(EXTRA_MESSAGE, message); confirmDialog.setArguments(args); confirmDialog.setCallbacks(callbacks); return confirmDialog; } public void setCallbacks(ConfirmDialogCallback[] callbacks) { _callbacks = callbacks; } @Override @NonNull public Dialog onCreateDialog(Bundle savedInstanceState) { String title = getArguments().getString(EXTRA_TITLE); String message = getArguments().getString(EXTRA_MESSAGE); _data = getArguments().getSerializable(EXTRA_DATA); AlertDialog.Builder dialogBuilder; boolean darkTheme = AppSettings.get().isDarkThemeEnabled(); dialogBuilder = new AlertDialog.Builder(getActivity(), darkTheme ? R.style.Theme_AppCompat_Dialog : R.style.Theme_AppCompat_Light_Dialog); dialogBuilder.setTitle(title); if (!TextUtils.isEmpty(message)) { dialogBuilder.setMessage(message); } dialogBuilder.setPositiveButton(getString(android.R.string.ok), (dialog, which) -> { if (_callbacks != null) { for (ConfirmDialogCallback cdc : _callbacks) { if (cdc != null) { cdc.onConfirmDialogAnswer(true, _data); } } } }); dialogBuilder.setNegativeButton(getString(R.string.cancel), (dialog, which) -> { dialog.dismiss(); for (ConfirmDialogCallback cdc : _callbacks) { cdc.onConfirmDialogAnswer(false, _data); } }); return dialogBuilder.show(); } public interface ConfirmDialogCallback { void onConfirmDialogAnswer(boolean confirmed, Serializable data); } }
{ "pile_set_name": "Github" }
// Copyright 2004-present Facebook. All Rights Reserved. #include "SamplingProfilerJniMethod.h" #include <JavaScriptCore/JSProfilerPrivate.h> #include <jschelpers/JSCHelpers.h> #include <jni.h> #include <string> using namespace facebook::jni; namespace facebook { namespace react { /* static */ jni::local_ref<SamplingProfilerJniMethod::jhybriddata> SamplingProfilerJniMethod::initHybrid(jni::alias_ref<jclass>, jlong javaScriptContext) { return makeCxxInstance(javaScriptContext); } /* static */ void SamplingProfilerJniMethod::registerNatives() { registerHybrid( {makeNativeMethod("initHybrid", SamplingProfilerJniMethod::initHybrid), makeNativeMethod("poke", SamplingProfilerJniMethod::poke)}); } SamplingProfilerJniMethod::SamplingProfilerJniMethod(jlong javaScriptContext) { context_ = reinterpret_cast<JSGlobalContextRef>(javaScriptContext); } void SamplingProfilerJniMethod::poke( jni::alias_ref<JSPackagerClientResponder::javaobject> responder) { if (!JSC_JSSamplingProfilerEnabled(context_)) { responder->error("The JSSamplingProfiler is disabled. See this " "https://fburl.com/u4lw7xeq for some help"); return; } JSValueRef jsResult = JSC_JSPokeSamplingProfiler(context_); if (JSC_JSValueGetType(context_, jsResult) == kJSTypeNull) { responder->respond("started"); } else { JSStringRef resultStrRef = JSValueToStringCopy(context_, jsResult, nullptr); size_t length = JSStringGetLength(resultStrRef); char buffer[length + 1]; JSStringGetUTF8CString(resultStrRef, buffer, length + 1); JSStringRelease(resultStrRef); responder->respond(buffer); } } } }
{ "pile_set_name": "Github" }
package org.basex.query.func.validate; import org.basex.query.*; import org.basex.query.func.*; import org.basex.query.value.item.*; import org.basex.util.*; /** * Function implementation. * * @author BaseX Team 2005-20, BSD License * @author Christian Gruen */ public final class ValidateXsdProcessor extends StandardFunc { @Override public Item item(final QueryContext qc, final InputInfo ii) { return Str.get(ValidateXsd.IMPL[ValidateXsd.OFFSET + 1]); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" xmlns:android="http://schemas.android.com/apk/res/android" > <Button android:id="@+id/btn_crash_restart" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="重启App" android:layout_alignParentTop="true" /> <TextView android:id="@+id/tv_crash_info" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="false" android:ellipsize="none" android:gravity="left" android:inputType="textMultiLine" android:layout_below="@id/btn_crash_restart" /> </RelativeLayout>
{ "pile_set_name": "Github" }
package org.jetbrains.dokka.base.transformers.documentables import org.jetbrains.dokka.model.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer import org.jetbrains.dokka.transformers.documentation.perPackageOptions import org.jetbrains.dokka.transformers.documentation.source import org.jetbrains.dokka.transformers.documentation.sourceSet import java.io.File class SuppressedDocumentableFilterTransformer(val context: DokkaContext) : PreMergeDocumentableTransformer { override fun invoke(modules: List<DModule>): List<DModule> { return modules.mapNotNull(::filterModule) } private fun filterModule(module: DModule): DModule? { val packages = module.packages.mapNotNull { pkg -> filterPackage(pkg) } return when { packages == module.packages -> module packages.isEmpty() -> null else -> module.copy(packages = packages) } } private fun filterPackage(pkg: DPackage): DPackage? { val options = perPackageOptions(pkg) if (options?.suppress == true) { return null } val filteredChildren = pkg.children.filterNot(::isSuppressed) return when { filteredChildren == pkg.children -> pkg filteredChildren.isEmpty() -> null else -> pkg.copy( functions = filteredChildren.filterIsInstance<DFunction>(), classlikes = filteredChildren.filterIsInstance<DClasslike>(), typealiases = filteredChildren.filterIsInstance<DTypeAlias>(), properties = filteredChildren.filterIsInstance<DProperty>() ) } } private fun isSuppressed(documentable: Documentable): Boolean { if (documentable !is WithSources) return false val sourceFile = File(source(documentable).path).absoluteFile return sourceSet(documentable).suppressedFiles.any { suppressedFile -> sourceFile.startsWith(suppressedFile.absoluteFile) } } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <Workspace version = "1.0"> <FileRef location = "group:Runner.xcodeproj"> </FileRef> </Workspace>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <packages> <package id="Dapper" version="1.50.4-alpha1-00070" targetFramework="net452" /> <package id="Dapper.Contrib" version="1.50.0" targetFramework="net452" /> <package id="Dapper.Extension" version="1.0.0.1" targetFramework="net452" /> <package id="EntityFramework" version="6.1.3" targetFramework="net452" /> <package id="SyntacticSugar" version="2.4.1" targetFramework="net452" /> </packages>
{ "pile_set_name": "Github" }
/* * TupleTypeUtil.java * * This source file is part of the FoundationDB open source project * * Copyright 2015-2019 Apple Inc. and the FoundationDB project 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 com.apple.foundationdb.record.metadata; import com.apple.foundationdb.record.provider.foundationdb.FDBRecordVersion; import com.apple.foundationdb.tuple.Tuple; import com.google.protobuf.ByteString; import com.google.protobuf.Descriptors; import com.google.protobuf.ProtocolMessageEnum; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.math.BigInteger; import java.util.ArrayList; import java.util.List; /** * Utility class for dealing with {@link Tuple} types. In theory, these methods should live in * {@link com.apple.foundationdb.tuple.TupleHelpers TupleHelpers} except that they use some Protobuf specific things * like the {@link ByteString} class, and {@code TupleHelpers} is defined in the * <a href="https://javadoc.io/doc/org.foundationdb/fdb-extensions/">fdb-extensions</a> sub-project * which does not (and probably should not) take Protobuf as a dependency. */ class TupleTypeUtil { @Nonnull private static final BigInteger BIG_INT_MAX_LONG = BigInteger.valueOf(Long.MAX_VALUE); @Nonnull private static final BigInteger BIG_INT_MIN_LONG = BigInteger.valueOf(Long.MIN_VALUE); /** * Normalize a list of values so that it can be checked for equality with other lists sharing * the same {@link Tuple} representation. In other words, it should be the case that: * * <pre> {@code * toTupleEquivalentValue(list1).equals(toTupleEquivalentValue) * == Arrays.equals(Tuple.fromList(toTupleAppropriateList(list1)).pack(), Tuple.fromList(toTupleAppropriateList(list2)).pack()) * }</pre> * * <p> * for any two lists {@code list1} and {@code list2}. * </p> * * @param values the list of values to normalized * @return a new list containing the normalized elements of {@code values} */ @Nonnull static List<Object> toTupleEquivalentList(@Nonnull List<?> values) { List<Object> tupleEquivalentList = new ArrayList<>(values.size()); for (Object o : values) { tupleEquivalentList.add(toTupleEquivalentValue(o)); } return tupleEquivalentList; } /** * Normalize a value so that it compares equal to anything with the same {@link Tuple} representation. * The value that is returned cannot necessarily be packed by a {@code Tuple} (for example, * a <code>byte[]</code> is returned as a {@link ByteString}), but it does implement {@link Object#equals(Object)} * and {@link Object#hashCode()}, so the value can be used in hash-based data structures like * {@link java.util.HashSet HashSet}s and {@link java.util.HashMap HashMap}s. In other words, it should * bethe case that: * * <pre> {@code * Objects.equals(toTupleEquivalentValue(value1), toTupleEquivalentValue(value2)) * == Arrays.equals(Tuple.from(value1).pack(), Tuple.from(value2).pack()) * }</pre> * * <p> * for any two values {@code value1} and {@code value2}. * </p> * * <p> * This will only return {@code null} if {@link #toTupleAppropriateValue(Object)} would return {@code null} * on the same input. If the object is already in * </p> * * @param obj the value to normalize * @return a value that has the same representation when {@link Tuple}-encoded */ @Nullable static Object toTupleEquivalentValue(@Nullable Object obj) { if (obj == null || obj instanceof Key.Evaluated.NullStandin) { return null; } else if (obj instanceof List<?>) { List<?> list = (List<?>)obj; return toTupleEquivalentList(list); } else if (obj instanceof Tuple) { return toTupleEquivalentList(((Tuple)obj).getItems()); } else if (obj instanceof byte[]) { return ByteString.copyFrom((byte[]) obj); } else if ((obj instanceof Byte) || (obj instanceof Short) || (obj instanceof Integer)) { return ((Number)obj).longValue(); } else if (obj instanceof BigInteger) { BigInteger bigInt = (BigInteger)obj; if (bigInt.compareTo(BIG_INT_MIN_LONG) > 0 && bigInt.compareTo(BIG_INT_MAX_LONG) < 0) { return bigInt.longValue(); } else { return bigInt; } } else if (obj instanceof ProtocolMessageEnum) { return (long)((ProtocolMessageEnum)obj).getNumber(); } else if (obj instanceof Descriptors.EnumValueDescriptor) { return (long)((Descriptors.EnumValueDescriptor)obj).getNumber(); } else if (obj instanceof FDBRecordVersion) { return ((FDBRecordVersion)obj).toVersionstamp(false); } else { return obj; } } /** * Convert a list of values into items that can all be stored within a {@link Tuple}. * * @param values a list of values * @return a new list with {@link Tuple}-encodable versions of the elements of {@code values} */ @Nonnull static List<Object> toTupleAppropriateList(@Nonnull List<?> values) { List<Object> tupleAppropriateList = new ArrayList<>(values.size()); for (Object o : values) { tupleAppropriateList.add(toTupleAppropriateValue(o)); } return tupleAppropriateList; } /** * Convert a value into a type that can be stored within a {@link Tuple}. * * @param obj the value to convert * @return the value converted to some {@link Tuple}-encodable type */ @Nullable static Object toTupleAppropriateValue(@Nullable Object obj) { if (obj instanceof Key.Evaluated.NullStandin) { return null; } else if (obj instanceof ByteString) { return ((ByteString) obj).toByteArray(); } else if (obj instanceof List) { return toTupleAppropriateList((List<?>) obj); // Following two are both Internal.EnumLite, so could use that, too. } else if (obj instanceof ProtocolMessageEnum) { return ((ProtocolMessageEnum) obj).getNumber(); } else if (obj instanceof Descriptors.EnumValueDescriptor) { return ((Descriptors.EnumValueDescriptor) obj).getNumber(); } else if (obj instanceof FDBRecordVersion) { return ((FDBRecordVersion) obj).toVersionstamp(false); } else { return obj; } } private TupleTypeUtil() { } }
{ "pile_set_name": "Github" }
package de.peeeq.wurstscript.utils; import de.peeeq.wurstscript.WLogger; public class ExecutiontimeMeasure implements AutoCloseable { private String message; private long startTime; public ExecutiontimeMeasure(String message) { this.message = message; this.startTime = System.currentTimeMillis(); } @Override public void close() { long time = System.currentTimeMillis() - startTime; WLogger.info("Executed " + message + " in " + time + "ms."); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" ?> <component id="root" name="root"> <component id="system" name="system"> <!--McPAT will skip the components if number is set to 0 --> <param name="number_of_cores" value="64"/> <param name="number_of_L1Directories" value="0"/> <param name="number_of_L2Directories" value="0"/> <param name="number_of_L2s" value="64"/> <!-- This number means how many L2 clusters in each cluster there can be multiple banks/ports --> <param name="number_of_L3s" value="0"/> <!-- This number means how many L3 clusters --> <param name="number_of_NoCs" value="1"/> <param name="homogeneous_cores" value="1"/><!--1 means homo --> <param name="homogeneous_L2s" value="1"/> <param name="homogeneous_L1Directorys" value="1"/> <param name="homogeneous_L2Directorys" value="1"/> <param name="homogeneous_L3s" value="1"/> <param name="homogeneous_ccs" value="1"/><!--cache coherece hardware --> <param name="homogeneous_NoCs" value="1"/> <param name="core_tech_node" value="22"/><!-- nm --> <param name="target_core_clockrate" value="3500"/><!--MHz --> <param name="temperature" value="360"/> <!-- Kelvin --> <param name="number_cache_levels" value="2"/> <param name="interconnect_projection_type" value="0"/><!--0: agressive wire technology; 1: conservative wire technology --> <param name="device_type" value="0"/><!--0: HP(High Performance Type); 1: LSTP(Low standby power) 2: LOP (Low Operating Power) --> <param name="longer_channel_device" value="1"/><!-- 0 no use; 1 use when possible --> <param name="machine_bits" value="64"/> <param name="virtual_address_width" value="64"/> <param name="physical_address_width" value="52"/> <param name="virtual_memory_page_size" value="4096"/> <stat name="total_cycles" value="100000"/> <stat name="idle_cycles" value="0"/> <stat name="busy_cycles" value="100000"/> <!--This page size(B) is complete different from the page size in Main memo secction. this page size is the size of virtual memory from OS/Archi perspective; the page size in Main memo secction is the actuall physical line in a DRAM bank --> <!-- *********************** cores ******************* --> <component id="system.core0" name="core0"> <!-- Core property --> <param name="clock_rate" value="3500"/> <param name="instruction_length" value="32"/> <param name="opcode_width" value="9"/> <!-- address width determins the tag_width in Cache, LSQ and buffers in cache controller default value is machine_bits, if not set --> <param name="machine_type" value="1"/><!-- 1 inorder; 0 OOO--> <!-- inorder/OoO --> <param name="number_hardware_threads" value="4"/> <!-- number_instruction_fetch_ports(icache ports) is always 1 in single-thread processor, it only may be more than one in SMT processors. BTB ports always equals to fetch ports since branch information in consective branch instructions in the same fetch group can be read out from BTB once.--> <param name="fetch_width" value="1"/> <!-- fetch_width determins the size of cachelines of L1 cache block --> <param name="number_instruction_fetch_ports" value="1"/> <param name="decode_width" value="1"/> <!-- decode_width determins the number of ports of the renaming table (both RAM and CAM) scheme --> <param name="issue_width" value="1"/> <!-- issue_width determins the number of ports of Issue window and other logic as in the complexity effective proccessors paper; issue_width==dispatch_width --> <param name="commit_width" value="1"/> <!-- commit_width determins the number of ports of register files --> <param name="fp_issue_width" value="1"/> <param name="prediction_width" value="0"/> <!-- number of branch instructions can be predicted simultannouesl--> <!-- Current version of McPAT does not distinguish int and floating point pipelines Theses parameters are reserved for future use.--> <param name="pipelines_per_core" value="1,1"/> <!--integer_pipeline and floating_pipelines, if the floating_pipelines is 0, then the pipeline is shared--> <param name="pipeline_depth" value="6,6"/> <!-- pipeline depth of int and fp, if pipeline is shared, the second number is the average cycles of fp ops --> <!-- issue and exe unit--> <param name="ALU_per_core" value="1"/> <!-- contains an adder, a shifter, and a logical unit --> <param name="MUL_per_core" value="1"/> <!-- For MUL and Div --> <param name="FPU_per_core" value="0.125"/> <!-- buffer between IF and ID stage --> <param name="instruction_buffer_size" value="16"/> <!-- buffer between ID and sche/exe stage --> <param name="decoded_stream_buffer_size" value="16"/> <param name="instruction_window_scheme" value="0"/><!-- 0 PHYREG based, 1 RSBASED--> <!-- McPAT support 2 types of OoO cores, RS based and physical reg based--> <param name="instruction_window_size" value="16"/> <param name="fp_instruction_window_size" value="16"/> <!-- the instruction issue Q as in Alpha 21264; The RS as in Intel P6 --> <param name="ROB_size" value="80"/> <!-- each in-flight instruction has an entry in ROB --> <!-- registers --> <param name="archi_Regs_IRF_size" value="32"/> <param name="archi_Regs_FRF_size" value="32"/> <!-- if OoO processor, phy_reg number is needed for renaming logic, renaming logic is for both integer and floating point insts. --> <param name="phy_Regs_IRF_size" value="80"/> <param name="phy_Regs_FRF_size" value="80"/> <!-- rename logic --> <param name="rename_scheme" value="0"/> <!-- can be RAM based(0) or CAM based(1) rename scheme RAM-based scheme will have free list, status table; CAM-based scheme have the valid bit in the data field of the CAM both RAM and CAM need RAM-based checkpoint table, checkpoint_depth=# of in_flight instructions; Detailed RAT Implementation see TR --> <param name="register_windows_size" value="8"/> <!-- how many windows in the windowed register file, sun processors; no register windowing is used when this number is 0 --> <!-- In OoO cores, loads and stores can be issued whether inorder(Pentium Pro) or (OoO)out-of-order(Alpha), They will always try to exeute out-of-order though. --> <param name="LSU_order" value="inorder"/> <param name="store_buffer_size" value="32"/> <!-- By default, in-order cores do not have load buffers --> <param name="load_buffer_size" value="32"/> <!-- number of ports refer to sustainable concurrent memory accesses --> <param name="memory_ports" value="1"/> <!-- max_allowed_in_flight_memo_instructions determins the # of ports of load and store buffer as well as the ports of Dcache which is connected to LSU --> <!-- dual-pumped Dcache can be used to save the extra read/write ports --> <param name="RAS_size" value="32"/> <!-- general stats, defines simulation periods;require total, idle, and busy cycles for senity check --> <!-- please note: if target architecture is X86, then all the instrucions refer to (fused) micro-ops --> <stat name="total_instructions" value="800000"/> <stat name="int_instructions" value="600000"/> <stat name="fp_instructions" value="20000"/> <stat name="branch_instructions" value="0"/> <stat name="branch_mispredictions" value="0"/> <stat name="load_instructions" value="100000"/> <stat name="store_instructions" value="100000"/> <stat name="committed_instructions" value="800000"/> <stat name="committed_int_instructions" value="600000"/> <stat name="committed_fp_instructions" value="20000"/> <stat name="pipeline_duty_cycle" value="0.6"/><!--<=1, runtime_ipc/peak_ipc; averaged for all cores if homogenous --> <!-- the following cycle stats are used for heterogeneouse cores only, please ignore them if homogeneouse cores --> <stat name="total_cycles" value="100000"/> <stat name="idle_cycles" value="0"/> <stat name="busy_cycles" value="100000"/> <!-- instruction buffer stats --> <!-- ROB stats, both RS and Phy based OoOs have ROB performance simulator should capture the difference on accesses, otherwise, McPAT has to guess based on number of commited instructions. --> <stat name="ROB_reads" value="263886"/> <stat name="ROB_writes" value="263886"/> <!-- RAT accesses --> <stat name="rename_accesses" value="263886"/> <stat name="fp_rename_accesses" value="263886"/> <!-- decode and rename stage use this, should be total ic - nop --> <!-- Inst window stats --> <stat name="inst_window_reads" value="263886"/> <stat name="inst_window_writes" value="263886"/> <stat name="inst_window_wakeup_accesses" value="263886"/> <stat name="fp_inst_window_reads" value="263886"/> <stat name="fp_inst_window_writes" value="263886"/> <stat name="fp_inst_window_wakeup_accesses" value="263886"/> <!-- RF accesses --> <stat name="int_regfile_reads" value="1600000"/> <stat name="float_regfile_reads" value="40000"/> <stat name="int_regfile_writes" value="800000"/> <stat name="float_regfile_writes" value="20000"/> <!-- accesses to the working reg --> <stat name="function_calls" value="5"/> <stat name="context_switches" value="260343"/> <!-- Number of Windowes switches (number of function calls and returns)--> <!-- Alu stats by default, the processor has one FPU that includes the divider and multiplier. The fpu accesses should include accesses to multiplier and divider --> <stat name="ialu_accesses" value="800000"/> <stat name="fpu_accesses" value="10000"/> <stat name="mul_accesses" value="100000"/> <stat name="cdb_alu_accesses" value="1000000"/> <stat name="cdb_mul_accesses" value="0"/> <stat name="cdb_fpu_accesses" value="0"/> <!-- multiple cycle accesses should be counted multiple times, otherwise, McPAT can use internal counter for different floating point instructions to get final accesses. But that needs detailed info for floating point inst mix --> <!-- currently the performance simulator should make sure all the numbers are final numbers, including the explicit read/write accesses, and the implicite accesses such as replacements and etc. Future versions of McPAT may be able to reason the implicite access based on param and stats of last level cache The same rule applies to all cache access stats too! --> <!-- following is AF for max power computation. Do not change them, unless you understand them--> <stat name="IFU_duty_cycle" value="0.25"/> <stat name="LSU_duty_cycle" value="0.25"/> <stat name="MemManU_I_duty_cycle" value="1"/> <stat name="MemManU_D_duty_cycle" value="0.25"/> <stat name="ALU_duty_cycle" value="0.9"/> <stat name="MUL_duty_cycle" value="0.5"/> <stat name="FPU_duty_cycle" value="0.4"/> <stat name="ALU_cdb_duty_cycle" value="0.9"/> <stat name="MUL_cdb_duty_cycle" value="0.5"/> <stat name="FPU_cdb_duty_cycle" value="0.4"/> <component id="system.core0.predictor" name="PBT"> <!-- branch predictor; tournament predictor see Alpha implementation --> <param name="local_predictor_size" value="10,3"/> <param name="local_predictor_entries" value="1024"/> <param name="global_predictor_entries" value="4096"/> <param name="global_predictor_bits" value="2"/> <param name="chooser_predictor_entries" value="4096"/> <param name="chooser_predictor_bits" value="2"/> <!-- These parameters can be combined like below in next version <param name="load_predictor" value="10,3,1024"/> <param name="global_predictor" value="4096,2"/> <param name="predictor_chooser" value="4096,2"/> --> </component> <component id="system.core0.itlb" name="itlb"> <param name="number_entries" value="64"/> <stat name="total_accesses" value="800000"/> <stat name="total_misses" value="4"/> <stat name="conflicts" value="0"/> <!-- there is no write requests to itlb although writes happen to itlb after miss, which is actually a replacement --> </component> <component id="system.core0.icache" name="icache"> <!-- there is no write requests to itlb although writes happen to it after miss, which is actually a replacement --> <param name="icache_config" value="16384,32,4,1,1,3,8,0"/> <!-- the parameters are capacity,block_width, associativity, bank, throughput w.r.t. core clock, latency w.r.t. core clock,output_width, cache policy --> <!-- cache_policy;//0 no write or write-though with non-write allocate;1 write-back with write-allocate --> <param name="buffer_sizes" value="16, 16, 16,0"/> <!-- cache controller buffer sizes: miss_buffer_size(MSHR),fill_buffer_size,prefetch_buffer_size,wb_buffer_size--> <stat name="read_accesses" value="200000"/> <stat name="read_misses" value="0"/> <stat name="conflicts" value="0"/> </component> <component id="system.core0.dtlb" name="dtlb"> <param name="number_entries" value="64"/> <stat name="total_accesses" value="200000"/> <stat name="total_misses" value="4"/> <stat name="conflicts" value="0"/> </component> <component id="system.core0.dcache" name="dcache"> <!-- all the buffer related are optional --> <param name="dcache_config" value="8192,16,4,1,1,3,16,0"/> <param name="buffer_sizes" value="16, 16, 16, 16"/> <!-- cache controller buffer sizes: miss_buffer_size(MSHR),fill_buffer_size,prefetch_buffer_size,wb_buffer_size--> <stat name="read_accesses" value="200000"/> <stat name="write_accesses" value="27276"/> <stat name="read_misses" value="1632"/> <stat name="write_misses" value="183"/> <stat name="conflicts" value="0"/> </component> <component id="system.core0.BTB" name="BTB"> <!-- all the buffer related are optional --> <param name="BTB_config" value="8192,4,2,1, 1,3"/> <!-- the parameters are capacity,block_width,associativity,bank, throughput w.r.t. core clock, latency w.r.t. core clock,--> </component> </component> <component id="system.L1Directory0" name="L1Directory0"> <param name="Directory_type" value="0"/> <!--0 cam based shadowed tag. 1 directory cache --> <param name="Dir_config" value="2048,1,0,1, 4, 4,8"/> <!-- the parameters are capacity,block_width, associativity,bank, throughput w.r.t. core clock, latency w.r.t. core clock,--> <param name="buffer_sizes" value="8, 8, 8, 8"/> <!-- all the buffer related are optional --> <param name="clockrate" value="3500"/> <param name="ports" value="1,1,1"/> <!-- number of r, w, and rw search ports --> <param name="device_type" value="0"/> <!-- altough there are multiple access types, Performance simulator needs to cast them into reads or writes e.g. the invalidates can be considered as writes --> <stat name="read_accesses" value="800000"/> <stat name="write_accesses" value="27276"/> <stat name="read_misses" value="1632"/> <stat name="write_misses" value="183"/> <stat name="conflicts" value="20"/> <stat name="duty_cycle" value="0.45"/> </component> <component id="system.L2Directory0" name="L2Directory0"> <param name="Directory_type" value="1"/> <!--0 cam based shadowed tag. 1 directory cache --> <param name="Dir_config" value="1048576,16,16,1,2, 100"/> <!-- the parameters are capacity,block_width, associativity,bank, throughput w.r.t. core clock, latency w.r.t. core clock,--> <param name="buffer_sizes" value="8, 8, 8, 8"/> <!-- all the buffer related are optional --> <param name="clockrate" value="3500"/> <param name="ports" value="1,1,1"/> <!-- number of r, w, and rw search ports --> <param name="device_type" value="0"/> <!-- altough there are multiple access types, Performance simulator needs to cast them into reads or writes e.g. the invalidates can be considered as writes --> <stat name="read_accesses" value="58824"/> <stat name="write_accesses" value="27276"/> <stat name="read_misses" value="1632"/> <stat name="write_misses" value="183"/> <stat name="conflicts" value="100"/> <stat name="duty_cycle" value="0.45"/> </component> <component id="system.L20" name="L20"> <!-- all the buffer related are optional --> <param name="L2_config" value="1048576,64,16,1, 4,23, 64, 1"/> <!-- consider 4-way bank interleaving for Niagara 1 --> <!-- the parameters are capacity,block_width, associativity, bank, throughput w.r.t. core clock, latency w.r.t. core clock,output_width, cache policy --> <param name="buffer_sizes" value="16, 16, 16, 16"/> <!-- cache controller buffer sizes: miss_buffer_size(MSHR),fill_buffer_size,prefetch_buffer_size,wb_buffer_size--> <param name="clockrate" value="3500"/> <param name="ports" value="1,1,1"/> <!-- number of r, w, and rw ports --> <param name="device_type" value="0"/> <stat name="read_accesses" value="200000"/> <stat name="write_accesses" value="0"/> <stat name="read_misses" value="0"/> <stat name="write_misses" value="0"/> <stat name="conflicts" value="0"/> <stat name="duty_cycle" value="0.5"/> </component> <!--**********************************************************************--> <component id="system.L30" name="L30"> <param name="L3_config" value="1048576,64,16,1, 2,100, 64,1"/> <!-- the parameters are capacity,block_width, associativity, bank, throughput w.r.t. core clock, latency w.r.t. core clock,output_width, cache policy --> <param name="clockrate" value="3500"/> <param name="ports" value="1,1,1"/> <!-- number of r, w, and rw ports --> <param name="device_type" value="0"/> <param name="buffer_sizes" value="16, 16, 16, 16"/> <!-- cache controller buffer sizes: miss_buffer_size(MSHR),fill_buffer_size,prefetch_buffer_size,wb_buffer_size--> <stat name="read_accesses" value="58824"/> <stat name="write_accesses" value="27276"/> <stat name="read_misses" value="1632"/> <stat name="write_misses" value="183"/> <stat name="conflicts" value="0"/> <stat name="duty_cycle" value="0.35"/> </component> <!--**********************************************************************--> <component id="system.NoC0" name="noc0"> <param name="clockrate" value="3500"/> <param name="type" value="1"/> <!-- 1 NoC, O bus --> <param name="horizontal_nodes" value="8"/> <param name="vertical_nodes" value="8"/> <param name="has_global_link" value="1"/> <!-- 1 has global link, 0 does not have global link --> <param name="link_throughput" value="1"/><!--w.r.t clock --> <param name="link_latency" value="1"/><!--w.r.t clock --> <!-- througput >= latency --> <!-- Router architecture --> <param name="input_ports" value="5"/> <param name="output_ports" value="5"/> <param name="virtual_channel_per_port" value="1"/> <!-- input buffer; in classic routers only input ports need buffers --> <param name="flit_bits" value="256"/> <param name="input_buffer_entries_per_vc" value="4"/><!--VCs within the same ports share input buffers whose size is propotional to the number of VCs--> <param name="chip_coverage" value="1"/> <!-- When multiple NOC present, one NOC will cover part of the whole chip. chip_coverage <=1 --> <stat name="total_accesses" value="360000"/> <!-- This is the number of total accesses within the whole network not for each router --> <stat name="duty_cycle" value="0.1"/> </component> <!--**********************************************************************--> <component id="system.mem" name="mem"> <!-- Main memory property --> <param name="mem_tech_node" value="32"/> <param name="device_clock" value="200"/><!--MHz, this is clock rate of the actual memory device, not the FSB --> <param name="peak_transfer_rate" value="3200"/><!--MB/S--> <param name="internal_prefetch_of_DRAM_chip" value="4"/> <!-- 2 for DDR, 4 for DDR2, 8 for DDR3...--> <!-- the device clock, peak_transfer_rate, and the internal prefetch decide the DIMM property --> <!-- above numbers can be easily found from Wikipedia --> <param name="capacity_per_channel" value="4096"/> <!-- MB --> <!-- capacity_per_Dram_chip=capacity_per_channel/number_of_dimms/number_ranks/Dram_chips_per_rank Current McPAT assumes single DIMMs are used.--> <param name="number_ranks" value="2"/> <param name="num_banks_of_DRAM_chip" value="8"/> <param name="Block_width_of_DRAM_chip" value="64"/> <!-- B --> <param name="output_width_of_DRAM_chip" value="8"/> <!--number of Dram_chips_per_rank=" 72/output_width_of_DRAM_chip--> <!--number of Dram_chips_per_rank=" 72/output_width_of_DRAM_chip--> <param name="page_size_of_DRAM_chip" value="8"/> <!-- 8 or 16 --> <param name="burstlength_of_DRAM_chip" value="8"/> <stat name="memory_accesses" value="1052"/> <stat name="memory_reads" value="1052"/> <stat name="memory_writes" value="1052"/> </component> <component id="system.mc" name="mc"> <!-- Memeory controllers are for DDR(2,3...) DIMMs --> <!-- current version of McPAT uses published values for base parameters of memory controller improvments on MC will be added in later versions. --> <param name="mc_clock" value="200"/><!--DIMM IO bus clock rate MHz DDR2-400 for Niagara 1--> <param name="peak_transfer_rate" value="3200"/><!--MB/S--> <param name="llc_line_length" value="64"/><!--B--> <param name="number_mcs" value="4"/> <!-- current McPAT only supports homogeneous memory controllers --> <param name="memory_channels_per_mc" value="1"/> <param name="number_ranks" value="2"/> <!-- # of ranks of each channel--> <param name="req_window_size_per_channel" value="32"/> <param name="IO_buffer_size_per_channel" value="32"/> <param name="databus_width" value="128"/> <param name="addressbus_width" value="51"/> <!-- McPAT will add the control bus width to the addressbus width automatically --> <stat name="memory_accesses" value="33333"/> <stat name="memory_reads" value="16667"/> <stat name="memory_writes" value="16667"/> <!-- McPAT does not track individual mc, instead, it takes the total accesses and calculate the average power per MC or per channel. This is sufficent for most application. Further trackdown can be easily added in later versions. --> </component> <!--**********************************************************************--> </component> </component>
{ "pile_set_name": "Github" }
log.level=${log.level} log.path=${log.path} dubbo.registry.address=${dubbo.registry.address} dubbo.protocal.port=${dubbo.protocal.port} dubbo.service.version=${dubbo.service.version} ws.connect.path=${ws.connect.path} ws.connect.port=${ws.connect.port} ws.connect.bus.port=${ws.connect.bus.port} service.name=ws_server service.version=1.0 service.bus.name=bus_ws_server service.bus.version=1.0 consul.host=${consul.host} consul.port=${consul.port}
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="it.tiwiz.rxjavacrunch.part9.Part9Activity"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Retain configuration instance (value)" /> <TextView android:id="@+id/currentValue" android:layout_width="match_parent" android:layout_height="wrap_content" android:textAppearance="?android:textAppearanceLarge" android:padding="@dimen/activity_vertical_margin" android:gravity="center" tools:text="10"/> </LinearLayout>
{ "pile_set_name": "Github" }
package example.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public class Customer1390 { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String firstName; private String lastName; protected Customer1390() {} public Customer1390(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } @Override public String toString() { return String.format("Customer1390[id=%d, firstName='%s', lastName='%s']", id, firstName, lastName); } }
{ "pile_set_name": "Github" }
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * */ package org.activiti.designer.validation.bpmn20.bundle; /** * Plugin constants for the org.activiti.designer.validation.bpmn20 bundle. * * @author Tiese Barrell * @version 1 * @since 5.6 * */ public final class PluginConstants { public static final String VALIDATOR_ID = "com.atosorigin.esuite.editor.process.validation.ESuiteProcessValidator"; public static final String VALIDATOR_NAME = "E-Suite Process Validator"; public static final String FORMAT_NAME = "E-Suite ZaakType jPDL"; public static final String MARKER_MESSAGE_PATTERN = "[%s] %s"; public static final int WORK_CLEAR_MARKERS = 5; public static final int WORK_EXTRACT_CONSTRUCTS = 20; public static final int WORK_USER_TASK = 10; public static final int WORK_SCRIPT_TASK = 10; public static final int WORK_SERVICE_TASK = 10; public static final int WORK_SEQUENCE_FLOW = 10; public static final int WORK_SUB_PROCESS = 10; public static final int WORK_TOTAL = WORK_CLEAR_MARKERS + WORK_EXTRACT_CONSTRUCTS + WORK_USER_TASK + WORK_SCRIPT_TASK + WORK_SERVICE_TASK + WORK_SEQUENCE_FLOW + WORK_SUB_PROCESS; }
{ "pile_set_name": "Github" }
package io.quarkus.it.panache; import java.io.Serializable; import java.util.Objects; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import io.quarkus.hibernate.orm.panache.PanacheEntityBase; @Entity @IdClass(ObjectWithCompositeId.ObjectKey.class) public class ObjectWithCompositeId extends PanacheEntityBase { @Id public String part1; @Id public String part2; public String description; static class ObjectKey implements Serializable { private String part1; private String part2; public ObjectKey() { } public ObjectKey(String part1, String part2) { this.part1 = part1; this.part2 = part2; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ObjectKey objectKey = (ObjectKey) o; return part1.equals(objectKey.part1) && part2.equals(objectKey.part2); } @Override public int hashCode() { return Objects.hash(part1, part2); } } }
{ "pile_set_name": "Github" }
/** * Copyright (c) Rich Hickey. All rights reserved. * The use and distribution terms for this software are covered by the * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) * which can be found in the file epl-v10.html at the root of this distribution. * By using this software in any fashion, you are agreeing to be bound by * the terms of this license. * You must not remove this notice, or any other, from this software. **/ using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Clojure")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Clojure")] [assembly: AssemblyCopyright("Copyright © 2009")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("92a6be2b-759d-4d62-8912-9dde0052bc33")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.4.0.0")] [assembly: AssemblyFileVersion("1.3")] [assembly: System.Resources.NeutralResourcesLanguage("en-US")]
{ "pile_set_name": "Github" }
/* * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package sun.tools.jconsole; import java.awt.*; import java.awt.event.*; import java.io.*; import java.lang.management.*; import java.lang.reflect.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.event.*; import java.util.*; import java.util.concurrent.*; import java.util.List; import static sun.tools.jconsole.Utilities.*; @SuppressWarnings("serial") class ThreadTab extends Tab implements ActionListener, DocumentListener, ListSelectionListener { PlotterPanel threadMeter; TimeComboBox timeComboBox; JTabbedPane threadListTabbedPane; DefaultListModel<Long> listModel; JTextField filterTF; JLabel messageLabel; JSplitPane threadsSplitPane; HashMap<Long, String> nameCache = new HashMap<Long, String>(); private ThreadOverviewPanel overviewPanel; private boolean plotterListening = false; private static final String threadCountKey = "threadCount"; private static final String peakKey = "peak"; private static final Color threadCountColor = Plotter.defaultColor; private static final Color peakColor = Color.red; private static final Border thinEmptyBorder = new EmptyBorder(2, 2, 2, 2); /* Hierarchy of panels and layouts for this tab: ThreadTab (BorderLayout) North: topPanel (BorderLayout) Center: controlPanel (FlowLayout) timeComboBox Center: plotterPanel (BorderLayout) Center: plotter */ public static String getTabName() { return Messages.THREADS; } public ThreadTab(VMPanel vmPanel) { super(vmPanel, getTabName()); setLayout(new BorderLayout(0, 0)); setBorder(new EmptyBorder(4, 4, 3, 4)); JPanel topPanel = new JPanel(new BorderLayout()); JPanel plotterPanel = new JPanel(new VariableGridLayout(0, 1, 4, 4, true, true)); add(topPanel, BorderLayout.NORTH); add(plotterPanel, BorderLayout.CENTER); JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 20, 5)); topPanel.add(controlPanel, BorderLayout.CENTER); threadMeter = new PlotterPanel(Messages.NUMBER_OF_THREADS, Plotter.Unit.NONE, true); threadMeter.plotter.createSequence(threadCountKey, Messages.LIVE_THREADS, threadCountColor, true); threadMeter.plotter.createSequence(peakKey, Messages.PEAK, peakColor, true); setAccessibleName(threadMeter.plotter, Messages.THREAD_TAB_THREAD_PLOTTER_ACCESSIBLE_NAME); plotterPanel.add(threadMeter); timeComboBox = new TimeComboBox(threadMeter.plotter); controlPanel.add(new LabeledComponent(Messages.TIME_RANGE_COLON, Resources.getMnemonicInt(Messages.TIME_RANGE_COLON), timeComboBox)); listModel = new DefaultListModel<Long>(); JTextArea textArea = new JTextArea(); textArea.setBorder(thinEmptyBorder); textArea.setEditable(false); setAccessibleName(textArea, Messages.THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME); ThreadJList list = new ThreadJList(listModel, textArea); Dimension di = new Dimension(super.getPreferredSize()); di.width = Math.min(di.width, 200); JScrollPane threadlistSP = new JScrollPane(list); threadlistSP.setPreferredSize(di); threadlistSP.setBorder(null); JScrollPane textAreaSP = new JScrollPane(textArea); textAreaSP.setBorder(null); threadListTabbedPane = new JTabbedPane(JTabbedPane.TOP); threadsSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, threadlistSP, textAreaSP); threadsSplitPane.setOneTouchExpandable(true); threadsSplitPane.setBorder(null); JPanel firstTabPanel = new JPanel(new BorderLayout()); firstTabPanel.setOpaque(false); JPanel firstTabToolPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 2)); firstTabToolPanel.setOpaque(false); filterTF = new PromptingTextField("Filter", 20); filterTF.getDocument().addDocumentListener(this); firstTabToolPanel.add(filterTF); JSeparator separator = new JSeparator(JSeparator.VERTICAL); separator.setPreferredSize(new Dimension(separator.getPreferredSize().width, filterTF.getPreferredSize().height)); firstTabToolPanel.add(separator); JButton detectDeadlockButton = new JButton(Messages.DETECT_DEADLOCK); detectDeadlockButton.setMnemonic(Resources.getMnemonicInt(Messages.DETECT_DEADLOCK)); detectDeadlockButton.setActionCommand("detectDeadlock"); detectDeadlockButton.addActionListener(this); detectDeadlockButton.setToolTipText(Messages.DETECT_DEADLOCK_TOOLTIP); firstTabToolPanel.add(detectDeadlockButton); messageLabel = new JLabel(); firstTabToolPanel.add(messageLabel); firstTabPanel.add(threadsSplitPane, BorderLayout.CENTER); firstTabPanel.add(firstTabToolPanel, BorderLayout.SOUTH); threadListTabbedPane.addTab(Messages.THREADS, firstTabPanel); plotterPanel.add(threadListTabbedPane); } private long oldThreads[] = new long[0]; public SwingWorker<?, ?> newSwingWorker() { final ProxyClient proxyClient = vmPanel.getProxyClient(); if (!plotterListening) { proxyClient.addWeakPropertyChangeListener(threadMeter.plotter); plotterListening = true; } return new SwingWorker<Boolean, Object>() { private int tlCount; private int tpCount; private long ttCount; private long[] threads; private long timeStamp; public Boolean doInBackground() { try { ThreadMXBean threadMBean = proxyClient.getThreadMXBean(); tlCount = threadMBean.getThreadCount(); tpCount = threadMBean.getPeakThreadCount(); if (overviewPanel != null) { ttCount = threadMBean.getTotalStartedThreadCount(); } else { ttCount = 0L; } threads = threadMBean.getAllThreadIds(); for (long newThread : threads) { if (nameCache.get(newThread) == null) { ThreadInfo ti = threadMBean.getThreadInfo(newThread); if (ti != null) { String name = ti.getThreadName(); if (name != null) { nameCache.put(newThread, name); } } } } timeStamp = System.currentTimeMillis(); return true; } catch (IOException e) { return false; } catch (UndeclaredThrowableException e) { return false; } } protected void done() { try { if (!get()) { return; } } catch (InterruptedException ex) { return; } catch (ExecutionException ex) { if (JConsole.isDebug()) { ex.printStackTrace(); } return; } threadMeter.plotter.addValues(timeStamp, tlCount, tpCount); threadMeter.setValueLabel(tlCount+""); if (overviewPanel != null) { overviewPanel.updateThreadsInfo(tlCount, tpCount, ttCount, timeStamp); } String filter = filterTF.getText().toLowerCase(Locale.ENGLISH); boolean doFilter = (filter.length() > 0); ArrayList<Long> l = new ArrayList<Long>(); for (long t : threads) { l.add(t); } Iterator<Long> iterator = l.iterator(); while (iterator.hasNext()) { long newThread = iterator.next(); String name = nameCache.get(newThread); if (doFilter && name != null && name.toLowerCase(Locale.ENGLISH).indexOf(filter) < 0) { iterator.remove(); } } long[] newThreads = threads; if (l.size() < threads.length) { newThreads = new long[l.size()]; for (int i = 0; i < newThreads.length; i++) { newThreads[i] = l.get(i); } } for (long oldThread : oldThreads) { boolean found = false; for (long newThread : newThreads) { if (newThread == oldThread) { found = true; break; } } if (!found) { listModel.removeElement(oldThread); if (!doFilter) { nameCache.remove(oldThread); } } } // Threads are in reverse chronological order for (int i = newThreads.length - 1; i >= 0; i--) { long newThread = newThreads[i]; boolean found = false; for (long oldThread : oldThreads) { if (newThread == oldThread) { found = true; break; } } if (!found) { listModel.addElement(newThread); } } oldThreads = newThreads; } }; } long lastSelected = -1; public void valueChanged(ListSelectionEvent ev) { ThreadJList list = (ThreadJList)ev.getSource(); final JTextArea textArea = list.textArea; Long selected = list.getSelectedValue(); if (selected == null) { if (lastSelected != -1) { selected = lastSelected; } } else { lastSelected = selected; } textArea.setText(""); if (selected != null) { final long threadID = selected; workerAdd(new Runnable() { public void run() { ProxyClient proxyClient = vmPanel.getProxyClient(); StringBuilder sb = new StringBuilder(); try { ThreadMXBean threadMBean = proxyClient.getThreadMXBean(); ThreadInfo ti = null; MonitorInfo[] monitors = null; if (proxyClient.isLockUsageSupported() && threadMBean.isObjectMonitorUsageSupported()) { // VMs that support the monitor usage monitoring ThreadInfo[] infos = threadMBean.dumpAllThreads(true, false); for (ThreadInfo info : infos) { if (info.getThreadId() == threadID) { ti = info; monitors = info.getLockedMonitors(); break; } } } else { // VM doesn't support monitor usage monitoring ti = threadMBean.getThreadInfo(threadID, Integer.MAX_VALUE); } if (ti != null) { if (ti.getLockName() == null) { sb.append(Resources.format(Messages.NAME_STATE, ti.getThreadName(), ti.getThreadState().toString())); } else if (ti.getLockOwnerName() == null) { sb.append(Resources.format(Messages.NAME_STATE_LOCK_NAME, ti.getThreadName(), ti.getThreadState().toString(), ti.getLockName())); } else { sb.append(Resources.format(Messages.NAME_STATE_LOCK_NAME_LOCK_OWNER, ti.getThreadName(), ti.getThreadState().toString(), ti.getLockName(), ti.getLockOwnerName())); } sb.append(Resources.format(Messages.BLOCKED_COUNT_WAITED_COUNT, ti.getBlockedCount(), ti.getWaitedCount())); sb.append(Messages.STACK_TRACE); int index = 0; for (StackTraceElement e : ti.getStackTrace()) { sb.append(e).append('\n'); if (monitors != null) { for (MonitorInfo mi : monitors) { if (mi.getLockedStackDepth() == index) { sb.append(Resources.format(Messages.MONITOR_LOCKED, mi.toString())); } } } index++; } } } catch (IOException ex) { // Ignore } catch (UndeclaredThrowableException e) { proxyClient.markAsDead(); } final String text = sb.toString(); SwingUtilities.invokeLater(new Runnable() { public void run() { textArea.setText(text); textArea.setCaretPosition(0); } }); } }); } } private void doUpdate() { workerAdd(new Runnable() { public void run() { update(); } }); } private void detectDeadlock() { workerAdd(new Runnable() { public void run() { try { final Long[][] deadlockedThreads = getDeadlockedThreadIds(); if (deadlockedThreads == null || deadlockedThreads.length == 0) { // Display message for 30 seconds. Do it on a separate thread so // the sleep won't hold up the worker queue. // This will be replaced later by separate statusbar logic. new Thread() { public void run() { try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { String msg = Messages.NO_DEADLOCK_DETECTED; messageLabel.setText(msg); threadListTabbedPane.revalidate(); } }); sleep(30 * 1000); } catch (InterruptedException ex) { // Ignore } catch (InvocationTargetException ex) { // Ignore } SwingUtilities.invokeLater(new Runnable() { public void run() { messageLabel.setText(""); } }); } }.start(); return; } SwingUtilities.invokeLater(new Runnable() { public void run() { // Remove old deadlock tabs while (threadListTabbedPane.getTabCount() > 1) { threadListTabbedPane.removeTabAt(1); } if (deadlockedThreads != null) { for (int i = 0; i < deadlockedThreads.length; i++) { DefaultListModel<Long> listModel = new DefaultListModel<Long>(); JTextArea textArea = new JTextArea(); textArea.setBorder(thinEmptyBorder); textArea.setEditable(false); setAccessibleName(textArea, Messages.THREAD_TAB_THREAD_INFO_ACCESSIBLE_NAME); ThreadJList list = new ThreadJList(listModel, textArea); JScrollPane threadlistSP = new JScrollPane(list); JScrollPane textAreaSP = new JScrollPane(textArea); threadlistSP.setBorder(null); textAreaSP.setBorder(null); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, threadlistSP, textAreaSP); splitPane.setOneTouchExpandable(true); splitPane.setBorder(null); splitPane.setDividerLocation(threadsSplitPane.getDividerLocation()); String tabName; if (deadlockedThreads.length > 1) { tabName = Resources.format(Messages.DEADLOCK_TAB_N, i+1); } else { tabName = Messages.DEADLOCK_TAB; } threadListTabbedPane.addTab(tabName, splitPane); for (long t : deadlockedThreads[i]) { listModel.addElement(t); } } threadListTabbedPane.setSelectedIndex(1); } } }); } catch (IOException e) { // Ignore } catch (UndeclaredThrowableException e) { vmPanel.getProxyClient().markAsDead(); } } }); } // Return deadlocked threads or null public Long[][] getDeadlockedThreadIds() throws IOException { ProxyClient proxyClient = vmPanel.getProxyClient(); ThreadMXBean threadMBean = proxyClient.getThreadMXBean(); long[] ids = proxyClient.findDeadlockedThreads(); if (ids == null) { return null; } ThreadInfo[] infos = threadMBean.getThreadInfo(ids, Integer.MAX_VALUE); List<Long[]> dcycles = new ArrayList<Long[]>(); List<Long> cycle = new ArrayList<Long>(); // keep track of which thread is visited // one thread can only be in one cycle boolean[] visited = new boolean[ids.length]; int deadlockedThread = -1; // Index into arrays while (true) { if (deadlockedThread < 0) { if (cycle.size() > 0) { // a cycle found dcycles.add(cycle.toArray(new Long[0])); cycle = new ArrayList<Long>(); } // start a new cycle from a non-visited thread for (int j = 0; j < ids.length; j++) { if (!visited[j]) { deadlockedThread = j; visited[j] = true; break; } } if (deadlockedThread < 0) { // done break; } } cycle.add(ids[deadlockedThread]); long nextThreadId = infos[deadlockedThread].getLockOwnerId(); for (int j = 0; j < ids.length; j++) { ThreadInfo ti = infos[j]; if (ti.getThreadId() == nextThreadId) { if (visited[j]) { deadlockedThread = -1; } else { deadlockedThread = j; visited[j] = true; } break; } } } return dcycles.toArray(new Long[0][0]); } // ActionListener interface public void actionPerformed(ActionEvent evt) { String cmd = ((AbstractButton)evt.getSource()).getActionCommand(); if (cmd == "detectDeadlock") { messageLabel.setText(""); detectDeadlock(); } } // DocumentListener interface public void insertUpdate(DocumentEvent e) { doUpdate(); } public void removeUpdate(DocumentEvent e) { doUpdate(); } public void changedUpdate(DocumentEvent e) { doUpdate(); } private class ThreadJList extends JList<Long> { private JTextArea textArea; ThreadJList(DefaultListModel<Long> listModel, JTextArea textArea) { super(listModel); this.textArea = textArea; setBorder(thinEmptyBorder); setSelectionMode(ListSelectionModel.SINGLE_SELECTION); textArea.setText(Messages.THREAD_TAB_INITIAL_STACK_TRACE_MESSAGE); addListSelectionListener(ThreadTab.this); setCellRenderer(new DefaultListCellRenderer() { public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if (value != null) { String name = nameCache.get(value); if (name == null) { name = value.toString(); } setText(name); } return this; } }); } public Dimension getPreferredSize() { Dimension d = super.getPreferredSize(); d.width = Math.max(d.width, 100); return d; } } private class PromptingTextField extends JTextField implements FocusListener { private String prompt; boolean promptRemoved = false; Color fg; public PromptingTextField(String prompt, int columns) { super(prompt, columns); this.prompt = prompt; updateForeground(); addFocusListener(this); setAccessibleName(this, prompt); } @Override public void revalidate() { super.revalidate(); updateForeground(); } private void updateForeground() { this.fg = UIManager.getColor("TextField.foreground"); if (promptRemoved) { setForeground(fg); } else { setForeground(Color.gray); } } public String getText() { if (!promptRemoved) { return ""; } else { return super.getText(); } } public void focusGained(FocusEvent e) { if (!promptRemoved) { setText(""); setForeground(fg); promptRemoved = true; } } public void focusLost(FocusEvent e) { if (promptRemoved && getText().isEmpty()) { setText(prompt); setForeground(Color.gray); promptRemoved = false; } } } OverviewPanel[] getOverviewPanels() { if (overviewPanel == null) { overviewPanel = new ThreadOverviewPanel(); } return new OverviewPanel[] { overviewPanel }; } private static class ThreadOverviewPanel extends OverviewPanel { ThreadOverviewPanel() { super(Messages.THREADS, threadCountKey, Messages.LIVE_THREADS, null); } private void updateThreadsInfo(long tlCount, long tpCount, long ttCount, long timeStamp) { getPlotter().addValues(timeStamp, tlCount); getInfoLabel().setText(Resources.format(Messages.THREAD_TAB_INFO_LABEL_FORMAT, tlCount, tpCount, ttCount)); } } }
{ "pile_set_name": "Github" }
File.open(${1:path_to_yml}, "w") { |${2:file}| YAML.dump(${3:obj}, ${4:$2}) }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2014 Saravan Pantham * * 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.psaravan.filebrowserview.lib.AsyncTasks; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.os.AsyncTask; import android.widget.Toast; import com.psaravan.filebrowserview.lib.Interfaces.MoveInterface; import com.psaravan.filebrowserview.lib.R; import org.apache.commons.io.FileUtils; import java.io.File; /** * AsyncTask that moves the specified file/folder recursively to a new location. * * @author Saravan Pantham */ public class AsyncMoveTask extends AsyncTask<String, Void, Boolean> { private Context mContext; private ProgressDialog pd; private File mSourceFile; private File mDestDirFile; private boolean mShowProgress = true; private MoveInterface mMoveInterface; public AsyncMoveTask(Context context, File source, File destDir, boolean showProgress) { mContext = context; mSourceFile = source; mShowProgress = showProgress; mDestDirFile = destDir; } @Override protected void onPreExecute() { if (mSourceFile==null) return; //Skip the rest of this method if the user doesn't want a progress dialog. if (!mShowProgress) return; pd = new ProgressDialog(mContext); pd.setCancelable(false); pd.setIndeterminate(false); pd.setTitle(R.string.move); pd.setMessage(mContext.getResources().getString(R.string.moving) + " " + mSourceFile.getName()); pd.setButton(DialogInterface.BUTTON_NEUTRAL, mContext.getResources() .getString(R.string.run_in_background), new OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { pd.dismiss(); } }); pd.show(); if (mMoveInterface!=null) mMoveInterface.preMoveStartSync(); } @Override protected Boolean doInBackground(String... params) { if (mMoveInterface!=null) mMoveInterface.preMoveStartAsync(); if (mSourceFile==null || mDestDirFile==null) { if (mMoveInterface!=null) mMoveInterface.onMoveCompleteAsync(false); return false; } if (mSourceFile.isDirectory()) { try { FileUtils.moveDirectory(mSourceFile, mDestDirFile); } catch (Exception e) { if (mMoveInterface!=null) mMoveInterface.onMoveCompleteAsync(false); return false; } } else { try { FileUtils.moveFile(mSourceFile, mDestDirFile); } catch (Exception e) { if (mMoveInterface!=null) mMoveInterface.onMoveCompleteAsync(false); return false; } } if (mMoveInterface!=null) mMoveInterface.onMoveCompleteAsync(true); return true; } @Override protected void onPostExecute(Boolean result) { super.onPostExecute(result); if (mMoveInterface!=null) mMoveInterface.onMoveCompleteSync(result); if (pd!=null) pd.dismiss(); if (result==true) { String message = mSourceFile.getName() + " " + mContext.getResources().getString(R.string.moved); Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show(); } else { String message = mSourceFile.getName() + " " + mContext.getResources().getString(R.string.could_not_be_moved); Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show(); } } /** * @param moveInterface The move interface instance to attach to this * AsyncTask. */ public void setMoveInterface(MoveInterface moveInterface) { mMoveInterface = moveInterface; } }
{ "pile_set_name": "Github" }
/* This repository is no longer actively maintained. To find all solutions to this problem (and practice coding more problems) at: ~~~~~~~~~~~~~~~~~~~~~~~~~ https://backtobackswe.com ~~~~~~~~~~~~~~~~~~~~~~~~~ */ public class Solution { public static void main(String args[]) { /* Here you are given the adjacency list, but even if you were given the raw edges and vertices (remember: G = (V, E)), you'd still be able to build the adjacency list in O(|E|) time. Just loop over the edges and build what you see below. */ Map<Integer, List<Integer>> originalNodeToAdjacents = new HashMap<>(); originalNodeToAdjacents.put(0, Arrays.asList(1)); originalNodeToAdjacents.put(1, Arrays.asList(2)); originalNodeToAdjacents.put(2, Arrays.asList(3, 4)); originalNodeToAdjacents.put(3, Arrays.asList(0)); originalNodeToAdjacents.put(4, Arrays.asList(2)); /* The graph above: 0 ---> 1 ---> 2 <---> 4 ^ / \ / \ / \ ⌄ 3 */ /* If we reverse each edge: 0 <--- 1 <--- 2 <---> 4 \ ^ \ / \ / ⌄ / 3 */ System.out.println(isStronglyConnected(originalNodeToAdjacents)); } private static boolean isStronglyConnected(Map<Integer, List<Integer>> originalNodeToAdjacents) { boolean allNodesReached = allNodesReachedViaBFS(originalNodeToAdjacents); if (!allNodesReached) { return false; } Map<Integer, List<Integer>> reversedNodeToAdjacents = reverseGraph(originalNodeToAdjacents); boolean allNodesReachedWithReverseGraph = allNodesReachedViaBFS(reversedNodeToAdjacents); return allNodesReachedWithReverseGraph; } private static boolean allNodesReachedViaBFS(Map<Integer, List<Integer>> originalNodeToAdjacents) { Set<Integer> visited = new HashSet<>(); Queue<Integer> queue = new LinkedList<>(); queue.add(0); visited.add(0); while (!queue.isEmpty()) { int node = queue.poll(); List<Integer> adjacents = originalNodeToAdjacents.get(node); if (adjacents != null) { for (int adjacent: adjacents) { if (!visited.contains(adjacent)) { visited.add(adjacent); queue.add(adjacent); } } } } return visited.size() == originalNodeToAdjacents.size(); } private static Map<Integer, List<Integer>> reverseGraph(Map<Integer, List<Integer>> originalNodeToAdjacents) { Map<Integer, List<Integer>> reversedNodeToAdjacents = new HashMap<>(); for (Map.Entry<Integer, List<Integer>> entry: originalNodeToAdjacents.entrySet()) { int nodeValue = entry.getKey(); List<Integer> adjacents = entry.getValue(); // Reverse each edge for (int adjacent: adjacents) { List<Integer> reversedAdjacents; if (!reversedNodeToAdjacents.containsKey(adjacent)) { reversedAdjacents = new ArrayList<>(); } else { reversedAdjacents = reversedNodeToAdjacents.get(adjacent); } // Reverse edge, before node went to adjacent, now adjacent maps to the node reversedAdjacents.add(nodeValue); reversedNodeToAdjacents.put(adjacent, reversedAdjacents); } } return reversedNodeToAdjacents; } }
{ "pile_set_name": "Github" }
/* * 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. */ drop dataverse test if exists; create dataverse test; use test; create type test.MyRecord as { id : bigint, point : point, kwds : string }; create external dataset MyData(MyRecord) using localfs((`path`=`asterix_nc1://data/spatial/spatialData.json`),(`format`=`adm`));
{ "pile_set_name": "Github" }
<!-- ~ Copyright 2019. Google LLC ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ https://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/bg_blue" android:orientation="vertical" android:padding="20dp" tools:context="com.google.android.apps.santatracker.dasherdancer.CharacterActivity" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:orientation="horizontal" > <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible" /> <ImageButton android:id="@+id/btn_character_santa" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:adjustViewBounds="true" android:background="@drawable/dasher_ripple" android:onClick="onCharacterClick" android:scaleType="fitCenter" android:layout_gravity="bottom" android:src="@drawable/santa" /> <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:orientation="horizontal" > <ImageButton android:id="@+id/btn_character_elf" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:adjustViewBounds="true" android:background="@drawable/dasher_ripple" android:onClick="onCharacterClick" android:scaleType="fitCenter" android:layout_gravity="center" android:src="@drawable/elf" /> <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible" /> <ImageButton android:id="@+id/btn_character_reindeer" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:adjustViewBounds="true" android:background="@drawable/dasher_ripple" android:onClick="onCharacterClick" android:scaleType="fitCenter" android:layout_gravity="center" android:src="@drawable/reindeer" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:orientation="horizontal" > <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible" /> <ImageButton android:id="@+id/btn_character_snowman" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:adjustViewBounds="true" android:background="@drawable/dasher_ripple" android:onClick="onCharacterClick" android:scaleType="fitCenter" android:layout_gravity="top" android:src="@drawable/snowman" /> <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:visibility="invisible" /> </LinearLayout> </LinearLayout>
{ "pile_set_name": "Github" }
package net.sgoliver.android.controlpers2; import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.TextView; public class ControlLogin extends LinearLayout { private EditText txtUsuario; private EditText txtPassword; private Button btnLogin; private TextView lblMensaje; private OnLoginListener listener; public ControlLogin(Context context) { super(context); inicializar(); } public ControlLogin(Context context, AttributeSet attrs) { super(context, attrs); inicializar(); // Procesamos los atributos XML personalizados TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.ControlLogin); String textoBoton = a.getString( R.styleable.ControlLogin_login_text); btnLogin.setText(textoBoton); a.recycle(); } private void inicializar() { //Utilizamos el layout 'control_login' como interfaz del control String infService = Context.LAYOUT_INFLATER_SERVICE; LayoutInflater li = (LayoutInflater)getContext().getSystemService(infService); li.inflate(R.layout.control_login, this, true); //Obtenemoslas referencias a los distintos control txtUsuario = (EditText)findViewById(R.id.TxtUsuario); txtPassword = (EditText)findViewById(R.id.TxtPassword); btnLogin = (Button)findViewById(R.id.BtnAceptar); lblMensaje = (TextView)findViewById(R.id.LblMensaje); //Asociamos los eventos necesarios asignarEventos(); } public void setOnLoginListener(OnLoginListener l) { listener = l; } private void asignarEventos() { btnLogin.setOnClickListener(new OnClickListener() { public void onClick(View v) { listener.onLogin(txtUsuario.getText().toString(), txtPassword.getText().toString()); } }); } public void setMensaje(String msg) { lblMensaje.setText(msg); } }
{ "pile_set_name": "Github" }
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html module Stratosphere.ResourceProperties.DLMLifecyclePolicySchedule where import Stratosphere.ResourceImports import Stratosphere.ResourceProperties.DLMLifecyclePolicyCreateRule import Stratosphere.ResourceProperties.DLMLifecyclePolicyCrossRegionCopyRule import Stratosphere.ResourceProperties.DLMLifecyclePolicyFastRestoreRule import Stratosphere.ResourceProperties.DLMLifecyclePolicyRetainRule import Stratosphere.ResourceProperties.Tag -- | Full data type definition for DLMLifecyclePolicySchedule. See -- 'dlmLifecyclePolicySchedule' for a more convenient constructor. data DLMLifecyclePolicySchedule = DLMLifecyclePolicySchedule { _dLMLifecyclePolicyScheduleCopyTags :: Maybe (Val Bool) , _dLMLifecyclePolicyScheduleCreateRule :: Maybe DLMLifecyclePolicyCreateRule , _dLMLifecyclePolicyScheduleCrossRegionCopyRules :: Maybe [DLMLifecyclePolicyCrossRegionCopyRule] , _dLMLifecyclePolicyScheduleFastRestoreRule :: Maybe DLMLifecyclePolicyFastRestoreRule , _dLMLifecyclePolicyScheduleName :: Maybe (Val Text) , _dLMLifecyclePolicyScheduleRetainRule :: Maybe DLMLifecyclePolicyRetainRule , _dLMLifecyclePolicyScheduleTagsToAdd :: Maybe [Tag] , _dLMLifecyclePolicyScheduleVariableTags :: Maybe [Tag] } deriving (Show, Eq) instance ToJSON DLMLifecyclePolicySchedule where toJSON DLMLifecyclePolicySchedule{..} = object $ catMaybes [ fmap (("CopyTags",) . toJSON) _dLMLifecyclePolicyScheduleCopyTags , fmap (("CreateRule",) . toJSON) _dLMLifecyclePolicyScheduleCreateRule , fmap (("CrossRegionCopyRules",) . toJSON) _dLMLifecyclePolicyScheduleCrossRegionCopyRules , fmap (("FastRestoreRule",) . toJSON) _dLMLifecyclePolicyScheduleFastRestoreRule , fmap (("Name",) . toJSON) _dLMLifecyclePolicyScheduleName , fmap (("RetainRule",) . toJSON) _dLMLifecyclePolicyScheduleRetainRule , fmap (("TagsToAdd",) . toJSON) _dLMLifecyclePolicyScheduleTagsToAdd , fmap (("VariableTags",) . toJSON) _dLMLifecyclePolicyScheduleVariableTags ] -- | Constructor for 'DLMLifecyclePolicySchedule' containing required fields -- as arguments. dlmLifecyclePolicySchedule :: DLMLifecyclePolicySchedule dlmLifecyclePolicySchedule = DLMLifecyclePolicySchedule { _dLMLifecyclePolicyScheduleCopyTags = Nothing , _dLMLifecyclePolicyScheduleCreateRule = Nothing , _dLMLifecyclePolicyScheduleCrossRegionCopyRules = Nothing , _dLMLifecyclePolicyScheduleFastRestoreRule = Nothing , _dLMLifecyclePolicyScheduleName = Nothing , _dLMLifecyclePolicyScheduleRetainRule = Nothing , _dLMLifecyclePolicyScheduleTagsToAdd = Nothing , _dLMLifecyclePolicyScheduleVariableTags = Nothing } -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-copytags dlmlpsCopyTags :: Lens' DLMLifecyclePolicySchedule (Maybe (Val Bool)) dlmlpsCopyTags = lens _dLMLifecyclePolicyScheduleCopyTags (\s a -> s { _dLMLifecyclePolicyScheduleCopyTags = a }) -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-createrule dlmlpsCreateRule :: Lens' DLMLifecyclePolicySchedule (Maybe DLMLifecyclePolicyCreateRule) dlmlpsCreateRule = lens _dLMLifecyclePolicyScheduleCreateRule (\s a -> s { _dLMLifecyclePolicyScheduleCreateRule = a }) -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-crossregioncopyrules dlmlpsCrossRegionCopyRules :: Lens' DLMLifecyclePolicySchedule (Maybe [DLMLifecyclePolicyCrossRegionCopyRule]) dlmlpsCrossRegionCopyRules = lens _dLMLifecyclePolicyScheduleCrossRegionCopyRules (\s a -> s { _dLMLifecyclePolicyScheduleCrossRegionCopyRules = a }) -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-fastrestorerule dlmlpsFastRestoreRule :: Lens' DLMLifecyclePolicySchedule (Maybe DLMLifecyclePolicyFastRestoreRule) dlmlpsFastRestoreRule = lens _dLMLifecyclePolicyScheduleFastRestoreRule (\s a -> s { _dLMLifecyclePolicyScheduleFastRestoreRule = a }) -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-name dlmlpsName :: Lens' DLMLifecyclePolicySchedule (Maybe (Val Text)) dlmlpsName = lens _dLMLifecyclePolicyScheduleName (\s a -> s { _dLMLifecyclePolicyScheduleName = a }) -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-retainrule dlmlpsRetainRule :: Lens' DLMLifecyclePolicySchedule (Maybe DLMLifecyclePolicyRetainRule) dlmlpsRetainRule = lens _dLMLifecyclePolicyScheduleRetainRule (\s a -> s { _dLMLifecyclePolicyScheduleRetainRule = a }) -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-tagstoadd dlmlpsTagsToAdd :: Lens' DLMLifecyclePolicySchedule (Maybe [Tag]) dlmlpsTagsToAdd = lens _dLMLifecyclePolicyScheduleTagsToAdd (\s a -> s { _dLMLifecyclePolicyScheduleTagsToAdd = a }) -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-schedule.html#cfn-dlm-lifecyclepolicy-schedule-variabletags dlmlpsVariableTags :: Lens' DLMLifecyclePolicySchedule (Maybe [Tag]) dlmlpsVariableTags = lens _dLMLifecyclePolicyScheduleVariableTags (\s a -> s { _dLMLifecyclePolicyScheduleVariableTags = a })
{ "pile_set_name": "Github" }
# GENERATED VERSION FILE # TIME: Sun May 24 21:24:18 2020 __version__ = '1.0.rc0' short_version = '1.0.rc0'
{ "pile_set_name": "Github" }
<!DOCTYPE HTML> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc --> <title>JTabbedPane.ModelListener (Java SE 12 &amp; JDK 12 )</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="javax.swing.JTabbedPane.ModelListener class"> <meta name="keywords" content="stateChanged()"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="../../../script.js"></script> <script type="text/javascript" src="../../../jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif]--> <script type="text/javascript" src="../../../jquery/jquery-3.3.1.js"></script> <script type="text/javascript" src="../../../jquery/jquery-migrate-3.0.1.js"></script> <script type="text/javascript" src="../../../jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="JTabbedPane.ModelListener (Java SE 12 & JDK 12 )"; } } catch(err) { } //--> var pathtoroot = "../../../"; var useModuleDirectories = true; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <header role="banner"> <nav role="navigation"> <div class="fixedNav"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a id="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../index.html">Overview</a></li> <li><a href="../../module-summary.html">Module</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/JTabbedPane.ModelListener.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-files/index-1.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 &amp; JDK 12</strong> </div></div> </div> <div class="subNav"> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&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><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <ul class="navListSearch"> <li><label for="search">SEARCH:</label> <input type="text" id="search" value="search" disabled="disabled"> <input type="reset" id="reset" value="reset" disabled="disabled"> </li> </ul> </div> <a id="skip.navbar.top"> <!-- --> </a> <!-- ========= END OF TOP NAVBAR ========= --> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><!-- $('.navPadding').css('padding-top', $('.fixedNav').css("height")); //--> </script> </nav> </header> <!-- ======== START OF CLASS DATA ======== --> <main role="main"> <div class="header"> <div class="subTitle"><span class="moduleLabelInType">Module</span>&nbsp;<a href="../../module-summary.html">java.desktop</a></div> <div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">javax.swing</a></div> <h2 title="Class JTabbedPane.ModelListener" class="title">Class JTabbedPane.ModelListener</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="../../../java.base/java/lang/Object.html" title="class in java.lang">java.lang.Object</a></li> <li> <ul class="inheritance"> <li>javax.swing.JTabbedPane.ModelListener</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><code><a href="../../../java.base/java/io/Serializable.html" title="interface in java.io">Serializable</a></code>, <code><a href="../../../java.base/java/util/EventListener.html" title="interface in java.util">EventListener</a></code>, <code><a href="event/ChangeListener.html" title="interface in javax.swing.event">ChangeListener</a></code></dd> </dl> <dl> <dt>Enclosing class:</dt> <dd><a href="JTabbedPane.html" title="class in javax.swing">JTabbedPane</a></dd> </dl> <hr> <pre>protected class <span class="typeNameLabel">JTabbedPane.ModelListener</span> extends <a href="../../../java.base/java/lang/Object.html" title="class in java.lang">Object</a> implements <a href="event/ChangeListener.html" title="interface in javax.swing.event">ChangeListener</a>, <a href="../../../java.base/java/io/Serializable.html" title="interface in java.io">Serializable</a></pre> <div class="block">We pass <code>ModelChanged</code> events along to the listeners with the tabbedpane (instead of the model itself) as the event source.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <div class="memberSummary"> <table> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier</th> <th class="colSecond" scope="col">Constructor</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>protected </code></td> <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">ModelListener</a></span>()</code></th> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </div> </li> </ul> </section> <!-- ========== METHOD SUMMARY =========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <ul class="blockList"> <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods declared in class&nbsp;java.lang.<a href="../../../java.base/java/lang/Object.html" title="class in java.lang">Object</a></h3> <code><a href="../../../java.base/java/lang/Object.html#clone()">clone</a>, <a href="../../../java.base/java/lang/Object.html#equals(java.lang.Object)">equals</a>, <a href="../../../java.base/java/lang/Object.html#finalize()">finalize</a>, <a href="../../../java.base/java/lang/Object.html#getClass()">getClass</a>, <a href="../../../java.base/java/lang/Object.html#hashCode()">hashCode</a>, <a href="../../../java.base/java/lang/Object.html#notify()">notify</a>, <a href="../../../java.base/java/lang/Object.html#notifyAll()">notifyAll</a>, <a href="../../../java.base/java/lang/Object.html#toString()">toString</a>, <a href="../../../java.base/java/lang/Object.html#wait()">wait</a>, <a href="../../../java.base/java/lang/Object.html#wait(long)">wait</a>, <a href="../../../java.base/java/lang/Object.html#wait(long,int)">wait</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a id="methods.inherited.from.class.javax.swing.event.ChangeListener"> <!-- --> </a> <h3>Methods declared in interface&nbsp;javax.swing.event.<a href="event/ChangeListener.html" title="interface in javax.swing.event">ChangeListener</a></h3> <code><a href="event/ChangeListener.html#stateChanged(javax.swing.event.ChangeEvent)">stateChanged</a></code></li> </ul> </li> </ul> </section> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a id="&lt;init&gt;()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>ModelListener</h4> <pre>protected&nbsp;ModelListener()</pre> </li> </ul> </li> </ul> </section> </li> </ul> </div> </div> </main> <!-- ========= END OF CLASS DATA ========= --> <footer role="contentinfo"> <nav role="navigation"> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a id="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../index.html">Overview</a></li> <li><a href="../../module-summary.html">Module</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/JTabbedPane.ModelListener.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-files/index-1.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 &amp; JDK 12</strong> </div></div> </div> <div class="subNav"> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&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><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> </div> <a id="skip.navbar.bottom"> <!-- --> </a> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> <p class="legalCopy"><small><a href="https://bugreport.java.com/bugreport/">Report a bug or suggest an enhancement</a><br> For further API reference and developer documentation see the <a href="https://docs.oracle.com/pls/topic/lookup?ctx=javase12.0.2&amp;id=homepage" target="_blank">Java SE Documentation</a>, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.<br> <a href="../../../../legal/copyright.html">Copyright</a> &copy; 1993, 2019, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.<br>All rights reserved. Use is subject to <a href="https://www.oracle.com/technetwork/java/javase/terms/license/java12.0.2speclicense.html">license terms</a> and the <a href="https://www.oracle.com/technetwork/java/redist-137594.html">documentation redistribution policy</a>. <!-- Version 12.0.2+10 --></small></p> </footer> </body> </html>
{ "pile_set_name": "Github" }
package plugins.core.combat; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import akka.actor.ActorRef; import akka.actor.ActorSelection; import akka.actor.Props; import akka.actor.UntypedActor; import io.gamemachine.chat.ChatSubscriptions; import io.gamemachine.core.ActorUtil; import io.gamemachine.core.GameEntityManager; import io.gamemachine.core.GameEntityManagerService; import io.gamemachine.core.GameMachineLoader; import io.gamemachine.core.PlayerMessage; import io.gamemachine.grid.Grid; import io.gamemachine.grid.GridService; import io.gamemachine.messages.CombatLog; import io.gamemachine.messages.GameMessage; import io.gamemachine.messages.PlayerSkill; import io.gamemachine.messages.RegionInfo; import io.gamemachine.messages.StatusEffect; import io.gamemachine.messages.StatusEffectTarget; import io.gamemachine.messages.TrackData; import io.gamemachine.messages.Zone; import io.gamemachine.regions.ZoneService; public class StatusEffectManager extends UntypedActor { private static final Logger logger = LoggerFactory.getLogger(StatusEffectManager.class); public static String name = StatusEffectManager.class.getSimpleName(); public static boolean combatLogEnabled = true; public static List<GridSet> gridsets = new ArrayList<GridSet>(); public static Set<String> handlerZones = new HashSet<String>(); public static void tell(String gridName, String zone, StatusEffectTarget statusEffectTarget, ActorRef sender) { String actorName = null; if (!hasEffects(statusEffectTarget)) { logger.warn("No effects found for skill " + statusEffectTarget.skillRequest.playerSkill.id); return; } if (activeEffectCount(statusEffectTarget) > 0) { actorName = ActiveEffectHandler.actorName(gridName, zone); ActorSelection sel = ActorUtil.getSelectionByName(actorName); sel.tell(statusEffectTarget.clone(), sender); } if (passiveEffectCount(statusEffectTarget) > 0) { actorName = PassiveEffectHandler.actorName(gridName, zone); ActorSelection sel = ActorUtil.getSelectionByName(actorName); sel.tell(statusEffectTarget.clone(), sender); } } private static boolean hasEffects(StatusEffectTarget statusEffectTarget) { if (StatusEffectData.skillEffects.containsKey(statusEffectTarget.skillRequest.playerSkill.id)) { return true; } else { return false; } } private static int passiveEffectCount(StatusEffectTarget statusEffectTarget) { int count = 0; for (StatusEffect statusEffect : StatusEffectData.skillEffects.get(statusEffectTarget.skillRequest.playerSkill.id)) { if (statusEffect.type == StatusEffect.Type.AttributeMaxDecrease || statusEffect.type == StatusEffect.Type.AttributeMaxIncrease) { count++; } } return count; } private static int activeEffectCount(StatusEffectTarget statusEffectTarget) { int count = 0; for (StatusEffect statusEffect : StatusEffectData.skillEffects.get(statusEffectTarget.skillRequest.playerSkill.id)) { if (statusEffect.type == StatusEffect.Type.AttributeDecrease || statusEffect.type == StatusEffect.Type.AttributeIncrease) { count++; } } return count; } public static int getEffectValue(StatusEffect statusEffect, PlayerSkill playerSkill, String characterId) { GameEntityManager gameEntityManager = GameEntityManagerService.instance().getGameEntityManager(); return gameEntityManager.getEffectValue(statusEffect, playerSkill.id, characterId); } public static boolean inGroup(String playerId) { String playerGroup = ChatSubscriptions.playerGroup(playerId); if (playerGroup.equals("nogroup")) { return false; } else { return true; } } public static void skillUsed(PlayerSkill playerSkill, String characterId) { GameEntityManager gameEntityManager = GameEntityManagerService.instance().getGameEntityManager(); gameEntityManager.skillUsed(playerSkill.id, characterId); } public static String playerGroup(String playerId) { return ChatSubscriptions.playerGroup(playerId); } public static boolean inSameGroup(String playerId, String otherId) { if (!inGroup(playerId)) { return false; } String otherGroup = ChatSubscriptions.playerGroup(otherId); if (playerGroup(playerId).equals(otherGroup)) { return true; } else { return false; } } public static boolean DeductCost(VitalsProxy vitalsProxy, StatusEffect statusEffect) { if (statusEffect.resourceCost == 0) { return true; } if (statusEffect.resource == StatusEffect.Resource.ResourceStamina) { if (vitalsProxy.get("stamina") < statusEffect.resourceCost) { //logger.warn("Insufficient stamina needed " + statusEffect.resourceCost); return false; } vitalsProxy.subtract("stamina", statusEffect.resourceCost); } else if (statusEffect.resource == StatusEffect.Resource.ResourceMagic) { if (vitalsProxy.get("magic") < statusEffect.resourceCost) { //logger.warn("Insufficient magic needed " + statusEffect.resourceCost); return false; } vitalsProxy.subtract("magic", statusEffect.resourceCost); } return true; } public static void sendCombatDamage(VitalsProxy origin, VitalsProxy target, int value, CombatLog.Type type, String zone) { GameEntityManager gameEntityManager = GameEntityManagerService.instance().getGameEntityManager(); gameEntityManager.combatDamage(origin, target, value, type); if (!combatLogEnabled) { return; } GameMessage msg = new GameMessage(); msg.combatLog = new CombatLog(); msg.combatLog.origin = origin.getEntityId(); msg.combatLog.target = target.getEntityId(); msg.combatLog.value = value; msg.combatLog.type = type; Grid grid = GridService.getInstance().getGrid(zone, "default"); TrackData trackData = grid.get(msg.combatLog.origin); if (trackData != null) { PlayerMessage.tell(msg, trackData.id); } trackData = grid.get(msg.combatLog.target); if (trackData != null) { PlayerMessage.tell(msg, trackData.id); } } public StatusEffectManager() { createDefaultEffectHandlers(); } private void createDefaultEffectHandlers() { int zoneCount = RegionInfo.db().findAll().size(); if (zoneCount == 0) { logger.warn("Combat system requires at least one zone configured"); return; } for (Zone zone : ZoneService.staticZones()) { createEffectHandler(zone.name); } } public static void createEffectHandler(String zone) { if (handlerZones.contains(zone)) { logger.warn("effect handler already created for zone " + zone); return; } GridSet gridSet = new GridSet(); gridSet.zone = zone; GridService.getInstance().createForZone(zone); gridSet.playerGrid = GridService.getInstance().getGrid(zone, "default"); gridSet.objectGrid = GridService.getInstance().getGrid(zone, "build_objects"); gridsets.add(gridSet); GameMachineLoader.getActorSystem().actorOf(Props.create(ActiveEffectHandler.class, "default", zone), ActiveEffectHandler.actorName("default", zone)); GameMachineLoader.getActorSystem().actorOf(Props.create(ActiveEffectHandler.class, "build_objects", zone), ActiveEffectHandler.actorName("build_objects", zone)); GameMachineLoader.getActorSystem().actorOf(Props.create(PassiveEffectHandler.class, "default", zone), PassiveEffectHandler.actorName("default", zone)); GameMachineLoader.getActorSystem().actorOf(Props.create(PassiveEffectHandler.class, "build_objects", zone), PassiveEffectHandler.actorName("build_objects", zone)); GameMachineLoader.getActorSystem().actorOf(Props.create(VitalsRegen.class, zone), VitalsRegen.actorName(zone)); handlerZones.add(zone); } @Override public void onReceive(Object arg0) throws Exception { // TODO Auto-generated method stub } }
{ "pile_set_name": "Github" }
package com.trinity.sample.view.foucs enum class AutoFocusTrigger { GESTURE, METHOD }
{ "pile_set_name": "Github" }
/* Copyright 2012 Yaqiang Wang, * yaqiang.wang@gmail.com * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or (at * your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser * General Public License for more details. */ package org.meteoinfo.data.mapdata.geotiff; import java.util.HashMap; /** * * @author yaqiang */ public class Tag implements Comparable { // <editor-fold desc="Variables"> private static HashMap map = new HashMap(); public static final Tag NewSubfileType = new Tag("NewSubfileType", 254); public static final Tag ImageWidth = new Tag("ImageWidth", 256); public static final Tag ImageLength = new Tag("ImageLength", 257); public static final Tag BitsPerSample = new Tag("BitsPerSample", 258); public static final Tag Compression = new Tag("Compression", 259); public static final Tag PhotometricInterpretation = new Tag("PhotometricInterpretation", 262); public static final Tag FillOrder = new Tag("FillOrder", 266); public static final Tag DocumentName = new Tag("DocumentName", 269); public static final Tag ImageDescription = new Tag("ImageDescription", 270); public static final Tag StripOffsets = new Tag("StripOffsets", 273); public static final Tag Orientation = new Tag("Orientation", 274); public static final Tag SamplesPerPixel = new Tag("SamplesPerPixel", 277); public static final Tag RowsPerStrip = new Tag("RowsPerStrip", 278); public static final Tag StripByteCounts = new Tag("StripByteCounts", 279); public static final Tag XResolution = new Tag("XResolution", 282); public static final Tag YResolution = new Tag("YResolution", 283); public static final Tag PlanarConfiguration = new Tag("PlanarConfiguration", 284); public static final Tag ResolutionUnit = new Tag("ResolutionUnit", 296); public static final Tag PageNumber = new Tag("PageNumber", 297); public static final Tag Software = new Tag("Software", 305); public static final Tag ColorMap = new Tag("ColorMap", 320); public static final Tag TileWidth = new Tag("TileWidth", 322); public static final Tag TileLength = new Tag("TileLength", 323); public static final Tag TileOffsets = new Tag("TileOffsets", 324); public static final Tag TileByteCounts = new Tag("TileByteCounts", 325); public static final Tag SampleFormat = new Tag("SampleFormat", 339); public static final Tag SMinSampleValue = new Tag("SMinSampleValue", 340); public static final Tag SMaxSampleValue = new Tag("SMaxSampleValue", 341); public static final Tag ModelPixelScaleTag = new Tag("ModelPixelScaleTag", 33550); public static final Tag IntergraphMatrixTag = new Tag("IntergraphMatrixTag", 33920); public static final Tag ModelTiepointTag = new Tag("ModelTiepointTag", 33922); public static final Tag ModelTransformationTag = new Tag("ModelTransformationTag", 34264); public static final Tag GeoKeyDirectoryTag = new Tag("GeoKeyDirectoryTag", 34735); public static final Tag GeoDoubleParamsTag = new Tag("GeoDoubleParamsTag", 34736); public static final Tag GeoAsciiParamsTag = new Tag("GeoAsciiParamsTag", 34737); public static final Tag GDALNoData = new Tag("GDALNoDataTag", 42113); private String name; private int code; // </editor-fold> // <editor-fold desc="Constructor"> static Tag get(int code) { return (Tag) map.get(new Integer(code)); } private Tag(String name, int code) { this.name = name; this.code = code; map.put(new Integer(code), this); } Tag(int code) { this.code = code; } // </editor-fold> // <editor-fold desc="Get Set Methods"> /** * Get name * * @return Name */ public String getName() { return this.name; } /** * Get code * * @return Code */ public int getCode() { return this.code; } // </editor-fold> // <editor-fold desc="Methods"> /** * To string * * @return String */ @Override public String toString() { return this.code + " (" + this.name + ")"; } /** * Compare to * * @param o Object * @return Int */ @Override public int compareTo(Object o) { return this.code - ((Tag) o).getCode(); } // </editor-fold> }
{ "pile_set_name": "Github" }
/* * 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. */ using System; using System.Collections.Generic; using Aliyun.Acs.Core.Transform; using Aliyun.Acs.Iot.Model.V20180120; namespace Aliyun.Acs.Iot.Transform.V20180120 { public class CreateProductTagsResponseUnmarshaller { public static CreateProductTagsResponse Unmarshall(UnmarshallerContext context) { CreateProductTagsResponse createProductTagsResponse = new CreateProductTagsResponse(); createProductTagsResponse.HttpResponse = context.HttpResponse; createProductTagsResponse.RequestId = context.StringValue("CreateProductTags.RequestId"); createProductTagsResponse.Success = context.BooleanValue("CreateProductTags.Success"); createProductTagsResponse.ErrorMessage = context.StringValue("CreateProductTags.ErrorMessage"); createProductTagsResponse.Code = context.StringValue("CreateProductTags.Code"); List<CreateProductTagsResponse.CreateProductTags_ProductTag> createProductTagsResponse_invalidProductTags = new List<CreateProductTagsResponse.CreateProductTags_ProductTag>(); for (int i = 0; i < context.Length("CreateProductTags.InvalidProductTags.Length"); i++) { CreateProductTagsResponse.CreateProductTags_ProductTag productTag = new CreateProductTagsResponse.CreateProductTags_ProductTag(); productTag.TagKey = context.StringValue("CreateProductTags.InvalidProductTags["+ i +"].TagKey"); productTag.TagValue = context.StringValue("CreateProductTags.InvalidProductTags["+ i +"].TagValue"); createProductTagsResponse_invalidProductTags.Add(productTag); } createProductTagsResponse.InvalidProductTags = createProductTagsResponse_invalidProductTags; return createProductTagsResponse; } } }
{ "pile_set_name": "Github" }
testConstructorMessageCause(org.apache.commons.math.FunctionEvaluationExceptionTest) testConstructorMessage(org.apache.commons.math.FunctionEvaluationExceptionTest) testConstructor(org.apache.commons.math.FunctionEvaluationExceptionTest) testConstructorCause(org.apache.commons.math.MathConfigurationExceptionTest) testConstructorMessageCause(org.apache.commons.math.MathConfigurationExceptionTest) testConstructorMessage(org.apache.commons.math.MathConfigurationExceptionTest) testConstructor(org.apache.commons.math.MathConfigurationExceptionTest) testSerialization(org.apache.commons.math.MathExceptionTest) testConstructorCause(org.apache.commons.math.MathExceptionTest) testConstructorMessageCause(org.apache.commons.math.MathExceptionTest) testConstructorMessage(org.apache.commons.math.MathExceptionTest) testPrintStackTrace(org.apache.commons.math.MathExceptionTest) testConstructor(org.apache.commons.math.MathExceptionTest) testSetMaximalIterationCount(org.apache.commons.math.analysis.BisectionSolverTest) testSetRelativeAccuracy(org.apache.commons.math.analysis.BisectionSolverTest) testSetAbsoluteAccuracy(org.apache.commons.math.analysis.BisectionSolverTest) testSerialization(org.apache.commons.math.analysis.BisectionSolverTest) testSetFunctionValueAccuracy(org.apache.commons.math.analysis.BisectionSolverTest) testResetRelativeAccuracy(org.apache.commons.math.analysis.BisectionSolverTest) testResetAbsoluteAccuracy(org.apache.commons.math.analysis.BisectionSolverTest) testResetMaximalIterationCount(org.apache.commons.math.analysis.BisectionSolverTest) testResetFunctionValueAccuracy(org.apache.commons.math.analysis.BisectionSolverTest) testQuinticZero(org.apache.commons.math.analysis.BisectionSolverTest) testSinZero(org.apache.commons.math.analysis.BisectionSolverTest) testBadEndpoints(org.apache.commons.math.analysis.BrentSolverTest) testQuinticZero(org.apache.commons.math.analysis.BrentSolverTest) testSinZero(org.apache.commons.math.analysis.BrentSolverTest) testConstructorCause(org.apache.commons.math.analysis.ConvergenceExceptionTest) testConstructorMessageCause(org.apache.commons.math.analysis.ConvergenceExceptionTest) testConstructorMessage(org.apache.commons.math.analysis.ConvergenceExceptionTest) testConstructor(org.apache.commons.math.analysis.ConvergenceExceptionTest) testParameters(org.apache.commons.math.analysis.DividedDifferenceInterpolatorTest) testSinFunction(org.apache.commons.math.analysis.DividedDifferenceInterpolatorTest) testExpm1Function(org.apache.commons.math.analysis.DividedDifferenceInterpolatorTest) testLinearFunction(org.apache.commons.math.analysis.LaguerreSolverTest) testQuadraticFunction(org.apache.commons.math.analysis.LaguerreSolverTest) testParameters(org.apache.commons.math.analysis.LaguerreSolverTest) testQuinticFunction2(org.apache.commons.math.analysis.LaguerreSolverTest) testQuinticFunction(org.apache.commons.math.analysis.LaguerreSolverTest) testExpm1Function2(org.apache.commons.math.analysis.MullerSolverTest) testParameters(org.apache.commons.math.analysis.MullerSolverTest) testSinFunction(org.apache.commons.math.analysis.MullerSolverTest) testQuinticFunction2(org.apache.commons.math.analysis.MullerSolverTest) testExpm1Function(org.apache.commons.math.analysis.MullerSolverTest) testSinFunction2(org.apache.commons.math.analysis.MullerSolverTest) testQuinticFunction(org.apache.commons.math.analysis.MullerSolverTest) testParameters(org.apache.commons.math.analysis.NevilleInterpolatorTest) testSinFunction(org.apache.commons.math.analysis.NevilleInterpolatorTest) testExpm1Function(org.apache.commons.math.analysis.NevilleInterpolatorTest) testSerialization(org.apache.commons.math.analysis.NewtonSolverTest) testQuinticZero(org.apache.commons.math.analysis.NewtonSolverTest) testSinZero(org.apache.commons.math.analysis.NewtonSolverTest) testLinearFunction(org.apache.commons.math.analysis.PolynomialFunctionLagrangeFormTest) testQuadraticFunction(org.apache.commons.math.analysis.PolynomialFunctionLagrangeFormTest) testParameters(org.apache.commons.math.analysis.PolynomialFunctionLagrangeFormTest) testQuinticFunction(org.apache.commons.math.analysis.PolynomialFunctionLagrangeFormTest) testLinearFunction(org.apache.commons.math.analysis.PolynomialFunctionNewtonFormTest) testQuadraticFunction(org.apache.commons.math.analysis.PolynomialFunctionNewtonFormTest) testParameters(org.apache.commons.math.analysis.PolynomialFunctionNewtonFormTest) testQuinticFunction(org.apache.commons.math.analysis.PolynomialFunctionNewtonFormTest) testQuadratic(org.apache.commons.math.analysis.PolynomialFunctionTest) testConstants(org.apache.commons.math.analysis.PolynomialFunctionTest) testQuintic(org.apache.commons.math.analysis.PolynomialFunctionTest) testLinear(org.apache.commons.math.analysis.PolynomialFunctionTest) testfirstDerivativeComparision(org.apache.commons.math.analysis.PolynomialFunctionTest) testValues(org.apache.commons.math.analysis.PolynomialSplineFunctionTest) testConstructor(org.apache.commons.math.analysis.PolynomialSplineFunctionTest) testParameters(org.apache.commons.math.analysis.RiddersSolverTest) testSinFunction(org.apache.commons.math.analysis.RiddersSolverTest) testExpm1Function(org.apache.commons.math.analysis.RiddersSolverTest) testQuinticFunction(org.apache.commons.math.analysis.RiddersSolverTest) testParameters(org.apache.commons.math.analysis.RombergIntegratorTest) testSinFunction(org.apache.commons.math.analysis.RombergIntegratorTest) testQuinticFunction(org.apache.commons.math.analysis.RombergIntegratorTest) testParameters(org.apache.commons.math.analysis.SimpsonIntegratorTest) testSinFunction(org.apache.commons.math.analysis.SimpsonIntegratorTest) testQuinticFunction(org.apache.commons.math.analysis.SimpsonIntegratorTest) testInterpolateSin(org.apache.commons.math.analysis.SplineInterpolatorTest) testInterpolateLinearDegenerateTwoSegment(org.apache.commons.math.analysis.SplineInterpolatorTest) testIllegalArguments(org.apache.commons.math.analysis.SplineInterpolatorTest) testInterpolateLinear(org.apache.commons.math.analysis.SplineInterpolatorTest) testInterpolateLinearDegenerateThreeSegment(org.apache.commons.math.analysis.SplineInterpolatorTest) testParameters(org.apache.commons.math.analysis.TrapezoidIntegratorTest) testSinFunction(org.apache.commons.math.analysis.TrapezoidIntegratorTest) testQuinticFunction(org.apache.commons.math.analysis.TrapezoidIntegratorTest) testNewBrentSolverValid(org.apache.commons.math.analysis.UnivariateRealSolverFactoryImplTest) testNewBisectionSolverValid(org.apache.commons.math.analysis.UnivariateRealSolverFactoryImplTest) testNewBrentSolverNull(org.apache.commons.math.analysis.UnivariateRealSolverFactoryImplTest) testNewBisectionSolverNull(org.apache.commons.math.analysis.UnivariateRealSolverFactoryImplTest) testNewNewtonSolverNull(org.apache.commons.math.analysis.UnivariateRealSolverFactoryImplTest) testNewNewtonSolverValid(org.apache.commons.math.analysis.UnivariateRealSolverFactoryImplTest) testNewSecantSolverValid(org.apache.commons.math.analysis.UnivariateRealSolverFactoryImplTest) testNewSecantSolverNull(org.apache.commons.math.analysis.UnivariateRealSolverFactoryImplTest) testSolveNoRoot(org.apache.commons.math.analysis.UnivariateRealSolverUtilsTest) testSolveSin(org.apache.commons.math.analysis.UnivariateRealSolverUtilsTest) testSolveAccuracySin(org.apache.commons.math.analysis.UnivariateRealSolverUtilsTest) testSolveBadParameters(org.apache.commons.math.analysis.UnivariateRealSolverUtilsTest) testSolveNull(org.apache.commons.math.analysis.UnivariateRealSolverUtilsTest) testBracketSin(org.apache.commons.math.analysis.UnivariateRealSolverUtilsTest) testBracketCornerSolution(org.apache.commons.math.analysis.UnivariateRealSolverUtilsTest) testSolveAccuracyNull(org.apache.commons.math.analysis.UnivariateRealSolverUtilsTest) testBadParameters(org.apache.commons.math.analysis.UnivariateRealSolverUtilsTest) testParseNegativeImaginary(org.apache.commons.math.complex.ComplexFormatTest) testConstructorSingleFormat(org.apache.commons.math.complex.ComplexFormatTest) testParseSimpleWithDecimals(org.apache.commons.math.complex.ComplexFormatTest) testZeroImaginary(org.apache.commons.math.complex.ComplexFormatTest) testSetImaginaryFormatNull(org.apache.commons.math.complex.ComplexFormatTest) testDifferentImaginaryChar(org.apache.commons.math.complex.ComplexFormatTest) testFormatNumber(org.apache.commons.math.complex.ComplexFormatTest) testFormatObject(org.apache.commons.math.complex.ComplexFormatTest) testNan(org.apache.commons.math.complex.ComplexFormatTest) testSimpleWithDecimalsTrunc(org.apache.commons.math.complex.ComplexFormatTest) testSetImaginaryCharacterNull(org.apache.commons.math.complex.ComplexFormatTest) testStaticFormatComplex(org.apache.commons.math.complex.ComplexFormatTest) testGetRealFormat(org.apache.commons.math.complex.ComplexFormatTest) testParseNegativeBoth(org.apache.commons.math.complex.ComplexFormatTest) testParseNegativeReal(org.apache.commons.math.complex.ComplexFormatTest) testGetImaginaryFormat(org.apache.commons.math.complex.ComplexFormatTest) testParseSimpleWithDecimalsTrunc(org.apache.commons.math.complex.ComplexFormatTest) testNegativeInfinity(org.apache.commons.math.complex.ComplexFormatTest) testSetRealFormatNull(org.apache.commons.math.complex.ComplexFormatTest) testPaseNegativeInfinity(org.apache.commons.math.complex.ComplexFormatTest) testParseDifferentImaginaryChar(org.apache.commons.math.complex.ComplexFormatTest) testSetImaginaryCharacterEmpty(org.apache.commons.math.complex.ComplexFormatTest) testSimpleNoDecimals(org.apache.commons.math.complex.ComplexFormatTest) testZeroReal(org.apache.commons.math.complex.ComplexFormatTest) testNegativeBoth(org.apache.commons.math.complex.ComplexFormatTest) testNegativeReal(org.apache.commons.math.complex.ComplexFormatTest) testNegativeImaginary(org.apache.commons.math.complex.ComplexFormatTest) testParseSimpleNoDecimals(org.apache.commons.math.complex.ComplexFormatTest) testPositiveInfinity(org.apache.commons.math.complex.ComplexFormatTest) testParseZeroReal(org.apache.commons.math.complex.ComplexFormatTest) testParseNan(org.apache.commons.math.complex.ComplexFormatTest) testParseZeroImaginary(org.apache.commons.math.complex.ComplexFormatTest) testParsePositiveInfinity(org.apache.commons.math.complex.ComplexFormatTest) testSimpleWithDecimals(org.apache.commons.math.complex.ComplexFormatTest) testConjugateNaN(org.apache.commons.math.complex.ComplexTest) testEqualsClass(org.apache.commons.math.complex.ComplexTest) testAddInfinite(org.apache.commons.math.complex.ComplexTest) testAbs(org.apache.commons.math.complex.ComplexTest) testAdd(org.apache.commons.math.complex.ComplexTest) testSubtract(org.apache.commons.math.complex.ComplexTest) testDivideNaNInf(org.apache.commons.math.complex.ComplexTest) testDivideNaN(org.apache.commons.math.complex.ComplexTest) testEqualsRealDifference(org.apache.commons.math.complex.ComplexTest) testNegateNaN(org.apache.commons.math.complex.ComplexTest) testEqualsNull(org.apache.commons.math.complex.ComplexTest) testEqualsSame(org.apache.commons.math.complex.ComplexTest) testEqualsTrue(org.apache.commons.math.complex.ComplexTest) testMultiplyNaN(org.apache.commons.math.complex.ComplexTest) testConjugate(org.apache.commons.math.complex.ComplexTest) testMultiplyNaNInf(org.apache.commons.math.complex.ComplexTest) testEqualsImaginaryDifference(org.apache.commons.math.complex.ComplexTest) testConstructorNaN(org.apache.commons.math.complex.ComplexTest) testHashCode(org.apache.commons.math.complex.ComplexTest) testAbsNaN(org.apache.commons.math.complex.ComplexTest) testAddNaN(org.apache.commons.math.complex.ComplexTest) testDivide(org.apache.commons.math.complex.ComplexTest) testMultiply(org.apache.commons.math.complex.ComplexTest) testEqualsNaN(org.apache.commons.math.complex.ComplexTest) testDivideInfinite(org.apache.commons.math.complex.ComplexTest) testNegate(org.apache.commons.math.complex.ComplexTest) testConjugateInfiinite(org.apache.commons.math.complex.ComplexTest) testSubtractNaN(org.apache.commons.math.complex.ComplexTest) testAbsInfinite(org.apache.commons.math.complex.ComplexTest) testConstructor(org.apache.commons.math.complex.ComplexTest) testTanNull(org.apache.commons.math.complex.ComplexUtilsTest) testTanhInf(org.apache.commons.math.complex.ComplexUtilsTest) testTanhNaN(org.apache.commons.math.complex.ComplexUtilsTest) testSqrt1zNull(org.apache.commons.math.complex.ComplexUtilsTest) testlogNull(org.apache.commons.math.complex.ComplexUtilsTest) testExpNull(org.apache.commons.math.complex.ComplexUtilsTest) testAcosInf(org.apache.commons.math.complex.ComplexUtilsTest) testAcosNaN(org.apache.commons.math.complex.ComplexUtilsTest) testCos(org.apache.commons.math.complex.ComplexUtilsTest) testExp(org.apache.commons.math.complex.ComplexUtilsTest) testLog(org.apache.commons.math.complex.ComplexUtilsTest) testPow(org.apache.commons.math.complex.ComplexUtilsTest) testSin(org.apache.commons.math.complex.ComplexUtilsTest) testTan(org.apache.commons.math.complex.ComplexUtilsTest) testAcos(org.apache.commons.math.complex.ComplexUtilsTest) testAsin(org.apache.commons.math.complex.ComplexUtilsTest) testAtan(org.apache.commons.math.complex.ComplexUtilsTest) testCosh(org.apache.commons.math.complex.ComplexUtilsTest) testSinh(org.apache.commons.math.complex.ComplexUtilsTest) testTanh(org.apache.commons.math.complex.ComplexUtilsTest) testAsinInf(org.apache.commons.math.complex.ComplexUtilsTest) testAsinNaN(org.apache.commons.math.complex.ComplexUtilsTest) testAtanInf(org.apache.commons.math.complex.ComplexUtilsTest) testAtanNaN(org.apache.commons.math.complex.ComplexUtilsTest) testAcosNull(org.apache.commons.math.complex.ComplexUtilsTest) testTanhCritical(org.apache.commons.math.complex.ComplexUtilsTest) testPowZero(org.apache.commons.math.complex.ComplexUtilsTest) testSqrtImaginaryZero(org.apache.commons.math.complex.ComplexUtilsTest) testPolar2ComplexInf(org.apache.commons.math.complex.ComplexUtilsTest) testPolar2ComplexNaN(org.apache.commons.math.complex.ComplexUtilsTest) testSqrtRealPositive(org.apache.commons.math.complex.ComplexUtilsTest) testSqrt1zNaN(org.apache.commons.math.complex.ComplexUtilsTest) testSqrtRealNegative(org.apache.commons.math.complex.ComplexUtilsTest) testSqrtPolar(org.apache.commons.math.complex.ComplexUtilsTest) testSqrtNull(org.apache.commons.math.complex.ComplexUtilsTest) testLogZero(org.apache.commons.math.complex.ComplexUtilsTest) testAsinNull(org.apache.commons.math.complex.ComplexUtilsTest) testTanhNull(org.apache.commons.math.complex.ComplexUtilsTest) testTanCritical(org.apache.commons.math.complex.ComplexUtilsTest) testCoshNull(org.apache.commons.math.complex.ComplexUtilsTest) testPowNaNBase(org.apache.commons.math.complex.ComplexUtilsTest) testPolar2ComplexIllegalModulus(org.apache.commons.math.complex.ComplexUtilsTest) testCosNull(org.apache.commons.math.complex.ComplexUtilsTest) testCoshInf(org.apache.commons.math.complex.ComplexUtilsTest) testCoshNaN(org.apache.commons.math.complex.ComplexUtilsTest) testAtanNull(org.apache.commons.math.complex.ComplexUtilsTest) testPowNaNExponent(org.apache.commons.math.complex.ComplexUtilsTest) testSqrtRealZero(org.apache.commons.math.complex.ComplexUtilsTest) testSqrtImaginaryNegative(org.apache.commons.math.complex.ComplexUtilsTest) testsinhNull(org.apache.commons.math.complex.ComplexUtilsTest) testCosInf(org.apache.commons.math.complex.ComplexUtilsTest) testCosNaN(org.apache.commons.math.complex.ComplexUtilsTest) testExpInf(org.apache.commons.math.complex.ComplexUtilsTest) testExpNaN(org.apache.commons.math.complex.ComplexUtilsTest) testLogInf(org.apache.commons.math.complex.ComplexUtilsTest) testLogNaN(org.apache.commons.math.complex.ComplexUtilsTest) testPowInf(org.apache.commons.math.complex.ComplexUtilsTest) testSinNull(org.apache.commons.math.complex.ComplexUtilsTest) testSinhInf(org.apache.commons.math.complex.ComplexUtilsTest) testSinhNaN(org.apache.commons.math.complex.ComplexUtilsTest) testSinInf(org.apache.commons.math.complex.ComplexUtilsTest) testSinNaN(org.apache.commons.math.complex.ComplexUtilsTest) testSqrt1z(org.apache.commons.math.complex.ComplexUtilsTest) testTanInf(org.apache.commons.math.complex.ComplexUtilsTest) testTanNaN(org.apache.commons.math.complex.ComplexUtilsTest) testPolar2Complex(org.apache.commons.math.complex.ComplexUtilsTest) testpowNull(org.apache.commons.math.complex.ComplexUtilsTest) testSqrtInf(org.apache.commons.math.complex.ComplexUtilsTest) testSqrtNaN(org.apache.commons.math.complex.ComplexUtilsTest) testParseNegativeImaginary(org.apache.commons.math.complex.FrenchComplexFormatTest) testConstructorSingleFormat(org.apache.commons.math.complex.FrenchComplexFormatTest) testParseSimpleWithDecimals(org.apache.commons.math.complex.FrenchComplexFormatTest) testZeroImaginary(org.apache.commons.math.complex.FrenchComplexFormatTest) testSetImaginaryFormatNull(org.apache.commons.math.complex.FrenchComplexFormatTest) testDifferentImaginaryChar(org.apache.commons.math.complex.FrenchComplexFormatTest) testFormatNumber(org.apache.commons.math.complex.FrenchComplexFormatTest) testFormatObject(org.apache.commons.math.complex.FrenchComplexFormatTest) testNan(org.apache.commons.math.complex.FrenchComplexFormatTest) testSimpleWithDecimalsTrunc(org.apache.commons.math.complex.FrenchComplexFormatTest) testSetImaginaryCharacterNull(org.apache.commons.math.complex.FrenchComplexFormatTest) testStaticFormatComplex(org.apache.commons.math.complex.FrenchComplexFormatTest) testGetRealFormat(org.apache.commons.math.complex.FrenchComplexFormatTest) testParseNegativeBoth(org.apache.commons.math.complex.FrenchComplexFormatTest) testParseNegativeReal(org.apache.commons.math.complex.FrenchComplexFormatTest) testGetImaginaryFormat(org.apache.commons.math.complex.FrenchComplexFormatTest) testParseSimpleWithDecimalsTrunc(org.apache.commons.math.complex.FrenchComplexFormatTest) testNegativeInfinity(org.apache.commons.math.complex.FrenchComplexFormatTest) testSetRealFormatNull(org.apache.commons.math.complex.FrenchComplexFormatTest) testPaseNegativeInfinity(org.apache.commons.math.complex.FrenchComplexFormatTest) testParseDifferentImaginaryChar(org.apache.commons.math.complex.FrenchComplexFormatTest) testSetImaginaryCharacterEmpty(org.apache.commons.math.complex.FrenchComplexFormatTest) testSimpleNoDecimals(org.apache.commons.math.complex.FrenchComplexFormatTest) testZeroReal(org.apache.commons.math.complex.FrenchComplexFormatTest) testNegativeBoth(org.apache.commons.math.complex.FrenchComplexFormatTest) testNegativeReal(org.apache.commons.math.complex.FrenchComplexFormatTest) testNegativeImaginary(org.apache.commons.math.complex.FrenchComplexFormatTest) testParseSimpleNoDecimals(org.apache.commons.math.complex.FrenchComplexFormatTest) testPositiveInfinity(org.apache.commons.math.complex.FrenchComplexFormatTest) testParseZeroReal(org.apache.commons.math.complex.FrenchComplexFormatTest) testParseNan(org.apache.commons.math.complex.FrenchComplexFormatTest) testParseZeroImaginary(org.apache.commons.math.complex.FrenchComplexFormatTest) testParsePositiveInfinity(org.apache.commons.math.complex.FrenchComplexFormatTest) testSimpleWithDecimals(org.apache.commons.math.complex.FrenchComplexFormatTest) testDegenerate0(org.apache.commons.math.distribution.BinomialDistributionTest) testDegenerate1(org.apache.commons.math.distribution.BinomialDistributionTest) testDensities(org.apache.commons.math.distribution.BinomialDistributionTest) testInverseCumulativeProbabilities(org.apache.commons.math.distribution.BinomialDistributionTest) testCumulativeProbabilities(org.apache.commons.math.distribution.BinomialDistributionTest) testIllegalArguments(org.apache.commons.math.distribution.BinomialDistributionTest) testScale(org.apache.commons.math.distribution.CauchyDistributionTest) testMedian(org.apache.commons.math.distribution.CauchyDistributionTest) testInverseCumulativeProbabilityExtremes(org.apache.commons.math.distribution.CauchyDistributionTest) testSetScale(org.apache.commons.math.distribution.CauchyDistributionTest) testInverseCumulativeProbabilities(org.apache.commons.math.distribution.CauchyDistributionTest) testCumulativeProbabilities(org.apache.commons.math.distribution.CauchyDistributionTest) testIllegalArguments(org.apache.commons.math.distribution.CauchyDistributionTest) testConsistency(org.apache.commons.math.distribution.CauchyDistributionTest) testDfAccessors(org.apache.commons.math.distribution.ChiSquareDistributionTest) testSmallDf(org.apache.commons.math.distribution.ChiSquareDistributionTest) testInverseCumulativeProbabilities(org.apache.commons.math.distribution.ChiSquareDistributionTest) testCumulativeProbabilities(org.apache.commons.math.distribution.ChiSquareDistributionTest) testIllegalArguments(org.apache.commons.math.distribution.ChiSquareDistributionTest) testConsistency(org.apache.commons.math.distribution.ChiSquareDistributionTest) testWeibullDistributionZeroPositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testBinomialDistributionPositivePositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testBinomialDistributionPositiveNegative(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateTDistributionPositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testHypergeometricDistributionPositivePositiveZero(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateTDistributionNegative(org.apache.commons.math.distribution.DistributionFactoryImplTest) testWeibullDistributionNegativePositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateExponentialDistributionZero(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCauchyDistributionNegative(org.apache.commons.math.distribution.DistributionFactoryImplTest) testHypergeometricDistributionNegativePositivePositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCauchyDistributionZero(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateGammaDistributionPositiveZero(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateFDistributionPositiveZero(org.apache.commons.math.distribution.DistributionFactoryImplTest) testBinomialDistributionPositiveZero(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateGammaDistributionNegativePositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testWeibullDistributionPositiveZero(org.apache.commons.math.distribution.DistributionFactoryImplTest) testHypergeometricDistributionZeroPositivePositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateFDistributionNegativePositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testWeibullDistributionPositiveNegative(org.apache.commons.math.distribution.DistributionFactoryImplTest) testHypergeometricDistributionPositiveNegativePositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateGammaDistributionPositivePositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateTDistributionZero(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateGammaDistributionPositiveNegative(org.apache.commons.math.distribution.DistributionFactoryImplTest) testBinomialDistributionNegativePositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testHypergeometricDistributionPositiveZeroPositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateChiSquareDistributionPositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateExponentialDistributionPositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateChiSquareDistributionNegative(org.apache.commons.math.distribution.DistributionFactoryImplTest) testHypergeometricDistributionSmallPopulationSize(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateFDistributionPositivePositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateExponentialDistributionNegative(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateChiSquareDistributionZero(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateFDistributionPositiveNegative(org.apache.commons.math.distribution.DistributionFactoryImplTest) testHypergeometricDistributionPositivePositiveNegative(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateGammaDistributionZeroPositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCreateFDistributionZeroPositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testBinomialDistributionZeroPositive(org.apache.commons.math.distribution.DistributionFactoryImplTest) testBinomialDistributionPositiveOne(org.apache.commons.math.distribution.DistributionFactoryImplTest) testBinomialDistributionPositiveTwo(org.apache.commons.math.distribution.DistributionFactoryImplTest) testCumulativeProbability2(org.apache.commons.math.distribution.ExponentialDistributionTest) testCumulativeProbabilityExtremes(org.apache.commons.math.distribution.ExponentialDistributionTest) testInverseCumulativeProbabilityExtremes(org.apache.commons.math.distribution.ExponentialDistributionTest) testMeanAccessors(org.apache.commons.math.distribution.ExponentialDistributionTest) testInverseCumulativeProbabilities(org.apache.commons.math.distribution.ExponentialDistributionTest) testCumulativeProbabilities(org.apache.commons.math.distribution.ExponentialDistributionTest) testIllegalArguments(org.apache.commons.math.distribution.ExponentialDistributionTest) testConsistency(org.apache.commons.math.distribution.ExponentialDistributionTest) testCumulativeProbabilityExtremes(org.apache.commons.math.distribution.FDistributionTest) testLargeDegreesOfFreedom(org.apache.commons.math.distribution.FDistributionTest) testDfAccessors(org.apache.commons.math.distribution.FDistributionTest) testInverseCumulativeProbabilityExtremes(org.apache.commons.math.distribution.FDistributionTest) testInverseCumulativeProbabilities(org.apache.commons.math.distribution.FDistributionTest) testCumulativeProbabilities(org.apache.commons.math.distribution.FDistributionTest) testIllegalArguments(org.apache.commons.math.distribution.FDistributionTest) testConsistency(org.apache.commons.math.distribution.FDistributionTest) testProbabilities(org.apache.commons.math.distribution.GammaDistributionTest) testParameterAccessors(org.apache.commons.math.distribution.GammaDistributionTest) testInverseCumulativeProbabilityExtremes(org.apache.commons.math.distribution.GammaDistributionTest) testValues(org.apache.commons.math.distribution.GammaDistributionTest) testInverseCumulativeProbabilities(org.apache.commons.math.distribution.GammaDistributionTest) testCumulativeProbabilities(org.apache.commons.math.distribution.GammaDistributionTest) testIllegalArguments(org.apache.commons.math.distribution.GammaDistributionTest) testConsistency(org.apache.commons.math.distribution.GammaDistributionTest) testLargeValues(org.apache.commons.math.distribution.HypergeometricDistributionTest) testDegenerateNoFailures(org.apache.commons.math.distribution.HypergeometricDistributionTest) testDegenerateNoSuccesses(org.apache.commons.math.distribution.HypergeometricDistributionTest) testDegenerateFullSample(org.apache.commons.math.distribution.HypergeometricDistributionTest) testPopulationSize(org.apache.commons.math.distribution.HypergeometricDistributionTest) testMoreLargeValues(org.apache.commons.math.distribution.HypergeometricDistributionTest) testDensities(org.apache.commons.math.distribution.HypergeometricDistributionTest) testInverseCumulativeProbabilities(org.apache.commons.math.distribution.HypergeometricDistributionTest) testCumulativeProbabilities(org.apache.commons.math.distribution.HypergeometricDistributionTest) testIllegalArguments(org.apache.commons.math.distribution.HypergeometricDistributionTest) testSetStandardDeviation(org.apache.commons.math.distribution.NormalDistributionTest) testGetStandardDeviation(org.apache.commons.math.distribution.NormalDistributionTest) testQuantiles(org.apache.commons.math.distribution.NormalDistributionTest) testGetMean(org.apache.commons.math.distribution.NormalDistributionTest) testSetMean(org.apache.commons.math.distribution.NormalDistributionTest) testInverseCumulativeProbabilityExtremes(org.apache.commons.math.distribution.NormalDistributionTest) testInverseCumulativeProbabilities(org.apache.commons.math.distribution.NormalDistributionTest) testCumulativeProbabilities(org.apache.commons.math.distribution.NormalDistributionTest) testIllegalArguments(org.apache.commons.math.distribution.NormalDistributionTest) testConsistency(org.apache.commons.math.distribution.NormalDistributionTest) testDegenerate0(org.apache.commons.math.distribution.PascalDistributionTest) testDegenerate1(org.apache.commons.math.distribution.PascalDistributionTest) testDensities(org.apache.commons.math.distribution.PascalDistributionTest) testInverseCumulativeProbabilities(org.apache.commons.math.distribution.PascalDistributionTest) testCumulativeProbabilities(org.apache.commons.math.distribution.PascalDistributionTest) testIllegalArguments(org.apache.commons.math.distribution.PascalDistributionTest) testDegenerateInverseCumulativeProbability(org.apache.commons.math.distribution.PoissonDistributionTest) testMean(org.apache.commons.math.distribution.PoissonDistributionTest) testLargeMeanInverseCumulativeProbability(org.apache.commons.math.distribution.PoissonDistributionTest) testNormalApproximateProbability(org.apache.commons.math.distribution.PoissonDistributionTest) testLargeMeanCumulativeProbability(org.apache.commons.math.distribution.PoissonDistributionTest) testDensities(org.apache.commons.math.distribution.PoissonDistributionTest) testInverseCumulativeProbabilities(org.apache.commons.math.distribution.PoissonDistributionTest) testCumulativeProbabilities(org.apache.commons.math.distribution.PoissonDistributionTest) testIllegalArguments(org.apache.commons.math.distribution.PoissonDistributionTest) testCumulativeProbabilityAgaintStackOverflow(org.apache.commons.math.distribution.TDistributionTest) testDfAccessors(org.apache.commons.math.distribution.TDistributionTest) testInverseCumulativeProbabilityExtremes(org.apache.commons.math.distribution.TDistributionTest) testSmallDf(org.apache.commons.math.distribution.TDistributionTest) testInverseCumulativeProbabilities(org.apache.commons.math.distribution.TDistributionTest) testCumulativeProbabilities(org.apache.commons.math.distribution.TDistributionTest) testIllegalArguments(org.apache.commons.math.distribution.TDistributionTest) testConsistency(org.apache.commons.math.distribution.TDistributionTest) testAlpha(org.apache.commons.math.distribution.WeibullDistributionTest) testBeta(org.apache.commons.math.distribution.WeibullDistributionTest) testSetBeta(org.apache.commons.math.distribution.WeibullDistributionTest) testInverseCumulativeProbabilityExtremes(org.apache.commons.math.distribution.WeibullDistributionTest) testSetAlpha(org.apache.commons.math.distribution.WeibullDistributionTest) testInverseCumulativeProbabilities(org.apache.commons.math.distribution.WeibullDistributionTest) testCumulativeProbabilities(org.apache.commons.math.distribution.WeibullDistributionTest) testIllegalArguments(org.apache.commons.math.distribution.WeibullDistributionTest) testConsistency(org.apache.commons.math.distribution.WeibullDistributionTest) testNumeratorFormat(org.apache.commons.math.fraction.FractionFormatTest) testFormatImproperNegative(org.apache.commons.math.fraction.FractionFormatTest) testFormatImproper(org.apache.commons.math.fraction.FractionFormatTest) testParseProper(org.apache.commons.math.fraction.FractionFormatTest) testParseProperNegative(org.apache.commons.math.fraction.FractionFormatTest) testParse(org.apache.commons.math.fraction.FractionFormatTest) testWholeFormat(org.apache.commons.math.fraction.FractionFormatTest) testFormatZero(org.apache.commons.math.fraction.FractionFormatTest) testFormatNegative(org.apache.commons.math.fraction.FractionFormatTest) testParseInvalidDenominator(org.apache.commons.math.fraction.FractionFormatTest) testDenominatorFormat(org.apache.commons.math.fraction.FractionFormatTest) testParseProperInvalidMinus(org.apache.commons.math.fraction.FractionFormatTest) testParseInteger(org.apache.commons.math.fraction.FractionFormatTest) testParseInvalid(org.apache.commons.math.fraction.FractionFormatTest) testFormat(org.apache.commons.math.fraction.FractionFormatTest) testParseNegative(org.apache.commons.math.fraction.FractionFormatTest) testFloatValue(org.apache.commons.math.fraction.FractionTest) testAbs(org.apache.commons.math.fraction.FractionTest) testAdd(org.apache.commons.math.fraction.FractionTest) testSubtract(org.apache.commons.math.fraction.FractionTest) testReciprocal(org.apache.commons.math.fraction.FractionTest) testGetReducedFraction(org.apache.commons.math.fraction.FractionTest) testConstructorDouble(org.apache.commons.math.fraction.FractionTest) testCompareTo(org.apache.commons.math.fraction.FractionTest) testLongValue(org.apache.commons.math.fraction.FractionTest) testIntValue(org.apache.commons.math.fraction.FractionTest) testDivide(org.apache.commons.math.fraction.FractionTest) testMultiply(org.apache.commons.math.fraction.FractionTest) testEqualsAndHashCode(org.apache.commons.math.fraction.FractionTest) testNegate(org.apache.commons.math.fraction.FractionTest) testDoubleValue(org.apache.commons.math.fraction.FractionTest) testConstructor(org.apache.commons.math.fraction.FractionTest) testOperate(org.apache.commons.math.linear.BigMatrixImplTest) testAddFail(org.apache.commons.math.linear.BigMatrixImplTest) testAdd(org.apache.commons.math.linear.BigMatrixImplTest) testScalarAdd(org.apache.commons.math.linear.BigMatrixImplTest) testSolve(org.apache.commons.math.linear.BigMatrixImplTest) testTrace(org.apache.commons.math.linear.BigMatrixImplTest) testNorm(org.apache.commons.math.linear.BigMatrixImplTest) testToString(org.apache.commons.math.linear.BigMatrixImplTest) testIsSingular(org.apache.commons.math.linear.BigMatrixImplTest) testConstructors(org.apache.commons.math.linear.BigMatrixImplTest) testPlusMinus(org.apache.commons.math.linear.BigMatrixImplTest) testDeterminant(org.apache.commons.math.linear.BigMatrixImplTest) testMultiply2(org.apache.commons.math.linear.BigMatrixImplTest) testDimensions(org.apache.commons.math.linear.BigMatrixImplTest) testSubMatrix(org.apache.commons.math.linear.BigMatrixImplTest) testPremultiplyVector(org.apache.commons.math.linear.BigMatrixImplTest) testCopyFunctions(org.apache.commons.math.linear.BigMatrixImplTest) testLUDecomposition(org.apache.commons.math.linear.BigMatrixImplTest) testGetVectors(org.apache.commons.math.linear.BigMatrixImplTest) testGetColumnMatrix(org.apache.commons.math.linear.BigMatrixImplTest) testMultiply(org.apache.commons.math.linear.BigMatrixImplTest) testEqualsAndHashCode(org.apache.commons.math.linear.BigMatrixImplTest) testInverse(org.apache.commons.math.linear.BigMatrixImplTest) testTranspose(org.apache.commons.math.linear.BigMatrixImplTest) testPremultiply(org.apache.commons.math.linear.BigMatrixImplTest) testGetRowMatrix(org.apache.commons.math.linear.BigMatrixImplTest) testSetSubMatrix(org.apache.commons.math.linear.BigMatrixImplTest) testConstructorMessage(org.apache.commons.math.linear.InvalidMatrixExceptionTest) testConstructor(org.apache.commons.math.linear.InvalidMatrixExceptionTest) testConstructorMessage(org.apache.commons.math.linear.MatrixIndexExceptionTest) testConstructor(org.apache.commons.math.linear.MatrixIndexExceptionTest) testCreateRealMatrix(org.apache.commons.math.linear.MatrixUtilsTest) testCreateRowRealMatrix(org.apache.commons.math.linear.MatrixUtilsTest) testCreateBigMatrix(org.apache.commons.math.linear.MatrixUtilsTest) testCreateColumnBigMatrix(org.apache.commons.math.linear.MatrixUtilsTest) testCreateBigIdentityMatrix(org.apache.commons.math.linear.MatrixUtilsTest) testCreateRowBigMatrix(org.apache.commons.math.linear.MatrixUtilsTest) testCreateIdentityMatrix(org.apache.commons.math.linear.MatrixUtilsTest) testCreateColumnRealMatrix(org.apache.commons.math.linear.MatrixUtilsTest) testAEqualQR(org.apache.commons.math.linear.QRDecompositionImplTest) testDimensions(org.apache.commons.math.linear.QRDecompositionImplTest) testRUpperTriangular(org.apache.commons.math.linear.QRDecompositionImplTest) testQOrthogonal(org.apache.commons.math.linear.QRDecompositionImplTest) testOperate(org.apache.commons.math.linear.RealMatrixImplTest) testExamples(org.apache.commons.math.linear.RealMatrixImplTest) testGetEntry(org.apache.commons.math.linear.RealMatrixImplTest) testAddFail(org.apache.commons.math.linear.RealMatrixImplTest) testAdd(org.apache.commons.math.linear.RealMatrixImplTest) testScalarAdd(org.apache.commons.math.linear.RealMatrixImplTest) testSolve(org.apache.commons.math.linear.RealMatrixImplTest) testTrace(org.apache.commons.math.linear.RealMatrixImplTest) testNorm(org.apache.commons.math.linear.RealMatrixImplTest) testToString(org.apache.commons.math.linear.RealMatrixImplTest) testIsSingular(org.apache.commons.math.linear.RealMatrixImplTest) testPlusMinus(org.apache.commons.math.linear.RealMatrixImplTest) testDeterminant(org.apache.commons.math.linear.RealMatrixImplTest) testMultiply2(org.apache.commons.math.linear.RealMatrixImplTest) testDimensions(org.apache.commons.math.linear.RealMatrixImplTest) testSubMatrix(org.apache.commons.math.linear.RealMatrixImplTest) testPremultiplyVector(org.apache.commons.math.linear.RealMatrixImplTest) testCopyFunctions(org.apache.commons.math.linear.RealMatrixImplTest) testLUDecomposition(org.apache.commons.math.linear.RealMatrixImplTest) testGetVectors(org.apache.commons.math.linear.RealMatrixImplTest) testGetColumnMatrix(org.apache.commons.math.linear.RealMatrixImplTest) testMultiply(org.apache.commons.math.linear.RealMatrixImplTest) testEqualsAndHashCode(org.apache.commons.math.linear.RealMatrixImplTest) testInverse(org.apache.commons.math.linear.RealMatrixImplTest) testTranspose(org.apache.commons.math.linear.RealMatrixImplTest) testPremultiply(org.apache.commons.math.linear.RealMatrixImplTest) testGetRowMatrix(org.apache.commons.math.linear.RealMatrixImplTest) testSetSubMatrix(org.apache.commons.math.linear.RealMatrixImplTest) testRegularizedBetaPositiveNanPositive(org.apache.commons.math.special.BetaTest) testRegularizedBetaPositivePositivePositive(org.apache.commons.math.special.BetaTest) testRegularizedBetaPositivePositiveNegative(org.apache.commons.math.special.BetaTest) testRegularizedBetaPositiveZeroPositive(org.apache.commons.math.special.BetaTest) testLogBetaPositivePositive(org.apache.commons.math.special.BetaTest) testLogBetaPositiveNegative(org.apache.commons.math.special.BetaTest) testLogBetaPositiveNan(org.apache.commons.math.special.BetaTest) testRegularizedBetaNegativePositivePositive(org.apache.commons.math.special.BetaTest) testRegularizedBetaPositivePositiveNan(org.apache.commons.math.special.BetaTest) testLogBetaZeroPositive(org.apache.commons.math.special.BetaTest) testRegularizedBetaPositivePositiveZero(org.apache.commons.math.special.BetaTest) testRegularizedBetaPositiveNegativePositive(org.apache.commons.math.special.BetaTest) testLogBetaNanPositive(org.apache.commons.math.special.BetaTest) testLogBetaNegativePositive(org.apache.commons.math.special.BetaTest) testLogBetaPositiveZero(org.apache.commons.math.special.BetaTest) testRegularizedBetaZeroPositivePositive(org.apache.commons.math.special.BetaTest) testRegularizedBetaNanPositivePositive(org.apache.commons.math.special.BetaTest) testErf1960(org.apache.commons.math.special.ErfTest) testErf2576(org.apache.commons.math.special.ErfTest) testErf2807(org.apache.commons.math.special.ErfTest) testErf3291(org.apache.commons.math.special.ErfTest) testErf0(org.apache.commons.math.special.ErfTest) testLogGammaPositive(org.apache.commons.math.special.GammaTest) testLogGammaNegative(org.apache.commons.math.special.GammaTest) testRegularizedGammaPositivePositive(org.apache.commons.math.special.GammaTest) testRegularizedGammaPositiveNegative(org.apache.commons.math.special.GammaTest) testLogGammaNan(org.apache.commons.math.special.GammaTest) testRegularizedGammaNanPositive(org.apache.commons.math.special.GammaTest) testRegularizedGammaZeroPositive(org.apache.commons.math.special.GammaTest) testLogGammaZero(org.apache.commons.math.special.GammaTest) testRegularizedGammaNegativePositive(org.apache.commons.math.special.GammaTest) testRegularizedGammaPositiveNan(org.apache.commons.math.special.GammaTest) testRegularizedGammaPositiveZero(org.apache.commons.math.special.GammaTest) testUnivariateImpl(org.apache.commons.math.stat.CertifiedDataTest) testStoredUnivariateImpl(org.apache.commons.math.stat.CertifiedDataTest) testEmptyTable(org.apache.commons.math.stat.FrequencyTest) testAdd(org.apache.commons.math.stat.FrequencyTest) testPcts(org.apache.commons.math.stat.FrequencyTest) testToString(org.apache.commons.math.stat.FrequencyTest) testIntegerValues(org.apache.commons.math.stat.FrequencyTest) testCounts(org.apache.commons.math.stat.FrequencyTest) testDifferenceStats(org.apache.commons.math.stat.StatUtilsTest) testPercentile(org.apache.commons.math.stat.StatUtilsTest) testArrayIndexConditions(org.apache.commons.math.stat.StatUtilsTest) testMax(org.apache.commons.math.stat.StatUtilsTest) testMin(org.apache.commons.math.stat.StatUtilsTest) testStats(org.apache.commons.math.stat.StatUtilsTest) testSumSq(org.apache.commons.math.stat.StatUtilsTest) testMean(org.apache.commons.math.stat.StatUtilsTest) testN0andN1Conditions(org.apache.commons.math.stat.StatUtilsTest) testProduct(org.apache.commons.math.stat.StatUtilsTest) testGeometricMean(org.apache.commons.math.stat.StatUtilsTest) testVariance(org.apache.commons.math.stat.StatUtilsTest) testSumLog(org.apache.commons.math.stat.StatUtilsTest) testCertifiedValues(org.apache.commons.math.stat.data.LewTest) testCertifiedValues(org.apache.commons.math.stat.data.LotteryTest) testGetSortedValues(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsImplTest) testProductAndGeometricMean(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsImplTest) testStats(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsImplTest) testN0andN1Conditions(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsImplTest) testPercentiles(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsImplTest) testSkewAndKurtosis(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsImplTest) testGetSortedValues(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsTest) testProductAndGeometricMean(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsTest) testSerialization(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsTest) testStats(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsTest) testToString(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsTest) testN0andN1Conditions(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsTest) testAddValue(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsTest) testWindowing(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsTest) testPercentiles(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsTest) testWindowSize(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsTest) testNewInstanceClassValid(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsTest) testNewInstanceClassNull(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsTest) testSkewAndKurtosis(org.apache.commons.math.stat.descriptive.DescriptiveStatisticsTest) testInteraction(org.apache.commons.math.stat.descriptive.InteractionTest) testProductAndGeometricMean(org.apache.commons.math.stat.descriptive.ListUnivariateImplTest) testSerialization(org.apache.commons.math.stat.descriptive.ListUnivariateImplTest) testStats(org.apache.commons.math.stat.descriptive.ListUnivariateImplTest) testN0andN1Conditions(org.apache.commons.math.stat.descriptive.ListUnivariateImplTest) testSkewAndKurtosis(org.apache.commons.math.stat.descriptive.ListUnivariateImplTest) testProductAndGeometricMean(org.apache.commons.math.stat.descriptive.MixedListUnivariateImplTest) testStats(org.apache.commons.math.stat.descriptive.MixedListUnivariateImplTest) testN0andN1Conditions(org.apache.commons.math.stat.descriptive.MixedListUnivariateImplTest) testSkewAndKurtosis(org.apache.commons.math.stat.descriptive.MixedListUnivariateImplTest) testSerialization(org.apache.commons.math.stat.descriptive.StatisticalSummaryValuesTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.StatisticalSummaryValuesTest) testProductAndGeometricMean(org.apache.commons.math.stat.descriptive.SummaryStatisticsImplTest) testGetSummary(org.apache.commons.math.stat.descriptive.SummaryStatisticsImplTest) testSerialization(org.apache.commons.math.stat.descriptive.SummaryStatisticsImplTest) testStats(org.apache.commons.math.stat.descriptive.SummaryStatisticsImplTest) testNaNContracts(org.apache.commons.math.stat.descriptive.SummaryStatisticsImplTest) testN0andN1Conditions(org.apache.commons.math.stat.descriptive.SummaryStatisticsImplTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.SummaryStatisticsImplTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.moment.FirstMomentTest) testSerialization(org.apache.commons.math.stat.descriptive.moment.FirstMomentTest) testIncrementation(org.apache.commons.math.stat.descriptive.moment.FirstMomentTest) testConsistency(org.apache.commons.math.stat.descriptive.moment.FirstMomentTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.moment.FirstMomentTest) testEvaluation(org.apache.commons.math.stat.descriptive.moment.FirstMomentTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.moment.FourthMomentTest) testSerialization(org.apache.commons.math.stat.descriptive.moment.FourthMomentTest) testIncrementation(org.apache.commons.math.stat.descriptive.moment.FourthMomentTest) testConsistency(org.apache.commons.math.stat.descriptive.moment.FourthMomentTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.moment.FourthMomentTest) testEvaluation(org.apache.commons.math.stat.descriptive.moment.FourthMomentTest) testSpecialValues(org.apache.commons.math.stat.descriptive.moment.GeometricMeanTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.moment.GeometricMeanTest) testSerialization(org.apache.commons.math.stat.descriptive.moment.GeometricMeanTest) testIncrementation(org.apache.commons.math.stat.descriptive.moment.GeometricMeanTest) testConsistency(org.apache.commons.math.stat.descriptive.moment.GeometricMeanTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.moment.GeometricMeanTest) testEvaluation(org.apache.commons.math.stat.descriptive.moment.GeometricMeanTest) testNaN(org.apache.commons.math.stat.descriptive.moment.KurtosisTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.moment.KurtosisTest) testSerialization(org.apache.commons.math.stat.descriptive.moment.KurtosisTest) testIncrementation(org.apache.commons.math.stat.descriptive.moment.KurtosisTest) testConsistency(org.apache.commons.math.stat.descriptive.moment.KurtosisTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.moment.KurtosisTest) testEvaluation(org.apache.commons.math.stat.descriptive.moment.KurtosisTest) testSmallSamples(org.apache.commons.math.stat.descriptive.moment.MeanTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.moment.MeanTest) testSerialization(org.apache.commons.math.stat.descriptive.moment.MeanTest) testIncrementation(org.apache.commons.math.stat.descriptive.moment.MeanTest) testConsistency(org.apache.commons.math.stat.descriptive.moment.MeanTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.moment.MeanTest) testEvaluation(org.apache.commons.math.stat.descriptive.moment.MeanTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.moment.SecondMomentTest) testSerialization(org.apache.commons.math.stat.descriptive.moment.SecondMomentTest) testIncrementation(org.apache.commons.math.stat.descriptive.moment.SecondMomentTest) testConsistency(org.apache.commons.math.stat.descriptive.moment.SecondMomentTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.moment.SecondMomentTest) testEvaluation(org.apache.commons.math.stat.descriptive.moment.SecondMomentTest) testNaN(org.apache.commons.math.stat.descriptive.moment.SkewnessTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.moment.SkewnessTest) testSerialization(org.apache.commons.math.stat.descriptive.moment.SkewnessTest) testIncrementation(org.apache.commons.math.stat.descriptive.moment.SkewnessTest) testConsistency(org.apache.commons.math.stat.descriptive.moment.SkewnessTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.moment.SkewnessTest) testEvaluation(org.apache.commons.math.stat.descriptive.moment.SkewnessTest) testNaN(org.apache.commons.math.stat.descriptive.moment.StandardDeviationTest) testPopulation(org.apache.commons.math.stat.descriptive.moment.StandardDeviationTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.moment.StandardDeviationTest) testSerialization(org.apache.commons.math.stat.descriptive.moment.StandardDeviationTest) testIncrementation(org.apache.commons.math.stat.descriptive.moment.StandardDeviationTest) testConsistency(org.apache.commons.math.stat.descriptive.moment.StandardDeviationTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.moment.StandardDeviationTest) testEvaluation(org.apache.commons.math.stat.descriptive.moment.StandardDeviationTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.moment.ThirdMomentTest) testSerialization(org.apache.commons.math.stat.descriptive.moment.ThirdMomentTest) testIncrementation(org.apache.commons.math.stat.descriptive.moment.ThirdMomentTest) testConsistency(org.apache.commons.math.stat.descriptive.moment.ThirdMomentTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.moment.ThirdMomentTest) testEvaluation(org.apache.commons.math.stat.descriptive.moment.ThirdMomentTest) testNaN(org.apache.commons.math.stat.descriptive.moment.VarianceTest) testPopulation(org.apache.commons.math.stat.descriptive.moment.VarianceTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.moment.VarianceTest) testSerialization(org.apache.commons.math.stat.descriptive.moment.VarianceTest) testIncrementation(org.apache.commons.math.stat.descriptive.moment.VarianceTest) testConsistency(org.apache.commons.math.stat.descriptive.moment.VarianceTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.moment.VarianceTest) testEvaluation(org.apache.commons.math.stat.descriptive.moment.VarianceTest) testNaNs(org.apache.commons.math.stat.descriptive.rank.MaxTest) testSpecialValues(org.apache.commons.math.stat.descriptive.rank.MaxTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.rank.MaxTest) testSerialization(org.apache.commons.math.stat.descriptive.rank.MaxTest) testIncrementation(org.apache.commons.math.stat.descriptive.rank.MaxTest) testConsistency(org.apache.commons.math.stat.descriptive.rank.MaxTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.rank.MaxTest) testEvaluation(org.apache.commons.math.stat.descriptive.rank.MaxTest) testEvaluation(org.apache.commons.math.stat.descriptive.rank.MedianTest) testNaNs(org.apache.commons.math.stat.descriptive.rank.MinTest) testSpecialValues(org.apache.commons.math.stat.descriptive.rank.MinTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.rank.MinTest) testSerialization(org.apache.commons.math.stat.descriptive.rank.MinTest) testIncrementation(org.apache.commons.math.stat.descriptive.rank.MinTest) testConsistency(org.apache.commons.math.stat.descriptive.rank.MinTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.rank.MinTest) testEvaluation(org.apache.commons.math.stat.descriptive.rank.MinTest) testPercentile(org.apache.commons.math.stat.descriptive.rank.PercentileTest) testNISTExample(org.apache.commons.math.stat.descriptive.rank.PercentileTest) testSingleton(org.apache.commons.math.stat.descriptive.rank.PercentileTest) testSetQuantile(org.apache.commons.math.stat.descriptive.rank.PercentileTest) test5(org.apache.commons.math.stat.descriptive.rank.PercentileTest) testHighPercentile(org.apache.commons.math.stat.descriptive.rank.PercentileTest) testSpecialValues(org.apache.commons.math.stat.descriptive.rank.PercentileTest) testNullEmpty(org.apache.commons.math.stat.descriptive.rank.PercentileTest) testEvaluation(org.apache.commons.math.stat.descriptive.rank.PercentileTest) testSpecialValues(org.apache.commons.math.stat.descriptive.summary.ProductTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.summary.ProductTest) testSerialization(org.apache.commons.math.stat.descriptive.summary.ProductTest) testIncrementation(org.apache.commons.math.stat.descriptive.summary.ProductTest) testConsistency(org.apache.commons.math.stat.descriptive.summary.ProductTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.summary.ProductTest) testEvaluation(org.apache.commons.math.stat.descriptive.summary.ProductTest) testSpecialValues(org.apache.commons.math.stat.descriptive.summary.SumLogTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.summary.SumLogTest) testSerialization(org.apache.commons.math.stat.descriptive.summary.SumLogTest) testIncrementation(org.apache.commons.math.stat.descriptive.summary.SumLogTest) testConsistency(org.apache.commons.math.stat.descriptive.summary.SumLogTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.summary.SumLogTest) testEvaluation(org.apache.commons.math.stat.descriptive.summary.SumLogTest) testSpecialValues(org.apache.commons.math.stat.descriptive.summary.SumSqTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.summary.SumSqTest) testSerialization(org.apache.commons.math.stat.descriptive.summary.SumSqTest) testIncrementation(org.apache.commons.math.stat.descriptive.summary.SumSqTest) testConsistency(org.apache.commons.math.stat.descriptive.summary.SumSqTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.summary.SumSqTest) testEvaluation(org.apache.commons.math.stat.descriptive.summary.SumSqTest) testSpecialValues(org.apache.commons.math.stat.descriptive.summary.SumTest) testMomentSmallSamples(org.apache.commons.math.stat.descriptive.summary.SumTest) testSerialization(org.apache.commons.math.stat.descriptive.summary.SumTest) testIncrementation(org.apache.commons.math.stat.descriptive.summary.SumTest) testConsistency(org.apache.commons.math.stat.descriptive.summary.SumTest) testEqualsAndHashCode(org.apache.commons.math.stat.descriptive.summary.SumTest) testEvaluation(org.apache.commons.math.stat.descriptive.summary.SumTest) testChiSquareIndependence(org.apache.commons.math.stat.inference.ChiSquareFactoryTest) testChiSquareZeroCount(org.apache.commons.math.stat.inference.ChiSquareFactoryTest) testChiSquareLargeTestStatistic(org.apache.commons.math.stat.inference.ChiSquareFactoryTest) testChiSquare(org.apache.commons.math.stat.inference.ChiSquareFactoryTest) testChiSquareIndependence(org.apache.commons.math.stat.inference.ChiSquareTestTest) testChiSquareZeroCount(org.apache.commons.math.stat.inference.ChiSquareTestTest) testChiSquareLargeTestStatistic(org.apache.commons.math.stat.inference.ChiSquareTestTest) testChiSquare(org.apache.commons.math.stat.inference.ChiSquareTestTest) testOneSampleTTest(org.apache.commons.math.stat.inference.TTestFactoryTest) testSmallSamples(org.apache.commons.math.stat.inference.TTestFactoryTest) testTwoSampleTHeterscedastic(org.apache.commons.math.stat.inference.TTestFactoryTest) testOneSampleT(org.apache.commons.math.stat.inference.TTestFactoryTest) testPaired(org.apache.commons.math.stat.inference.TTestFactoryTest) testTwoSampleTHomoscedastic(org.apache.commons.math.stat.inference.TTestFactoryTest) testOneSampleTTest(org.apache.commons.math.stat.inference.TTestTest) testSmallSamples(org.apache.commons.math.stat.inference.TTestTest) testTwoSampleTHeterscedastic(org.apache.commons.math.stat.inference.TTestTest) testOneSampleT(org.apache.commons.math.stat.inference.TTestTest) testPaired(org.apache.commons.math.stat.inference.TTestTest) testTwoSampleTHomoscedastic(org.apache.commons.math.stat.inference.TTestTest) testOneSampleTTest(org.apache.commons.math.stat.inference.TestUtilsTest) testChiSquareIndependence(org.apache.commons.math.stat.inference.TestUtilsTest) testChiSquareZeroCount(org.apache.commons.math.stat.inference.TestUtilsTest) testSmallSamples(org.apache.commons.math.stat.inference.TestUtilsTest) testTwoSampleTHeterscedastic(org.apache.commons.math.stat.inference.TestUtilsTest) testChiSquareLargeTestStatistic(org.apache.commons.math.stat.inference.TestUtilsTest) testChiSquare(org.apache.commons.math.stat.inference.TestUtilsTest) testOneSampleT(org.apache.commons.math.stat.inference.TestUtilsTest) testPaired(org.apache.commons.math.stat.inference.TestUtilsTest) testTwoSampleTHomoscedastic(org.apache.commons.math.stat.inference.TestUtilsTest) testClear(org.apache.commons.math.stat.regression.SimpleRegressionTest) testCorr(org.apache.commons.math.stat.regression.SimpleRegressionTest) testNaNs(org.apache.commons.math.stat.regression.SimpleRegressionTest) testPerfect(org.apache.commons.math.stat.regression.SimpleRegressionTest) testSSENonNegative(org.apache.commons.math.stat.regression.SimpleRegressionTest) testPerfectNegative(org.apache.commons.math.stat.regression.SimpleRegressionTest) testNorris(org.apache.commons.math.stat.regression.SimpleRegressionTest) testInference(org.apache.commons.math.stat.regression.SimpleRegressionTest) testRandom(org.apache.commons.math.stat.regression.SimpleRegressionTest) testAdHocData(org.apache.commons.math.transform.FastCosineTransformerTest) testParameters(org.apache.commons.math.transform.FastCosineTransformerTest) testSinFunction(org.apache.commons.math.transform.FastCosineTransformerTest) testAdHocData(org.apache.commons.math.transform.FastFourierTransformerTest) testParameters(org.apache.commons.math.transform.FastFourierTransformerTest) testSinFunction(org.apache.commons.math.transform.FastFourierTransformerTest) testAdHocData(org.apache.commons.math.transform.FastSineTransformerTest) testParameters(org.apache.commons.math.transform.FastSineTransformerTest) testSinFunction(org.apache.commons.math.transform.FastSineTransformerTest) testGoldenRation(org.apache.commons.math.util.ContinuedFractionTest) testTransformDouble(org.apache.commons.math.util.DefaultTransformerTest) testTransformBigDecimal(org.apache.commons.math.util.DefaultTransformerTest) testTransformObject(org.apache.commons.math.util.DefaultTransformerTest) testTransformString(org.apache.commons.math.util.DefaultTransformerTest) testTransformInteger(org.apache.commons.math.util.DefaultTransformerTest) testTransformNull(org.apache.commons.math.util.DefaultTransformerTest) testBinomialCoefficient(org.apache.commons.math.util.MathUtilsTest) testFactorialFail(org.apache.commons.math.util.MathUtilsTest) testIndicatorDouble(org.apache.commons.math.util.MathUtilsTest) testRoundDouble(org.apache.commons.math.util.MathUtilsTest) testIndicatorInt(org.apache.commons.math.util.MathUtilsTest) testGcd(org.apache.commons.math.util.MathUtilsTest) testLcm(org.apache.commons.math.util.MathUtilsTest) testCosh(org.apache.commons.math.util.MathUtilsTest) testHash(org.apache.commons.math.util.MathUtilsTest) testSinh(org.apache.commons.math.util.MathUtilsTest) testRoundFloat(org.apache.commons.math.util.MathUtilsTest) testFactorial(org.apache.commons.math.util.MathUtilsTest) testSubAndCheck(org.apache.commons.math.util.MathUtilsTest) testBinomialCoefficientFail(org.apache.commons.math.util.MathUtilsTest) testCoshNaN(org.apache.commons.math.util.MathUtilsTest) testSubAndCheckErrorMessage(org.apache.commons.math.util.MathUtilsTest) test0Choose0(org.apache.commons.math.util.MathUtilsTest) testMulAndCheck(org.apache.commons.math.util.MathUtilsTest) testSignByte(org.apache.commons.math.util.MathUtilsTest) testSignLong(org.apache.commons.math.util.MathUtilsTest) testEquals(org.apache.commons.math.util.MathUtilsTest) testIndicatorFloat(org.apache.commons.math.util.MathUtilsTest) testIndicatorShort(org.apache.commons.math.util.MathUtilsTest) testIndicatorByte(org.apache.commons.math.util.MathUtilsTest) testIndicatorLong(org.apache.commons.math.util.MathUtilsTest) testSignDouble(org.apache.commons.math.util.MathUtilsTest) testAddAndCheck(org.apache.commons.math.util.MathUtilsTest) testSignInt(org.apache.commons.math.util.MathUtilsTest) testSinhNaN(org.apache.commons.math.util.MathUtilsTest) testSignFloat(org.apache.commons.math.util.MathUtilsTest) testSignShort(org.apache.commons.math.util.MathUtilsTest) testNextAfter(org.apache.commons.math.util.MathUtilsTest) testNextAfterSpecialCases(org.apache.commons.math.util.MathUtilsTest) testAdd1000(org.apache.commons.math.util.ResizableDoubleArrayTest) testConstructors(org.apache.commons.math.util.ResizableDoubleArrayTest) testAddElementRolling(org.apache.commons.math.util.ResizableDoubleArrayTest) testWithInitialCapacityAndExpansionFactor(org.apache.commons.math.util.ResizableDoubleArrayTest) testSetNumberOfElements(org.apache.commons.math.util.ResizableDoubleArrayTest) testWithInitialCapacity(org.apache.commons.math.util.ResizableDoubleArrayTest) testDiscard(org.apache.commons.math.util.ResizableDoubleArrayTest) testMutators(org.apache.commons.math.util.ResizableDoubleArrayTest) testSetElementArbitraryExpansion(org.apache.commons.math.util.ResizableDoubleArrayTest) testGetValues(org.apache.commons.math.util.ResizableDoubleArrayTest) testMinMax(org.apache.commons.math.util.ResizableDoubleArrayTest) testClear(org.apache.commons.math.util.TransformerMapTest) testContainsTransformer(org.apache.commons.math.util.TransformerMapTest) testTransformers(org.apache.commons.math.util.TransformerMapTest) testPutTransformer(org.apache.commons.math.util.TransformerMapTest) testContainsClass(org.apache.commons.math.util.TransformerMapTest) testClasses(org.apache.commons.math.util.TransformerMapTest) testRemoveTransformer(org.apache.commons.math.util.TransformerMapTest)
{ "pile_set_name": "Github" }
// Copyright 2008 The Closure Library 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. /** * @fileoverview An alternative custom button renderer that uses even more CSS * voodoo than the default implementation to render custom buttons with fake * rounded corners and dimensionality (via a subtle flat shadow on the bottom * half of the button) without the use of images. * * Based on the Custom Buttons 3.1 visual specification, see * http://go/custombuttons * * @author eae@google.com (Emil A Eklund) * @see ../demos/imagelessbutton.html */ goog.provide('goog.ui.ImagelessButtonRenderer'); goog.require('goog.dom.classes'); goog.require('goog.ui.Button'); goog.require('goog.ui.ControlContent'); goog.require('goog.ui.CustomButtonRenderer'); goog.require('goog.ui.INLINE_BLOCK_CLASSNAME'); goog.require('goog.ui.registry'); /** * Custom renderer for {@link goog.ui.Button}s. Imageless buttons can contain * almost arbitrary HTML content, will flow like inline elements, but can be * styled like block-level elements. * * @constructor * @extends {goog.ui.CustomButtonRenderer} */ goog.ui.ImagelessButtonRenderer = function() { goog.ui.CustomButtonRenderer.call(this); }; goog.inherits(goog.ui.ImagelessButtonRenderer, goog.ui.CustomButtonRenderer); /** * The singleton instance of this renderer class. * @type {goog.ui.ImagelessButtonRenderer?} * @private */ goog.ui.ImagelessButtonRenderer.instance_ = null; goog.addSingletonGetter(goog.ui.ImagelessButtonRenderer); /** * Default CSS class to be applied to the root element of components rendered * by this renderer. * @type {string} */ goog.ui.ImagelessButtonRenderer.CSS_CLASS = goog.getCssName('goog-imageless-button'); /** * Returns the button's contents wrapped in the following DOM structure: * <div class="goog-inline-block goog-imageless-button"> * <div class="goog-inline-block goog-imageless-button-outer-box"> * <div class="goog-imageless-button-inner-box"> * <div class="goog-imageless-button-pos-box"> * <div class="goog-imageless-button-top-shadow">&nbsp;</div> * <div class="goog-imageless-button-content">Contents...</div> * </div> * </div> * </div> * </div> * @override */ goog.ui.ImagelessButtonRenderer.prototype.createDom; /** @override */ goog.ui.ImagelessButtonRenderer.prototype.getContentElement = function( element) { return /** @type {Element} */ (element && element.firstChild && element.firstChild.firstChild && element.firstChild.firstChild.firstChild.lastChild); }; /** * Takes a text caption or existing DOM structure, and returns the content * wrapped in a pseudo-rounded-corner box. Creates the following DOM structure: * <div class="goog-inline-block goog-imageless-button-outer-box"> * <div class="goog-inline-block goog-imageless-button-inner-box"> * <div class="goog-imageless-button-pos"> * <div class="goog-imageless-button-top-shadow">&nbsp;</div> * <div class="goog-imageless-button-content">Contents...</div> * </div> * </div> * </div> * Used by both {@link #createDom} and {@link #decorate}. To be overridden * by subclasses. * @param {goog.ui.ControlContent} content Text caption or DOM structure to wrap * in a box. * @param {goog.dom.DomHelper} dom DOM helper, used for document interaction. * @return {Element} Pseudo-rounded-corner box containing the content. * @override */ goog.ui.ImagelessButtonRenderer.prototype.createButton = function(content, dom) { var baseClass = this.getCssClass(); var inlineBlock = goog.ui.INLINE_BLOCK_CLASSNAME + ' '; return dom.createDom('div', inlineBlock + goog.getCssName(baseClass, 'outer-box'), dom.createDom('div', inlineBlock + goog.getCssName(baseClass, 'inner-box'), dom.createDom('div', goog.getCssName(baseClass, 'pos'), dom.createDom('div', goog.getCssName(baseClass, 'top-shadow'), '\u00A0'), dom.createDom('div', goog.getCssName(baseClass, 'content'), content)))); }; /** * Check if the button's element has a box structure. * @param {goog.ui.Button} button Button instance whose structure is being * checked. * @param {Element} element Element of the button. * @return {boolean} Whether the element has a box structure. * @protected * @override */ goog.ui.ImagelessButtonRenderer.prototype.hasBoxStructure = function( button, element) { var outer = button.getDomHelper().getFirstElementChild(element); var outerClassName = goog.getCssName(this.getCssClass(), 'outer-box'); if (outer && goog.dom.classes.has(outer, outerClassName)) { var inner = button.getDomHelper().getFirstElementChild(outer); var innerClassName = goog.getCssName(this.getCssClass(), 'inner-box'); if (inner && goog.dom.classes.has(inner, innerClassName)) { var pos = button.getDomHelper().getFirstElementChild(inner); var posClassName = goog.getCssName(this.getCssClass(), 'pos'); if (pos && goog.dom.classes.has(pos, posClassName)) { var shadow = button.getDomHelper().getFirstElementChild(pos); var shadowClassName = goog.getCssName( this.getCssClass(), 'top-shadow'); if (shadow && goog.dom.classes.has(shadow, shadowClassName)) { var content = button.getDomHelper().getNextElementSibling(shadow); var contentClassName = goog.getCssName( this.getCssClass(), 'content'); if (content && goog.dom.classes.has(content, contentClassName)) { // We have a proper box structure. return true; } } } } } return false; }; /** * Returns the CSS class to be applied to the root element of components * rendered using this renderer. * @return {string} Renderer-specific CSS class. * @override */ goog.ui.ImagelessButtonRenderer.prototype.getCssClass = function() { return goog.ui.ImagelessButtonRenderer.CSS_CLASS; }; // Register a decorator factory function for goog.ui.ImagelessButtonRenderer. goog.ui.registry.setDecoratorByClassName( goog.ui.ImagelessButtonRenderer.CSS_CLASS, function() { return new goog.ui.Button(null, goog.ui.ImagelessButtonRenderer.getInstance()); }); // Register a decorator factory function for toggle buttons using the // goog.ui.ImagelessButtonRenderer. goog.ui.registry.setDecoratorByClassName( goog.getCssName('goog-imageless-toggle-button'), function() { var button = new goog.ui.Button(null, goog.ui.ImagelessButtonRenderer.getInstance()); button.setSupportedState(goog.ui.Component.State.CHECKED, true); return button; });
{ "pile_set_name": "Github" }
/* * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package java.lang.instrument; /* * Copyright 2003 Wily Technology, Inc. */ /** * This class serves as a parameter block to the <code>Instrumentation.redefineClasses</code> method. * Serves to bind the <code>Class</code> that needs redefining together with the new class file bytes. * * @see java.lang.instrument.Instrumentation#redefineClasses * @since 1.5 */ public final class ClassDefinition { /** * The class to redefine */ private final Class<?> mClass; /** * The replacement class file bytes */ private final byte[] mClassFile; /** * Creates a new <code>ClassDefinition</code> binding using the supplied * class and class file bytes. Does not copy the supplied buffer, just captures a reference to it. * * @param theClass the <code>Class</code> that needs redefining * @param theClassFile the new class file bytes * * @throws java.lang.NullPointerException if the supplied class or array is <code>null</code>. */ public ClassDefinition( Class<?> theClass, byte[] theClassFile) { if (theClass == null || theClassFile == null) { throw new NullPointerException(); } mClass = theClass; mClassFile = theClassFile; } /** * Returns the class. * * @return the <code>Class</code> object referred to. */ public Class<?> getDefinitionClass() { return mClass; } /** * Returns the array of bytes that contains the new class file. * * @return the class file bytes. */ public byte[] getDefinitionClassFile() { return mClassFile; } }
{ "pile_set_name": "Github" }
/* * Copyright 2006-2009, 2017, 2020 United States Government, as represented by the * Administrator of the National Aeronautics and Space Administration. * All rights reserved. * * The NASA World Wind Java (WWJ) platform is 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. * * NASA World Wind Java (WWJ) also contains the following 3rd party Open Source * software: * * Jackson Parser – Licensed under Apache 2.0 * GDAL – Licensed under MIT * JOGL – Licensed under Berkeley Software Distribution (BSD) * Gluegen – Licensed under Berkeley Software Distribution (BSD) * * A complete listing of 3rd Party software notices and licenses included in * NASA World Wind Java (WWJ) can be found in the WorldWindJava-v2.2 3rd-party * notices and licenses PDF found in code directory. */ package gov.nasa.worldwindx.examples; import gov.nasa.worldwind.avlist.AVKey; import gov.nasa.worldwind.geom.*; import gov.nasa.worldwind.globes.Globe; import gov.nasa.worldwind.layers.RenderableLayer; import gov.nasa.worldwind.render.*; import gov.nasa.worldwind.util.ContourList; import gov.nasa.worldwind.util.combine.ShapeCombiner; /** * Shows how to use the {@link gov.nasa.worldwind.util.combine.Combinable} interface and the {@link * gov.nasa.worldwind.util.combine.ShapeCombiner} class to combine WorldWind surface shapes into a complex set of * contours by using boolean operations. * <p> * This example creates two static SurfaceCircle instances that partially overlap and displays them in a layer named * "Original". A ShapeCombiner is used to combine the two surface circles into a potentially complex set of contours * using boolean operations. Three examples of such operations are given: union, intersection and difference. The result * of each operation is displayed in a separate layer beneath the original shapes. * * @author dcollins * @version $Id: ShapeCombining.java 2411 2014-10-30 21:27:00Z dcollins $ */ public class ShapeCombining extends ApplicationTemplate { public static class AppFrame extends ApplicationTemplate.AppFrame { public AppFrame() { ShapeAttributes attrs = new BasicShapeAttributes(); attrs.setInteriorOpacity(0.5); attrs.setOutlineWidth(2); // Create two surface circles that partially overlap, and add them to a layer named "Original". SurfaceCircle shape1 = new SurfaceCircle(attrs, LatLon.fromDegrees(50, -105), 500000); SurfaceCircle shape2 = new SurfaceCircle(attrs, LatLon.fromDegrees(50, -100), 500000); shape1.setValue(AVKey.DISPLAY_NAME, "Original"); shape2.setValue(AVKey.DISPLAY_NAME, "Original"); RenderableLayer originalLayer = new RenderableLayer(); originalLayer.setName("Original"); originalLayer.addRenderable(shape1); originalLayer.addRenderable(shape2); this.getWwd().getModel().getLayers().add(originalLayer); // Set up a ShapeCombiner to combine the two surface circles into a potentially complex set of contours // using boolean operations: union, intersection and difference. Globe globe = this.getWwd().getModel().getGlobe(); double resolutionRadians = 10000 / globe.getRadius(); // 10km resolution ShapeCombiner shapeCombiner = new ShapeCombiner(globe, resolutionRadians); // Compute the union of the two surface circles. Display the result 10 degrees beneath the original. ContourList union = shapeCombiner.union(shape1, shape2); this.displayContours(union, "Union", Position.fromDegrees(-10, 0, 0)); // Compute the intersection of the two surface circles. Display the result 20 degrees beneath the original. ContourList intersection = shapeCombiner.intersection(shape1, shape2); this.displayContours(intersection, "Intersection", Position.fromDegrees(-20, 0, 0)); // Compute the difference of the two surface circles. Display the result 30 degrees beneath the original. ContourList difference = shapeCombiner.difference(shape1, shape2); this.displayContours(difference, "Difference", Position.fromDegrees(-30, 0, 0)); } protected void displayContours(ContourList contours, String displayName, Position offset) { ShapeAttributes attrs = new BasicShapeAttributes(); attrs.setInteriorMaterial(Material.CYAN); attrs.setInteriorOpacity(0.5); attrs.setOutlineMaterial(Material.WHITE); attrs.setOutlineWidth(2); SurfaceMultiPolygon shape = new SurfaceMultiPolygon(attrs, contours); shape.setValue(AVKey.DISPLAY_NAME, displayName); shape.setPathType(AVKey.LINEAR); shape.move(offset); RenderableLayer layer = new RenderableLayer(); layer.setName(displayName); layer.addRenderable(shape); this.getWwd().getModel().getLayers().add(layer); } } public static void main(String[] args) { start("WorldWind Shape Combining", AppFrame.class); } }
{ "pile_set_name": "Github" }
/** * Created with JetBrains PhpStorm. * User: xuheng * Date: 12-9-26 * Time: 下午12:29 * To change this template use File | Settings | File Templates. */ //清空上次查选的痕迹 editor.firstForSR = 0; editor.currentRangeForSR = null; //给tab注册切换事件 /** * tab点击处理事件 * @param tabHeads * @param tabBodys * @param obj */ function clickHandler( tabHeads,tabBodys,obj ) { //head样式更改 for ( var k = 0, len = tabHeads.length; k < len; k++ ) { tabHeads[k].className = ""; } obj.className = "focus"; //body显隐 var tabSrc = obj.getAttribute( "tabSrc" ); for ( var j = 0, length = tabBodys.length; j < length; j++ ) { var body = tabBodys[j], id = body.getAttribute( "id" ); if ( id != tabSrc ) { body.style.zIndex = 1; } else { body.style.zIndex = 200; } } } /** * TAB切换 * @param tabParentId tab的父节点ID或者对象本身 */ function switchTab( tabParentId ) { var tabElements = $G( tabParentId ).children, tabHeads = tabElements[0].children, tabBodys = tabElements[1].children; for ( var i = 0, length = tabHeads.length; i < length; i++ ) { var head = tabHeads[i]; if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head ); head.onclick = function () { clickHandler(tabHeads,tabBodys,this); } } } //是否区分大小写 function getMatchCase(id) { return $G(id).checked ? true : false; } //查找 $G("nextFindBtn").onclick = function (txt, dir, mcase) { var findtxt = $G("findtxt").value, obj; if (!findtxt) { return false; } obj = { searchStr:findtxt, dir:1, casesensitive:getMatchCase("matchCase") }; if (!frCommond(obj)) { alert(lang.getEnd); } }; $G("nextReplaceBtn").onclick = function (txt, dir, mcase) { var findtxt = $G("findtxt1").value, obj; if (!findtxt) { return false; } obj = { searchStr:findtxt, dir:1, casesensitive:getMatchCase("matchCase1") }; frCommond(obj); }; $G("preFindBtn").onclick = function (txt, dir, mcase) { var findtxt = $G("findtxt").value, obj; if (!findtxt) { return false; } obj = { searchStr:findtxt, dir:-1, casesensitive:getMatchCase("matchCase") }; if (!frCommond(obj)) { alert(lang.getStart); } }; $G("preReplaceBtn").onclick = function (txt, dir, mcase) { var findtxt = $G("findtxt1").value, obj; if (!findtxt) { return false; } obj = { searchStr:findtxt, dir:-1, casesensitive:getMatchCase("matchCase1") }; frCommond(obj); }; //替换 $G("repalceBtn").onclick = function () { var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj, replacetxt = $G("replacetxt").value.replace(/^\s|\s$/g, ""); if (!findtxt) { return false; } if (findtxt == replacetxt || (!getMatchCase("matchCase1") && findtxt.toLowerCase() == replacetxt.toLowerCase())) { return false; } obj = { searchStr:findtxt, dir:1, casesensitive:getMatchCase("matchCase1"), replaceStr:replacetxt }; frCommond(obj); }; //全部替换 $G("repalceAllBtn").onclick = function () { var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj, replacetxt = $G("replacetxt").value.replace(/^\s|\s$/g, ""); if (!findtxt) { return false; } if (findtxt == replacetxt || (!getMatchCase("matchCase1") && findtxt.toLowerCase() == replacetxt.toLowerCase())) { return false; } obj = { searchStr:findtxt, casesensitive:getMatchCase("matchCase1"), replaceStr:replacetxt, all:true }; var num = frCommond(obj); if (num) { alert(lang.countMsg.replace("{#count}", num)); } }; //执行 var frCommond = function (obj) { return editor.execCommand("searchreplace", obj); }; switchTab("searchtab");
{ "pile_set_name": "Github" }
<!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) on Thu Jan 05 01:03:22 EST 2017 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>StaxServerConfiguration (appsensor-parent 2.3.1 API)</title> <meta name="date" content="2017-01-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="StaxServerConfiguration (appsensor-parent 2.3.1 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.owasp.appsensor.configuration.stax.server</div> <h2 title="Class StaxServerConfiguration" class="title">Class StaxServerConfiguration</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> <li> <ul class="inheritance"> <li><a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html" title="class in org.owasp.appsensor.core.configuration.server">org.owasp.appsensor.core.configuration.server.ServerConfiguration</a></li> <li> <ul class="inheritance"> <li>org.owasp.appsensor.configuration.stax.server.StaxServerConfiguration</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>@Named public class <span class="typeNameLabel">StaxServerConfiguration</span> extends <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html" title="class in org.owasp.appsensor.core.configuration.server">ServerConfiguration</a></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../org/owasp/appsensor/configuration/stax/server/StaxServerConfiguration.html#StaxServerConfiguration--">StaxServerConfiguration</a></span>()</code></td> </tr> <tr class="rowColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../org/owasp/appsensor/configuration/stax/server/StaxServerConfiguration.html#StaxServerConfiguration-boolean-">StaxServerConfiguration</a></span>(boolean&nbsp;loadConfiguration)</code></td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.org.owasp.appsensor.core.configuration.server.ServerConfiguration"> <!-- --> </a> <h3>Methods inherited from class&nbsp;org.owasp.appsensor.core.configuration.server.<a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html" title="class in org.owasp.appsensor.core.configuration.server">ServerConfiguration</a></h3> <code><a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#equals-java.lang.Object-">equals</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#findClientApplication-java.lang.String-">findClientApplication</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#findDetectionPoints-org.owasp.appsensor.core.DetectionPoint-">findDetectionPoints</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#findDetectionPoints-org.owasp.appsensor.core.DetectionPoint-java.lang.String-">findDetectionPoints</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#getClientApplicationIdentificationHeaderName--">getClientApplicationIdentificationHeaderName</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#getClientApplications--">getClientApplications</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#getConfigurationFile--">getConfigurationFile</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#getCorrelationSets--">getCorrelationSets</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#getCustomDetectionPoints--">getCustomDetectionPoints</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#getDetectionPoints--">getDetectionPoints</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#getGeolocationDatabasePath--">getGeolocationDatabasePath</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#getRelatedDetectionSystems-org.owasp.appsensor.core.DetectionSystem-">getRelatedDetectionSystems</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#getServerHostName--">getServerHostName</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#getServerPort--">getServerPort</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#getServerSocketTimeout--">getServerSocketTimeout</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#hashCode--">hashCode</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#isGeolocateIpAddresses--">isGeolocateIpAddresses</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#setClientApplicationIdentificationHeaderName-java.lang.String-">setClientApplicationIdentificationHeaderName</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#setClientApplications-java.util.Collection-">setClientApplications</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#setConfigurationFile-java.io.File-">setConfigurationFile</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#setCorrelationSets-java.util.Collection-">setCorrelationSets</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#setCustomDetectionPoints-java.util.HashMap-">setCustomDetectionPoints</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#setDetectionPoints-java.util.Collection-">setDetectionPoints</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#setGeolocateIpAddresses-boolean-">setGeolocateIpAddresses</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#setGeolocationDatabasePath-java.lang.String-">setGeolocationDatabasePath</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#setServerHostName-java.lang.String-">setServerHostName</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#setServerPort-int-">setServerPort</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#setServerSocketTimeout-int-">setServerSocketTimeout</a>, <a href="../../../../../../org/owasp/appsensor/core/configuration/server/ServerConfiguration.html#toString--">toString</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> <code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="StaxServerConfiguration--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>StaxServerConfiguration</h4> <pre>public&nbsp;StaxServerConfiguration()</pre> </li> </ul> <a name="StaxServerConfiguration-boolean-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>StaxServerConfiguration</h4> <pre>public&nbsp;StaxServerConfiguration(boolean&nbsp;loadConfiguration)</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <p class="legalCopy"><small>Copyright &#169; 2017 <a href="http://www.owasp.org">The Open Web Application Security Project (OWASP)</a>. All rights reserved.</small></p> </body> </html>
{ "pile_set_name": "Github" }
def euclideanDistance(p: List[Int], q: List[Int]): Int = math.sqrt(p.zip(q).map { case (u, v) => math.pow(u-v, 2) }.sum)
{ "pile_set_name": "Github" }
/* * Copyright 2019 The Error Prone 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 com.google.errorprone.bugpatterns; import static com.google.errorprone.BugPattern.SeverityLevel.ERROR; import static com.google.errorprone.matchers.Description.NO_MATCH; import static com.google.errorprone.matchers.JUnitMatchers.hasJUnit4TestRunner; import static com.google.errorprone.util.ASTHelpers.getAnnotationWithSimpleName; import static com.google.errorprone.util.ASTHelpers.hasAnnotation; import com.google.errorprone.BugPattern; import com.google.errorprone.VisitorState; import com.google.errorprone.bugpatterns.BugChecker.ClassTreeMatcher; import com.google.errorprone.fixes.SuggestedFix; import com.google.errorprone.fixes.SuggestedFixes; import com.google.errorprone.matchers.Description; import com.sun.source.tree.AnnotationTree; import com.sun.source.tree.ClassTree; /** Flags uses of parameters in non-parameterized tests. */ @BugPattern( name = "ParametersButNotParameterized", summary = "This test has @Parameters but is using the default JUnit4 runner. The parameters will" + " have no effect.", severity = ERROR) public final class ParametersButNotParameterized extends BugChecker implements ClassTreeMatcher { private static final String PARAMETERIZED = "org.junit.runners.Parameterized"; private static final String PARAMETER = "org.junit.runners.Parameterized.Parameter"; private static final String PARAMETERS = "org.junit.runners.Parameterized.Parameters"; @Override public Description matchClass(ClassTree tree, VisitorState state) { if (!hasJUnit4TestRunner.matches(tree, state)) { return NO_MATCH; } if (tree.getMembers().stream() .noneMatch( m -> hasAnnotation(m, PARAMETER, state) || hasAnnotation(m, PARAMETERS, state))) { return NO_MATCH; } AnnotationTree annotation = getAnnotationWithSimpleName(tree.getModifiers().getAnnotations(), "RunWith"); SuggestedFix.Builder fix = SuggestedFix.builder(); fix.replace( annotation, String.format("@RunWith(%s.class)", SuggestedFixes.qualifyType(state, fix, PARAMETERIZED))); return describeMatch(tree, fix.build()); } }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2006-2011 Christian Plattner. All rights reserved. * Please refer to the LICENSE.txt for licensing details. */ package ch.ethz.ssh2.packets; import ch.ethz.ssh2.DHGexParameters; /** * PacketKexDhGexRequestOld. * * @author Christian Plattner * @version 2.50, 03/15/10 */ public class PacketKexDhGexRequestOld { byte[] payload; int n; public PacketKexDhGexRequestOld(DHGexParameters para) { this.n = para.getPref_group_len(); } public byte[] getPayload() { if (payload == null) { TypesWriter tw = new TypesWriter(); tw.writeByte(Packets.SSH_MSG_KEX_DH_GEX_REQUEST_OLD); tw.writeUINT32(n); payload = tw.getBytes(); } return payload; } }
{ "pile_set_name": "Github" }
package com.yarolegovich.mp.io; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.view.LayoutInflater; import android.view.View; import android.widget.EditText; import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.FragmentActivity; import com.kunzisoft.androidclearchroma.ChromaDialog; import com.kunzisoft.androidclearchroma.IndicatorMode; import com.kunzisoft.androidclearchroma.colormode.ColorMode; import com.kunzisoft.androidclearchroma.listener.OnColorSelectedListener; import com.yarolegovich.mp.R; import java.util.HashSet; import java.util.Set; /** * Created by yarolegovich on 06.05.2016. */ public class StandardUserInputModule implements UserInputModule { protected Context context; public StandardUserInputModule(Context context) { this.context = context; } @Override public void showEditTextInput( String key, CharSequence title, CharSequence defaultValue, final Listener<String> listener) { final View view = LayoutInflater.from(context).inflate(R.layout.dialog_edittext, null); final EditText inputField = (EditText) view.findViewById(R.id.mp_text_input); if (defaultValue != null) { inputField.setText(defaultValue); inputField.setSelection(defaultValue.length()); } final Dialog dialog = new AlertDialog.Builder(context) .setTitle(title) .setView(view) .show(); view.findViewById(R.id.mp_btn_confirm).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { listener.onInput(inputField.getText().toString()); dialog.dismiss(); } }); } @Override public void showSingleChoiceInput( String key, CharSequence title, CharSequence[] displayItems, final CharSequence[] values, int selected, final Listener<String> listener) { new AlertDialog.Builder(context) .setTitle(title) .setSingleChoiceItems(displayItems, selected, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String selected = values[which].toString(); listener.onInput(selected); dialog.dismiss(); } }) /*.setItems(displayItems, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String selected = values[which].toString(); listener.onInput(selected); } })*/ .show(); } @Override public void showMultiChoiceInput( String key, CharSequence title, CharSequence[] displayItems, final CharSequence[] values, final boolean[] itemStates, final Listener<Set<String>> listener) { new AlertDialog.Builder(context) .setTitle(title) .setMultiChoiceItems(displayItems, itemStates, new DialogInterface.OnMultiChoiceClickListener() { @Override public void onClick(DialogInterface dialog, int which, boolean isChecked) { itemStates[which] = isChecked; } }) .setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface dialog) { Set<String> result = new HashSet<>(); for (int i = 0; i < values.length; i++) { if (itemStates[i]) { result.add(values[i].toString()); } } listener.onInput(result); } }) .show(); } @Override public void showColorSelectionInput( String key, CharSequence title, int defaultColor, final Listener<Integer> colorListener) { FragmentActivity activity; try { activity = (FragmentActivity) context; } catch (ClassCastException exc) { throw new AssertionError(context.getString(R.string.exc_not_frag_activity_subclass)); } final String tag = colorListener.getClass().getSimpleName(); ChromaDialog dialog = new ChromaDialog.Builder() .initialColor(defaultColor) .colorMode(ColorMode.ARGB) .indicatorMode(IndicatorMode.HEX) .create(); dialog.setOnColorSelectedListener(new OnColorSelectedListener() { @Override public void onPositiveButtonClick(int color) { colorListener.onInput(color); } @Override public void onNegativeButtonClick(int color) { } }); dialog.show(activity.getSupportFragmentManager(), tag); } }
{ "pile_set_name": "Github" }
package com.xixiciTest import com.xixici.P10 import org.scalatest.FunSuite /** * Created by xixici * Date: 2019/3/13 * Project Name: sword-offer-scala-sbt * Project URL: https://github.com/xixici/sword-offer-scala **/ class P10Test extends FunSuite { test("P10Test") { val Expected = 5 val Actual = P10.RectCover(4) assert(Expected === Actual) } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <configuration status="OFF"> <appenders> <Console name="Console" target="SYSTEM_OUT"> <PatternLayout pattern="%d [%t] %-5p %M(%F:%L) - %m%n"/> </Console> </appenders> <loggers> <root level="info"> <appender-ref ref="Console"/> <appender-ref ref="Console" level="error"/> </root> </loggers> </configuration>
{ "pile_set_name": "Github" }
package org.nextrtc.signalingserver.api.dto; import org.nextrtc.signalingserver.api.NextRTCEvents; import org.nextrtc.signalingserver.exception.SignalingException; import java.time.ZonedDateTime; import java.util.Map; import java.util.Optional; public interface NextRTCEvent { NextRTCEvents type(); ZonedDateTime published(); Optional<NextRTCMember> from(); Optional<NextRTCMember> to(); Optional<NextRTCConversation> conversation(); Optional<SignalingException> exception(); Map<String, String> custom(); String content(); }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@color/b4" android:state_checked="false" android:state_focused="false" android:state_pressed="false" /> <item android:color="@color/c1" android:state_checked="true" android:state_focused="false" android:state_pressed="false" /> <item android:color="@color/c1" android:state_checked="false" android:state_focused="true" android:state_pressed="false" /> <item android:color="@color/b4" android:state_checked="true" android:state_focused="true" android:state_pressed="false" /> </selector>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <model ref="5ef691b5-60ce-4ece-a04e-25e642dfa128/r:59b6a434-36b8-4735-ae34-3acf97303510(com.mbeddr.mpsutil.lantest/com.mbeddr.mpsutil.lantest.structure)"> <persistence version="9" /> <languages> <use id="982eb8df-2c96-4bd7-9963-11712ea622e5" name="jetbrains.mps.lang.resources" version="2" /> <devkit ref="78434eb8-b0e5-444b-850d-e7c4ad2da9ab(jetbrains.mps.devkit.aspect.structure)" /> </languages> <imports> <import index="tp25" ref="r:00000000-0000-4000-0000-011c89590301(jetbrains.mps.lang.smodel.structure)" /> <import index="tpck" ref="r:00000000-0000-4000-0000-011c89590288(jetbrains.mps.lang.core.structure)" implicit="true" /> <import index="tpce" ref="r:00000000-0000-4000-0000-011c89590292(jetbrains.mps.lang.structure.structure)" implicit="true" /> </imports> <registry> <language id="c72da2b9-7cce-4447-8389-f407dc1158b7" name="jetbrains.mps.lang.structure"> <concept id="6054523464627964745" name="jetbrains.mps.lang.structure.structure.AttributeInfo_AttributedConcept" flags="ng" index="trNpa"> <reference id="6054523464627965081" name="concept" index="trN6q" /> </concept> <concept id="2992811758677295509" name="jetbrains.mps.lang.structure.structure.AttributeInfo" flags="ng" index="M6xJ_"> <property id="7588428831955550663" name="role" index="Hh88m" /> <child id="7588428831947959310" name="attributed" index="EQaZv" /> </concept> <concept id="1169125787135" name="jetbrains.mps.lang.structure.structure.AbstractConceptDeclaration" flags="ig" index="PkWjJ"> <property id="6714410169261853888" name="conceptId" index="EcuMT" /> <property id="4628067390765907488" name="conceptShortDescription" index="R4oN_" /> <property id="4628067390765956807" name="final" index="R5$K2" /> <property id="4628067390765956802" name="abstract" index="R5$K7" /> <property id="5092175715804935370" name="conceptAlias" index="34LRSv" /> <child id="1071489727083" name="linkDeclaration" index="1TKVEi" /> <child id="1071489727084" name="propertyDeclaration" index="1TKVEl" /> </concept> <concept id="1169125989551" name="jetbrains.mps.lang.structure.structure.InterfaceConceptDeclaration" flags="ig" index="PlHQZ" /> <concept id="1169127622168" name="jetbrains.mps.lang.structure.structure.InterfaceConceptReference" flags="ig" index="PrWs8"> <reference id="1169127628841" name="intfc" index="PrY4T" /> </concept> <concept id="1071489090640" name="jetbrains.mps.lang.structure.structure.ConceptDeclaration" flags="ig" index="1TIwiD"> <property id="1096454100552" name="rootable" index="19KtqR" /> <reference id="1071489389519" name="extends" index="1TJDcQ" /> <child id="1169129564478" name="implements" index="PzmwI" /> </concept> <concept id="1071489288299" name="jetbrains.mps.lang.structure.structure.PropertyDeclaration" flags="ig" index="1TJgyi"> <property id="241647608299431129" name="propertyId" index="IQ2nx" /> <reference id="1082985295845" name="dataType" index="AX2Wp" /> </concept> <concept id="1071489288298" name="jetbrains.mps.lang.structure.structure.LinkDeclaration" flags="ig" index="1TJgyj"> <property id="1071599776563" name="role" index="20kJfa" /> <property id="1071599893252" name="sourceCardinality" index="20lbJX" /> <property id="1071599937831" name="metaClass" index="20lmBu" /> <property id="241647608299431140" name="linkId" index="IQ2ns" /> <reference id="1071599976176" name="target" index="20lvS9" /> </concept> </language> <language id="ceab5195-25ea-4f22-9b92-103b95ca8c0c" name="jetbrains.mps.lang.core"> <concept id="1133920641626" name="jetbrains.mps.lang.core.structure.BaseConcept" flags="ng" index="2VYdi"> <property id="1193676396447" name="virtualPackage" index="3GE5qa" /> <child id="5169995583184591170" name="smodelAttribute" index="lGtFl" /> </concept> <concept id="1169194658468" name="jetbrains.mps.lang.core.structure.INamedConcept" flags="ng" index="TrEIO"> <property id="1169194664001" name="name" index="TrG5h" /> </concept> </language> </registry> <node concept="1TIwiD" id="4XCJ8CcQ6Nj"> <property role="TrG5h" value="LantestConfig" /> <property role="34LRSv" value="lantest_config" /> <property role="19KtqR" value="true" /> <property role="R4oN_" value="configuration for language testing" /> <property role="EcuMT" value="5722030627681234131" /> <ref role="1TJDcQ" to="tpck:gw2VY9q" resolve="BaseConcept" /> <node concept="1TJgyj" id="2A9nHKANPH8" role="1TKVEi"> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="seedModel" /> <property role="IQ2ns" value="2993027727001344840" /> <ref role="20lvS9" node="2A9nHKANPGu" resolve="AbstractSeedModel" /> </node> <node concept="1TJgyj" id="2P6psD9B1UY" role="1TKVEi"> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="seedChooser" /> <property role="20lbJX" value="fLJekj4/_1" /> <property role="IQ2ns" value="3262406899569270462" /> <ref role="20lvS9" node="2P6psD9B1UX" resolve="ISeedChooser" /> </node> <node concept="1TJgyj" id="33cGTVo60G$" role="1TKVEi"> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="langSpecificConfig" /> <property role="IQ2ns" value="3516382903881173796" /> <ref role="20lvS9" node="33cGTVo609o" resolve="ILanguageSpecificConfig" /> </node> <node concept="1TJgyj" id="5aWlhTu3WIo" role="1TKVEi"> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="scope" /> <property role="20lbJX" value="fLJekj5/_0__n" /> <property role="IQ2ns" value="5961733595647167384" /> <ref role="20lvS9" node="5aWlhTu2ZzL" resolve="InterestingLanguages" /> </node> <node concept="1TJgyj" id="30nlpkLbz5c" role="1TKVEi"> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="conceptChooser" /> <property role="20lbJX" value="fLJekj4/_1" /> <property role="IQ2ns" value="3465332537548484940" /> <ref role="20lvS9" node="30nlpkLbzJw" resolve="IConceptChooser" /> </node> <node concept="1TJgyj" id="3acDVtIDSu6" role="1TKVEi"> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20lbJX" value="fLJekj4/_1" /> <property role="20kJfa" value="modelWhereResultsAreSaved" /> <property role="IQ2ns" value="3642470604913215366" /> <ref role="20lvS9" to="tp25:v3WHCwUiHy" resolve="ModelReferenceExpression" /> </node> <node concept="1TJgyj" id="52eR6w5Qnsd" role="1TKVEi"> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20lbJX" value="fLJekj4/_1" /> <property role="20kJfa" value="temporaryModel" /> <property role="IQ2ns" value="5804819309059995405" /> <ref role="20lvS9" to="tp25:v3WHCwUiHy" resolve="ModelReferenceExpression" /> </node> <node concept="1TJgyj" id="1EeUs_TucP_" role="1TKVEi"> <property role="IQ2ns" value="1913723943214697829" /> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="modelWithBuggyRootsAfterChecking" /> <property role="20lbJX" value="fLJekj4/_1" /> <ref role="20lvS9" to="tp25:v3WHCwUiHy" resolve="ModelReferenceExpression" /> </node> <node concept="1TJgyj" id="2zqpPfizDaF" role="1TKVEi"> <property role="IQ2ns" value="2943778916152545963" /> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="whatToCheckForEditorActions" /> <ref role="20lvS9" node="2zqpPfi$1nS" resolve="AbstractEditorActionsScope" /> </node> <node concept="1TJgyj" id="2zqpPfizDco" role="1TKVEi"> <property role="IQ2ns" value="2943778916152546072" /> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="linksKnownToBeHidden" /> <property role="20lbJX" value="fLJekj5/_0__n" /> <ref role="20lvS9" to="tp25:2iMJRNx_nol" resolve="LinkIdRefExpression" /> </node> <node concept="1TJgyj" id="2zqpPfiG1QG" role="1TKVEi"> <property role="IQ2ns" value="2943778916154744236" /> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="conceptsKnownNotToBeInstantiable" /> <property role="20lbJX" value="fLJekj5/_0__n" /> <ref role="20lvS9" to="tp25:2iMJRNxweHk" resolve="ConceptIdRefExpression" /> </node> <node concept="1TJgyi" id="4XCJ8CcQCV$" role="1TKVEl"> <property role="TrG5h" value="maximumNumberOfTries" /> <property role="IQ2nx" value="5722030627681373924" /> <ref role="AX2Wp" to="tpck:fKAQMTA" resolve="integer" /> </node> <node concept="1TJgyi" id="3HDVcqVU4f8" role="1TKVEl"> <property role="TrG5h" value="minimalDepth" /> <property role="IQ2nx" value="4281213259092607944" /> <ref role="AX2Wp" to="tpck:fKAQMTA" resolve="integer" /> </node> <node concept="1TJgyi" id="4XCJ8CcQZiq" role="1TKVEl"> <property role="TrG5h" value="maximalDepth" /> <property role="IQ2nx" value="5722030627681465498" /> <ref role="AX2Wp" to="tpck:fKAQMTA" resolve="integer" /> </node> <node concept="1TJgyi" id="3acDVtI_Wt4" role="1TKVEl"> <property role="TrG5h" value="cloneOriginalNodeRatio" /> <property role="IQ2nx" value="3642470604912183108" /> <ref role="AX2Wp" to="tpck:fKAQMTA" resolve="integer" /> </node> <node concept="1TJgyi" id="1ir9k2TCuuL" role="1TKVEl"> <property role="TrG5h" value="forceSavingOfAllModels" /> <property role="IQ2nx" value="1484821462071240625" /> <ref role="AX2Wp" to="tpck:fKAQMTB" resolve="boolean" /> </node> <node concept="1TJgyi" id="484XVyxOHJP" role="1TKVEl"> <property role="IQ2nx" value="4757199478771080181" /> <property role="TrG5h" value="checkEditor" /> <ref role="AX2Wp" to="tpck:fKAQMTB" resolve="boolean" /> </node> <node concept="1TJgyi" id="5JsRhvvgGh" role="1TKVEl"> <property role="IQ2nx" value="103428260108241681" /> <property role="TrG5h" value="checkEditorOnTheFly" /> <ref role="AX2Wp" to="tpck:fKAQMTB" resolve="boolean" /> </node> <node concept="1TJgyi" id="484XVyxOHK2" role="1TKVEl"> <property role="IQ2nx" value="4757199478771080194" /> <property role="TrG5h" value="checkGeneratedCode" /> <ref role="AX2Wp" to="tpck:fKAQMTB" resolve="boolean" /> </node> <node concept="1TJgyi" id="484XVyxOHKv" role="1TKVEl"> <property role="IQ2nx" value="4757199478771080223" /> <property role="TrG5h" value="deleteCheckedRoots" /> <ref role="AX2Wp" to="tpck:fKAQMTB" resolve="boolean" /> </node> <node concept="1TJgyi" id="5siEZZN9u33" role="1TKVEl"> <property role="IQ2nx" value="6274266346664878275" /> <property role="TrG5h" value="pathToLogDirectory" /> <ref role="AX2Wp" to="tpck:fKAOsGN" resolve="string" /> </node> <node concept="PrWs8" id="4XCJ8CcQ6V_" role="PzmwI"> <ref role="PrY4T" to="tpck:h0TrEE$" resolve="INamedConcept" /> </node> </node> <node concept="PlHQZ" id="2P6psD9B1UX"> <property role="TrG5h" value="ISeedChooser" /> <property role="3GE5qa" value="concept_seed" /> <property role="EcuMT" value="3262406899569270461" /> </node> <node concept="1TIwiD" id="2P6psD9B1V8"> <property role="34LRSv" value="random descendant seed" /> <property role="TrG5h" value="RandomDescendantSeed" /> <property role="EcuMT" value="3262406899569270472" /> <ref role="1TJDcQ" to="tpck:gw2VY9q" resolve="BaseConcept" /> <node concept="PrWs8" id="2P6psD9B1Zi" role="PzmwI"> <ref role="PrY4T" node="2P6psD9B1UX" resolve="ISeedChooser" /> </node> </node> <node concept="1TIwiD" id="2P6psD9D$Jx"> <property role="34LRSv" value="concept seed" /> <property role="TrG5h" value="ConceptSeed" /> <property role="3GE5qa" value="concept_seed" /> <property role="EcuMT" value="3262406899569937377" /> <ref role="1TJDcQ" to="tpck:gw2VY9q" resolve="BaseConcept" /> <node concept="PrWs8" id="2P6psD9D$Jy" role="PzmwI"> <ref role="PrY4T" node="2P6psD9B1UX" resolve="ISeedChooser" /> </node> <node concept="1TJgyj" id="7K2NL56H6S_" role="1TKVEi"> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="concepts" /> <property role="20lbJX" value="fLJekj6/_1__n" /> <property role="IQ2ns" value="8935932283764108837" /> <ref role="20lvS9" node="7K2NL56H6Rb" resolve="AbstractConceptDeclarationRef" /> </node> </node> <node concept="PlHQZ" id="33cGTVo609o"> <property role="TrG5h" value="ILanguageSpecificConfig" /> <property role="EcuMT" value="3516382903881171544" /> <property role="3GE5qa" value="language_specific_config" /> </node> <node concept="1TIwiD" id="5aWlhTu2ZzL"> <property role="TrG5h" value="InterestingLanguages" /> <property role="EcuMT" value="5961733595646916849" /> <property role="34LRSv" value="interesting languages matcher" /> <property role="3GE5qa" value="language_scope" /> <ref role="1TJDcQ" to="tpck:gw2VY9q" resolve="BaseConcept" /> <node concept="1TJgyj" id="6CKjFdBPe0z" role="1TKVEi"> <property role="IQ2ns" value="7651702299350589475" /> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="interestingLanguages" /> <property role="20lbJX" value="fLJekj5/_0__n" /> <ref role="20lvS9" node="6CKjFdBPdCS" resolve="InterestingLanguage" /> </node> </node> <node concept="1TIwiD" id="2A9nHKANPGu"> <property role="TrG5h" value="AbstractSeedModel" /> <property role="R5$K7" value="true" /> <property role="R5$K2" value="false" /> <property role="3GE5qa" value="seed" /> <property role="EcuMT" value="2993027727001344798" /> <ref role="1TJDcQ" to="tpck:gw2VY9q" resolve="BaseConcept" /> </node> <node concept="1TIwiD" id="2A9nHKANPGv"> <property role="3GE5qa" value="seed" /> <property role="TrG5h" value="SingleModelSeed" /> <property role="EcuMT" value="2993027727001344799" /> <property role="34LRSv" value="single model seed" /> <ref role="1TJDcQ" node="2A9nHKANPGu" resolve="AbstractSeedModel" /> <node concept="1TJgyj" id="2A9nHKANPGS" role="1TKVEi"> <property role="20kJfa" value="startingPoint" /> <property role="IQ2ns" value="2993027727001344824" /> <ref role="20lvS9" to="tpck:h0TrEE$" resolve="INamedConcept" /> </node> </node> <node concept="1TIwiD" id="7K2NL56H6Rb"> <property role="TrG5h" value="AbstractConceptDeclarationRef" /> <property role="3GE5qa" value="concept_seed" /> <property role="EcuMT" value="8935932283764108747" /> <ref role="1TJDcQ" to="tpck:gw2VY9q" resolve="BaseConcept" /> <node concept="1TJgyj" id="7K2NL56H6Rl" role="1TKVEi"> <property role="20kJfa" value="conceptDeclaration" /> <property role="20lbJX" value="fLJekj4/_1" /> <property role="IQ2ns" value="8935932283764108757" /> <ref role="20lvS9" to="tpce:h0PkWnZ" resolve="AbstractConceptDeclaration" /> </node> </node> <node concept="1TIwiD" id="30nlpkL5nws"> <property role="TrG5h" value="MutatedNodeAnnotation" /> <property role="EcuMT" value="3465332537546864668" /> <ref role="1TJDcQ" to="tpck:2ULFgo8_XDk" resolve="NodeAttribute" /> <node concept="1TJgyi" id="3acDVtI_ylt" role="1TKVEl"> <property role="TrG5h" value="mutationDepth" /> <property role="IQ2nx" value="3642470604912076125" /> <ref role="AX2Wp" to="tpck:fKAQMTA" resolve="integer" /> </node> <node concept="M6xJ_" id="30nlpkL5nwt" role="lGtFl"> <property role="Hh88m" value="mutatedAnnotation" /> <node concept="trNpa" id="30nlpkL5nwx" role="EQaZv"> <ref role="trN6q" to="tpck:gw2VY9q" resolve="BaseConcept" /> </node> </node> </node> <node concept="1TIwiD" id="30nlpkLbzJv"> <property role="TrG5h" value="RandomConceptChooser" /> <property role="3GE5qa" value="concept_chooser" /> <property role="EcuMT" value="3465332537548487647" /> <property role="34LRSv" value="random concept chooser" /> <ref role="1TJDcQ" to="tpck:gw2VY9q" resolve="BaseConcept" /> <node concept="PrWs8" id="30nlpkLbzKi" role="PzmwI"> <ref role="PrY4T" node="30nlpkLbzJw" resolve="IConceptChooser" /> </node> </node> <node concept="PlHQZ" id="30nlpkLbzJw"> <property role="TrG5h" value="IConceptChooser" /> <property role="3GE5qa" value="concept_chooser" /> <property role="EcuMT" value="3465332537548487648" /> </node> <node concept="1TIwiD" id="tJrHRTVPJ_"> <property role="TrG5h" value="ExceptionAnnotation" /> <property role="EcuMT" value="535768780340419557" /> <ref role="1TJDcQ" to="tpck:2ULFgo8_XDk" resolve="NodeAttribute" /> <node concept="1TJgyi" id="64cByBTL3ml" role="1TKVEl"> <property role="TrG5h" value="message" /> <property role="IQ2nx" value="6993138224520770965" /> <ref role="AX2Wp" to="tpck:fKAOsGN" resolve="string" /> </node> <node concept="1TJgyi" id="7VeUlv6Zsjs" role="1TKVEl"> <property role="IQ2nx" value="9137497257191261404" /> <property role="TrG5h" value="stackTrace" /> <ref role="AX2Wp" to="tpck:fKAOsGN" resolve="string" /> </node> <node concept="M6xJ_" id="tJrHRTVPJA" role="lGtFl"> <property role="Hh88m" value="exception" /> <node concept="trNpa" id="tJrHRTVPJD" role="EQaZv"> <ref role="trN6q" to="tpck:gw2VY9q" resolve="BaseConcept" /> </node> </node> </node> <node concept="1TIwiD" id="3S9K2OvqeWn"> <property role="EcuMT" value="4470315405174959895" /> <property role="3GE5qa" value="concept_chooser" /> <property role="TrG5h" value="FirstConceptFixedThenRandomChooser" /> <property role="34LRSv" value="first concept given then random" /> <ref role="1TJDcQ" to="tpck:gw2VY9q" resolve="BaseConcept" /> <node concept="1TJgyj" id="3S9K2OvqeWr" role="1TKVEi"> <property role="IQ2ns" value="4470315405174959899" /> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="first" /> <property role="20lbJX" value="fLJekj4/_1" /> <ref role="20lvS9" node="7K2NL56H6Rb" resolve="AbstractConceptDeclarationRef" /> </node> <node concept="PrWs8" id="3S9K2OvqeXM" role="PzmwI"> <ref role="PrY4T" node="30nlpkLbzJw" resolve="IConceptChooser" /> </node> </node> <node concept="1TIwiD" id="6CKjFdBPdCS"> <property role="EcuMT" value="7651702299350587960" /> <property role="TrG5h" value="InterestingLanguage" /> <property role="34LRSv" value="language" /> <property role="R4oN_" value="allow/dissallow languages based on their name" /> <property role="3GE5qa" value="language_scope" /> <ref role="1TJDcQ" to="tpck:gw2VY9q" resolve="BaseConcept" /> <node concept="1TJgyj" id="6CKjFdBR33G" role="1TKVEi"> <property role="IQ2ns" value="7651702299351068908" /> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="excluded" /> <property role="20lbJX" value="fLJekj5/_0__n" /> <ref role="20lvS9" node="6CKjFdBR33w" resolve="LanguageExcluded" /> </node> <node concept="1TJgyi" id="6CKjFdBPdCT" role="1TKVEl"> <property role="IQ2nx" value="7651702299350587961" /> <property role="TrG5h" value="languageNameSubstring" /> <ref role="AX2Wp" to="tpck:fKAOsGN" resolve="string" /> </node> <node concept="1TJgyi" id="6CKjFdBPdDc" role="1TKVEl"> <property role="IQ2nx" value="7651702299350587980" /> <property role="TrG5h" value="languageNameSubstringIsRegex" /> <ref role="AX2Wp" to="tpck:fKAQMTB" resolve="boolean" /> </node> </node> <node concept="1TIwiD" id="6CKjFdBR33w"> <property role="EcuMT" value="7651702299351068896" /> <property role="3GE5qa" value="language_scope" /> <property role="TrG5h" value="LanguageExcluded" /> <property role="34LRSv" value="excluded" /> <ref role="1TJDcQ" to="tpck:gw2VY9q" resolve="BaseConcept" /> <node concept="1TJgyi" id="6CKjFdBR33x" role="1TKVEl"> <property role="IQ2nx" value="7651702299351068897" /> <property role="TrG5h" value="languageNameSubstring" /> <ref role="AX2Wp" to="tpck:fKAOsGN" resolve="string" /> </node> </node> <node concept="1TIwiD" id="7UfzZYaIfQ3"> <property role="EcuMT" value="9119666098155355523" /> <property role="3GE5qa" value="seed" /> <property role="TrG5h" value="RandomRootNodeFromSolution" /> <property role="34LRSv" value="random root node from solution" /> <property role="R4oN_" value="pick a random root node from a solution" /> <ref role="1TJDcQ" node="2A9nHKANPGu" resolve="AbstractSeedModel" /> <node concept="1TJgyj" id="52eR6w5Pjol" role="1TKVEi"> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="module" /> <property role="20lbJX" value="fLJekj4/_1" /> <property role="IQ2ns" value="5804819309059716629" /> <ref role="20lvS9" to="tp25:1t9FffgebJy" resolve="ModuleRefExpression" /> </node> </node> <node concept="1TIwiD" id="2zqpPfi$1nS"> <property role="EcuMT" value="2943778916152645112" /> <property role="TrG5h" value="AbstractEditorActionsScope" /> <property role="R5$K7" value="true" /> <property role="R5$K2" value="false" /> <property role="3GE5qa" value="editor_actions_seed" /> <ref role="1TJDcQ" to="tpck:gw2VY9q" resolve="BaseConcept" /> </node> <node concept="1TIwiD" id="2zqpPfi$274"> <property role="EcuMT" value="2943778916152648132" /> <property role="3GE5qa" value="editor_actions_seed" /> <property role="TrG5h" value="ModelScopeForEditorActions" /> <property role="34LRSv" value="model scope" /> <property role="R4oN_" value="check instantiability of nodes from model" /> <ref role="1TJDcQ" node="2zqpPfi$1nS" resolve="AbstractEditorActionsScope" /> <node concept="1TJgyj" id="2zqpPfi$275" role="1TKVEi"> <property role="IQ2ns" value="2943778916152648133" /> <property role="20lmBu" value="fLJjDmT/aggregation" /> <property role="20kJfa" value="modelPointerExpression" /> <property role="20lbJX" value="fLJekj4/_1" /> <ref role="20lvS9" to="tp25:1Bs_61$nfRn" resolve="ModelPointerExpression" /> </node> </node> <node concept="1TIwiD" id="2zqpPfi$7FA"> <property role="EcuMT" value="2943778916152670950" /> <property role="3GE5qa" value="editor_actions_seed" /> <property role="TrG5h" value="SingleRootNodeScope" /> <property role="34LRSv" value="single root node scope" /> <property role="R4oN_" value="check a single root node" /> <ref role="1TJDcQ" node="2zqpPfi$1nS" resolve="AbstractEditorActionsScope" /> <node concept="1TJgyj" id="2zqpPfi$7FB" role="1TKVEi"> <property role="IQ2ns" value="2943778916152670951" /> <property role="20kJfa" value="root" /> <property role="20lbJX" value="fLJekj4/_1" /> <ref role="20lvS9" to="tpck:h0TrEE$" resolve="INamedConcept" /> </node> </node> </model>
{ "pile_set_name": "Github" }
/* //@HEADER // ************************************************************************ // // Kokkos v. 3.0 // Copyright (2020) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. Neither the name of the Corporation nor the names of the // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY NTESS "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 NTESS OR THE // 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. // // Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER */ #include <threads/TestThreads_Category.hpp> #include <TestViewSubview.hpp> namespace Test { TEST(threads, view_subview_2d_from_3d_atomic) { TestViewSubview::test_2d_subview_3d<TEST_EXECSPACE, Kokkos::MemoryTraits<Kokkos::Atomic> >(); } } // namespace Test
{ "pile_set_name": "Github" }
module tests.it.runtime.regressions; import tests.it.runtime; import reggae.reggae; import std.path; @("Issue 14: builddir not expanded") @Tags(["ninja", "regressions"]) unittest { with(immutable ReggaeSandbox()) { writeFile("reggaefile.d", q{ import reggae; enum ao = objectFile(SourceFile("a.c")); enum liba = Target("$builddir/liba.a", "ar rcs $out $in", [ao]); mixin build!(liba); }); writeFile("a.c"); runReggae("-b", "ninja"); ninja.shouldExecuteOk; } } @("Issue 12: can't set executable as a dependency") @Tags(["ninja", "regressions"]) unittest { with(immutable ReggaeSandbox()) { writeFile("reggaefile.d", q{ import reggae; alias app = scriptlike!(App(SourceFileName("main.d"), BinaryFileName("$builddir/myapp")), Flags("-g -debug"), ImportPaths(["/path/to/imports"]) ); alias code_gen = target!("out.c", "./myapp $in $out", target!"in.txt", app); mixin build!(code_gen); }); writeFile("main.d", q{ import std.stdio; import std.algorithm; import std.conv; void main(string[] args) { auto inFileName = args[1]; auto outFileName = args[2]; auto lines = File(inFileName).byLine. map!(a => a.to!string). map!(a => a ~ ` ` ~ a); auto outFile = File(outFileName, `w`); foreach(line; lines) outFile.writeln(line); } }); writeFile("in.txt", ["foo", "bar", "baz"]); runReggae("-b", "ninja"); ninja.shouldExecuteOk; ["cat", "out.c"].shouldExecuteOk; shouldEqualLines("out.c", ["foo foo", "bar bar", "baz baz"]); } } @("Issue 10: dubConfigurationTarget doesn't work for unittest builds") @Tags(["ninja", "regressions"]) unittest { import std.path; import std.file; with(immutable ReggaeSandbox()) { writeFile("dub.json", ` { "name": "dubproj", "configurations": [ { "name": "executable", "targetName": "foo"}, { "name": "unittest", "targetName": "ut"} ] }`); writeFile("reggaefile.d", q{ import reggae; alias ut = dubConfigurationTarget!(Configuration(`unittest`), CompilerFlags(`-g -debug -cov`)); mixin build!ut; }); mkdir(buildPath(testPath, "source")); writeFile(buildPath("source", "src.d"), q{ unittest { static assert(false, `oopsie`); } int add(int i, int j) { return i + j; } }); writeFile(buildPath("source", "main.d"), q{ import src; void main() {} }); runReggae("-b", "ninja"); ninja.shouldFailToExecute(testPath); } }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <UIFoundation/NSCollectionViewLayout.h> @interface NSCollectionViewLayout (NSPrivateItemSequence) + (BOOL)itemLayoutIsSequential; @end
{ "pile_set_name": "Github" }
version: 1 dn: m-oid=1.3.6.1.4.1.42.2.27.4.1.6,ou=attributeTypes,cn=java,ou=schema creatorsname: uid=admin,ou=system objectclass: metaAttributeType objectclass: metaTop objectclass: top m-equality: caseExactMatch m-syntax: 1.3.6.1.4.1.1466.115.121.1.15 m-singlevalue: TRUE m-collective: FALSE m-nousermodification: FALSE m-usage: USER_APPLICATIONS m-oid: 1.3.6.1.4.1.42.2.27.4.1.6 m-name: javaClassName m-description: Fully qualified name of distinguished Java class or interface m-obsolete: FALSE entryUUID: 0306e4a6-82a3-43f5-8990-42b6ff9b1714 entryCSN: 20130919081858.901000Z#000000#000#000000 entryParentId: b6bd9cdf-6973-431e-beae-f51d70d1183a createTimestamp: 20130919081908.481Z
{ "pile_set_name": "Github" }
package com.coderising.ood.srp; import com.coderising.ood.srp.utils.DBUtil; import com.coderising.ood.srp.utils.MailUtil; import com.coderising.ood.srp.utils.ArgsUtil; import java.io.IOException; import java.util.*; /** * PromotionMail * * @author Chenpz * @package com.coderising.ood.srp * @date 2017/6/12/23:33 */ public class PromotionMail { private ProductInfo productInfo; private List<MailInfo> mailInfoList = new ArrayList<>(); private static final String NAME_KEY = "NAME"; private static final String EMAIL_KEY = "EMAIL"; public PromotionMail(){} public PromotionMail(ProductInfo productInfo) throws Exception { this.productInfo = productInfo; initMailInfoList(loadMailingList()); } /** * 获取每个型号的手机关注的人员信息列表 * @return * @throws Exception */ private List<Map<String, String>> loadMailingList() throws Exception { String sql = "select name from subscriptions " + "where product_id= '" + productInfo.getProductID() +"' " + "and send_mail=1 "; return DBUtil.query(sql); } /** * 组装促销邮件的内容信息 * @param mailingList */ private void initMailInfoList(List<Map<String, String>> mailingList) { if (ArgsUtil.isNotEmpty(mailingList)){ for (Map<String, String> map : mailingList){ // 初始化 mailInfoList mailInfoList.add(buildMailInfo(map)); } } } /** * 组装邮件内容信息 * @param userInfo * @return */ private MailInfo buildMailInfo(Map<String, String> userInfo){ String name = userInfo.get(NAME_KEY); String subject = "您关注的产品降价了"; String message = "尊敬的 "+name+", 您关注的产品 " + productInfo.getProductDesc() + " 降价了,欢迎购买!" ; String toAddress = userInfo.get(EMAIL_KEY); return new MailInfo(toAddress, subject, message); } /** * 发送促销邮件 * @param debug * @throws IOException */ public void sendEMails(boolean debug) throws IOException { System.out.println("开始发送邮件... ..."); if (ArgsUtil.isNotEmpty(mailInfoList)) { for (MailInfo mailInfo : mailInfoList){ MailUtil.sendEmail(mailInfo.toAddress, mailInfo.subject, mailInfo.message, debug); } }else { System.out.println("没有邮件发送... ..."); } } class MailInfo{ private String toAddress = null; private String subject = null; private String message = null; MailInfo(String toAddress, String subject, String message){ this.toAddress = toAddress; this.subject = subject; this.message = message; } } }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2004, PostgreSQL Global Development Group * See the LICENSE file in the project root for more information. */ package org.postgresql.ds; import org.postgresql.ds.common.BaseDataSource; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.sql.SQLException; import javax.sql.DataSource; /** * Simple DataSource which does not perform connection pooling. In order to use the DataSource, you * must set the property databaseName. The settings for serverName, portNumber, user, and password * are optional. Note: these properties are declared in the superclass. * * @author Aaron Mulder (ammulder@chariotsolutions.com) */ public class PGSimpleDataSource extends BaseDataSource implements DataSource, Serializable { /** * Gets a description of this DataSource. */ public String getDescription() { return "Non-Pooling DataSource from " + org.postgresql.util.DriverInfo.DRIVER_FULL_NAME; } private void writeObject(ObjectOutputStream out) throws IOException { writeBaseObject(out); } private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { readBaseObject(in); } public boolean isWrapperFor(Class<?> iface) throws SQLException { return iface.isAssignableFrom(getClass()); } public <T> T unwrap(Class<T> iface) throws SQLException { if (iface.isAssignableFrom(getClass())) { return iface.cast(this); } throw new SQLException("Cannot unwrap to " + iface.getName()); } }
{ "pile_set_name": "Github" }
/* * 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.psi.impl.source.resolve.reference.impl.manipulators; import com.intellij.openapi.editor.Document; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiPlainTextFile; import com.intellij.psi.AbstractElementManipulator; import com.intellij.util.IncorrectOperationException; import javax.annotation.Nonnull; /** * Created by IntelliJ IDEA. * User: ik * Date: 09.12.2003 * Time: 14:10:35 * To change this template use Options | File Templates. */ public class PlainFileManipulator extends AbstractElementManipulator<PsiPlainTextFile> { @Override public PsiPlainTextFile handleContentChange(@Nonnull PsiPlainTextFile file, @Nonnull TextRange range, String newContent) throws IncorrectOperationException { final Document document = FileDocumentManager.getInstance().getDocument(file.getVirtualFile()); document.replaceString(range.getStartOffset(), range.getEndOffset(), newContent); PsiDocumentManager.getInstance(file.getProject()).commitDocument(document); return file; } }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <NewsUI2/_TtC7NewsUI217NoopAudioAssembly.h> @interface _TtC7NewsUI217NoopAudioAssembly (NewsUI2) - (void)loadInRegistry:(id)arg1; @end
{ "pile_set_name": "Github" }
package ezy.sdk3rd.social.sdk; /** * Created by ezy on 17/3/18. */ public interface OnSucceed<T> { void onSucceed(T result); }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- 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. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.cxf.systests</groupId> <artifactId>cxf-systests-container-integration</artifactId> <version>3.4.1-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <artifactId>cxf-systests-ci-webapp</artifactId> <name>Apache CXF Container Integration Test Webapp</name> <description>Apache CXF Container Integration Test Webapp</description> <packaging>war</packaging> <properties> <cxf.module.name>org.apache.cxf.systests.ci.webapp</cxf.module.name> </properties> <dependencies> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> </dependency> </dependencies> </project>
{ "pile_set_name": "Github" }
/* * Copyright 2019 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. */ package com.netflix.spinnaker.orca.igor.model; public interface RetryableStageDefinition { int getConsecutiveErrors(); }
{ "pile_set_name": "Github" }
### ### DO NOT MODIFY THIS FILE. THIS FILE HAS BEEN AUTOGENERATED ### FROM openjdk:15-ea-10-jdk-buster # It's DynamoDB, in Docker! # # Check for details on how to run DynamoDB locally.: # # http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html # # This Dockerfile essentially replicates those instructions. # Create our main application folder. RUN mkdir -p opt/dynamodb WORKDIR /opt/dynamodb # Download and unpack dynamodb. RUN wget http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz -q -O - | tar -xz || curl -L http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz | tar xz # The entrypoint is the dynamodb jar. ENTRYPOINT ["java", "-Xmx1G", "-jar", "DynamoDBLocal.jar"] # Default port for "DynamoDB Local" is 8000. EXPOSE 8000
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="com.jeecms.cms.entity.assist"> <class name="CmsGuestbookExt" table="jc_guestbook_ext"> <meta attribute="sync-DAO">false</meta> <cache usage="read-write"/> <id name="id" type="java.lang.Integer" column="guestbook_id"> <generator class="foreign"><param name="property">guestbook</param></generator> </id> <property name="title" column="title" type="string" not-null="false" length="255"/> <property name="content" column="content" type="string" not-null="false"/> <property name="reply" column="reply" type="string" not-null="false"/> <property name="email" column="email" type="string" not-null="false" length="100"/> <property name="phone" column="phone" type="string" not-null="false" length="100"/> <property name="qq" column="qq" type="string" not-null="false" length="50"/> <one-to-one name="guestbook" class="CmsGuestbook" constrained="true"/> </class> </hibernate-mapping>
{ "pile_set_name": "Github" }
package org.intellij.markdown.parser.sequentialparsers.impl import org.intellij.markdown.MarkdownElementTypes import org.intellij.markdown.MarkdownTokenTypes import org.intellij.markdown.parser.sequentialparsers.LocalParsingResult import org.intellij.markdown.parser.sequentialparsers.RangesListBuilder import org.intellij.markdown.parser.sequentialparsers.SequentialParser import org.intellij.markdown.parser.sequentialparsers.TokensCache class ReferenceLinkParser : SequentialParser { override fun parse(tokens: TokensCache, rangesToGlue: List<IntRange>): SequentialParser.ParsingResult { var result = SequentialParser.ParsingResultBuilder() val delegateIndices = RangesListBuilder() var iterator: TokensCache.Iterator = tokens.RangesListIterator(rangesToGlue) while (iterator.type != null) { if (iterator.type == MarkdownTokenTypes.LBRACKET) { val referenceLink = parseReferenceLink(iterator) if (referenceLink != null) { iterator = referenceLink.iteratorPosition.advance() result = result.withOtherParsingResult(referenceLink) continue } } delegateIndices.put(iterator.index) iterator = iterator.advance() } return result.withFurtherProcessing(delegateIndices.get()) } companion object { fun parseReferenceLink(iterator: TokensCache.Iterator): LocalParsingResult? { return parseFullReferenceLink(iterator) ?: parseShortReferenceLink(iterator) } private fun parseFullReferenceLink(iterator: TokensCache.Iterator): LocalParsingResult? { val startIndex = iterator.index val linkText = LinkParserUtil.parseLinkText(iterator) ?: return null var it = linkText.iteratorPosition.advance() if (it.type == MarkdownTokenTypes.EOL) { it = it.advance() } val linkLabel = LinkParserUtil.parseLinkLabel(it) ?: return null it = linkLabel.iteratorPosition return LocalParsingResult(it, linkText.parsedNodes + linkLabel.parsedNodes + SequentialParser.Node(startIndex..it.index + 1, MarkdownElementTypes.FULL_REFERENCE_LINK), linkText.rangesToProcessFurther + linkLabel.rangesToProcessFurther) } private fun parseShortReferenceLink(iterator: TokensCache.Iterator): LocalParsingResult? { val startIndex = iterator.index val linkLabel = LinkParserUtil.parseLinkLabel(iterator) ?: return null var it = linkLabel.iteratorPosition val shortcutLinkEnd = it it = it.advance() if (it.type == MarkdownTokenTypes.EOL) { it = it.advance() } if (it.type == MarkdownTokenTypes.LBRACKET && it.rawLookup(1) == MarkdownTokenTypes.RBRACKET) { it = it.advance() } else { it = shortcutLinkEnd } return LocalParsingResult(it, linkLabel.parsedNodes + SequentialParser.Node(startIndex..it.index + 1, MarkdownElementTypes.SHORT_REFERENCE_LINK), linkLabel.rangesToProcessFurther) } } }
{ "pile_set_name": "Github" }
<#-- /** * Copyright 2000-present Liferay, 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. */ --> <#assign aui = PortletJspTagLibs["/META-INF/liferay-aui.tld"] /> <#assign liferay_portlet = PortletJspTagLibs["/META-INF/liferay-portlet-ext.tld"] /> <#assign liferay_security = PortletJspTagLibs["/META-INF/liferay-security.tld"] /> <#assign liferay_theme = PortletJspTagLibs["/META-INF/liferay-theme.tld"] /> <#assign liferay_ui = PortletJspTagLibs["/META-INF/liferay-ui.tld"] /> <#assign liferay_util = PortletJspTagLibs["/META-INF/liferay-util.tld"] /> <#assign portlet = PortletJspTagLibs["/META-INF/liferay-portlet.tld"] /> <@liferay_theme["defineObjects"] /> <@portlet["defineObjects"] />
{ "pile_set_name": "Github" }
package org.spigotmc; /** * FINDME * * @author Hexeption admin@hexeption.co.uk * @since 11/11/2019 - 08:06 am */ public interface FINDME { }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (11.0.3) on Sun Mar 29 22:42:10 IST 2020 --> <title>Uses of Class com.googlecode.cqengine.quantizer.BigDecimalQuantizer (CQEngine 3.5.0 API)</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="dc.created" content="2020-03-29"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> <script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif]--> <script type="text/javascript" src="../../../../../jquery/jquery-3.3.1.js"></script> <script type="text/javascript" src="../../../../../jquery/jquery-migrate-3.0.1.js"></script> <script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.googlecode.cqengine.quantizer.BigDecimalQuantizer (CQEngine 3.5.0 API)"; } } catch(err) { } //--> var pathtoroot = "../../../../../"; var useModuleDirectories = true; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <header role="banner"> <nav role="navigation"> <div class="fixedNav"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a id="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../index.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../BigDecimalQuantizer.html" title="class in com.googlecode.cqengine.quantizer">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" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses.html">All&nbsp;Classes</a></li> </ul> <ul class="navListSearch"> <li><label for="search">SEARCH:</label> <input type="text" id="search" value="search" disabled="disabled"> <input type="reset" id="reset" value="reset" disabled="disabled"> </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> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <a id="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><!-- $('.navPadding').css('padding-top', $('.fixedNav').css("height")); //--> </script> </nav> </header> <main role="main"> <div class="header"> <h2 title="Uses of Class com.googlecode.cqengine.quantizer.BigDecimalQuantizer" class="title">Uses of Class<br>com.googlecode.cqengine.quantizer.BigDecimalQuantizer</h2> </div> <div class="classUseContainer">No usage of com.googlecode.cqengine.quantizer.BigDecimalQuantizer</div> </main> <footer role="contentinfo"> <nav role="navigation"> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a id="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../index.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../BigDecimalQuantizer.html" title="class in com.googlecode.cqengine.quantizer">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" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses.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> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <a id="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> <p class="legalCopy"><small>Copyright &#169; 2020. All rights reserved.</small></p> </footer> </body> </html>
{ "pile_set_name": "Github" }
@if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @rem @rem ########################################################################## @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS= set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if "%ERRORLEVEL%" == "0" goto init echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto init echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :init @rem Get command-line arguments, handling Windowz variants if not "%OS%" == "Windows_NT" goto win9xME_args if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. set CMD_LINE_ARGS= set _SKIP=2 :win9xME_args_slurp if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* goto execute :4NT_args @rem Get arguments from the 4NT Shell from JP Software set CMD_LINE_ARGS=%$ :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% :end @rem End local scope for the variables with windows NT shell if "%ERRORLEVEL%"=="0" goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 exit /b 1 :mainEnd if "%OS%"=="Windows_NT" endlocal :omega
{ "pile_set_name": "Github" }
// Copyright 2012 Citrix Systems, Inc. Licensed under the // Apache License, Version 2.0 (the "License"); you may not use this // file except in compliance with the License. Citrix Systems, Inc. // reserves all rights not expressly granted by 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. // // Automatically generated by addcopyright.py at 04/03/2012 package com.cloud.test.stress; import java.util.Arrays; import java.util.Iterator; import java.util.List; import org.apache.log4j.Logger; import com.trilead.ssh2.Connection; import com.trilead.ssh2.Session; public class SshTest { public static final Logger s_logger = Logger.getLogger(SshTest.class.getName()); public static String host = ""; public static String password = "password"; public static String url = "http://google.com"; public static void main (String[] args) { // Parameters List<String> argsList = Arrays.asList(args); Iterator<String> iter = argsList.iterator(); while (iter.hasNext()) { String arg = iter.next(); if (arg.equals("-h")) { host = iter.next(); } if (arg.equals("-p")) { password = iter.next(); } if (arg.equals("-u")) { url = iter.next(); } } if (host == null || host.equals("")) { s_logger.info("Did not receive a host back from test, ignoring ssh test"); System.exit(2); } if (password == null){ s_logger.info("Did not receive a password back from test, ignoring ssh test"); System.exit(2); } try { s_logger.info("Attempting to SSH into host " + host); Connection conn = new Connection(host); conn.connect(null, 60000, 60000); s_logger.info("User + ssHed successfully into host " + host); boolean isAuthenticated = conn.authenticateWithPassword("root", password); if (isAuthenticated == false) { s_logger.info("Authentication failed for root with password" + password); System.exit(2); } String linuxCommand = "wget " + url; Session sess = conn.openSession(); sess.execCommand(linuxCommand); sess.close(); conn.close(); } catch (Exception e) { s_logger.error("SSH test fail with error", e); System.exit(2); } } }
{ "pile_set_name": "Github" }
package mirror.android.os; import android.os.Parcel; import mirror.RefClass; import mirror.RefObject; public class BundleICS { public static Class<?> TYPE = RefClass.load(BundleICS.class, "android.os.Bundle"); public static RefObject<Parcel> mParcelledData; }
{ "pile_set_name": "Github" }
package org.matomo.sdk.dispatcher; import androidx.annotation.Nullable; public enum DispatchMode { /** * Dispatch always (default) */ ALWAYS("always"), /** * Dispatch only on WIFI */ WIFI_ONLY("wifi_only"), /** * The dispatcher will assume being offline. This is not persisted and will revert on app restart. * Ensures no information is lost when tracking exceptions. See #247 */ EXCEPTION("exception"); private final String key; DispatchMode(String key) {this.key = key;} @Override public String toString() { return key; } @Nullable public static DispatchMode fromString(String raw) { for (DispatchMode mode : DispatchMode.values()) { if (mode.key.equals(raw)) return mode; } return null; } }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /** * Defines the <em>{@index rmic rmic}</em> compiler for generating stubs and * skeletons using the Java Remote Method Protocol (JRMP) for remote objects. * * <dl style="font-family:'DejaVu Sans', Arial, Helvetica, sans serif"> * <dt class="simpleTagLabel">Tool Guides: * <dd>{@extLink rmic_tool_reference rmic} * </dl> * * @moduleGraph * @since 9 */ module jdk.rmic { requires jdk.compiler; requires jdk.javadoc; }
{ "pile_set_name": "Github" }
YUI Doc generates API documentation from a modified JavaDoc syntax. Current version (0.3.50) Usage: yuidoc <options> <input path> Common Options: -c, --config, --configfile <filename> A JSON config file to provide configuration data. You can also create a yuidoc.json file and place it anywhere under your source tree and YUI Doc will find it and use it. -e, --extension <comma sep list of file extensions> The list of file extensions to parse for api documentation. (defaults to .js) -x, --exclude <comma sep list of directories> Directories to exclude from parsing (defaults to '.DS_Store,.svn,CVS,.git,build_rollup_tmp,build_tmp') -v, --version Show the current YUIDoc version --project-version Set the doc version for the template -N, --no-color Turn off terminal colors (for automation) -C, --no-code Turn off code generation (don't include source files in output) -n, --norecurse Do not recurse directories (default is to recurse) -S, --selleck Look for Selleck component data and attach to API meta data -V, --view Dump the Handlebars.js view data instead of writing template files -p, --parse-only Only parse the API docs and create the JSON data, do not render templates -o, --outdir <directory path> Path to put the generated files (defaults to ./out) -t, --themedir <directory path> Path to a custom theme directory containing Handlebars templates -H, --helpers <comma separated list of paths to files> Require these file and add Handlebars helpers. See docs for more information --charset CHARSET Use this as the default charset for all file operations. Defaults to 'utf8' -h, --help Show this help -q, --quiet Supress logging output -T, --theme <simple|default> Choose one of the built in themes (default is default) --syntaxtype <js|coffee> Choose comment syntax type (default is js) --server <port> Fire up the YUIDoc server for faster API doc developement. Pass optional port to listen on. (default is 3000) --lint Lint your docs, will print parser warnings and exit code 1 if there are any <input path> Supply a list of paths (shell globbing is handy here)
{ "pile_set_name": "Github" }
/* * Copyright 2003-2018 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 jetbrains.mps.idea.java.psi; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiCodeBlock; import com.intellij.psi.PsiDirectory; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiExpression; import com.intellij.psi.PsiField; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiFileSystemItem; import com.intellij.psi.PsiJavaFile; import com.intellij.psi.PsiMethod; import com.intellij.psi.PsiModifier; import com.intellij.psi.PsiModifierList; import com.intellij.psi.PsiParameter; import com.intellij.psi.PsiParameterList; import com.intellij.psi.PsiReferenceList; import com.intellij.psi.PsiTreeChangeEvent; import com.intellij.psi.PsiTypeParameter; import com.intellij.psi.PsiTypeParameterList; import com.intellij.psi.PsiWhiteSpace; import jetbrains.mps.ide.platform.watching.ReloadParticipant; import jetbrains.mps.idea.java.psi.JavaPsiListener.FSMove; import jetbrains.mps.idea.java.psi.JavaPsiListener.FSRename; import jetbrains.mps.idea.java.psi.JavaPsiListener.PsiEvent; import org.jetbrains.annotations.NotNull; import org.jetbrains.mps.openapi.util.ProgressMonitor; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Map.Entry; import java.util.Set; /** * danilla 5/25/13 */ public class PsiChangeProcessor extends ReloadParticipant { // Per project change data // The thing is there's only one instance of reload participant for a given participant class, // whereas PsiChangesWatcher is a project component (as PsiManager) private Map<Project, PsiChangeData> changeData = new HashMap<Project, PsiChangeData>(); public PsiChangeProcessor() { } @Override public boolean wantsToShowProgress() { // we'll not request progress indicator for psi updates return false; } // TODO look with what locks is it called @Override public void update(ProgressMonitor monitor) { monitor.start("PSI update", changeData.size() + 1); try { for (Entry<Project, PsiChangeData> e : changeData.entrySet()) { final Project project = e.getKey(); final PsiChangeData change = e.getValue(); // we do update asynchronously, so we want to check if project is live yet if (project.isDisposed()) { continue; } project.getComponent(PsiChangesWatcher.class).notifyListeners(change); monitor.advance(1); } } finally { // clean-up changeData = new HashMap<>(); } monitor.done(); } @Override public boolean isEmpty() { for (PsiChangeData data : changeData.values()) { if (data.isNotEmpty()) { return false; } } return true; } // The following methods are called by PsiChangesWatcher when it receives a PSI event // We're not PsiTreeChangeAdapter ourselves for a reason: // we're a ReloadParticipant => we can be instantiated by ReloadManager itself and there's only // one instance of us per application, whereas psi listeners exist per project (as well as PsiManager) // todo filter out changes not related to stub structure /*package*/ void childAdded(final PsiTreeChangeEvent event) { if (!filter(event.getChild())) return; PsiChangeData data = projectData(event.getChild()); PsiElement elem = event.getChild(); if (elem instanceof PsiFileSystemItem) { data.created.add((PsiFileSystemItem) elem); } else { data.changed.add(elem.getContainingFile()); } } /*package*/ void childRemoved(PsiTreeChangeEvent event) { if (!(event.getChild() instanceof PsiFileSystemItem) && !filter(event.getParent())) { // can't use getChild() here as it's not valid any longer return; } // so, if fs item or passed filtering then proceed PsiChangeData data = projectData(event.getParent()); PsiElement elem = event.getChild(); if (elem instanceof PsiFileSystemItem) { data.removed.add((PsiFileSystemItem) elem); } else { // todo fix is parent is a file itself data.changed.add(event.getParent().getContainingFile()); } } /*package*/ void childReplaced(PsiTreeChangeEvent event) { // if both are uninteresting, only then ignore if (!filter(event.getOldChild()) && !filter(event.getNewChild())) return; PsiChangeData data = projectData(event.getNewChild()); // todo Q: should we check if it's PsiFile? data.changed.add(event.getNewChild().getContainingFile()); } /*package*/ void childrenChanged(PsiTreeChangeEvent event) { if (!filter(event.getParent())) return; if (event.getParent() instanceof PsiFile) { // it's some generic notification, we don't need it // (don't remember already what that means) return; } PsiChangeData data = projectData(event.getParent()); data.changed.add(event.getParent().getContainingFile()); } /*package*/ void childMoved(@NotNull PsiTreeChangeEvent event) { if (!filter(event.getChild())) return; PsiChangeData data = projectData(event.getChild()); PsiElement elem = event.getChild(); if (elem instanceof PsiFileSystemItem) { // file item; data.moved.add(new FSMove((PsiFileSystemItem) elem, (PsiFileSystemItem) event.getOldParent(), (PsiFileSystemItem) event.getNewParent())); } else { // todo what if old/new parent is PsiFileSystemItem ? data.changed.add(event.getOldParent().getContainingFile()); data.changed.add(event.getNewParent().getContainingFile()); } } /*package*/ void propertyChanged(@NotNull PsiTreeChangeEvent event) { if (!(event.getElement() instanceof PsiFileSystemItem && (PsiTreeChangeEvent.PROP_FILE_NAME.equals(event.getPropertyName()) || PsiTreeChangeEvent.PROP_DIRECTORY_NAME.equals(event.getPropertyName()))) ) { return; } PsiChangeData data = projectData(event.getElement()); FSRename rename = new FSRename((PsiFileSystemItem) event.getElement(), (String) event.getOldValue()); data.renamed.add(rename); } private PsiChangeData projectData(PsiElement subject) { Project project = subject.getProject(); PsiChangeData data = changeData.get(project); if (data == null) { data = new PsiChangeData(); changeData.put(project, data); } return data; } private boolean filter(PsiElement elem) { if (elem == null || elem instanceof PsiWhiteSpace) { return false; } if (elem instanceof PsiJavaFile || elem instanceof PsiDirectory) { return true; } PsiElement e = elem; do { if (interesting(e)) { return true; } if (notInteresting(e)) { return false; } e = e.getParent(); } while (e != null); return false; } private boolean interesting(PsiElement elem) { if (elem instanceof PsiClass || elem instanceof PsiMethod || elem instanceof PsiField || elem instanceof PsiParameterList || elem instanceof PsiParameter || elem instanceof PsiReferenceList // but not PsiReference ! || elem instanceof PsiModifierList || elem instanceof PsiModifier || elem instanceof PsiTypeParameterList || elem instanceof PsiTypeParameter) { return true; } return false; } private boolean notInteresting(PsiElement elem) { return elem instanceof PsiCodeBlock || elem instanceof PsiExpression; } } class PsiChangeData implements PsiEvent { Set<PsiFileSystemItem> created = new HashSet<PsiFileSystemItem>(); Set<PsiFileSystemItem> removed = new HashSet<PsiFileSystemItem>(); Set<FSMove> moved = new HashSet<FSMove>(); Set<FSRename> renamed = new HashSet<FSRename>(); Set<PsiFile> changed = new HashSet<PsiFile>(); @Override public Iterable<PsiFileSystemItem> getCreated() { return created; } @Override public Iterable<PsiFileSystemItem> getRemoved() { return removed; } @Override public Iterable<FSMove> getMoved() { return moved; } @Override public Iterable<FSRename> getRenamed() { return renamed; } @Override public Set<PsiFile> getChanged() { return changed; } boolean isNotEmpty() { return !(changed.isEmpty() && created.isEmpty() && renamed.isEmpty() && moved.isEmpty() && removed.isEmpty()); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- 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. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.camel</groupId> <artifactId>components</artifactId> <version>3.6.0-SNAPSHOT</version> </parent> <artifactId>camel-lucene</artifactId> <packaging>jar</packaging> <name>Camel :: Lucene</name> <description>Camel Lucene based search component</description> <properties> <camel.osgi.import.additional> org.apache.lucene.*;version="${lucene-version-range}" </camel.osgi.import.additional> </properties> <dependencies> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-support</artifactId> </dependency> <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-core</artifactId> <version>${lucene-version}</version> </dependency> <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-queryparser</artifactId> <version>${lucene-version}</version> </dependency> <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-analyzers-common</artifactId> <version>${lucene-version}</version> </dependency> <!-- test dependencies --> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-test-junit5</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-slf4j-impl</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-clean-plugin</artifactId> <configuration> <filesets> <fileset> <directory>${basedir}/res</directory> </fileset> </filesets> </configuration> </plugin> </plugins> </build> </project>
{ "pile_set_name": "Github" }
package com.rhwayfun.springboot.configuration.property; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; /** * 带前缀属性配置 * 使用@ConfigurationProperties将property的配置映射到这个类的属性中 * * property加载顺序: * * 1. Devtools global settings properties on your home directory (~/.spring-boot-devtools.properties when devtools is active). * 2. @TestPropertySource annotations on your tests. * 3. @SpringBootTest#properties annotation attribute on your tests. * 4. Command line arguments. * 5. Properties from SPRING_APPLICATION_JSON (inline JSON embedded in an environment variable or system property) * 6. ServletConfig init parameters. * 7. ServletContext init parameters. * 8. JNDI attributes from java:comp/env. * 9. Java System properties (System.getProperties()). * 10. OS environment variables. * 11. A RandomValuePropertySource that only has properties in random.*. * 12. Profile-specific application properties outside of your packaged jar (application-{profile}.properties and YAML variants) * 13. Profile-specific application properties packaged inside your jar (application-{profile}.properties and YAML variants) * 14. Application properties outside of your packaged jar (application.properties and YAML variants). * 15. Application properties packaged inside your jar (application.properties and YAML variants). * 16. @PropertySource annotations on your @Configuration classes. * 17. Default properties (specified using SpringApplication.setDefaultProperties). * * @author happyxiaofan * @since 0.0.1 */ @Configuration @ConfigurationProperties(prefix = "my.config") public class SimpleProperty { private String app; private String user; private int age; private String email; private String blog; private String github; public String getApp() { return app; } public void setApp(String app) { this.app = app; } public String getUser() { return user; } public void setUser(String user) { this.user = user; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getBlog() { return blog; } public void setBlog(String blog) { this.blog = blog; } public String getGithub() { return github; } public void setGithub(String github) { this.github = github; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <ajxp_plugin label="CONF_MESSAGE[Notification Center]" description="CONF_MESSAGE[Handle users watches and notifications]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd"> <class_definition classname="Pydio\Notification\Core\NotificationCenter" filename="plugins/core.notifications/NotificationCenter.php"/> <client_settings> <resources> <i18n namespace="notification.tpl.short" path="plugins/core.notifications/templates/short"/> <i18n namespace="notification.tpl.long" path="plugins/core.notifications/templates/long"/> <i18n namespace="notification.tpl.group" path="plugins/core.notifications/templates/group"/> <i18n namespace="notification.tpl.block" path="plugins/core.notifications/templates/block"/> <i18n namespace="notification.tpl.location" path="plugins/core.notifications/templates/location"/> <i18n namespace="notification_center" path="plugins/core.notifications/res/i18n"/> <js className="PydioNotifications" file="plugins/core.notifications/res/build/PydioNotifications.js" depends="React,PydioComponents"/> </resources> </client_settings> <server_settings> <param name="activate_notifications" scope="user" description="CONF_MESSAGE[Activate desktop notifications]" label="CONF_MESSAGE[Desktop Notifications]" type="button" choices="run_client_action:activateDesktopNotifications" expose="true" editable="true"/> <global_param name="USER_EVENTS" description="CONF_MESSAGE[Display a new entry with all events happening on a user workspaces, and alerts. An SQL database must be setup for the FEED_DRIVER configuration.]" label="CONF_MESSAGE[User events and alerts]" type="boolean" default="false"/> <global_param name="SHOW_WORKSPACES_ACTIVITY" label="CONF_MESSAGE[Display Workspaces Activity]" description="CONF_MESSAGE[Display workspaces activity to the users in the right-hand information panel]" type="boolean" default="true"/> <global_param type="plugin_instance:feed" name="UNIQUE_FEED_INSTANCE" group="CONF_MESSAGE[Instance Params]" label="CONF_MESSAGE[Feed Instance]" description="CONF_MESSAGE[Choose the plugin]" mandatory="true" default="feed.sql"/> </server_settings> <registry_contributions> <actions> <action name="get_my_feed"> <processing> <serverCallback methodName="loadUserFeed"/> </processing> </action> <action name="feed"> <rightsContext adminOnly="false" noUser="false" read="false" userLogged="only" write="false"/> <processing> <serverCallback methodName="loadUserFeed" restParams="/feed_type/path+" developerComment="Load an activity feed for the given node. Filtered by what the current user is authorized to see"> <input_param name="path" type="path" description="Optional filter to get activity on a file or a folder"/> <input_param name="format" type="string" description="html, json, xml, array (internal value)"/> <input_param name="feed_type" type="string" description="notif, alert or all"/> <input_param name="offset" type="integer" description="Offset for pagination"/> <input_param name="limit" type="integer" description="Limit for pagination"/> <input_param name="merge_description" type="boolean" description="Wether to merge notification title and description in text"/> <input_param name="merge_description_as_label" type="boolean" description="Wether to merge notification title and description in title"/> <input_param name="current_repository" type="boolean" description="Wether to get activity from current repository (true), or compute all from authorized repositories for user (false)"/> </serverCallback> </processing> </action> <action name="clear_feed"> <processing><serverCallback methodName="clearUserFeed" restParams="/context_type/context_value"> <input_param name="context_type" type="string" description="all|repository|user"/> <input_param name="context_value" type="string" description="Either empty, or a repo ID, or a userId depending on the context_type"/> </serverCallback></processing> </action> <action name="dismiss_user_alert"> <gui text="notification_center.7" title="notification_center.7" iconClass="mdi mdi-close-circle" src="notification_center/ICON_SIZE/feed.png" accessKey="" hasAccessKey="false"> <context selection="true" dir="" recycle="true" actionBar="true" actionBarGroup="inline-notifications" contextMenu="false" infoPanel="false"/> <selectionContext dir="true" file="true" recycle="false" unique="true"/> </gui> <rightsContext adminOnly="false" noUser="true" read="false" userLogged="only" write="false"/> <processing> <clientCallback module="PydioCoreActions.Callbacks.dismissUserAlert"/> <serverCallback methodName="dismissUserAlert" restParams="/alert_id/occurences" developerComment="Dismiss one or more occurences of alerts"> <input_param name="alert_id" type="integer" description="Id passed in /feed action list"/> <input_param name="occurences" type="integer" description="1 or more"/> </serverCallback> </processing> </action> <action name="update_alerts_last_read"> <processing> <serverCallback methodName="updateAlertsLastRead" restParams="/repository_scope"> <input_param name="repository_scope" type="string" description="all|repositoryId"/> </serverCallback> </processing> </action> <action name="load_user_recent_items"> <processing> <serverCallback methodName="loadRecentItemsList" restParams="/"/> </processing> </action> <action name="activateDesktopNotifications"> <gui src="" iconClass="icon-rss" text="notification_center.1" title="notification_title.2"> <context dir="true" recycle="true" selection="false"/> </gui> <processing> <clientCallback module="PydioCoreActions.Callbacks.activateDesktopNotifications"/> </processing> </action> </actions> <hooks> <serverCallback methodName="persistChangeHookToFeed" hookName="node.change" defer="true"/> <serverCallback methodName="persistReadHookToRecentList" hookName="node.read"/> <serverCallback methodName="persistNotificationToAlerts" hookName="msg.notification"/> <serverCallback methodName="loadRepositoryInfo" hookName="repository.load_info"/> <serverCallback methodName="shareAssignRight" hookName="node.share.assign_right"/> </hooks> <client_configs> <component_config component="InfoPanel"> <infoPanel mime="ajxp_root_node,generic_dir,generic_file" reactComponent="PydioNotifications.ActivityPanel"/> </component_config> <component_config component="AjxpReactComponent::left_navigator"> <additional_content id="navigation_alerts" position="0" type="ListProvider" options='{"title":"notification_center.3", "titleClassName":"colorcode-alert", "startOpen":true, "dataModelBadge":{"property":"metadata","metadata_sum":"event_occurence", "className":"alerts_number_badge"}, "fit":"content","silentLoading":true,"actionBarGroups":["inline-notifications"],"nodeProviderProperties":{"get_action":"get_my_feed", "connexion_discrete":true, "format":"xml", "current_repository":"true", "feed_type":"alert", "merge_description":"false"},"reloadOnServerMessage":"tree/reload_user_feed", "connexion_discrete":true, "tipAttribute":"event_description_long", "emptyChildrenMessage":"notification_center.8"}'/> </component_config> </client_configs> </registry_contributions> <dependencies> <activePlugin pluginName="core.conf"/> </dependencies> </ajxp_plugin>
{ "pile_set_name": "Github" }
package controllers; import java.math.BigDecimal; import apimodels.Client; import java.time.LocalDate; import java.time.OffsetDateTime; import apimodels.OuterComposite; import apimodels.User; import play.mvc.Controller; import play.mvc.Result; import play.mvc.Http; import java.util.List; import java.util.Map; import java.util.ArrayList; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; import javax.validation.constraints.*; import play.Configuration; import swagger.SwaggerUtils.ApiAction; public class FakeApiController extends Controller { private final FakeApiControllerImpInterface imp; private final ObjectMapper mapper; private final Configuration configuration; @Inject private FakeApiController(Configuration configuration, FakeApiControllerImpInterface imp) { this.imp = imp; mapper = new ObjectMapper(); this.configuration = configuration; } @ApiAction public Result fakeOuterBooleanSerialize() throws Exception { JsonNode nodebody = request().body().asJson(); Boolean body; if (nodebody != null) { body = mapper.readValue(nodebody.toString(), Boolean.class); if (configuration.getBoolean("useInputBeanValidation")) { SwaggerUtils.validate(body); } } else { body = null; } Boolean obj = imp.fakeOuterBooleanSerialize(body); JsonNode result = mapper.valueToTree(obj); return ok(result); } @ApiAction public Result fakeOuterCompositeSerialize() throws Exception { JsonNode nodebody = request().body().asJson(); OuterComposite body; if (nodebody != null) { body = mapper.readValue(nodebody.toString(), OuterComposite.class); if (configuration.getBoolean("useInputBeanValidation")) { SwaggerUtils.validate(body); } } else { body = null; } OuterComposite obj = imp.fakeOuterCompositeSerialize(body); if (configuration.getBoolean("useOutputBeanValidation")) { SwaggerUtils.validate(obj); } JsonNode result = mapper.valueToTree(obj); return ok(result); } @ApiAction public Result fakeOuterNumberSerialize() throws Exception { JsonNode nodebody = request().body().asJson(); BigDecimal body; if (nodebody != null) { body = mapper.readValue(nodebody.toString(), BigDecimal.class); if (configuration.getBoolean("useInputBeanValidation")) { SwaggerUtils.validate(body); } } else { body = null; } BigDecimal obj = imp.fakeOuterNumberSerialize(body); if (configuration.getBoolean("useOutputBeanValidation")) { SwaggerUtils.validate(obj); } JsonNode result = mapper.valueToTree(obj); return ok(result); } @ApiAction public Result fakeOuterStringSerialize() throws Exception { JsonNode nodebody = request().body().asJson(); String body; if (nodebody != null) { body = mapper.readValue(nodebody.toString(), String.class); if (configuration.getBoolean("useInputBeanValidation")) { SwaggerUtils.validate(body); } } else { body = null; } String obj = imp.fakeOuterStringSerialize(body); JsonNode result = mapper.valueToTree(obj); return ok(result); } @ApiAction public Result testBodyWithQueryParams() throws Exception { JsonNode nodebody = request().body().asJson(); User body; if (nodebody != null) { body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { SwaggerUtils.validate(body); } } else { throw new IllegalArgumentException("'body' parameter is required"); } String valuequery = request().getQueryString("query"); String query; if (valuequery != null) { query = valuequery; } else { throw new IllegalArgumentException("'query' parameter is required"); } imp.testBodyWithQueryParams(body, query); return ok(); } @ApiAction public Result testClientModel() throws Exception { JsonNode nodebody = request().body().asJson(); Client body; if (nodebody != null) { body = mapper.readValue(nodebody.toString(), Client.class); if (configuration.getBoolean("useInputBeanValidation")) { SwaggerUtils.validate(body); } } else { throw new IllegalArgumentException("'body' parameter is required"); } Client obj = imp.testClientModel(body); if (configuration.getBoolean("useOutputBeanValidation")) { SwaggerUtils.validate(obj); } JsonNode result = mapper.valueToTree(obj); return ok(result); } @ApiAction public Result testEndpointParameters() throws Exception { String valueinteger = (request().body().asMultipartFormData().asFormUrlEncoded().get("integer"))[0]; Integer integer; if (valueinteger != null) { integer = Integer.parseInt(valueinteger); } else { integer = null; } String valueint32 = (request().body().asMultipartFormData().asFormUrlEncoded().get("int32"))[0]; Integer int32; if (valueint32 != null) { int32 = Integer.parseInt(valueint32); } else { int32 = null; } String valueint64 = (request().body().asMultipartFormData().asFormUrlEncoded().get("int64"))[0]; Long int64; if (valueint64 != null) { int64 = Long.parseLong(valueint64); } else { int64 = null; } String valuenumber = (request().body().asMultipartFormData().asFormUrlEncoded().get("number"))[0]; BigDecimal number; if (valuenumber != null) { number = new BigDecimal(valuenumber); } else { throw new IllegalArgumentException("'number' parameter is required"); } String value_float = (request().body().asMultipartFormData().asFormUrlEncoded().get("float"))[0]; Float _float; if (value_float != null) { _float = Float.parseFloat(value_float); } else { _float = null; } String value_double = (request().body().asMultipartFormData().asFormUrlEncoded().get("double"))[0]; Double _double; if (value_double != null) { _double = Double.parseDouble(value_double); } else { throw new IllegalArgumentException("'double' parameter is required"); } String valuestring = (request().body().asMultipartFormData().asFormUrlEncoded().get("string"))[0]; String string; if (valuestring != null) { string = valuestring; } else { string = null; } String valuepatternWithoutDelimiter = (request().body().asMultipartFormData().asFormUrlEncoded().get("pattern_without_delimiter"))[0]; String patternWithoutDelimiter; if (valuepatternWithoutDelimiter != null) { patternWithoutDelimiter = valuepatternWithoutDelimiter; } else { throw new IllegalArgumentException("'pattern_without_delimiter' parameter is required"); } String value_byte = (request().body().asMultipartFormData().asFormUrlEncoded().get("byte"))[0]; byte[] _byte; if (value_byte != null) { _byte = value_byte.getBytes(); } else { throw new IllegalArgumentException("'byte' parameter is required"); } String valuebinary = (request().body().asMultipartFormData().asFormUrlEncoded().get("binary"))[0]; byte[] binary; if (valuebinary != null) { binary = valuebinary.getBytes(); } else { binary = null; } String valuedate = (request().body().asMultipartFormData().asFormUrlEncoded().get("date"))[0]; LocalDate date; if (valuedate != null) { date = LocalDate.parse(valuedate); } else { date = null; } String valuedateTime = (request().body().asMultipartFormData().asFormUrlEncoded().get("dateTime"))[0]; OffsetDateTime dateTime; if (valuedateTime != null) { dateTime = OffsetDateTime.parse(valuedateTime); } else { dateTime = null; } String valuepassword = (request().body().asMultipartFormData().asFormUrlEncoded().get("password"))[0]; String password; if (valuepassword != null) { password = valuepassword; } else { password = null; } String valueparamCallback = (request().body().asMultipartFormData().asFormUrlEncoded().get("callback"))[0]; String paramCallback; if (valueparamCallback != null) { paramCallback = valueparamCallback; } else { paramCallback = null; } imp.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); return ok(); } @ApiAction public Result testEnumParameters() throws Exception { String[] enumQueryStringArrayArray = request().queryString().get("enum_query_string_array"); List<String> enumQueryStringArrayList = SwaggerUtils.parametersToList("csv", enumQueryStringArrayArray); List<String> enumQueryStringArray = new ArrayList<String>(); for (String curParam : enumQueryStringArrayList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation enumQueryStringArray.add(curParam); } } String valueenumQueryString = request().getQueryString("enum_query_string"); String enumQueryString; if (valueenumQueryString != null) { enumQueryString = valueenumQueryString; } else { enumQueryString = "-efg"; } String valueenumQueryInteger = request().getQueryString("enum_query_integer"); Integer enumQueryInteger; if (valueenumQueryInteger != null) { enumQueryInteger = Integer.parseInt(valueenumQueryInteger); } else { enumQueryInteger = null; } String[] enumFormStringArrayArray = request().body().asMultipartFormData().asFormUrlEncoded().get("enum_form_string_array"); List<String> enumFormStringArrayList = SwaggerUtils.parametersToList("csv", enumFormStringArrayArray); List<String> enumFormStringArray = new ArrayList<String>(); for (String curParam : enumFormStringArrayList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation enumFormStringArray.add(curParam); } } String valueenumFormString = (request().body().asMultipartFormData().asFormUrlEncoded().get("enum_form_string"))[0]; String enumFormString; if (valueenumFormString != null) { enumFormString = valueenumFormString; } else { enumFormString = "-efg"; } String valueenumQueryDouble = (request().body().asMultipartFormData().asFormUrlEncoded().get("enum_query_double"))[0]; Double enumQueryDouble; if (valueenumQueryDouble != null) { enumQueryDouble = Double.parseDouble(valueenumQueryDouble); } else { enumQueryDouble = null; } String[] enumHeaderStringArrayArray = request().headers().get("enum_header_string_array"); List<String> enumHeaderStringArrayList = SwaggerUtils.parametersToList("csv", enumHeaderStringArrayArray); List<String> enumHeaderStringArray = new ArrayList<String>(); for (String curParam : enumHeaderStringArrayList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation enumHeaderStringArray.add(curParam); } } String valueenumHeaderString = request().getHeader("enum_header_string"); String enumHeaderString; if (valueenumHeaderString != null) { enumHeaderString = valueenumHeaderString; } else { enumHeaderString = "-efg"; } imp.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); return ok(); } @ApiAction public Result testInlineAdditionalProperties() throws Exception { JsonNode nodeparam = request().body().asJson(); Object param; if (nodeparam != null) { param = mapper.readValue(nodeparam.toString(), Object.class); if (configuration.getBoolean("useInputBeanValidation")) { SwaggerUtils.validate(param); } } else { throw new IllegalArgumentException("'param' parameter is required"); } imp.testInlineAdditionalProperties(param); return ok(); } @ApiAction public Result testJsonFormData() throws Exception { String valueparam = (request().body().asMultipartFormData().asFormUrlEncoded().get("param"))[0]; String param; if (valueparam != null) { param = valueparam; } else { throw new IllegalArgumentException("'param' parameter is required"); } String valueparam2 = (request().body().asMultipartFormData().asFormUrlEncoded().get("param2"))[0]; String param2; if (valueparam2 != null) { param2 = valueparam2; } else { throw new IllegalArgumentException("'param2' parameter is required"); } imp.testJsonFormData(param, param2); return ok(); } }
{ "pile_set_name": "Github" }
/* * JBoss, Home of Professional Open Source * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual * contributors by the @authors tag. See the copyright.txt in the * distribution for a full listing of individual contributors. * * 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.jboss.as.quickstarts.loggingToolsQS.loggers; import org.jboss.logging.BasicLogger; import org.jboss.logging.Logger; import org.jboss.logging.Logger.Level; import org.jboss.logging.annotations.Cause; import org.jboss.logging.annotations.LogMessage; import org.jboss.logging.annotations.Message; import org.jboss.logging.annotations.MessageLogger; @MessageLogger(projectCode = "GTRDATES") public interface DateLogger extends BasicLogger { DateLogger LOGGER = Logger.getMessageLogger(DateLogger.class, DateLogger.class.getPackage().getName()); @LogMessage(level = Level.ERROR) @Message(id = 3, value = "Invalid date passed as string: %s") void logStringCouldntParseAsDate(String dateString, @Cause Throwable exception); @LogMessage @Message(id = 4, value = "Requested number of days until '%s'") void logDaysUntilRequest(String dateString); }
{ "pile_set_name": "Github" }
@file:Suppress("NOTHING_TO_INLINE") package io.ktor.utils.io.bits import io.ktor.utils.io.core.internal.* import java.nio.* @Suppress("ACTUAL_WITHOUT_EXPECT", "EXPERIMENTAL_FEATURE_WARNING") public actual inline class Memory @DangerousInternalIoApi constructor(public val buffer: ByteBuffer) { /** * Size of memory range in bytes. */ public actual inline val size: Long get() = buffer.limit().toLong() /** * Size of memory range in bytes represented as signed 32bit integer * @throws IllegalStateException when size doesn't fit into a signed 32bit integer */ public actual inline val size32: Int get() = buffer.limit() /** * Returns byte at [index] position. */ public actual inline fun loadAt(index: Int): Byte = buffer.get(index) /** * Returns byte at [index] position. */ public actual inline fun loadAt(index: Long): Byte = buffer.get(index.toIntOrFail("index")) /** * Write [value] at the specified [index]. */ public actual inline fun storeAt(index: Int, value: Byte) { buffer.put(index, value) } /** * Write [value] at the specified [index] */ public actual inline fun storeAt(index: Long, value: Byte) { buffer.put(index.toIntOrFail("index"), value) } public actual fun slice(offset: Int, length: Int): Memory = Memory(buffer.sliceSafe(offset, length)) public actual fun slice(offset: Long, length: Long): Memory { return slice(offset.toIntOrFail("offset"), length.toIntOrFail("length")) } /** * Copies bytes from this memory range from the specified [offset] and [length] * to the [destination] at [destinationOffset]. * Copying bytes from a memory to itself is allowed. */ public actual fun copyTo(destination: Memory, offset: Int, length: Int, destinationOffset: Int) { if (buffer.hasArray() && destination.buffer.hasArray() && !buffer.isReadOnly && !destination.buffer.isReadOnly ) { System.arraycopy( buffer.array(), buffer.arrayOffset() + offset, destination.buffer.array(), destination.buffer.arrayOffset() + destinationOffset, length ) return } // NOTE: it is ok here to make copy since it will be escaped by JVM // while temporary moving position/offset makes memory concurrent unsafe that is unacceptable val srcCopy = buffer.duplicate().apply { position(offset) limit(offset + length) } val dstCopy = destination.buffer.duplicate().apply { position(destinationOffset) } dstCopy.put(srcCopy) } /** * Copies bytes from this memory range from the specified [offset] and [length] * to the [destination] at [destinationOffset]. * Copying bytes from a memory to itself is allowed. */ public actual fun copyTo(destination: Memory, offset: Long, length: Long, destinationOffset: Long) { copyTo( destination, offset.toIntOrFail("offset"), length.toIntOrFail("length"), destinationOffset.toIntOrFail("destinationOffset") ) } public actual companion object { public actual val Empty: Memory = Memory(ByteBuffer.allocate(0).order(ByteOrder.BIG_ENDIAN)) } } /** * Copies bytes from this memory range from the specified [offset] and [length] * to the [destination] at [destinationOffset]. */ public actual fun Memory.copyTo( destination: ByteArray, offset: Int, length: Int, destinationOffset: Int ) { if (buffer.hasArray() && !buffer.isReadOnly) { System.arraycopy( buffer.array(), buffer.arrayOffset() + offset, destination, destinationOffset, length ) return } // we need to make a copy to prevent moving position buffer.duplicate().get(destination, destinationOffset, length) } /** * Copies bytes from this memory range from the specified [offset] and [length] * to the [destination] at [destinationOffset]. */ public actual fun Memory.copyTo( destination: ByteArray, offset: Long, length: Int, destinationOffset: Int ) { copyTo(destination, offset.toIntOrFail("offset"), length, destinationOffset) } /** * Copies bytes from this memory range from the specified [offset] * to the [destination] buffer. */ public fun Memory.copyTo( destination: ByteBuffer, offset: Int ) { val size = destination.remaining() if (buffer.hasArray() && !buffer.isReadOnly && destination.hasArray() && !destination.isReadOnly) { val dstPosition = destination.position() System.arraycopy( buffer.array(), buffer.arrayOffset() + offset, destination.array(), destination.arrayOffset() + dstPosition, size ) destination.position(dstPosition + size) return } // we need to make a copy to prevent moving position val source = buffer.duplicate().apply { limit(offset + size) position(offset) } destination.put(source) } /** * Copies bytes from this memory range from the specified [offset] * to the [destination] buffer. */ public fun Memory.copyTo(destination: ByteBuffer, offset: Long) { copyTo(destination, offset.toIntOrFail("offset")) } /** * Copy byte from this buffer moving it's position to the [destination] at [offset]. */ public fun ByteBuffer.copyTo(destination: Memory, offset: Int) { if (hasArray() && !isReadOnly) { destination.storeByteArray(offset, array(), arrayOffset() + position(), remaining()) position(limit()) return } destination.buffer.sliceSafe(offset, remaining()).put(this) } private inline fun ByteBuffer.myDuplicate(): ByteBuffer { duplicate().apply { return suppressNullCheck() } } private inline fun ByteBuffer.mySlice(): ByteBuffer { slice().apply { return suppressNullCheck() } } private inline fun ByteBuffer.suppressNullCheck(): ByteBuffer { return this } internal fun ByteBuffer.sliceSafe(offset: Int, length: Int): ByteBuffer { return myDuplicate().apply { position(offset); limit(offset + length) }.mySlice() } /** * Fill memory range starting at the specified [offset] with [value] repeated [count] times. */ public actual fun Memory.fill(offset: Long, count: Long, value: Byte) { fill(offset.toIntOrFail("offset"), count.toIntOrFail("count"), value) } /** * Fill memory range starting at the specified [offset] with [value] repeated [count] times. */ public actual fun Memory.fill(offset: Int, count: Int, value: Byte) { for (index in offset until offset + count) { buffer.put(index, value) } }
{ "pile_set_name": "Github" }
# DM Reader <a name="2lzA4"></a> ## 一、插件名称 名称:**dmreader** <a name="jVb3v"></a> ## 二、支持的数据源版本 **DM7、DM8**<br /> <a name="4lw0x"></a> ## 三、参数说明 - **jdbcUrl** - 描述:针对关系型数据库的jdbc连接字符串 <br />jdbcUrl参考文档:[达梦官方文档](http://www.dameng.com/down.aspx?TypeId=12&FId=t14:12:14) - 必选:是 - 默认值:无 - **username** - 描述:数据源的用户名 - 必选:是 - 默认值:无 - **password** - 描述:数据源指定用户名的密码 - 必选:是 - 默认值:无 - **where** - 描述:筛选条件,reader插件根据指定的column、table、where条件拼接SQL,并根据这个SQL进行数据抽取。在实际业务场景中,往往会选择当天的数据进行同步,可以将where条件指定为gmt_create > time。 - 注意:不可以将where条件指定为limit 10,limit不是SQL的合法where子句。 - 必选:否 - 默认值:无 - **splitPk** - 描述:当speed配置中的channel大于1时指定此参数,Reader插件根据并发数和此参数指定的字段拼接sql,使每个并发读取不同的数据,提升读取速率。 - 注意: - 推荐splitPk使用表主键,因为表主键通常情况下比较均匀,因此切分出来的分片也不容易出现数据热点。 - 目前splitPk仅支持整形数据切分,`不支持浮点、字符串、日期等其他类型`。如果用户指定其他非支持类型,FlinkX将报错! - 如果channel大于1但是没有配置此参数,任务将置为失败。 - 必选:否 - 默认值:无 - **queryTimeOut** - 描述:查询超时时间,单位秒。 - 注意:当数据量很大,或者从视图查询,或者自定义sql查询时,可通过此参数指定超时时间。 - 必选:否 - 默认值:3000 - **customSql** - 描述:自定义的查询语句,如果只指定字段不能满足需求时,可通过此参数指定查询的sql,可以是任意复杂的查询语句。 - 注意: - 只能是查询语句,否则会导致任务失败; - 查询语句返回的字段需要和column列表里的字段对应; - 当指定了此参数时,connection里指定的table无效; - 当指定此参数时,column必须指定具体字段信息,不能以*号代替; - 必选:否 - 默认值:无 - **column** - 描述:需要读取的字段。 - 格式:支持3种格式 <br />1.读取全部字段,如果字段数量很多,可以使用下面的写法: ```bash "column":["*"] ``` 2.只指定字段名称: ```json "column":["ID","NAME"] ``` 3.指定具体信息: ```json "column": [{ "name": "COL", "type": "datetime", "format": "yyyy-MM-dd hh:mm:ss", "value": "value" }] ``` - 属性说明: - name:字段名称,注意应该为大写,否则可能会出错 - type:字段类型,可以和数据库里的字段类型不一样,程序会做一次类型转换 - format:如果字段是时间字符串,可以指定时间的格式,将字段类型转为日期格式返回 - value:如果数据库里不存在指定的字段,则会把value的值作为常量列返回,如果指定的字段存在,当指定字段的值为null时,会以此value值作为默认值返回 - 必选:是 - 默认值:无 - **polling** - 描述:是否开启间隔轮询,开启后会根据`pollingInterval`轮询间隔时间周期性的从数据库拉取数据。开启间隔轮询还需配置参数`pollingInterval`,`increColumn`,可以选择配置参数`startLocation`。若不配置参数`startLocation`,任务启动时将会从数据库中查询增量字段最大值作为轮询的开始位置。 - 必选:否 - 默认值:false - **pollingInterval** - 描述:轮询间隔时间,从数据库中拉取数据的间隔时间,默认为5000毫秒。 - 必选:否 - 默认值:5000 - **requestAccumulatorInterval** - 描述:发送查询累加器请求的间隔时间。 - 必选:否 - 默认值:2 <a name="1LBc2"></a> ## 四、配置示例 <a name="xhLRp"></a> #### 1、基础配置 ```json { "job": { "content": [ { "reader": { "name": "dmreader", "parameter": { "column": [ { "name": "ID", "type": "int" }, { "name": "AGE", "type": "int" } ], "increColumn": "", "startLocation": "", "username": "SYSDBA", "password": "SYSDBA", "connection": [ { "jdbcUrl": [ "jdbc:dm://localhost:5236" ], "table": [ "PERSON.STUDENT" ] } ], "where": "" } }, "writer": { "name": "streamwriter", "parameter": { "print": true } } } ], "setting": { "speed": { "channel": 1, "bytes": 0 }, "errorLimit": { "record": 100 }, "restore": { "maxRowNumForCheckpoint": 0, "isRestore": false, "restoreColumnName": "", "restoreColumnIndex": 0 } } } } ``` <a name="obMdk"></a> #### 2、多通道 ```json { "job": { "content": [ { "reader": { "name": "dmreader", "parameter": { "column": [ { "name": "ID", "type": "int" }, { "name": "AGE", "type": "int" } ], "splitPk": "ID", "increColumn": "", "startLocation": "", "username": "SYSDBA", "password": "SYSDBA", "connection": [ { "jdbcUrl": [ "jdbc:dm://localhost:5236" ], "table": [ "PERSON.STUDENT" ] } ], "where": "" } }, "writer": { "name": "streamwriter", "parameter": { "print": true } } } ], "setting": { "speed": { "channel": 3, "bytes": 0 }, "errorLimit": { "record": 100 }, "restore": { "maxRowNumForCheckpoint": 0, "isRestore": false, "restoreColumnName": "", "restoreColumnIndex": 0 } } } } ``` <a name="zuPBB"></a> #### 3、指定customSql ```json { "job": { "content": [ { "reader": { "name": "dmreader", "parameter": { "column": [ { "name": "ID", "type": "int" }, { "name": "AGE", "type": "int" } ], "increColumn": "", "startLocation": "", "customSql": "SELECT * FROM PERSON.STUDENT WHERE ID>30", "username": "SYSDBA", "password": "SYSDBA", "connection": [ { "jdbcUrl": [ "jdbc:dm://localhost:5236" ], "table": [ "PERSON.STUDENT" ] } ], "where": "" } }, "writer": { "name": "streamwriter", "parameter": { "print": true } } } ], "setting": { "speed": { "channel": 1, "bytes": 0 }, "errorLimit": { "record": 100 }, "restore": { "maxRowNumForCheckpoint": 0, "isRestore": false, "restoreColumnName": "", "restoreColumnIndex": 0 } } } } ``` <a name="KyWmu"></a> #### 4、增量同步startLocation ```json { "job": { "content": [ { "reader": { "name": "dmreader", "parameter": { "column": [ { "name": "ID", "type": "int" }, { "name": "AGE", "type": "int" } ], "increColumn": "ID", "startLocation": "20", "username": "SYSDBA", "password": "SYSDBA", "connection": [ { "jdbcUrl": [ "jdbc:dm://localhost:5236" ], "table": [ "PERSON.STUDENT" ] } ], "where": "" } }, "writer": { "name": "streamwriter", "parameter": { "print": true } } } ], "setting": { "speed": { "channel": 1, "bytes": 0 }, "errorLimit": { "record": 100 }, "restore": { "maxRowNumForCheckpoint": 0, "isRestore": false, "restoreColumnName": "", "restoreColumnIndex": 0 } } } } ``` <a name="auGyQ"></a> #### 5、间隔轮询 ```json { "job": { "content": [ { "reader": { "name": "dmreader", "parameter": { "column": [ { "name": "ID", "type": "int" }, { "name": "AGE", "type": "int" } ], "increColumn": "", "startLocation": "", "username": "SYSDBA", "password": "SYSDBA", "polling": true, "pollingInterval": 3000, "connection": [ { "jdbcUrl": [ "jdbc:dm://localhost:5236" ], "table": [ "PERSON.STUDENT" ] } ], "where": "" } }, "writer": { "name": "streamwriter", "parameter": { "print": true } } } ], "setting": { "speed": { "channel": 1, "bytes": 0 }, "errorLimit": { "record": 100 }, "restore": { "maxRowNumForCheckpoint": 0, "isRestore": false, "restoreColumnName": "", "restoreColumnIndex": 0 } } } } ```
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright 2019 Google LLC ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ https://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <layout xmlns:android="http://schemas.android.com/apk/res/android"> <androidx.recyclerview.widget.RecyclerView android:id="@+id/questions" android:layout_width="match_parent" android:layout_height="match_parent" /> </layout>
{ "pile_set_name": "Github" }
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ package com.microsoft.graph.models.generated; /** * The Enum Signin Frequency Type. */ public enum SigninFrequencyType { /** * days */ DAYS, /** * hours */ HOURS, /** * For SigninFrequencyType values that were not expected from the service */ UNEXPECTED_VALUE }
{ "pile_set_name": "Github" }
############################################################ # <bsn.cl fy=2013 v=none> # # Copyright 2013, 2014 BigSwitch Networks, Inc. # # # # </bsn.cl> ############################################################ ARCH := amd64 PACKAGE_NAMES=onlp-x86-64-accton-as7716-32x-r0 include ../../../../../make/debuild.mk
{ "pile_set_name": "Github" }
/* * Copyright (C) 2016 Red Hat, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.syndesis.server.api.generator; import io.syndesis.common.model.api.APISummary; import io.syndesis.common.model.connection.ConfigurationProperty; import io.syndesis.common.model.connection.Connector; import io.syndesis.common.model.connection.ConnectorGroup; import io.syndesis.common.model.connection.ConnectorSettings; import io.syndesis.common.model.connection.ConnectorTemplate; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; public class ConnectorGeneratorTest { private final ConnectorGenerator generator = new ConnectorGenerator(new Connector.Builder() .addTags("from-connector") .build()) { @Override public Connector generate(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { return null; } @Override public APISummary info(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { return null; } @Override protected String determineConnectorDescription(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { return "test-description"; } @Override protected String determineConnectorName(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { return "test-name"; } }; private final ConnectorTemplate template = new ConnectorTemplate.Builder() .id("template-id") .connectorGroup(new ConnectorGroup.Builder().id("template-group").build()) .putProperty("property1", new ConfigurationProperty.Builder().build()) .putProperty("property2", new ConfigurationProperty.Builder().build()) .build(); @Test public void shouldCreateBaseConnectors() { final ConnectorSettings settings = new ConnectorSettings.Builder().putConfiguredProperty("property2", "value2").build(); final Connector connector = generator.baseConnectorFrom(template, settings); assertThat(connector).isEqualToIgnoringGivenFields( new Connector.Builder() .name("test-name") .description("test-description") .addTags("from-connector") .connectorGroup(template.getConnectorGroup()) .connectorGroupId("template-group") .properties(template.getConnectorProperties()) .putConfiguredProperty("property2", "value2") .build(), "id", "icon"); assertThat(connector.getIcon()).isEqualTo("data:image/svg+xml,dummy"); } @Test public void shouldCreateBaseConnectorsWithGivenNameAndDescription() { final ConnectorSettings settings = new ConnectorSettings.Builder().name("given-name").description("given-description") .putConfiguredProperty("property2", "value2").build(); final Connector connector = generator.baseConnectorFrom(template, settings); assertThat(connector).isEqualToIgnoringGivenFields( new Connector.Builder() .name("given-name") .description("given-description") .addTags("from-connector") .connectorGroup(template.getConnectorGroup()) .connectorGroupId("template-group") .properties(template.getConnectorProperties()) .putConfiguredProperty("property2", "value2").build(), "id", "icon"); assertThat(connector.getIcon()).isEqualTo("data:image/svg+xml,dummy"); } }
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <entity_profile> <profile id="Logistician"> <name>Logistician</name> </profile> <profile id="Translator"> <name>Translator</name> </profile> <profile id="Salesman"> <name>Salesman</name> </profile> </entity_profile>
{ "pile_set_name": "Github" }
OUTPUT := ./ ifeq ("$(origin O)", "command line") ifneq ($(O),) OUTPUT := $(O)/ endif endif ifeq ($(strip $(STATIC)),true) LIBS = -L../ -L$(OUTPUT) -lm OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o \ $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/sysfs.o else LIBS = -L../ -L$(OUTPUT) -lm -lcpupower OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o endif CFLAGS += -D_GNU_SOURCE -I../lib -DDEFAULT_CONFIG_FILE=\"$(confdir)/cpufreq-bench.conf\" $(OUTPUT)%.o : %.c $(ECHO) " CC " $@ $(QUIET) $(CC) -c $(CFLAGS) $< -o $@ $(OUTPUT)cpufreq-bench: $(OBJS) $(ECHO) " CC " $@ $(QUIET) $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) all: $(OUTPUT)cpufreq-bench install: mkdir -p $(DESTDIR)/$(sbindir) mkdir -p $(DESTDIR)/$(bindir) mkdir -p $(DESTDIR)/$(docdir) mkdir -p $(DESTDIR)/$(confdir) install -m 755 $(OUTPUT)cpufreq-bench $(DESTDIR)/$(sbindir)/cpufreq-bench install -m 755 cpufreq-bench_plot.sh $(DESTDIR)/$(bindir)/cpufreq-bench_plot.sh install -m 644 README-BENCH $(DESTDIR)/$(docdir)/README-BENCH install -m 755 cpufreq-bench_script.sh $(DESTDIR)/$(docdir)/cpufreq-bench_script.sh install -m 644 example.cfg $(DESTDIR)/$(confdir)/cpufreq-bench.conf clean: rm -f $(OUTPUT)*.o rm -f $(OUTPUT)cpufreq-bench
{ "pile_set_name": "Github" }
from __future__ import absolute_import from builtins import str from .base_monitor import BaseMonitor from kafka import KafkaProducer from kafka.common import KafkaUnavailableError from scutils.method_timer import MethodTimer from retrying import retry import json import sys import traceback class KafkaBaseMonitor(BaseMonitor): ''' Base monitor for handling outbound Kafka results ''' def setup(self, settings): ''' Setup the handler @param settings: The loaded settings file ''' self.producer = self._create_producer(settings) self.topic_prefix = settings['KAFKA_TOPIC_PREFIX'] self.use_appid_topics = settings['KAFKA_APPID_TOPICS'] self.logger.debug("Successfully connected to Kafka in {name}" .format(name=self.__class__.__name__)) @retry(wait_exponential_multiplier=500, wait_exponential_max=10000) def _create_producer(self, settings): """Tries to establish a Kafka consumer connection""" try: brokers = settings['KAFKA_HOSTS'] self.logger.debug("Creating new kafka producer using brokers: " + str(brokers)) return KafkaProducer(bootstrap_servers=brokers, value_serializer=lambda m: json.dumps(m), retries=3, linger_ms=settings['KAFKA_PRODUCER_BATCH_LINGER_MS'], buffer_memory=settings['KAFKA_PRODUCER_BUFFER_BYTES']) except KeyError as e: self.logger.error('Missing setting named ' + str(e), {'ex': traceback.format_exc()}) except: self.logger.error("Couldn't initialize kafka producer in plugin.", {'ex': traceback.format_exc()}) raise def _kafka_success(self, response): ''' Callback for successful send ''' self.logger.debug("Sent message to Kafka") def _kafka_failure(self, response): ''' Callback for failed send ''' self.logger.error("Failed to send message to Kafka") def _send_to_kafka(self, master): ''' Sends the message back to Kafka @param master: the final dict to send @returns: True if successfully sent to kafka ''' appid_topic = "{prefix}.outbound_{appid}".format( prefix=self.topic_prefix, appid=master['appid']) firehose_topic = "{prefix}.outbound_firehose".format( prefix=self.topic_prefix) try: # dont want logger in outbound kafka message if self.use_appid_topics: f1 = self.producer.send(appid_topic, master) f1.add_callback(self._kafka_success) f1.add_errback(self._kafka_failure) f2 = self.producer.send(firehose_topic, master) f2.add_callback(self._kafka_success) f2.add_errback(self._kafka_failure) return True except Exception as ex: message = "An exception '{0}' occured while sending a message " \ "to kafka. Arguments:\n{1!r}" \ .format(type(ex).__name__, ex.args) self.logger.error(message) return False def close(self): self.producer.flush() self.producer.close(timeout=10)
{ "pile_set_name": "Github" }
package br.com.swconsultoria.nfe.schema_4.retConsReciNFe; 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.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * <p>Classe Java de KeyInfoType complex type. * * <p>O seguinte fragmento do esquema especifica o contedo esperado contido dentro desta classe. * * <pre> * &lt;complexType name="KeyInfoType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="X509Data" type="{http://www.w3.org/2000/09/xmldsig#}X509DataType"/> * &lt;/sequence> * &lt;attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "KeyInfoType", namespace = "http://www.w3.org/2000/09/xmldsig#", propOrder = { "x509Data" }) public class KeyInfoType { @XmlElement(name = "X509Data", namespace = "http://www.w3.org/2000/09/xmldsig#", required = true) protected X509DataType x509Data; @XmlAttribute(name = "Id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID @XmlSchemaType(name = "ID") protected String id; /** * Obtm o valor da propriedade x509Data. * * @return * possible object is * {@link X509DataType } * */ public X509DataType getX509Data() { return x509Data; } /** * Define o valor da propriedade x509Data. * * @param value * allowed object is * {@link X509DataType } * */ public void setX509Data(X509DataType value) { this.x509Data = value; } /** * Obtm o valor da propriedade id. * * @return * possible object is * {@link String } * */ public String getId() { return id; } /** * Define o valor da propriedade id. * * @param value * allowed object is * {@link String } * */ public void setId(String value) { this.id = value; } }
{ "pile_set_name": "Github" }
org.slf4j.simpleLogger.defaultLogLevel=warn
{ "pile_set_name": "Github" }
import java.io.{File} import scalaxb.compiler.{Config} class UnqualifiedLocalTest extends TestBase { val inFile = new File("integration/src/test/resources/unqualified.xsd") lazy val generated = module.process(inFile, "unqualified", tmp) "unqualified.scala file must compile so that Foo can be used" in { (List("""scalaxb.toXML[unqualified.Foo](scalaxb.fromXML[unqualified.Foo](""" + """<unq:foo xmlns:unq="http://www.example.com/unqualified" attribute1="bar">""" + "<string1></string1>" + """<unq:bar>bar</unq:bar>""" + """</unq:foo>), """ + """Some("http://www.example.com/unqualified"), "foo", """ + """scalaxb.toScope(Some("unq") -> "http://www.example.com/unqualified") ).toString"""), generated) must evaluateTo("""<unq:foo attribute1="bar" xmlns:unq="http://www.example.com/unqualified">""" + "<string1></string1>" + """<unq:bar>bar</unq:bar>""" + "</unq:foo>", outdir = "./tmp") } "unqualified.scala file must compiled with an alternative toXML" in { (List("""scalaxb.toXML[unqualified.Foo](scalaxb.fromXML[unqualified.Foo](""" + """<unq:foo xmlns:unq="http://www.example.com/unqualified" attribute1="bar">""" + "<string1></string1>" + """<unq:bar>bar</unq:bar>""" + """</unq:foo>), """ + """Some("http://www.example.com/unqualified"), Some("foo"), """ + """scalaxb.toScope(Some("unq") -> "http://www.example.com/unqualified") ).toString"""), generated) must evaluateTo("""<unq:foo attribute1="bar" xmlns:unq="http://www.example.com/unqualified">""" + "<string1></string1>" + """<unq:bar>bar</unq:bar>""" + "</unq:foo>", outdir = "./tmp") } "unqualified.scala file must compile so that Foo can be used without toplevel prefix" in { (List("""scalaxb.toXML[unqualified.Foo](scalaxb.fromXML[unqualified.Foo](""" + """<unq:foo xmlns:unq="http://www.example.com/unqualified" attribute1="bar">""" + "<string1></string1>" + """<unq:bar>bar</unq:bar>""" + """</unq:foo>), "foo", """ + """scalaxb.toScope(Some("unq") -> "http://www.example.com/unqualified") ).toString"""), generated) must evaluateTo("""<foo attribute1="bar" xmlns:unq="http://www.example.com/unqualified">""" + "<string1></string1>" + """<unq:bar>bar</unq:bar>""" + "</foo>", outdir = "./tmp") } "unqualified.scala file must compile so that USAddress can roundtrip" in { (List("""val usaddress = unqualified.USAddress("123", "New York", "NY", 10000, Map())""", """val xml = scalaxb.toXML[unqualified.Addressable](usaddress, None, Some("shipTo"), unqualified.defaultScope)""", """val x = scalaxb.fromXML[unqualified.Addressable](xml).toString""", """x"""), generated) must evaluateTo ("""USAddress(123,New York,NY,10000,Map(@{http://www.w3.org/2001/XMLSchema-instance}type -> DataRecord({http://www.w3.org/2001/XMLSchema-instance}type,tns:USAddress)))""", outdir = "./tmp") } /* val inFile2 = new File("integration/src/test/resources/qualified.xsd") lazy val generated2 = (new Driver).process(inFile2, "qualified", tmp) "qualified.scala file must compile so that Foo can be used" in { (List("""scalaxb.toXML[qualified.Foo](scalaxb.fromXML[qualified.Foo](""" + """<q:foo xmlns:q="http://www.example.com/qualified" q:attribute1="bar">""" + "<q:string1></q:string1>" + """</q:foo>), """ + """Some("http://www.example.com/qualified"), "foo", """ + """scalaxb.toScope(Some("q") -> "http://www.example.com/qualified") ).toString"""), generated2) must evaluateTo("""<q:foo q:attribute1="bar" xmlns:q="http://www.example.com/qualified">""" + "<q:string1></q:string1>" + "</q:foo>", outdir = "./tmp") } */ }
{ "pile_set_name": "Github" }
package xiaofei.library.hermestest; import android.content.Context; import xiaofei.library.hermes.annotation.ClassId; /** * Created by Xiaofei on 16/4/28. */ @ClassId("FileUtils") public interface IFileUtils { String getExternalCacheDir(Context context); }
{ "pile_set_name": "Github" }
/** * 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.ratis.examples.filestore; import org.apache.ratis.thirdparty.com.google.protobuf.ByteString; import org.apache.ratis.util.*; import java.io.IOException; import java.nio.file.Path; import java.util.concurrent.CompletableFuture; public interface FileStoreCommon { String STATEMACHINE_DIR_KEY = "example.filestore.statemachine.dir"; SizeInBytes MAX_CHUNK_SIZE = SizeInBytes.valueOf(64, TraditionalBinaryPrefix.MEGA); static int getChunkSize(long suggestedSize) { return Math.toIntExact(Math.min(suggestedSize, MAX_CHUNK_SIZE.getSize())); } static ByteString toByteString(Path p) { return ProtoUtils.toByteString(p.toString()); } static <T> CompletableFuture<T> completeExceptionally( long index, String message) { return completeExceptionally(index, message, null); } static <T> CompletableFuture<T> completeExceptionally( long index, String message, Throwable cause) { return completeExceptionally(message + ", index=" + index, cause); } static <T> CompletableFuture<T> completeExceptionally( String message, Throwable cause) { return JavaUtils.completeExceptionally( new IOException(message).initCause(cause)); } }
{ "pile_set_name": "Github" }
/* * SonarQube * Copyright (C) 2009-2020 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.sonar.server.platform.db.migration.version.v84.users.fk.groupsusers; import org.sonar.db.Database; import org.sonar.server.platform.db.migration.step.DropIndexChange; public class DropIndexOnUserIdOfGroupsUsersTable extends DropIndexChange { private static final String TABLE_NAME = "groups_users"; private static final String INDEX_NAME = "index_groups_users_on_user_id"; public DropIndexOnUserIdOfGroupsUsersTable(Database db) { super(db, INDEX_NAME, TABLE_NAME); } }
{ "pile_set_name": "Github" }
package org.coralibre.android.sdk.fakegms.tasks; import androidx.annotation.NonNull; /** * Represents an asynchronous operation. * <p> * Minimal Task class providing interfaces currently required by the RKI app. */ public abstract class Task<T> { /** * Returns true if the Task is complete; false otherwise. * A Task is complete if it is done running, regardless of whether it was successful or * has been cancelled. */ public abstract boolean isComplete(); /** * Returns true if the Task has completed successfully; false otherwise. */ public abstract boolean isSuccessful(); /** * Adds a listener that is called if the Task completes successfully. * <p> * The listener will be called on the main application thread. * If the Task has already completed successfully, a call to the listener will be immediately * scheduled. If multiple listeners are added, they will be called in the order in which they * were added. * * @return this Task */ @NonNull public abstract Task<T> addOnSuccessListener(OnSuccessListener<? super T> listener); /** * Adds a listener that is called if the Task fails. * <p> * The listener will be called on main application thread. If the Task has already failed, * a call to the listener will be immediately scheduled. If multiple listeners are added, * they will be called in the order in which they were added. * <p> * A canceled Task is not a failure Task. * This listener will not trigger if the Task is canceled. * * @return this Task */ @NonNull public abstract Task<T> addOnFailureListener(OnFailureListener listener); }
{ "pile_set_name": "Github" }
/********************************************************************** // @@@ START COPYRIGHT @@@ // // 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. // // @@@ END COPYRIGHT @@@ **********************************************************************/ #ifndef ODBCCOMMON_H_ #define ODBCCOMMON_H_ /* * Translation unit: ODBCCOMMON * Generated by CNPGEN(TANTAU CNPGEN TANTAU_AG_PC8 20001120.103031) on Mon Jan 31 11:14:07 2011 * C++ constructs used * Header file for use with the CEE * Client functionality included * Server functionality included */ #include <stdarg.h> #include <cee.h> #if CEE_H_VERSION != 19991123 #error Version mismatch CEE_H_VERSION != 19991123 #endif #include <idltype.h> #if IDL_TYPE_H_VERSION != 19971225 #error Version mismatch IDL_TYPE_H_VERSION != 19971225 #endif typedef IDL_string UUID_def; #define UUID_def_cin_ ((char *) "d0+") #define UUID_def_csz_ ((IDL_unsigned_long) 3) typedef IDL_long DIALOGUE_ID_def; #define DIALOGUE_ID_def_cin_ ((char *) "F") #define DIALOGUE_ID_def_csz_ ((IDL_unsigned_long) 1) typedef IDL_char SQL_IDENTIFIER_def[513]; #define SQL_IDENTIFIER_def_cin_ ((char *) "d512+") #define SQL_IDENTIFIER_def_csz_ ((IDL_unsigned_long) 5) typedef IDL_char STMT_NAME_def[513]; #define STMT_NAME_def_cin_ ((char *) "d512+") #define STMT_NAME_def_csz_ ((IDL_unsigned_long) 5) typedef IDL_long SQL_DATATYPE_def; #define SQL_DATATYPE_def_cin_ ((char *) "F") #define SQL_DATATYPE_def_csz_ ((IDL_unsigned_long) 1) typedef IDL_char SQLSTATE_def[6]; #define SQLSTATE_def_cin_ ((char *) "d5+") #define SQLSTATE_def_csz_ ((IDL_unsigned_long) 3) typedef IDL_string ERROR_STR_def; #define ERROR_STR_def_cin_ ((char *) "d0+") #define ERROR_STR_def_csz_ ((IDL_unsigned_long) 3) typedef struct SQL_DataValue_def_seq_ { IDL_unsigned_long _length; char pad_to_offset_8_[4]; IDL_octet *_buffer; IDL_PTR_PAD(_buffer, 1) } SQL_DataValue_def; #define SQL_DataValue_def_cin_ ((char *) "c0+H") #define SQL_DataValue_def_csz_ ((IDL_unsigned_long) 4) typedef IDL_short SQL_INDICATOR_def; #define SQL_INDICATOR_def_cin_ ((char *) "I") #define SQL_INDICATOR_def_csz_ ((IDL_unsigned_long) 1) typedef IDL_long_long INTERVAL_NUM_def; #define INTERVAL_NUM_def_cin_ ((char *) "G") #define INTERVAL_NUM_def_csz_ ((IDL_unsigned_long) 1) typedef IDL_char TIMESTAMP_STR_def[31]; #define TIMESTAMP_STR_def_cin_ ((char *) "d30+") #define TIMESTAMP_STR_def_csz_ ((IDL_unsigned_long) 4) typedef struct USER_SID_def_seq_ { IDL_unsigned_long _length; char pad_to_offset_8_[4]; IDL_octet *_buffer; IDL_PTR_PAD(_buffer, 1) } USER_SID_def; #define USER_SID_def_cin_ ((char *) "c0+H") #define USER_SID_def_csz_ ((IDL_unsigned_long) 4) typedef struct USER_PASSWORD_def_seq_ { IDL_unsigned_long _length; char pad_to_offset_8_[4]; IDL_octet *_buffer; IDL_PTR_PAD(_buffer, 1) } USER_PASSWORD_def; #define USER_PASSWORD_def_cin_ ((char *) "c0+H") #define USER_PASSWORD_def_csz_ ((IDL_unsigned_long) 4) typedef struct USER_NAME_def_seq_ { IDL_unsigned_long _length; char pad_to_offset_8_[4]; IDL_octet *_buffer; IDL_PTR_PAD(_buffer, 1) } USER_NAME_def; #define USER_NAME_def_cin_ ((char *) "c0+H") #define USER_NAME_def_csz_ ((IDL_unsigned_long) 4) typedef IDL_long TIME_def; #define TIME_def_cin_ ((char *) "F") #define TIME_def_csz_ ((IDL_unsigned_long) 1) typedef IDL_short GEN_PARAM_TOKEN_def; #define GEN_PARAM_TOKEN_def_cin_ ((char *) "I") #define GEN_PARAM_TOKEN_def_csz_ ((IDL_unsigned_long) 1) typedef IDL_short GEN_PARAM_OPERATION_def; #define GEN_PARAM_OPERATION_def_cin_ ((char *) "I") #define GEN_PARAM_OPERATION_def_csz_ ((IDL_unsigned_long) 1) typedef struct GEN_PARAM_VALUE_def_seq_ { IDL_unsigned_long _length; char pad_to_offset_8_[4]; IDL_octet *_buffer; IDL_PTR_PAD(_buffer, 1) } GEN_PARAM_VALUE_def; #define GEN_PARAM_VALUE_def_cin_ ((char *) "c0+H") #define GEN_PARAM_VALUE_def_csz_ ((IDL_unsigned_long) 4) typedef IDL_char VPROC_def[33]; #define VPROC_def_cin_ ((char *) "d32+") #define VPROC_def_csz_ ((IDL_unsigned_long) 4) typedef IDL_char APLICATION_def[130]; #define APLICATION_def_cin_ ((char *) "d129+") #define APLICATION_def_csz_ ((IDL_unsigned_long) 5) typedef IDL_char COMPUTER_def[130]; #define COMPUTER_def_cin_ ((char *) "d129+") #define COMPUTER_def_csz_ ((IDL_unsigned_long) 5) typedef IDL_char NAME_def[130]; #define NAME_def_cin_ ((char *) "d129+") #define NAME_def_csz_ ((IDL_unsigned_long) 5) struct ERROR_DESC_t { IDL_long rowId; IDL_long errorDiagnosticId; IDL_long sqlcode; SQLSTATE_def sqlstate; char pad_to_offset_24_[6]; ERROR_STR_def errorText; IDL_PTR_PAD(errorText, 1) IDL_long operationAbortId; IDL_long errorCodeType; IDL_string Param1; IDL_PTR_PAD(Param1, 1) IDL_string Param2; IDL_PTR_PAD(Param2, 1) IDL_string Param3; IDL_PTR_PAD(Param3, 1) IDL_string Param4; IDL_PTR_PAD(Param4, 1) IDL_string Param5; IDL_PTR_PAD(Param5, 1) IDL_string Param6; IDL_PTR_PAD(Param6, 1) IDL_string Param7; IDL_PTR_PAD(Param7, 1) }; typedef ERROR_DESC_t ERROR_DESC_def; #define ERROR_DESC_def_cin_ ((char *) \ "b14+FFFd5+d0+FFd0+d0+d0+d0+d0+d0+d0+") #define ERROR_DESC_def_csz_ ((IDL_unsigned_long) 36) typedef struct ERROR_DESC_LIST_def_seq_ { IDL_unsigned_long _length; char pad_to_offset_8_[4]; ERROR_DESC_def *_buffer; IDL_PTR_PAD(_buffer, 1) } ERROR_DESC_LIST_def; #define ERROR_DESC_LIST_def_cin_ ((char *) \ "c0+b14+FFFd5+d0+FFd0+d0+d0+d0+d0+d0+d0+") #define ERROR_DESC_LIST_def_csz_ ((IDL_unsigned_long) 39) struct SQLItemDesc_t { IDL_long version; SQL_DATATYPE_def dataType; IDL_long datetimeCode; IDL_long maxLen; IDL_short precision; IDL_short scale; IDL_boolean nullInfo; IDL_char colHeadingNm[514]; IDL_boolean signType; IDL_long ODBCDataType; IDL_short ODBCPrecision; char pad_to_offset_544_[2]; IDL_long SQLCharset; IDL_long ODBCCharset; IDL_char TableName[514]; IDL_char CatalogName[514]; IDL_char SchemaName[514]; IDL_char Heading[514]; IDL_long intLeadPrec; IDL_long paramMode; }; typedef SQLItemDesc_t SQLItemDesc_def; #define SQLItemDesc_def_cin_ ((char *) \ "b19+FFFFIIBd513+BFIFFd513+d513+d513+d513+FF") #define SQLItemDesc_def_csz_ ((IDL_unsigned_long) 43) typedef struct SQLItemDescList_def_seq_ { IDL_unsigned_long _length; char pad_to_offset_8_[4]; SQLItemDesc_def *_buffer; IDL_PTR_PAD(_buffer, 1) } SQLItemDescList_def; #define SQLItemDescList_def_cin_ ((char *) \ "c0+b19+FFFFIIBd513+BFIFFd513+d513+d513+d513+FF") #define SQLItemDescList_def_csz_ ((IDL_unsigned_long) 46) struct SQLValue_t { SQL_DATATYPE_def dataType; SQL_INDICATOR_def dataInd; char pad_to_offset_8_[2]; SQL_DataValue_def dataValue; IDL_long dataCharset; char pad_to_size_32_[4]; }; typedef SQLValue_t SQLValue_def; #define SQLValue_def_cin_ ((char *) "b4+FIc0+HF") #define SQLValue_def_csz_ ((IDL_unsigned_long) 10) typedef struct SQLValueList_def_seq_ { IDL_unsigned_long _length; char pad_to_offset_8_[4]; SQLValue_def *_buffer; IDL_PTR_PAD(_buffer, 1) } SQLValueList_def; #define SQLValueList_def_cin_ ((char *) "c0+b4+FIc0+HF") #define SQLValueList_def_csz_ ((IDL_unsigned_long) 13) typedef IDL_enum USER_DESC_TYPE_t; #define SID_TYPE ((IDL_enum) 0) #define AUTHENTICATED_USER_TYPE ((IDL_enum) 1) #define UNAUTHENTICATED_USER_TYPE ((IDL_enum) 2) #define PASSWORD_ENCRYPTED_USER_TYPE ((IDL_enum) 3) #define SID_ENCRYPTED_USER_TYPE ((IDL_enum) 4) #define WIN95_USER_TYPE ((IDL_enum) 5) typedef USER_DESC_TYPE_t USER_DESC_TYPE_def; #define USER_DESC_TYPE_def_cin_ ((char *) "h5+") #define USER_DESC_TYPE_def_csz_ ((IDL_unsigned_long) 3) struct USER_DESC_t { USER_DESC_TYPE_def userDescType; char pad_to_offset_8_[4]; USER_SID_def userSid; IDL_string domainName; IDL_PTR_PAD(domainName, 1) IDL_string userName; IDL_PTR_PAD(userName, 1) USER_PASSWORD_def password; }; typedef USER_DESC_t USER_DESC_def; #define USER_DESC_def_cin_ ((char *) "b5+h5+c0+Hd0+d0+c0+H") #define USER_DESC_def_csz_ ((IDL_unsigned_long) 20) struct VERSION_t { IDL_short componentId; IDL_short majorVersion; IDL_short minorVersion; char pad_to_offset_8_[2]; IDL_unsigned_long buildId; }; typedef VERSION_t VERSION_def; #define VERSION_def_cin_ ((char *) "b4+IIIK") #define VERSION_def_csz_ ((IDL_unsigned_long) 7) typedef struct VERSION_LIST_def_seq_ { IDL_unsigned_long _length; char pad_to_offset_8_[4]; VERSION_def *_buffer; IDL_PTR_PAD(_buffer, 1) } VERSION_LIST_def; #define VERSION_LIST_def_cin_ ((char *) "c0+b4+IIIK") #define VERSION_LIST_def_csz_ ((IDL_unsigned_long) 10) struct CONNECTION_CONTEXT_t { SQL_IDENTIFIER_def datasource; SQL_IDENTIFIER_def catalog; SQL_IDENTIFIER_def schema; SQL_IDENTIFIER_def location; SQL_IDENTIFIER_def userRole; char pad_to_offset_2566_[1]; IDL_short accessMode; IDL_short autoCommit; char pad_to_offset_2572_[2]; IDL_unsigned_long queryTimeoutSec; IDL_unsigned_long idleTimeoutSec; IDL_unsigned_long loginTimeoutSec; IDL_short txnIsolationLevel; IDL_short rowSetSize; IDL_long diagnosticFlag; IDL_unsigned_long processId; IDL_char computerName[61]; char pad_to_offset_2664_[7]; IDL_string windowText; IDL_PTR_PAD(windowText, 1) IDL_unsigned_long ctxACP; IDL_unsigned_long ctxDataLang; IDL_unsigned_long ctxErrorLang; IDL_short ctxCtrlInferNCHAR; IDL_short cpuToUse; IDL_short cpuToUseEnd; IDL_char clientVproc[101]; char pad_to_offset_2744_[3]; IDL_string connectOptions; IDL_PTR_PAD(connectOptions, 1) VERSION_LIST_def clientVersionList; IDL_unsigned_long inContextOptions1; IDL_unsigned_long inContextOptions2; IDL_char sessionName[101]; char pad_to_offset_2880_[3]; IDL_string clientUserName; IDL_PTR_PAD(clientUserName, 1) }; typedef CONNECTION_CONTEXT_t CONNECTION_CONTEXT_def; #define CONNECTION_CONTEXT_def_cin_ ((char *) \ "b29+d512+d512+d512+d512+d512+IIKKKIIFKa1+61+Cd0+KKKIIIa1+51+"\ "Cd0+c0+b4+IIIKKKa1+101+Cd0+") #define CONNECTION_CONTEXT_def_csz_ ((IDL_unsigned_long) 87) struct OUT_CONNECTION_CONTEXT_t { VERSION_LIST_def versionList; IDL_short nodeId; char pad_to_offset_20_[2]; IDL_unsigned_long processId; IDL_char computerName[61]; SQL_IDENTIFIER_def catalog; SQL_IDENTIFIER_def schema; char pad_to_offset_1112_[1]; IDL_unsigned_long outContextOptions1; IDL_unsigned_long outContextOptions2; IDL_unsigned_long outContextOptionStringLen; char pad_to_offset_1128_[4]; IDL_string outContextOptionString; IDL_PTR_PAD(outContextOptionString, 1) }; typedef OUT_CONNECTION_CONTEXT_t OUT_CONNECTION_CONTEXT_def; #define OUT_CONNECTION_CONTEXT_def_cin_ ((char *) \ "b10+c0+b4+IIIKIKa1+61+Cd512+d512+KKKd0+") #define OUT_CONNECTION_CONTEXT_def_csz_ ((IDL_unsigned_long) 39) typedef IDL_char IDL_OBJECT_def[128]; #define IDL_OBJECT_def_cin_ ((char *) "a1+128+C") #define IDL_OBJECT_def_csz_ ((IDL_unsigned_long) 8) struct GEN_Param_t { GEN_PARAM_TOKEN_def paramToken; GEN_PARAM_OPERATION_def paramOperation; char pad_to_offset_8_[4]; GEN_PARAM_VALUE_def paramValue; }; typedef GEN_Param_t GEN_Param_def; #define GEN_Param_def_cin_ ((char *) "b3+IIc0+H") #define GEN_Param_def_csz_ ((IDL_unsigned_long) 9) typedef struct GEN_ParamList_def_seq_ { IDL_unsigned_long _length; char pad_to_offset_8_[4]; GEN_Param_def *_buffer; IDL_PTR_PAD(_buffer, 1) } GEN_ParamList_def; #define GEN_ParamList_def_cin_ ((char *) "c0+b3+IIc0+H") #define GEN_ParamList_def_csz_ ((IDL_unsigned_long) 12) struct RES_DESC_t { SQL_IDENTIFIER_def AttrNm; char pad_to_offset_520_[7]; IDL_long_long Limit; IDL_string Action; IDL_PTR_PAD(Action, 1) IDL_long Settable; char pad_to_size_544_[4]; }; typedef RES_DESC_t RES_DESC_def; #define RES_DESC_def_cin_ ((char *) "b4+d512+Gd0+F") #define RES_DESC_def_csz_ ((IDL_unsigned_long) 13) typedef struct RES_DESC_LIST_def_seq_ { IDL_unsigned_long _length; char pad_to_offset_8_[4]; RES_DESC_def *_buffer; IDL_PTR_PAD(_buffer, 1) } RES_DESC_LIST_def; #define RES_DESC_LIST_def_cin_ ((char *) "c0+b4+d512+Gd0+F") #define RES_DESC_LIST_def_csz_ ((IDL_unsigned_long) 16) struct ENV_DESC_t { IDL_long VarSeq; IDL_long VarType; IDL_string VarVal; IDL_PTR_PAD(VarVal, 1) }; typedef ENV_DESC_t ENV_DESC_def; #define ENV_DESC_def_cin_ ((char *) "b3+FFd0+") #define ENV_DESC_def_csz_ ((IDL_unsigned_long) 8) typedef struct ENV_DESC_LIST_def_seq_ { IDL_unsigned_long _length; char pad_to_offset_8_[4]; ENV_DESC_def *_buffer; IDL_PTR_PAD(_buffer, 1) } ENV_DESC_LIST_def; #define ENV_DESC_LIST_def_cin_ ((char *) "c0+b3+FFd0+") #define ENV_DESC_LIST_def_csz_ ((IDL_unsigned_long) 11) struct SRVR_CONTEXT_t { INTERVAL_NUM_def srvrIdleTimeout; INTERVAL_NUM_def connIdleTimeout; RES_DESC_LIST_def resDescList; ENV_DESC_LIST_def envDescList; }; typedef SRVR_CONTEXT_t SRVR_CONTEXT_def; #define SRVR_CONTEXT_def_cin_ ((char *) \ "b4+GGc0+b4+d512+Gd0+Fc0+b3+FFd0+") #define SRVR_CONTEXT_def_csz_ ((IDL_unsigned_long) 32) #ifdef USE_NEW_PHANDLE typedef SB_Phandle_Type PROCESS_HANDLE_def; #else typedef IDL_short PROCESS_HANDLE_def[10]; #endif #define PROCESS_HANDLE_def_cin_ ((char *) "a1+10+I") #define PROCESS_HANDLE_def_csz_ ((IDL_unsigned_long) 7) typedef struct PROCESS_HANDLE_List_def_seq_ { IDL_unsigned_long _length; char pad_to_offset_8_[4]; PROCESS_HANDLE_def *_buffer; IDL_PTR_PAD(_buffer, 1) } PROCESS_HANDLE_List_def; #define PROCESS_HANDLE_List_def_cin_ ((char *) "c0+a1+10+I") #define PROCESS_HANDLE_List_def_csz_ ((IDL_unsigned_long) 10) /* * End translation unit: ODBCCOMMON */ #endif /* ODBCCOMMON_H_ */
{ "pile_set_name": "Github" }
/* * 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.camel.component.file.remote; import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; public class FromFtpRecursiveNoopTest extends FtpServerTestSupport { protected String getFtpUrl() { return "ftp://admin@localhost:" + getPort() + "/noop?password=admin&binary=false&initialDelay=3000" + "&recursive=true&noop=true"; } @Override @BeforeEach public void setUp() throws Exception { super.setUp(); template.sendBodyAndHeader(getFtpUrl(), "a", Exchange.FILE_NAME, "a.txt"); template.sendBodyAndHeader(getFtpUrl(), "b", Exchange.FILE_NAME, "b.txt"); template.sendBodyAndHeader(getFtpUrl(), "a2", Exchange.FILE_NAME, "foo/a.txt"); template.sendBodyAndHeader(getFtpUrl(), "c", Exchange.FILE_NAME, "bar/c.txt"); template.sendBodyAndHeader(getFtpUrl(), "b2", Exchange.FILE_NAME, "bar/b.txt"); } @Test public void testRecursiveNoop() throws Exception { MockEndpoint mock = getMockEndpoint("mock:result"); mock.expectedBodiesReceivedInAnyOrder("a", "b", "a2", "c", "b2"); assertMockEndpointsSatisfied(); // reset mock and send in a new file to be picked up only mock.reset(); mock.expectedBodiesReceived("c2"); template.sendBodyAndHeader(getFtpUrl(), "c2", Exchange.FILE_NAME, "c.txt"); assertMockEndpointsSatisfied(); } @Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { from(getFtpUrl()).convertBodyTo(String.class).to("log:ftp").to("mock:result"); } }; } }
{ "pile_set_name": "Github" }
package mesosphere.marathon package core.task.state import com.typesafe.scalalogging.StrictLogging import mesosphere.marathon.state._ import scala.jdk.CollectionConverters._ import org.apache.mesos import scala.annotation.tailrec /** * Metadata about a task's networking information. * * @param hostPorts The hostPorts as taken originally from the accepted offer * @param hostName the agent's hostName * @param ipAddresses all associated IP addresses, computed from mesosStatus */ case class NetworkInfo(hostName: String, hostPorts: Seq[Int], ipAddresses: Seq[mesos.Protos.NetworkInfo.IPAddress]) { import NetworkInfo._ /** * compute the effective IP address based on whether the runSpec declares container-mode networking; if so * then choose the first address from the list provided by Mesos. Otherwise, in host- and bridge-mode * networking just use the agent hostname as the effective IP. * * we assume that container-mode networking is exclusive of bridge-mode networking. */ def effectiveIpAddress(runSpec: RunSpec): Option[String] = { if (runSpec.networks.hasContainerNetworking) { pickFirstIpAddressFrom(ipAddresses) } else { Some(hostName) } } /** * generate a list of possible port assignments, perhaps even including assignments for which no effective * address or port is available. A returned `PortAssignment` for which there is no `effectiveAddress` will have * have an `effectivePort` of `NoPort`. * * @param app the app run specification * @param includeUnresolved when `true` include assignments without effective address and port */ def portAssignments(app: AppDefinition, includeUnresolved: Boolean): Seq[PortAssignment] = { computePortAssignments(app, hostName, hostPorts, effectiveIpAddress(app), includeUnresolved) } /** * Update the network info with the given mesos TaskStatus. This will eventually update ipAddresses and the * effectiveIpAddress. * * Note: Only makes sense to call this the task just became running as the reported ip addresses are not * expected to change during a tasks lifetime. */ def update(mesosStatus: mesos.Protos.TaskStatus): NetworkInfo = { val newIpAddresses = resolveIpAddresses(mesosStatus) if (ipAddresses != newIpAddresses) { copy(ipAddresses = newIpAddresses) } else { // nothing has changed this } } } object NetworkInfo extends StrictLogging { /** * Pick the IP address based on an ip address configuration as given in teh AppDefinition * * Only applicable if the app definition defines an IP address. PortDefinitions cannot be configured in addition, * and we currently expect that there is at most one IP address assigned. */ private[state] def pickFirstIpAddressFrom(ipAddresses: Seq[mesos.Protos.NetworkInfo.IPAddress]): Option[String] = { // Explicitly take the ipAddress from the first given object, if available. We do not expect to receive // IPAddresses that do not define an ipAddress. ipAddresses.headOption.map { ipAddress => require(ipAddress.hasIpAddress, s"$ipAddress does not define an ipAddress") ipAddress.getIpAddress } } def resolveIpAddresses(mesosStatus: mesos.Protos.TaskStatus): Seq[mesos.Protos.NetworkInfo.IPAddress] = { if (mesosStatus.hasContainerStatus && mesosStatus.getContainerStatus.getNetworkInfosCount > 0) { mesosStatus.getContainerStatus.getNetworkInfosList.asScala.iterator.flatMap(_.getIpAddressesList.asScala).toSeq } else { Nil } } private def computePortAssignments( app: AppDefinition, hostName: String, hostPorts: Seq[Int], effectiveIpAddress: Option[String], includeUnresolved: Boolean ): Seq[PortAssignment] = { def fromPortMappings(container: Container): Seq[PortAssignment] = { import Container.PortMapping @tailrec def gen(ports: List[Int], mappings: List[PortMapping], assignments: List[PortAssignment]): List[PortAssignment] = { (ports, mappings) match { case (hostPort :: xs, PortMapping(containerPort, Some(_), _, _, portName, _, _) :: rs) => // agent port was requested, and we strongly prefer agentIP:hostPort (legacy reasons?) val assignment = PortAssignment( portName = portName, effectiveIpAddress = Option(hostName), effectivePort = hostPort, hostPort = Option(hostPort), // See [[TaskBuilder.computeContainerInfo.boundPortMappings]] for more info. containerPort = if (containerPort == 0) Option(hostPort) else Option(containerPort) ) gen(xs, rs, assignment :: assignments) case (_, mapping :: rs) if mapping.hostPort.isEmpty => // no port was requested on the agent (really, this is only possible for container networking) val assignment = PortAssignment( portName = mapping.name, // if there's no assigned IP and we have no host port, then this container isn't reachable effectiveIpAddress = effectiveIpAddress, // just pick containerPort; we don't have an agent port to fall back on regardless, // of effectiveIp or hasAssignedIpAddress effectivePort = effectiveIpAddress.fold(PortAssignment.NoPort)(_ => mapping.containerPort), hostPort = None, containerPort = Some(mapping.containerPort) ) gen(ports, rs, assignment :: assignments) case (Nil, Nil) => assignments case _ => throw new IllegalStateException( s"failed to align remaining allocated host ports $ports with remaining declared port mappings $mappings in app ${app.id}" ) } } gen(hostPorts.to(List), container.portMappings.to(List), Nil).reverse } def fromPortDefinitions: Seq[PortAssignment] = app.portDefinitions.zip(hostPorts).map { case (portDefinition, hostPort) => PortAssignment( portName = portDefinition.name, effectiveIpAddress = effectiveIpAddress, effectivePort = hostPort, hostPort = Some(hostPort) ) } app.container.collect { case c: Container if app.networks.hasNonHostNetworking => // don't return assignments that haven't yet been allocated a port val mappings = fromPortMappings(c) if (includeUnresolved) mappings else mappings.filter(_.isResolved) }.getOrElse(fromPortDefinitions) } }
{ "pile_set_name": "Github" }