text
stringlengths 6
99.5k
| meta
dict |
|---|---|
package org.zstack.sdk;
import java.util.HashMap;
import java.util.Map;
import org.zstack.sdk.*;
public class DetachPolicyFromUserGroupAction extends AbstractAction {
private static final HashMap<String, Parameter> parameterMap = new HashMap<>();
private static final HashMap<String, Parameter> nonAPIParameterMap = new HashMap<>();
public static class Result {
public ErrorCode error;
public org.zstack.sdk.DetachPolicyFromUserGroupResult value;
public Result throwExceptionIfError() {
if (error != null) {
throw new ApiException(
String.format("error[code: %s, description: %s, details: %s]", error.code, error.description, error.details)
);
}
return this;
}
}
@Param(required = true, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String policyUuid;
@Param(required = true, nonempty = false, nullElements = false, emptyString = true, noTrim = false)
public java.lang.String groupUuid;
@Param(required = false)
public java.util.List systemTags;
@Param(required = false)
public java.util.List userTags;
@Param(required = false)
public String sessionId;
@Param(required = false)
public String accessKeyId;
@Param(required = false)
public String accessKeySecret;
@Param(required = false)
public String requestIp;
@NonAPIParam
public long timeout = -1;
@NonAPIParam
public long pollingInterval = -1;
private Result makeResult(ApiResult res) {
Result ret = new Result();
if (res.error != null) {
ret.error = res.error;
return ret;
}
org.zstack.sdk.DetachPolicyFromUserGroupResult value = res.getResult(org.zstack.sdk.DetachPolicyFromUserGroupResult.class);
ret.value = value == null ? new org.zstack.sdk.DetachPolicyFromUserGroupResult() : value;
return ret;
}
public Result call() {
ApiResult res = ZSClient.call(this);
return makeResult(res);
}
public void call(final Completion<Result> completion) {
ZSClient.call(this, new InternalCompletion() {
@Override
public void complete(ApiResult res) {
completion.complete(makeResult(res));
}
});
}
protected Map<String, Parameter> getParameterMap() {
return parameterMap;
}
protected Map<String, Parameter> getNonAPIParameterMap() {
return nonAPIParameterMap;
}
protected RestInfo getRestInfo() {
RestInfo info = new RestInfo();
info.httpMethod = "DELETE";
info.path = "/accounts/groups/{groupUuid}/policies/{policyUuid}";
info.needSession = true;
info.needPoll = true;
info.parameterName = "";
return info;
}
}
|
{
"pile_set_name": "Github"
}
|
open module soat.vending.machine.gui {
requires java.desktopa ;
requires soat.vending.machine.model;
requires transitive soat.core;
exports fr.soat.vending.machine.model to another , again, ano;
exports fr.soat.vending.machine.model.it.should.be.breaking.but.only.a.part to another , again, ano;
exports fr.soat.vending.machine.model to another , again, ano, waht, another , again, ano, averyveryveryveryveryveryveryveryveryveryverylongname;
opens fr.soat.vending.machine.model to another , again,ano ;
opens fr.soat.vending.machine.model.it.should.be.breaking.but.only.a.part to another , again,ano ;
opens fr.soat.vending.machine.model to another , again,ano,another , again,ano,another , again,ano,another , again,averyveryveryveryveryveryveryveryveryveryverylongname ;
uses fr.soat.vendinga.machine.services.DrinksService ;
provides model with another , again,ano ;
provides fr.soat.vending.machine.model.it.should.be.breaking.but.only.a.part with another , again,ano ;
provides model with another , again,ano,another , again,ano,another , again,ano,another , again,averyveryveryveryveryveryveryveryveryveryverylongname ;
}
|
{
"pile_set_name": "Github"
}
|
/**
* A high-level abstraction layer for codebases, classes, and components of
* classes (methods, fields, instructions, etc.). The idea is to decouple
* FindBugs as much as possible from any particular bytecode framework (BCEL,
* ASM, etc.)
*
* Implementations of these interfaces may be found in the
* edu.umd.cs.findbugs.classfile.impl package. Instances should be created
* using the ClassFactory singleton in that package.
*/
@javax.annotation.ParametersAreNonnullByDefault
@edu.umd.cs.findbugs.internalAnnotations.AnalysisContextContained
package edu.umd.cs.findbugs.classfile;
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2012 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.google.gwt.i18n.client.impl.cldr;
// DO NOT EDIT - GENERATED FROM CLDR AND ICU DATA
/**
* Implementation of DateTimeFormatInfo for the "cu" locale.
*/
public class DateTimeFormatInfoImpl_cu extends DateTimeFormatInfoImpl {
@Override
public String[] ampms() {
return new String[] {
"ДП",
"ПП"
};
}
@Override
public String dateFormatFull() {
return "EEEE, d MMMM 'л'. y.";
}
@Override
public String dateFormatShort() {
return "y.MM.dd";
}
@Override
public String[] erasFull() {
return new String[] {
"пре́дъ р. х.",
"по р. х."
};
}
@Override
public String[] erasShort() {
return new String[] {
"пре́дъ р. х.",
"ѿ р. х."
};
}
@Override
public String formatMonthFullWeekdayDay() {
return "EEEE, MMMM d";
}
@Override
public String formatMonthNumDay() {
return "M/d";
}
@Override
public String formatYearMonthAbbrev() {
return "MMM y";
}
@Override
public String formatYearMonthAbbrevDay() {
return "MMM d, y";
}
@Override
public String formatYearMonthFull() {
return "MMMM y";
}
@Override
public String formatYearMonthFullDay() {
return "MMMM d, y";
}
@Override
public String formatYearMonthNum() {
return "M/y";
}
@Override
public String formatYearMonthNumDay() {
return "M/d/y";
}
@Override
public String formatYearMonthWeekdayDay() {
return "EEE, MMM d, y";
}
@Override
public String formatYearQuarterFull() {
return "QQQQ y";
}
@Override
public String formatYearQuarterShort() {
return "Q y";
}
@Override
public String[] monthsFull() {
return new String[] {
"і҆аннꙋа́рїа",
"феврꙋа́рїа",
"ма́рта",
"а҆прі́ллїа",
"ма́їа",
"і҆ꙋ́нїа",
"і҆ꙋ́лїа",
"а҆́ѵгꙋста",
"септе́мврїа",
"ѻ҆ктѡ́врїа",
"ное́мврїа",
"деке́мврїа"
};
}
@Override
public String[] monthsFullStandalone() {
return new String[] {
"і҆аннꙋа́рїй",
"феврꙋа́рїй",
"ма́ртъ",
"а҆прі́ллїй",
"ма́їй",
"і҆ꙋ́нїй",
"і҆ꙋ́лїй",
"а҆́ѵгꙋстъ",
"септе́мврїй",
"ѻ҆ктѡ́врїй",
"ное́мврїй",
"деке́мврїй"
};
}
@Override
public String[] monthsNarrow() {
return new String[] {
"І҆",
"Ф",
"М",
"А҆",
"М",
"І҆",
"І҆",
"А҆",
"С",
"Ѻ҆",
"Н",
"Д"
};
}
@Override
public String[] monthsShort() {
return new String[] {
"і҆аⷩ҇",
"феⷡ҇",
"маⷬ҇",
"а҆пⷬ҇",
"маꙵ",
"і҆ꙋⷩ҇",
"і҆ꙋⷧ҇",
"а҆́ѵⷢ҇",
"сеⷫ҇",
"ѻ҆кⷮ",
"ноеⷨ",
"деⷦ҇"
};
}
@Override
public String[] quartersFull() {
return new String[] {
"а҃_ѧ че́тверть",
"в҃_ѧ че́тверть",
"г҃_ѧ че́тверть",
"д҃_ѧ че́тверть"
};
}
@Override
public String[] quartersShort() {
return new String[] {
"а҃_ѧ че́тверть",
"в҃_ѧ че́тверть",
"г҃_ѧ че́тверть",
"д҃_ѧ че́тверть"
};
}
@Override
public String[] weekdaysFull() {
return new String[] {
"недѣ́лѧ",
"понедѣ́льникъ",
"вто́рникъ",
"среда̀",
"четверто́къ",
"пѧто́къ",
"сꙋббѡ́та"
};
}
@Override
public String[] weekdaysNarrow() {
return new String[] {
"Н",
"П",
"В",
"С",
"Ч",
"П",
"С"
};
}
@Override
public String[] weekdaysShort() {
return new String[] {
"ндⷧ҇ѧ",
"пнⷣе",
"втоⷬ҇",
"срⷣе",
"чеⷦ҇",
"пѧⷦ҇",
"сꙋⷠ҇"
};
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* JBoss, Home of Professional Open Source
* Copyright 2010, Red Hat Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This 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 software 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 software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.as.test.integration.weld.ejb.interceptor.packaging;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.as.test.integration.ejb.packaging.war.namingcontext.EjbInterface;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.naming.InitialContext;
import javax.naming.NamingException;
/**
* AS7-1032
*
* Tests the {@link org.jboss.as.weld.ejb.Jsr299BindingsInterceptor} is only applied to appropriate EJB's
*
* @author Stuart Douglas
*/
@RunWith(Arquillian.class)
public class CdiInterceptorEarPackagingTestCase {
@Deployment
public static Archive<?> deploy() {
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "CdiInterceptorPackaging.ear");
JavaArchive lib = ShrinkWrap.create(JavaArchive.class, "lib.jar");
lib.addClass(EjbInterface.class);
ear.addAsLibrary(lib);
JavaArchive jar1 = ShrinkWrap.create(JavaArchive.class, "cdiJar.jar");
jar1.addClasses(CdiInterceptorEarPackagingTestCase.class, CdiInterceptorBinding.class, CdiInterceptor.class, CdiEjb.class);
jar1.add(new StringAsset("<beans><interceptors><class>"+ CdiInterceptor.class.getName() + "</class></interceptors></beans>"), "META-INF/beans.xml");
ear.addAsModule(jar1);
JavaArchive jar2 = ShrinkWrap.create(JavaArchive.class, "nonCdiJar.jar");
jar2.addClasses(NonCdiEjb.class);
ear.addAsModule(jar2);
return ear;
}
@Test
public void testCdiInterceptorApplied() throws NamingException {
CdiEjb cdiEjb = (CdiEjb) new InitialContext().lookup("java:app/cdiJar/CdiEjb");
Assert.assertEquals("Hello World", cdiEjb.sayHello());
}
@Test
public void testCdiInterceptorNotApplied() throws NamingException {
NonCdiEjb cdiEjb = (NonCdiEjb) new InitialContext().lookup("java:app/nonCdiJar/NonCdiEjb");
Assert.assertEquals("Hello", cdiEjb.sayHello());
}
}
|
{
"pile_set_name": "Github"
}
|
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
package org.geoserver.wcs.kvp;
import static org.vfny.geoserver.wcs.WcsException.WcsExceptionCode.InvalidParameterValue;
import org.geoserver.ows.KvpParser;
import org.vfny.geoserver.wcs.WcsException;
/**
* Not really a parser, but a validity checker instead (ensures the specified type is among the
* values foreseen by the standard and supported by GeoServer)
*
* @author Andrea Aime
*/
public class GridTypeKvpParser extends KvpParser {
public GridTypeKvpParser() {
super("GridType", String.class);
}
@Override
public Object parse(String value) throws Exception {
GridType type = null;
for (GridType currType : GridType.values()) {
if (currType.getXmlConstant().equalsIgnoreCase(value)) {
type = currType;
break;
}
}
if (type == null)
throw new WcsException(
"Could not understand grid type '" + value + "'",
InvalidParameterValue,
"GridType");
if (type == GridType.GT2dGridIn3dCrs)
throw new WcsException(
"GeoServer does not support type " + type.name(),
InvalidParameterValue,
"GridType");
return type.getXmlConstant();
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* JBoss, Home of Professional Open Source
* Copyright 2010, Red Hat, Inc., 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.weld.tests.beanManager.injectionPoint;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Arrays;
import jakarta.enterprise.inject.Default;
import jakarta.enterprise.inject.spi.AnnotatedConstructor;
import jakarta.enterprise.inject.spi.AnnotatedField;
import jakarta.enterprise.inject.spi.AnnotatedMethod;
import jakarta.enterprise.inject.spi.AnnotatedParameter;
import jakarta.enterprise.inject.spi.AnnotatedType;
import jakarta.enterprise.inject.spi.BeanManager;
import jakarta.enterprise.inject.spi.InjectionPoint;
import jakarta.inject.Inject;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.BeanArchive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.weld.test.util.Utils;
import org.jboss.weld.tests.util.BeanUtilities;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(Arquillian.class)
public class CreateInjectionPointTest {
@Inject
private BeanManager manager;
@Deployment
public static Archive<?> getDeployment() {
return ShrinkWrap.create(BeanArchive.class, Utils.getDeploymentNameAsHash(CreateInjectionPointTest.class)).addPackage(Book.class.getPackage()).addClass(BeanUtilities.class);
}
@Test
public void testField() {
AnnotatedType<?> type = manager.createAnnotatedType(Library.class);
assertEquals(1, type.getFields().size());
AnnotatedField<?> field = type.getFields().iterator().next();
InjectionPoint ip = manager.createInjectionPoint(field);
validateParameterizedType(ip.getType(), Book.class, String.class);
BeanUtilities.verifyQualifierTypes(ip.getQualifiers(), Monograph.class, Fictional.class);
assertNull(ip.getBean());
assertEquals(field.getJavaMember(), ip.getMember());
assertNotNull(ip.getAnnotated());
assertFalse(ip.isDelegate());
assertTrue(ip.isTransient());
}
@Test
public void testConstructorParameter() {
AnnotatedType<?> type = manager.createAnnotatedType(Library.class);
assertEquals(1, type.getConstructors().size());
AnnotatedConstructor<?> constructor = type.getConstructors().iterator().next();
AnnotatedParameter<?> parameter = constructor.getParameters().get(1);
InjectionPoint ip = manager.createInjectionPoint(parameter);
validateParameterizedType(ip.getType(), Book.class, String.class);
BeanUtilities.verifyQualifierTypes(ip.getQualifiers(), Fictional.class);
assertNull(ip.getBean());
assertEquals(constructor.getJavaMember(), ip.getMember());
assertNotNull(ip.getAnnotated());
assertFalse(ip.isDelegate());
assertFalse(ip.isTransient());
}
@Test
public void testMethodParameter() {
AnnotatedType<?> type = manager.createAnnotatedType(Library.class);
assertEquals(1, type.getMethods().size());
AnnotatedMethod<?> method = type.getMethods().iterator().next();
AnnotatedParameter<?> parameter = method.getParameters().get(2);
InjectionPoint ip = manager.createInjectionPoint(parameter);
validateParameterizedType(ip.getType(), Book.class, Integer.class);
BeanUtilities.verifyQualifierTypes(ip.getQualifiers(), Default.class);
assertNull(ip.getBean());
assertEquals(method.getJavaMember(), ip.getMember());
assertNotNull(ip.getAnnotated());
assertFalse(ip.isDelegate());
assertFalse(ip.isTransient());
}
private static void validateParameterizedType(Type type, Class<?> rawType, Type... types) {
assertTrue(type instanceof ParameterizedType);
ParameterizedType parameterized = (ParameterizedType) type;
assertEquals(rawType, parameterized.getRawType());
assertTrue(Arrays.equals(types, parameterized.getActualTypeArguments()));
}
}
|
{
"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.
-->
<resources>
<string name="playstore_tagline">دستیار شما برای پیمایش I/O، چه بهصورت حضوری شرکت داشته باشید چه از راه دور.</string>
<string name="playstore_change">بهروزرسانیشده برای Google I/O 2018\n• رزرو صندلی برای رویدادها جلوتر از زمانبندی\n• مطالعه اطلاعات مهم درباره «رویداد»، جزئیات «سفر» و سوالات متداول.</string>
<string name="playstore_required_permissions">مجوزهای لازم</string>
<string name="playstore_optional_permissions">مجوزهای اختیاری</string>
<string name="playstore_permission_location_information">اطلاعات مکان: برای نشان دادن نقشه محل برگزاری در اطراف مکان کاربر نیاز است.</string>
</resources>
|
{
"pile_set_name": "Github"
}
|
/*******************************************************************************
* Copyright (c) 2017, 2018 GK Software AG, and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Stephan Herrmann - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.core.tests.compiler.regression;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.tests.util.Util;
import org.eclipse.jdt.internal.compiler.CompilationResult;
import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
import org.eclipse.jdt.internal.compiler.batch.BasicModule;
import org.eclipse.jdt.internal.compiler.batch.CompilationUnit;
import org.eclipse.jdt.internal.compiler.batch.FileSystem;
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.eclipse.jdt.internal.compiler.env.IModule;
import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.lookup.TypeConstants;
import org.eclipse.jdt.internal.compiler.parser.Parser;
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
public class AbstractRegressionTest9 extends AbstractRegressionTest {
public AbstractRegressionTest9(String name) {
super(name);
}
protected Map<String,IModule> moduleMap = new HashMap<>(); // by name
protected Map<String,String> file2module = new HashMap<>();
@Override
protected void tearDown() throws Exception {
super.tearDown();
this.moduleMap.clear();
this.file2module.clear();
DefaultJavaRuntimeEnvironment.cleanUpDefaultJreClassLibs();
}
@Override
protected INameEnvironment getNameEnvironment(final String[] testFiles, String[] classPaths) {
this.classpaths = classPaths == null ? getDefaultClassPaths() : classPaths;
INameEnvironment[] classLibs = getClassLibs(classPaths == null);
for (INameEnvironment nameEnvironment : classLibs) {
((FileSystem) nameEnvironment).scanForModules(createParser());
}
return new InMemoryNameEnvironment9(testFiles, this.moduleMap, classLibs);
}
@Override
protected CompilationUnit[] getCompilationUnits(String[] testFiles) {
Map<String,char[]> moduleFiles= new HashMap<>(); // filename -> modulename
CompilationUnit[] compilationUnits = Util.compilationUnits(testFiles);
// scan for all module-info.java:
for (int i = 0; i < testFiles.length; i+=2) {
IModule module = extractModuleDesc(testFiles[i], testFiles[i+1], compilationUnits[i/2]);
if (module != null) {
this.moduleMap.put(String.valueOf(module.name()), module);
moduleFiles.put(testFiles[0], module.name());
}
}
// record module information in CUs:
for (int i = 0; i < compilationUnits.length; i++) {
char[] fileName = compilationUnits[i].getFileName();
String fileNameString = String.valueOf(compilationUnits[i].getFileName());
if (CharOperation.endsWith(fileName, TypeConstants.MODULE_INFO_FILE_NAME)) {
compilationUnits[i].module = moduleFiles.get(fileNameString);
} else {
String modName = this.file2module.get(fileNameString.replace(File.separator, "/"));
if (modName != null) {
compilationUnits[i].module = modName.toCharArray();
}
}
}
return compilationUnits;
}
/**
* javac cannot leverage our internal map {@code file2module}, so we better
* neatly place each file into a sub directory matching the module name.
*/
protected String expandFileNameForJavac(String fileName) {
String fileNameAsKey = fileName.replace(File.separator, "/");
if (this.file2module != null && this.file2module.containsKey(fileNameAsKey)) {
fileName = new String(this.file2module.get(fileNameAsKey))+File.separator+fileName;
}
return fileName;
}
private IModule extractModuleDesc(String fileName, String fileContent, ICompilationUnit cu) {
if (fileName.toLowerCase().endsWith(IModule.MODULE_INFO_JAVA)) {
Parser parser = createParser();
CompilationResult compilationResult = new CompilationResult(cu, 0, 1, 10);
CompilationUnitDeclaration unit = parser.parse(cu, compilationResult);
if (unit.isModuleInfo() && unit.moduleDeclaration != null) {
return new BasicModule(unit.moduleDeclaration, null);
}
}
return null;
}
private Parser createParser() {
Map<String,String> opts = new HashMap<String, String>();
opts.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_9);
return new Parser(
new ProblemReporter(getErrorHandlingPolicy(), new CompilerOptions(opts), getProblemFactory()),
false);
}
// ------------------------------------------------------
/** Use in tests to associate the CU in given files to the module of the given name. */
public void associateToModule(String moduleName, String... fileNames) {
for (String fileName : fileNames)
this.file2module.put(fileName, moduleName);
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0"?>
<simulation>
<project id="qmc_short_kspace_4_4" series="0">
<application name="qmcapp" role="molecu" class="serial" version="1.0"/>
</project>
<qmcsystem>
<simulationcell>
<parameter name="lattice" units="bohr">
3.37316115 3.37316115 0.00000000
0.00000000 3.37316115 3.37316115
3.37316115 0.00000000 3.37316115
</parameter>
<parameter name="bconds">
p p p
</parameter>
<parameter name="LR_dim_cutoff" > 15 </parameter>
</simulationcell>
<particleset name="e" random="yes">
<group name="u" size="4" mass="1.0">
<parameter name="charge" > -1 </parameter>
<parameter name="mass" > 1.0 </parameter>
</group>
<group name="d" size="4" mass="1.0">
<parameter name="charge" > -1 </parameter>
<parameter name="mass" > 1.0 </parameter>
</group>
</particleset>
<particleset name="ion0">
<group name="C" size="2" mass="21894.7135906">
<parameter name="charge" > 4 </parameter>
<parameter name="valence" > 4 </parameter>
<parameter name="atomicnumber" > 6 </parameter>
<parameter name="mass" > 21894.7135906 </parameter>
<attrib name="position" datatype="posArray" condition="0">
0.00000000 0.00000000 0.00000000
1.68658058 1.68658058 1.68658058
</attrib>
</group>
</particleset>
<wavefunction name="psi0" target="e">
<determinantset type="einspline" href="pwscf.pwscf.h5" tilematrix="1 0 0 0 1 0 0 0 1" twistnum="0" source="ion0" meshfactor="1.0" precision="float">
<slaterdeterminant>
<determinant id="updet" size="4">
<occupation mode="ground" spindataset="0"/>
</determinant>
<determinant id="downdet" size="4">
<occupation mode="ground" spindataset="0"/>
</determinant>
</slaterdeterminant>
</determinantset>
<jastrow type="One-Body" name="J1" function="bspline" source="ion0" print="yes">
<correlation elementType="C" size="8" cusp="0.0">
<coefficients id="eC" type="Array">
-0.3172516203 -0.2714551466 -0.2368308755 -0.1959509965 -0.149673524 -0.1006788799
-0.05799436967 -0.02665568718
</coefficients>
</correlation>
</jastrow>
<jastrow type="Two-Body" name="J2" function="bspline" print="yes">
<correlation speciesA="u" speciesB="u" size="8">
<coefficients id="uu" type="Array">
0.1565069657 0.09355554336 0.05545579912 0.03036465466 0.01435568497 0.006079234192
0.002239268468 0.0004061168885
</coefficients>
</correlation>
<correlation speciesA="u" speciesB="d" size="8">
<coefficients id="ud" type="Array">
0.3471853819 0.2358509257 0.1524282487 0.09492328518 0.05658982415 0.03179902398
0.01573872491 0.006318590212
</coefficients>
</correlation>
</jastrow>
<jastrow type="kSpace" name="Jk" source="ion0">
<correlation kc="4.0" type="One-Body" symmetry="cystal">
<coefficients id="cG1" type="Array">
0.1677864259 0.07820325644 -0.6566847458 -0.02628407681 -0.07400038353
0.01567881686 0.03340956598 -0.02233451109
</coefficients>
</correlation>
<correlation kc="4.0" type="Two-Body" symmetry="crystal">
<coefficients id="cG2" type="Array">
-0.7187512443 -0.4334973599 -0.04630107772 -0.01242607163 0.00287093506
-0.003361327138
</coefficients>
</correlation>
</jastrow>
</wavefunction>
<hamiltonian name="h0" type="generic" target="e">
<pairpot type="coulomb" name="ElecElec" source="e" target="e"/>
<pairpot type="coulomb" name="IonIon" source="ion0" target="ion0"/>
<pairpot type="pseudo" name="PseudoPot" source="ion0" wavefunction="psi0" format="xml">
<pseudo elementType="C" href="C.BFD.xml"/>
</pairpot>
<estimator type="flux" name="Flux"/>
</hamiltonian>
</qmcsystem>
<qmc method="vmc" move="pbyp">
<estimator name="LocalEnergy" hdf5="no"/>
<parameter name="walkers" > 1 </parameter>
<parameter name="blocks" > 1000 </parameter>
<parameter name="steps" > 8.0 </parameter>
<parameter name="subSteps" > 2 </parameter>
<parameter name="timestep" > 0.3 </parameter>
<parameter name="warmupSteps" > 100 </parameter>
</qmc>
</simulation>
|
{
"pile_set_name": "Github"
}
|
msgid ""
msgstr ""
"Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2020-05-21 12:08+0000\n"
"Last-Translator: \n"
"Language-Team: Afrikaans\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: redgettext 3.1\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Crowdin-Project: red-discordbot\n"
"X-Crowdin-Project-ID: 289505\n"
"X-Crowdin-Language: af\n"
"X-Crowdin-File-ID: 51\n"
"Language: af_ZA\n"
#: redbot/cogs/audio/converters.py:33
msgid "\\nScope must be a valid version of one of the following:\\n Global\\n Guild\\n User\\n"
msgstr ""
#: redbot/cogs/audio/converters.py:41
msgid "\\nAuthor must be a valid version of one of the following:\\n User ID\\n User Mention\\n User Name#123\\n"
msgstr ""
#: redbot/cogs/audio/converters.py:49
msgid "\\nGuild must be a valid version of one of the following:\\n Guild ID\\n Exact guild name\\n"
msgstr ""
#: redbot/cogs/audio/converters.py:85
msgid "\\\"{arg}\\\" was not found. It must be the ID or complete name of a server which the bot can see."
msgstr ""
#: redbot/cogs/audio/converters.py:94
msgid "\\\"{arg}\\\" does not refer to a unique server. Please use the ID for the server you're trying to specify."
msgstr ""
#: redbot/cogs/audio/converters.py:125
msgid "\\\"{arg}\\\" was not found. It must be the ID or name or mention a user which the bot can see."
msgstr ""
#: redbot/cogs/audio/converters.py:134
msgid "\\\"{arg}\\\" does not refer to a unique server. Please use the ID for the server you're trying to specify."
msgstr ""
#: redbot/cogs/audio/converters.py:174
msgid "Could not match '{}' to a playlist."
msgstr ""
#: redbot/cogs/audio/converters.py:239 redbot/cogs/audio/converters.py:261
#: redbot/cogs/audio/converters.py:281 redbot/cogs/audio/converters.py:366
#: redbot/cogs/audio/converters.py:378 redbot/cogs/audio/converters.py:403
#: redbot/cogs/audio/converters.py:429 redbot/cogs/audio/converters.py:451
#: redbot/cogs/audio/converters.py:478
msgid "Nothing"
msgstr ""
#: redbot/cogs/audio/converters.py:259
msgid "You cannot use `--guild`"
msgstr ""
#: redbot/cogs/audio/converters.py:400
msgid "You cannot use `--to-server`"
msgstr ""
#: redbot/cogs/audio/converters.py:426
msgid "You cannot use `--from-server`"
msgstr ""
|
{
"pile_set_name": "Github"
}
|
/*
* HA-JDBC: High-Availability JDBC
* Copyright (C) 2013 Paul Ferraro
*
* 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, see <http://www.gnu.org/licenses/>.
*/
package net.sf.hajdbc.sql.io;
import java.io.IOException;
import java.io.OutputStream;
import net.sf.hajdbc.Database;
import net.sf.hajdbc.invocation.InvocationStrategies;
import net.sf.hajdbc.invocation.Invoker;
/**
* Static proxy for OutputStreams
* @author Paul Ferraro
* @param <Z> connection source
* @param <D> database
* @param <P> parent type
*/
public class OutputStreamProxy<Z, D extends Database<Z>, P> extends OutputStream
{
private final OutputStreamProxyFactory<Z, D, P> factory;
public OutputStreamProxy(OutputStreamProxyFactory<Z, D, P> factory)
{
this.factory = factory;
}
@Override
public void write(final byte[] b, final int off, final int len) throws IOException
{
OutputStreamInvoker<Z, D> invoker = new OutputStreamInvoker<Z, D>()
{
@Override
public Void invoke(D database, OutputStream output) throws IOException
{
output.write(b, off, len);
return null;
}
};
InvocationStrategies.INVOKE_ON_EXISTING.invoke(this.factory, invoker);
this.factory.record(invoker);
}
@Override
public void write(final byte[] b) throws IOException
{
OutputStreamInvoker<Z, D> invoker = new OutputStreamInvoker<Z, D>()
{
@Override
public Void invoke(D database, OutputStream output) throws IOException
{
output.write(b);
return null;
}
};
InvocationStrategies.INVOKE_ON_EXISTING.invoke(this.factory, invoker);
this.factory.record(invoker);
}
@Override
public void write(final int b) throws IOException
{
OutputStreamInvoker<Z, D> invoker = new OutputStreamInvoker<Z, D>()
{
@Override
public Void invoke(D database, OutputStream output) throws IOException
{
output.write(b);
return null;
}
};
InvocationStrategies.INVOKE_ON_EXISTING.invoke(this.factory, invoker);
this.factory.record(invoker);
}
@Override
public void flush() throws IOException
{
OutputStreamInvoker<Z, D> invoker = new OutputStreamInvoker<Z, D>()
{
@Override
public Void invoke(D database, OutputStream output) throws IOException
{
output.flush();
return null;
}
};
InvocationStrategies.INVOKE_ON_EXISTING.invoke(this.factory, invoker);
this.factory.record(invoker);
}
@Override
public void close() throws IOException
{
OutputStreamInvoker<Z, D> invoker = new OutputStreamInvoker<Z, D>()
{
@Override
public Void invoke(D database, OutputStream output) throws IOException
{
output.close();
return null;
}
};
InvocationStrategies.INVOKE_ON_EXISTING.invoke(this.factory, invoker);
this.factory.remove();
}
private interface OutputStreamInvoker<Z, D extends Database<Z>> extends Invoker<Z, D, OutputStream, Void, IOException>
{
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>shiro-example</artifactId>
<groupId>com.github.zhangkaitao</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>shiro-example-chapter6</artifactId>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.25</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>0.2.23</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>2.6.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.0.0.RELEASE</version>
</dependency>
</dependencies>
</project>
|
{
"pile_set_name": "Github"
}
|
package me.saket.dank.ui.submission;
import me.saket.dank.ui.submission.events.SubmissionChangeCommentSortClicked;
import me.saket.dank.utils.DankSubmissionRequest;
interface SubmissionUi {
void showProgress();
void hideProgress();
void acceptRequest(DankSubmissionRequest lastRequest);
void showChangeSortPopup(SubmissionChangeCommentSortClicked event, DankSubmissionRequest activeRequest);
}
|
{
"pile_set_name": "Github"
}
|
/*******************************************************************************
* Copyright (c) 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.ws.jca.utils.metagen.internal;
import java.io.File;
import com.ibm.websphere.ras.annotation.Trivial;
import com.ibm.ws.jca.utils.xml.ra.RaConnector;
import com.ibm.ws.jca.utils.xml.wlp.ra.WlpRaConnector;
/**
* Used to hold RAR, ra.xml, wlp-ra.xml, and so on files for
* a generator instance.
*/
@Trivial
public class XmlFileSet {
public File rarFile;
public File raXmlFile;
public File wlpRaXmlFile;
public RaConnector parsedXml;
public WlpRaConnector parsedWlpXml;
public String rarRaXmlFilePath;
public String rarWlpRaXmlFilePath;
@Override
public String toString() {
StringBuilder sb = new StringBuilder("XmlFileSet{");
if (rarFile != null)
sb.append("rarFile='").append(rarFile.getAbsolutePath()).append("' ");
if (raXmlFile != null)
sb.append("raXmlFile='").append(raXmlFile.getAbsolutePath()).append("' ");
if (wlpRaXmlFile != null)
sb.append("wlpRaXmlFile='").append(wlpRaXmlFile.getAbsolutePath()).append("' ");
if (rarRaXmlFilePath != null)
sb.append("rarRaXmlFilePath='").append(rarRaXmlFilePath).append("' ");
if (rarWlpRaXmlFilePath != null)
sb.append("wlpRaXmlFilePath='").append(rarWlpRaXmlFilePath).append("'");
sb.append('}');
return sb.toString();
}
}
|
{
"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.
//
////////////////////////////////////////////////////////////////////////////////
{
"config": "royale",
"compilerOptions": {
"debug": false,
"targets": ["JSRoyale"],
"source-map": true,
"html-template": "src/main/resources/jewel-example-index-template.html",
"theme": "${royalelib}/themes/Jewel-Light-NoFlat-Primary-Blue-Theme/src/main/resources/defaults.css"
},
"additionalOptions": "-remove-circulars -js-output-optimization=skipAsCoercions",
"files":
[
"src/main/royale/BE0007_Selecting_options_from_a_group_of_jewel_checkbox_controls.mxml"
]
}
|
{
"pile_set_name": "Github"
}
|
package sacloud
// CDROM ISOイメージ(CDROM)
type CDROM struct {
*Resource // ID
propName // 名称
propDescription // 説明
propAvailability // 有功状態
propSizeMB // サイズ(MB単位)
propScope // スコープ
propServiceClass // サービスクラス
propStorageClass // ストレージクラス
propStorage // ストレージ
propIcon // アイコン
propTags // タグ
propCreatedAt // 作成日時
}
|
{
"pile_set_name": "Github"
}
|
import java.util.Objects;
/**
* 学生类
*
* @author fraser
* @date 2019/12/16 9:34 PM
*/
public class Student {
private String name;
private int age;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Student student = (Student) o;
return age == student.age &&
Objects.equals(name, student.name);
}
@Override
public int hashCode() {
return Objects.hash(name, age);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "//www.w3.org/TR/html4/strict.dtd">
<HTML style="overflow:auto;">
<HEAD>
<meta name="generator" content="JDiff v1.1.0">
<!-- Generated by the JDiff Javadoc doclet -->
<!-- (http://www.jdiff.org) -->
<meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared.">
<meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet">
<TITLE>
android.media.tv.TvInputInfo
</TITLE>
<link href="../../../../assets/android-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="../stylesheet-jdiff.css" rel="stylesheet" type="text/css" />
<noscript>
<style type="text/css">
body{overflow:auto;}
#body-content{position:relative; top:0;}
#doc-content{overflow:visible;border-left:3px solid #666;}
#side-nav{padding:0;}
#side-nav .toggle-list ul {display:block;}
#resize-packages-nav{border-bottom:3px solid #666;}
</style>
</noscript>
<style type="text/css">
</style>
</HEAD>
<BODY>
<!-- Start of nav bar -->
<a name="top"></a>
<div id="header" style="margin-bottom:0;padding-bottom:0;">
<div id="headerLeft">
<a href="../../../../index.html" tabindex="-1" target="_top"><img src="../../../../assets/images/bg_logo.png" alt="Android Developers" /></a>
</div>
<div id="headerRight">
<div id="headerLinks">
<!-- <img src="/assets/images/icon_world.jpg" alt="" /> -->
<span class="text">
<!-- <a href="#">English</a> | -->
<nobr><a href="//developer.android.com" target="_top">Android Developers</a> | <a href="//www.android.com" target="_top">Android.com</a></nobr>
</span>
</div>
<div class="and-diff-id" style="margin-top:6px;margin-right:8px;">
<table class="diffspectable">
<tr>
<td colspan="2" class="diffspechead">API Diff Specification</td>
</tr>
<tr>
<td class="diffspec" style="padding-top:.25em">To Level:</td>
<td class="diffvaluenew" style="padding-top:.25em">24</td>
</tr>
<tr>
<td class="diffspec">From Level:</td>
<td class="diffvalueold">23</td>
</tr>
<tr>
<td class="diffspec">Generated</td>
<td class="diffvalue">2016.06.13 13:31</td>
</tr>
</table>
</div><!-- End and-diff-id -->
<div class="and-diff-id" style="margin-right:8px;">
<table class="diffspectable">
<tr>
<td class="diffspec" colspan="2"><a href="jdiff_statistics.html">Statistics</a>
</tr>
</table>
</div> <!-- End and-diff-id -->
</div> <!-- End headerRight -->
</div> <!-- End header -->
<div id="body-content" xstyle="padding:12px;padding-right:18px;">
<div id="doc-content" style="position:relative;">
<div id="mainBodyFluid">
<H2>
Class android.media.tv.<A HREF="../../../../reference/android/media/tv/TvInputInfo.html" target="_top"><font size="+2"><code>TvInputInfo</code></font></A>
</H2>
<a NAME="constructors"></a>
<a NAME="methods"></a>
<p>
<a NAME="Added"></a>
<TABLE summary="Added Methods" WIDTH="100%">
<TR>
<TH VALIGN="TOP" COLSPAN=2>Added Methods</FONT></TD>
</TH>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.media.tv.TvInputInfo.canRecord_added()"></A>
<nobr><code>boolean</code> <A HREF="../../../../reference/android/media/tv/TvInputInfo.html#canRecord()" target="_top"><code>canRecord</code></A>()</nobr>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.media.tv.TvInputInfo.getExtras_added()"></A>
<nobr><code>Bundle</code> <A HREF="../../../../reference/android/media/tv/TvInputInfo.html#getExtras()" target="_top"><code>getExtras</code></A>()</nobr>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.media.tv.TvInputInfo.getTunerCount_added()"></A>
<nobr><code>int</code> <A HREF="../../../../reference/android/media/tv/TvInputInfo.html#getTunerCount()" target="_top"><code>getTunerCount</code></A>()</nobr>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.media.tv.TvInputInfo.isHidden_added(android.content.Context)"></A>
<nobr><code>boolean</code> <A HREF="../../../../reference/android/media/tv/TvInputInfo.html#isHidden(android.content.Context)" target="_top"><code>isHidden</code></A>(<code>Context</code>)</nobr>
</TD>
<TD> </TD>
</TR>
<TR BGCOLOR="#FFFFFF" CLASS="TableRowColor">
<TD VALIGN="TOP" WIDTH="25%">
<A NAME="android.media.tv.TvInputInfo.loadCustomLabel_added(android.content.Context)"></A>
<nobr><code>CharSequence</code> <A HREF="../../../../reference/android/media/tv/TvInputInfo.html#loadCustomLabel(android.content.Context)" target="_top"><code>loadCustomLabel</code></A>(<code>Context</code>)</nobr>
</TD>
<TD> </TD>
</TR>
</TABLE>
<a NAME="fields"></a>
</div>
<div id="footer">
<div id="copyright">
Except as noted, this content is licensed under
<a href="//creativecommons.org/licenses/by/2.5/"> Creative Commons Attribution 2.5</a>.
For details and restrictions, see the <a href="/license.html">Content License</a>.
</div>
<div id="footerlinks">
<p>
<a href="//www.android.com/terms.html">Site Terms of Service</a> -
<a href="//www.android.com/privacy.html">Privacy Policy</a> -
<a href="//www.android.com/branding.html">Brand Guidelines</a>
</p>
</div>
</div> <!-- end footer -->
</div><!-- end doc-content -->
</div> <!-- end body-content -->
<script src="//www.google-analytics.com/ga.js" type="text/javascript">
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-5831155-1");
pageTracker._setAllowAnchor(true);
pageTracker._initData();
pageTracker._trackPageview();
} catch(e) {}
</script>
</BODY>
</HTML>
|
{
"pile_set_name": "Github"
}
|
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tile_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="@dimen/half_margin"
android:background="@drawable/bg_rounded_rec"
android:gravity="center"
android:padding="@dimen/single_margin"
android:textSize="@dimen/large_text"
android:textStyle="bold"
tools:test="8" />
|
{
"pile_set_name": "Github"
}
|
package nucleus.example.util.adapters;
import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;
import java.util.Collections;
import java.util.List;
import static java.util.Arrays.asList;
public abstract class BaseRecyclerViewAdapter extends RecyclerView.Adapter<BaseViewHolder> {
private final List<ViewHolderType> types;
public BaseRecyclerViewAdapter(ViewHolderType... types) {
this.types = Collections.unmodifiableList(asList(types));
}
protected abstract List<?> getItems();
@Override
public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return types.get(viewType).create(parent);
}
@Override
public void onBindViewHolder(BaseViewHolder holder, int position) {
holder.bind(getItems().get(position));
}
@Override
public int getItemViewType(int position) {
Object item = getItems().get(position);
for (int t = 0, size = types.size(); t < size; t++) {
if (types.get(t).isOfItem(item))
return t;
}
throw new IllegalStateException("No view holder is registered for item: " + item + " at position: " + position);
}
@Override
public int getItemCount() {
return getItems().size();
}
}
|
{
"pile_set_name": "Github"
}
|
/*******************************************************************************
* Copyright (c) 2013-2015 Sierra Wireless and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v20.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.html.
*
* Contributors:
* Sierra Wireless - initial API and implementation
*******************************************************************************/
package org.eclipse.leshan.server.demo.servlet.json;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.leshan.core.node.LwM2mMultipleResource;
import org.eclipse.leshan.core.node.LwM2mNode;
import org.eclipse.leshan.core.node.LwM2mObject;
import org.eclipse.leshan.core.node.LwM2mObjectInstance;
import org.eclipse.leshan.core.node.LwM2mResource;
import org.eclipse.leshan.core.node.LwM2mSingleResource;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.JsonPrimitive;
public class LwM2mNodeDeserializer implements JsonDeserializer<LwM2mNode> {
@Override
public LwM2mNode deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
throws JsonParseException {
if (json == null) {
return null;
}
LwM2mNode node;
if (json.isJsonObject()) {
JsonObject object = (JsonObject) json;
Integer id = null;
if (object.has("id")) {
id = object.get("id").getAsInt();
}
if (object.has("instances")) {
if (id == null) {
throw new JsonParseException("Missing id");
}
JsonArray array = object.get("instances").getAsJsonArray();
LwM2mObjectInstance[] instances = new LwM2mObjectInstance[array.size()];
for (int i = 0; i < array.size(); i++) {
instances[i] = context.deserialize(array.get(i), LwM2mNode.class);
}
node = new LwM2mObject(id, instances);
} else if (object.has("resources")) {
JsonArray array = object.get("resources").getAsJsonArray();
LwM2mResource[] resources = new LwM2mResource[array.size()];
for (int i = 0; i < array.size(); i++) {
resources[i] = context.deserialize(array.get(i), LwM2mNode.class);
}
if (id == null) {
node = new LwM2mObjectInstance(Arrays.asList(resources));
} else {
node = new LwM2mObjectInstance(id, resources);
}
} else if (object.has("value")) {
if (id == null) {
throw new JsonParseException("Missing id");
}
// single value resource
JsonPrimitive val = object.get("value").getAsJsonPrimitive();
org.eclipse.leshan.core.model.ResourceModel.Type expectedType = getTypeFor(val);
node = LwM2mSingleResource.newResource(id, deserializeValue(val, expectedType), expectedType);
} else if (object.has("values")) {
if (id == null) {
throw new JsonParseException("Missing id");
}
// multi-instances resource
Map<Integer, Object> values = new HashMap<>();
org.eclipse.leshan.core.model.ResourceModel.Type expectedType = null;
for (Entry<String, JsonElement> entry : object.get("values").getAsJsonObject().entrySet()) {
JsonPrimitive pval = entry.getValue().getAsJsonPrimitive();
expectedType = getTypeFor(pval);
values.put(Integer.valueOf(entry.getKey()), deserializeValue(pval, expectedType));
}
// use string by default;
if (expectedType == null)
expectedType = org.eclipse.leshan.core.model.ResourceModel.Type.STRING;
node = LwM2mMultipleResource.newResource(id, values, expectedType);
} else {
throw new JsonParseException("Invalid node element");
}
} else {
throw new JsonParseException("Invalid node element");
}
return node;
}
private org.eclipse.leshan.core.model.ResourceModel.Type getTypeFor(JsonPrimitive val) {
if (val.isBoolean())
return org.eclipse.leshan.core.model.ResourceModel.Type.BOOLEAN;
if (val.isString())
return org.eclipse.leshan.core.model.ResourceModel.Type.STRING;
if (val.isNumber()) {
if (val.getAsDouble() == val.getAsLong()) {
return org.eclipse.leshan.core.model.ResourceModel.Type.INTEGER;
} else {
return org.eclipse.leshan.core.model.ResourceModel.Type.FLOAT;
}
}
// use string as default value
return org.eclipse.leshan.core.model.ResourceModel.Type.STRING;
}
private Object deserializeValue(JsonPrimitive val, org.eclipse.leshan.core.model.ResourceModel.Type expectedType) {
switch (expectedType) {
case BOOLEAN:
return val.getAsBoolean();
case STRING:
return val.getAsString();
case INTEGER:
return val.getAsLong();
case FLOAT:
return val.getAsDouble();
case TIME:
case OPAQUE:
default:
// TODO we need to better handle this.
return val.getAsString();
}
}
}
|
{
"pile_set_name": "Github"
}
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.6-b27-fcs
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.06.11 at 10:33:54 AM PDT
//
package com.sun.identity.liberty.ws.common.jaxb.ac;
/**
* Java content class for KeySharingType complex type.
* <p>The following schema fragment specifies the expected content contained within this java content object. (defined at file:/Users/allan/A-SVN/trunk/opensso/products/federation/library/xsd/liberty/lib-arch-authentication-context.xsd line 590)
* <p>
* <pre>
* <complexType name="KeySharingType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <attribute name="sharing" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*/
public interface KeySharingType {
/**
* Gets the value of the sharing property.
*
*/
boolean isSharing();
/**
* Sets the value of the sharing property.
*
*/
void setSharing(boolean value);
}
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright © 2019 同程艺龙 (zhihui.li@ly.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
*
*/
package com.ly.train.flower.registry;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import com.ly.train.flower.common.core.config.FlowConfig;
import com.ly.train.flower.common.logging.Logger;
import com.ly.train.flower.common.logging.LoggerFactory;
import com.ly.train.flower.common.util.StringUtil;
import com.ly.train.flower.common.util.URL;
import com.ly.train.flower.common.util.concurrent.NamedThreadFactory;
import com.ly.train.flower.registry.config.ServiceInfo;
/**
* @author leeyazhou
*
*/
public abstract class AbstractRegistry implements Registry {
protected final Logger logger = LoggerFactory.getLogger(getClass());
protected final ConcurrentMap<String, ServiceInfo> serviceInfoCache = new ConcurrentHashMap<>();
protected final ConcurrentMap<String, FlowConfig> flowConfigCache = new ConcurrentHashMap<>();
private static final ScheduledExecutorService executorService =
Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("flower-registry"));
protected final String infoRoot = "flower:info";
protected final String configRoot = "flower:config";
protected final URL url;
public AbstractRegistry(URL url) {
this.url = url;
executorService.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
try {
doRegisterServiceInfos();
List<ServiceInfo> tt = doGetProvider(null);
if (tt != null && !tt.isEmpty()) {
for (ServiceInfo info : tt) {
serviceInfoCache.put(info.getServiceMeta().getServiceClassName(), info);
}
}
List<FlowConfig> t2 = doGetFlowConfig(null);
if (t2 != null && !t2.isEmpty()) {
for (FlowConfig info : t2) {
if (StringUtil.isNotBlank(info.getFlowName())) {
flowConfigCache.put(info.getFlowName(), info);
}
}
}
} catch (Exception e) {
logger.error("", e);
}
}
}, 5L, 3L, TimeUnit.SECONDS);
}
@Override
public boolean register(ServiceInfo serviceInfo) {
serviceInfoCache.putIfAbsent(serviceInfo.getServiceMeta().getServiceClassName(), serviceInfo);
return doRegister(serviceInfo);
}
@Override
public List<ServiceInfo> getProvider(ServiceInfo serviceInfo) {
List<ServiceInfo> ret = doGetProvider(serviceInfo);
if (ret != null) {
for (ServiceInfo i : ret) {
serviceInfoCache.put(i.getServiceMeta().getServiceClassName(), i);
}
}
return new ArrayList<ServiceInfo>(serviceInfoCache.values());
}
private void doRegisterServiceInfos() {
for (Map.Entry<String, ServiceInfo> entry : serviceInfoCache.entrySet()) {
doRegister(entry.getValue());
}
}
@Override
public URL getUrl() {
return url;
}
@Override
public boolean registerFlowConfig(FlowConfig flowConfig) {
flowConfigCache.put(flowConfig.getFlowName(), flowConfig);
return doRegisterFlowConfig(flowConfig);
}
@Override
public List<FlowConfig> getFlowConfig(FlowConfig flowConfig) {
List<FlowConfig> ret = doGetFlowConfig(flowConfig);
if (ret != null) {
for (FlowConfig i : ret) {
if (StringUtil.isNotBlank(i.getFlowName())) {
flowConfigCache.put(i.getFlowName(), i);
}
}
}
return new ArrayList<FlowConfig>(flowConfigCache.values());
}
public abstract boolean doRegister(ServiceInfo serviceInfo);
public abstract List<ServiceInfo> doGetProvider(ServiceInfo serviceInfo);
public abstract boolean doRegisterFlowConfig(FlowConfig flowConfig);
public abstract List<FlowConfig> doGetFlowConfig(FlowConfig flowConfig);
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0"?>
<!--
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.
-->
<configuration>
<property>
<name>mapreduce.job.split.metainfo.maxsize</name>
<value>-1</value>
<description>The maximum permissible size of the split metainfo file.
The JobTracker won't attempt to read split metainfo files bigger than
the configured value. No limits if set to -1.
</description>
</property>
<property>
<name>mapreduce.map.maxattempts</name>
<value>2</value>
</property>
<property>
<name>mapreduce.map.output.compress</name>
<value>true</value>
<description>Compress map outputs</description>
</property>
<property>
<name>mapreduce.map.output.compress.codec</name>
<value>org.apache.hadoop.io.compress.SnappyCodec</value>
<description>The compression codec to use for map outputs
</description>
</property>
<property>
<name>mapreduce.output.fileoutputformat.compress</name>
<value>true</value>
<description>Compress the output of a MapReduce job</description>
</property>
<property>
<name>mapreduce.output.fileoutputformat.compress.codec</name>
<value>org.apache.hadoop.io.compress.SnappyCodec</value>
<description>The compression codec to use for job outputs
</description>
</property>
<!--
<property>
<name>mapreduce.output.fileoutputformat.compress.type</name>
<value>BLOCK</value>
<description>The compression type to use for job outputs</description>
</property>
-->
<property>
<name>mapreduce.job.max.split.locations</name>
<value>2000</value>
<description>No description</description>
</property>
<property>
<name>dfs.replication</name>
<value>2</value>
<description>Block replication</description>
</property>
<!-- memory configuration for sandbox -->
<property>
<name>mapreduce.map.memory.mb</name>
<value>384</value>
</property>
<property>
<name>mapreduce.map.java.opts</name>
<value>-Xmx350m</value>
</property>
<property>
<name>mapreduce.task.io.sort.mb</name>
<value>30</value>
</property>
<property>
<name>mapreduce.reduce.memory.mb</name>
<value>384</value>
</property>
<property>
<name>mapreduce.reduce.java.opts</name>
<value>-Xmx350m</value>
</property>
</configuration>
|
{
"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.flink.table.codegen.calls
import org.apache.flink.api.common.typeinfo.TypeInformation
import org.apache.flink.table.codegen.CodeGenUtils._
import org.apache.flink.table.codegen.{CodeGenerator, GeneratedExpression}
import org.apache.flink.table.typeutils.TypeCheckUtils
trait CallGenerator {
def generate(
codeGenerator: CodeGenerator,
operands: Seq[GeneratedExpression])
: GeneratedExpression
}
object CallGenerator {
/**
* Generates a call with a single result statement.
*/
def generateCallIfArgsNotNull(
nullCheck: Boolean,
returnType: TypeInformation[_],
operands: Seq[GeneratedExpression])
(call: (Seq[String]) => String)
: GeneratedExpression = {
generateCallWithStmtIfArgsNotNull(nullCheck, returnType, operands) {
(terms) => (None, call(terms))
}
}
/**
* Generates a call with auxiliary statements and result expression.
*/
def generateCallWithStmtIfArgsNotNull(
nullCheck: Boolean,
returnType: TypeInformation[_],
operands: Seq[GeneratedExpression])
(call: (Seq[String]) => (Option[String], String))
: GeneratedExpression = {
val resultTerm = newName("result")
val nullTerm = newName("isNull")
val resultTypeTerm = primitiveTypeTermForTypeInfo(returnType)
val defaultValue = primitiveDefaultValue(returnType)
val (auxiliaryStmt, result) = call(operands.map(_.resultTerm))
val nullTermCode = if (
nullCheck &&
isReference(returnType) &&
!TypeCheckUtils.isTemporal(returnType)) {
s"""
|$nullTerm = ($resultTerm == null);
""".stripMargin
} else {
""
}
val resultCode = if (nullCheck && operands.nonEmpty) {
s"""
|${operands.map(_.code).mkString("\n")}
|boolean $nullTerm = ${operands.map(_.nullTerm).mkString(" || ")};
|$resultTypeTerm $resultTerm = $defaultValue;
|if (!$nullTerm) {
| ${auxiliaryStmt.getOrElse("")}
| $resultTerm = $result;
| $nullTermCode
|}
|""".stripMargin
} else if (nullCheck && operands.isEmpty) {
s"""
|${operands.map(_.code).mkString("\n")}
|boolean $nullTerm = false;
|${auxiliaryStmt.getOrElse("")}
|$resultTypeTerm $resultTerm = $result;
|$nullTermCode
|""".stripMargin
} else{
s"""
|boolean $nullTerm = false;
|${operands.map(_.code).mkString("\n")}
|${auxiliaryStmt.getOrElse("")}
|$resultTypeTerm $resultTerm = $result;
|""".stripMargin
}
GeneratedExpression(resultTerm, nullTerm, resultCode, returnType)
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
/* //device/apps/common/assets/res/any/strings.xml
**
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<resources>
<string msgid="735082772341716043" name="fingerprint_acquired_partial">"Odcisk palca został odczytany tylko częściowo. Spróbuj ponownie."</string>
<string msgid="4596546021310923214" name="fingerprint_acquired_insufficient">"Nie udało się przetworzyć odcisku palca. Spróbuj ponownie."</string>
<string msgid="1087209702421076105" name="fingerprint_acquired_imager_dirty">"Czytnik linii papilarnych jest zabrudzony. Wyczyść go i spróbuj ponownie."</string>
<string msgid="6470642383109155969" name="fingerprint_acquired_too_fast">"Palec został podniesiony zbyt wcześnie. Spróbuj jeszcze raz."</string>
<string msgid="59250885689661653" name="fingerprint_acquired_too_slow">"Palec został obrócony zbyt wolno. Spróbuj ponownie."</string>
<string msgid="7955921658939936596" name="fingerprint_error_hw_not_available">"Czytnik linii papilarnych nie jest dostępny."</string>
<string msgid="1055819001126053318" name="fingerprint_error_no_space">"Nie można zapisać odcisku palca. Usuń istniejący odcisk palca."</string>
<string msgid="3927186043737732875" name="fingerprint_error_timeout">"Osiągnięto limit czasu odczytu linii papilarnych. Spróbuj ponownie."</string>
<string msgid="4402024612660774395" name="fingerprint_error_canceled">"Odczyt odcisku palca został anulowany."</string>
<string msgid="5536934748136933450" name="fingerprint_error_lockout">"Zbyt wiele prób. Spróbuj ponownie później."</string>
<string msgid="6107816084103552441" name="fingerprint_error_unable_to_process">"Spróbuj ponownie."</string>
<string msgid="4516019619850763049" name="fingerprints">"Odciski cyfrowe:"</string>
<string name="fingerprint_not_recognized" msgid="2690661881608146617">"Nie rozpoznano odcisku palca."</string>
</resources>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package external.com.android.dx.rop.code;
import external.com.android.dx.rop.type.StdTypeList;
import external.com.android.dx.rop.type.Type;
import external.com.android.dx.rop.type.TypeList;
import external.com.android.dx.util.ToHuman;
/**
* A register-based instruction. An instruction is the combination of
* an opcode (which specifies operation and source/result types), a
* list of actual sources and result registers/values, and additional
* information.
*/
public abstract class Insn implements ToHuman {
/** {@code non-null;} opcode */
private final Rop opcode;
/** {@code non-null;} source position */
private final SourcePosition position;
/** {@code null-ok;} spec for the result of this instruction, if any */
private final RegisterSpec result;
/** {@code non-null;} specs for all the sources of this instruction */
private final RegisterSpecList sources;
/**
* Constructs an instance.
*
* @param opcode {@code non-null;} the opcode
* @param position {@code non-null;} source position
* @param result {@code null-ok;} spec for the result, if any
* @param sources {@code non-null;} specs for all the sources
*/
public Insn(Rop opcode, SourcePosition position, RegisterSpec result,
RegisterSpecList sources) {
if (opcode == null) {
throw new NullPointerException("opcode == null");
}
if (position == null) {
throw new NullPointerException("position == null");
}
if (sources == null) {
throw new NullPointerException("sources == null");
}
this.opcode = opcode;
this.position = position;
this.result = result;
this.sources = sources;
}
/**
* {@inheritDoc}
*
* Instances of this class compare by identity. That is,
* {@code x.equals(y)} is only true if {@code x == y}.
*/
@Override
public final boolean equals(Object other) {
return (this == other);
}
/**
* {@inheritDoc}
*
* This implementation returns the identity hashcode of this
* instance. This is proper, since instances of this class compare
* by identity (see {@link #equals}).
*/
@Override
public final int hashCode() {
return System.identityHashCode(this);
}
/** {@inheritDoc} */
@Override
public String toString() {
return toStringWithInline(getInlineString());
}
/**
* Gets a human-oriented (and slightly lossy) string for this instance.
*
* @return {@code non-null;} the human string form
*/
@Override
public String toHuman() {
return toHumanWithInline(getInlineString());
}
/**
* Gets an "inline" string portion for toHuman(), if available. This
* is the portion that appears after the Rop opcode
*
* @return {@code null-ok;} if non-null, the inline text for toHuman()
*/
public String getInlineString() {
return null;
}
/**
* Gets the opcode.
*
* @return {@code non-null;} the opcode
*/
public final Rop getOpcode() {
return opcode;
}
/**
* Gets the source position.
*
* @return {@code non-null;} the source position
*/
public final SourcePosition getPosition() {
return position;
}
/**
* Gets the result spec, if any. A return value of {@code null}
* means this instruction returns nothing.
*
* @return {@code null-ok;} the result spec, if any
*/
public final RegisterSpec getResult() {
return result;
}
/**
* Gets the spec of a local variable assignment that occurs at this
* instruction, or null if no local variable assignment occurs. This
* may be the result register, or for {@code mark-local} insns
* it may be the source.
*
* @return {@code null-ok;} a named register spec or null
*/
public final RegisterSpec getLocalAssignment() {
RegisterSpec assignment;
if (opcode.getOpcode() == RegOps.MARK_LOCAL) {
assignment = sources.get(0);
} else {
assignment = result;
}
if (assignment == null) {
return null;
}
LocalItem localItem = assignment.getLocalItem();
if (localItem == null) {
return null;
}
return assignment;
}
/**
* Gets the source specs.
*
* @return {@code non-null;} the source specs
*/
public final RegisterSpecList getSources() {
return sources;
}
/**
* Gets whether this instruction can possibly throw an exception. This
* is just a convenient wrapper for {@code getOpcode().canThrow()}.
*
* @return {@code true} iff this instruction can possibly throw
*/
public final boolean canThrow() {
return opcode.canThrow();
}
/**
* Gets the list of possibly-caught exceptions. This returns {@link
* StdTypeList#EMPTY} if this instruction has no handlers,
* which can be <i>either</i> if this instruction can't possibly
* throw or if it merely doesn't handle any of its possible
* exceptions. To determine whether this instruction can throw,
* use {@link #canThrow}.
*
* @return {@code non-null;} the catches list
*/
public abstract TypeList getCatches();
/**
* Calls the appropriate method on the given visitor, depending on the
* class of this instance. Subclasses must override this.
*
* @param visitor {@code non-null;} the visitor to call on
*/
public abstract void accept(Visitor visitor);
/**
* Returns an instance that is just like this one, except that it
* has a catch list with the given item appended to the end. This
* method throws an exception if this instance can't possibly
* throw. To determine whether this instruction can throw, use
* {@link #canThrow}.
*
* @param type {@code non-null;} type to append to the catch list
* @return {@code non-null;} an appropriately-constructed instance
*/
public abstract Insn withAddedCatch(Type type);
/**
* Returns an instance that is just like this one, except that all
* register references have been offset by the given delta.
*
* @param delta the amount to offset register references by
* @return {@code non-null;} an appropriately-constructed instance
*/
public abstract Insn withRegisterOffset(int delta);
/**
* Returns an instance that is just like this one, except that, if
* possible, the insn is converted into a version in which a source
* (if it is a constant) is represented directly rather than as a
* register reference. {@code this} is returned in cases where the
* translation is not possible.
*
* @return {@code non-null;} an appropriately-constructed instance
*/
public Insn withSourceLiteral() {
return this;
}
/**
* Returns an exact copy of this Insn
*
* @return {@code non-null;} an appropriately-constructed instance
*/
public Insn copy() {
return withRegisterOffset(0);
}
/**
* Compares, handling nulls safely
*
* @param a first object
* @param b second object
* @return true if they're equal or both null.
*/
private static boolean equalsHandleNulls (Object a, Object b) {
return (a == b) || ((a != null) && a.equals(b));
}
/**
* Compares Insn contents, since {@code Insn.equals()} is defined
* to be an identity compare. Insn's are {@code contentEquals()}
* if they have the same opcode, registers, source position, and other
* metadata.
*
* @return true in the case described above
*/
public boolean contentEquals(Insn b) {
return opcode == b.getOpcode()
&& position.equals(b.getPosition())
&& (getClass() == b.getClass())
&& equalsHandleNulls(result, b.getResult())
&& equalsHandleNulls(sources, b.getSources())
&& StdTypeList.equalContents(getCatches(), b.getCatches());
}
/**
* Returns an instance that is just like this one, except
* with new result and source registers.
*
* @param result {@code null-ok;} new result register
* @param sources {@code non-null;} new sources registers
* @return {@code non-null;} an appropriately-constructed instance
*/
public abstract Insn withNewRegisters(RegisterSpec result,
RegisterSpecList sources);
/**
* Returns the string form of this instance, with the given bit added in
* the standard location for an inline argument.
*
* @param extra {@code null-ok;} the inline argument string
* @return {@code non-null;} the string form
*/
protected final String toStringWithInline(String extra) {
StringBuilder sb = new StringBuilder(80);
sb.append("Insn{");
sb.append(position);
sb.append(' ');
sb.append(opcode);
if (extra != null) {
sb.append(' ');
sb.append(extra);
}
sb.append(" :: ");
if (result != null) {
sb.append(result);
sb.append(" <- ");
}
sb.append(sources);
sb.append('}');
return sb.toString();
}
/**
* Returns the human string form of this instance, with the given
* bit added in the standard location for an inline argument.
*
* @param extra {@code null-ok;} the inline argument string
* @return {@code non-null;} the human string form
*/
protected final String toHumanWithInline(String extra) {
StringBuilder sb = new StringBuilder(80);
sb.append(position);
sb.append(": ");
sb.append(opcode.getNickname());
if (extra != null) {
sb.append("(");
sb.append(extra);
sb.append(")");
}
if (result == null) {
sb.append(" .");
} else {
sb.append(" ");
sb.append(result.toHuman());
}
sb.append(" <-");
int sz = sources.size();
if (sz == 0) {
sb.append(" .");
} else {
for (int i = 0; i < sz; i++) {
sb.append(" ");
sb.append(sources.get(i).toHuman());
}
}
return sb.toString();
}
/**
* Visitor interface for this (outer) class.
*/
public static interface Visitor {
/**
* Visits a {@link PlainInsn}.
*
* @param insn {@code non-null;} the instruction to visit
*/
public void visitPlainInsn(PlainInsn insn);
/**
* Visits a {@link PlainCstInsn}.
*
* @param insn {@code non-null;} the instruction to visit
*/
public void visitPlainCstInsn(PlainCstInsn insn);
/**
* Visits a {@link SwitchInsn}.
*
* @param insn {@code non-null;} the instruction to visit
*/
public void visitSwitchInsn(SwitchInsn insn);
/**
* Visits a {@link ThrowingCstInsn}.
*
* @param insn {@code non-null;} the instruction to visit
*/
public void visitThrowingCstInsn(ThrowingCstInsn insn);
/**
* Visits a {@link ThrowingInsn}.
*
* @param insn {@code non-null;} the instruction to visit
*/
public void visitThrowingInsn(ThrowingInsn insn);
/**
* Visits a {@link FillArrayDataInsn}.
*
* @param insn {@code non-null;} the instruction to visit
*/
public void visitFillArrayDataInsn(FillArrayDataInsn insn);
/**
* Visits a {@link InvokePolymorphicInsn}.
*
* @param insn {@code non-null;} the instruction to visit
*/
public void visitInvokePolymorphicInsn(InvokePolymorphicInsn insn);
}
/**
* Base implementation of {@link Visitor}, which has empty method
* bodies for all methods.
*/
public static class BaseVisitor implements Visitor {
/** {@inheritDoc} */
@Override
public void visitPlainInsn(PlainInsn insn) {
// This space intentionally left blank.
}
/** {@inheritDoc} */
@Override
public void visitPlainCstInsn(PlainCstInsn insn) {
// This space intentionally left blank.
}
/** {@inheritDoc} */
@Override
public void visitSwitchInsn(SwitchInsn insn) {
// This space intentionally left blank.
}
/** {@inheritDoc} */
@Override
public void visitThrowingCstInsn(ThrowingCstInsn insn) {
// This space intentionally left blank.
}
/** {@inheritDoc} */
@Override
public void visitThrowingInsn(ThrowingInsn insn) {
// This space intentionally left blank.
}
/** {@inheritDoc} */
@Override
public void visitFillArrayDataInsn(FillArrayDataInsn insn) {
// This space intentionally left blank.
}
/** {@inheritDoc} */
@Override
public void visitInvokePolymorphicInsn(InvokePolymorphicInsn insn) {
// This space intentionally left blank.
}
}
}
|
{
"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.rocketmq.example.ordermessage;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerOrderly;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.common.consumer.ConsumeFromWhere;
import org.apache.rocketmq.common.message.MessageExt;
public class Consumer {
public static void main(String[] args) throws MQClientException {
DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("please_rename_unique_group_name_3");
consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_FIRST_OFFSET);
consumer.subscribe("TopicTest", "TagA || TagC || TagD");
consumer.registerMessageListener(new MessageListenerOrderly() {
AtomicLong consumeTimes = new AtomicLong(0);
@Override
public ConsumeOrderlyStatus consumeMessage(List<MessageExt> msgs, ConsumeOrderlyContext context) {
context.setAutoCommit(true);
System.out.printf("%s Receive New Messages: %s %n", Thread.currentThread().getName(), msgs);
this.consumeTimes.incrementAndGet();
if ((this.consumeTimes.get() % 2) == 0) {
return ConsumeOrderlyStatus.SUCCESS;
} else if ((this.consumeTimes.get() % 3) == 0) {
return ConsumeOrderlyStatus.ROLLBACK;
} else if ((this.consumeTimes.get() % 4) == 0) {
return ConsumeOrderlyStatus.COMMIT;
} else if ((this.consumeTimes.get() % 5) == 0) {
context.setSuspendCurrentQueueTimeMillis(3000);
return ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT;
}
return ConsumeOrderlyStatus.SUCCESS;
}
});
consumer.start();
System.out.printf("Consumer Started.%n");
}
}
|
{
"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.servicecomb.service.center.client.model;
public class GetSchemaResponse {
private String schema;
public String getSchema() {
return schema;
}
public void setSchema(String schema) {
this.schema = schema;
}
}
|
{
"pile_set_name": "Github"
}
|
<!--
doc/src/sgml/ref/security_label.sgml
PostgreSQL documentation
-->
<refentry id="SQL-SECURITY-LABEL">
<refmeta>
<refentrytitle>SECURITY LABEL</refentrytitle>
<manvolnum>7</manvolnum>
<refmiscinfo>SQL - Language Statements</refmiscinfo>
</refmeta>
<refnamediv>
<refname>SECURITY LABEL</refname>
<refpurpose>define or change a security label applied to an object</refpurpose>
</refnamediv>
<indexterm zone="sql-security-label">
<primary>SECURITY LABEL</primary>
</indexterm>
<refsynopsisdiv>
<synopsis>
SECURITY LABEL [ FOR <replaceable class="PARAMETER">provider</replaceable> ] ON
{
TABLE <replaceable class="PARAMETER">object_name</replaceable> |
COLUMN <replaceable class="PARAMETER">table_name</replaceable>.<replaceable class="PARAMETER">column_name</replaceable> |
AGGREGATE <replaceable class="PARAMETER">agg_name</replaceable> (<replaceable class="PARAMETER">agg_type</replaceable> [, ...] ) |
DATABASE <replaceable class="PARAMETER">object_name</replaceable> |
DOMAIN <replaceable class="PARAMETER">object_name</replaceable> |
FOREIGN TABLE <replaceable class="PARAMETER">object_name</replaceable>
FUNCTION <replaceable class="PARAMETER">function_name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) |
LARGE OBJECT <replaceable class="PARAMETER">large_object_oid</replaceable> |
[ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> |
ROLE <replaceable class="PARAMETER">object_name</replaceable> |
SCHEMA <replaceable class="PARAMETER">object_name</replaceable> |
SEQUENCE <replaceable class="PARAMETER">object_name</replaceable> |
TABLESPACE <replaceable class="PARAMETER">object_name</replaceable> |
TYPE <replaceable class="PARAMETER">object_name</replaceable> |
VIEW <replaceable class="PARAMETER">object_name</replaceable>
} IS '<replaceable class="PARAMETER">label</replaceable>'
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
<command>SECURITY LABEL</command> applies a security label to a database
object. An arbitrary number of security labels, one per label provider, can
be associated with a given database object. Label providers are loadable
modules which register themselves by using the function
<function>register_label_provider</>.
</para>
<note>
<para>
<function>register_label_provider</> is not an SQL function; it can
only be called from C code loaded into the backend.
</para>
</note>
<para>
The label provider determines whether a given label is valid and whether
it is permissible to assign that label to a given object. The meaning of a
given label is likewise at the discretion of the label provider.
<productname>PostgreSQL</> places no restrictions on whether or how a
label provider must interpret security labels; it merely provides a
mechanism for storing them. In practice, this facility is intended to allow
integration with label-based mandatory access control (MAC) systems such as
<productname>SE-Linux</>. Such systems make all access control decisions
based on object labels, rather than traditional discretionary access control
(DAC) concepts such as users and groups.
</para>
</refsect1>
<refsect1>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><replaceable class="parameter">object_name</replaceable></term>
<term><replaceable class="parameter">table_name.column_name</replaceable></term>
<term><replaceable class="parameter">agg_name</replaceable></term>
<term><replaceable class="parameter">function_name</replaceable></term>
<listitem>
<para>
The name of the object to be labeled. Names of tables,
aggregates, domains, foreign tables, functions, sequences, types, and
views can be schema-qualified.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">provider</replaceable></term>
<listitem>
<para>
The name of the provider with which this label is to be associated. The
named provider must be loaded and must consent to the proposed labeling
operation. If exactly one provider is loaded, the provider name may be
omitted for brevity.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">arg_type</replaceable></term>
<listitem>
<para>
An input data type on which the aggregate function operates.
To reference a zero-argument aggregate function, write <literal>*</>
in place of the list of input data types.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">argmode</replaceable></term>
<listitem>
<para>
The mode of a function argument: <literal>IN</>, <literal>OUT</>,
<literal>INOUT</>, or <literal>VARIADIC</>.
If omitted, the default is <literal>IN</>.
Note that <command>SECURITY LABEL ON FUNCTION</command> does not actually
pay any attention to <literal>OUT</> arguments, since only the input
arguments are needed to determine the function's identity.
So it is sufficient to list the <literal>IN</>, <literal>INOUT</>,
and <literal>VARIADIC</> arguments.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">argname</replaceable></term>
<listitem>
<para>
The name of a function argument.
Note that <command>SECURITY LABEL ON FUNCTION</command> does not actually
pay any attention to argument names, since only the argument data
types are needed to determine the function's identity.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">argtype</replaceable></term>
<listitem>
<para>
The data type(s) of the function's arguments (optionally
schema-qualified), if any.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">large_object_oid</replaceable></term>
<listitem>
<para>
The OID of the large object.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>PROCEDURAL</literal></term>
<listitem>
<para>
This is a noise word.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">label</replaceable></term>
<listitem>
<para>
The new security label, written as a string literal; or <literal>NULL</>
to drop the security label.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Examples</title>
<para>
The following example shows how the security label of a table might
be changed.
<programlisting>
SECURITY LABEL FOR selinux ON TABLE mytable IS 'system_u:object_r:sepgsql_table_t:s0';
</programlisting></para>
</refsect1>
<refsect1>
<title>Compatibility</title>
<para>
There is no <command>SECURITY LABEL</command> command in the SQL standard.
</para>
</refsect1>
<refsect1>
<title>See Also</title>
<simplelist type="inline">
<member><xref linkend="sepgsql"></member>
<member><xref linkend="dummy-seclabel"></member>
</simplelist>
</refsect1>
</refentry>
|
{
"pile_set_name": "Github"
}
|
package org.eclipse.ceylon.compiler.java.test.annotations;
@.org.eclipse.ceylon.compiler.java.metadata.Ceylon(
major = 8,
minor = 1)
@.org.eclipse.ceylon.compiler.java.metadata.Attribute
@.org.eclipse.ceylon.compiler.java.metadata.Name("attr1")
final class attr1_ {
private attr1_() {
}
private static final long $object$;
@.org.eclipse.ceylon.compiler.java.metadata.Ignore
private static volatile boolean $init$$object$ = false;
private static final .java.lang.Throwable $initException$;
static {
try {
$object$ = 1L;
.org.eclipse.ceylon.compiler.java.test.annotations.attr1_.$init$$object$ = true;
$initException$ = null;
} catch (.java.lang.Throwable x) {
$initException$ = x;
$object$ = 0L;
.org.eclipse.ceylon.compiler.java.test.annotations.attr1_.$init$$object$ = false;
}
}
public static long get_() {
if (.org.eclipse.ceylon.compiler.java.test.annotations.attr1_.$init$$object$) {
return .org.eclipse.ceylon.compiler.java.test.annotations.attr1_.$object$;
} else {
if ($initException$ != null) .org.eclipse.ceylon.compiler.java.Util.rethrow($initException$);
throw new .ceylon.language.InitializationError("Cyclic initialization trying to read the value of \'attr1\' before it was set");
}
}
}
@.org.eclipse.ceylon.compiler.java.metadata.Ceylon(
major = 8,
minor = 1)
@.org.eclipse.ceylon.compiler.java.metadata.Attribute
@.org.eclipse.ceylon.compiler.java.metadata.Name("attr2")
final class attr2_ {
private attr2_() {
}
private static long $object$;
@.org.eclipse.ceylon.compiler.java.metadata.Ignore
private static volatile boolean $init$$object$ = false;
private static final .java.lang.Throwable $initException$;
static {
try {
.org.eclipse.ceylon.compiler.java.test.annotations.attr2_.$object$ = 1L;
.org.eclipse.ceylon.compiler.java.test.annotations.attr2_.$init$$object$ = true;
$initException$ = null;
} catch (.java.lang.Throwable x) {
$initException$ = x;
.org.eclipse.ceylon.compiler.java.test.annotations.attr2_.$object$ = 0L;
.org.eclipse.ceylon.compiler.java.test.annotations.attr2_.$init$$object$ = false;
}
}
@.ceylon.language.VariableAnnotation$annotation$
public static long get_() {
if (.org.eclipse.ceylon.compiler.java.test.annotations.attr2_.$init$$object$) {
return .org.eclipse.ceylon.compiler.java.test.annotations.attr2_.$object$;
} else {
if ($initException$ != null) .org.eclipse.ceylon.compiler.java.Util.rethrow($initException$);
throw new .ceylon.language.InitializationError("Cyclic initialization trying to read the value of \'attr2\' before it was set");
}
}
public static void set_(@.org.eclipse.ceylon.compiler.java.metadata.Name("attr2")
final long attr2) {
if ($initException$ != null) .org.eclipse.ceylon.compiler.java.Util.rethrow($initException$);
.org.eclipse.ceylon.compiler.java.test.annotations.attr2_.$object$ = attr2;
}
}
@.org.eclipse.ceylon.compiler.java.metadata.Ceylon(
major = 8,
minor = 1)
@.org.eclipse.ceylon.compiler.java.metadata.Attribute
@.org.eclipse.ceylon.compiler.java.metadata.Name("attr3")
final class attr3_ {
private attr3_() {
}
@.org.eclipse.ceylon.compiler.java.metadata.Transient
public static long get_() {
return 1L;
}
}
@.org.eclipse.ceylon.compiler.java.metadata.Ceylon(
major = 8,
minor = 1)
@.org.eclipse.ceylon.compiler.java.metadata.Attribute
@.org.eclipse.ceylon.compiler.java.metadata.Name("attr4")
final class attr4_ {
private attr4_() {
}
@.org.eclipse.ceylon.compiler.java.metadata.Transient
public static long get_() {
return 1L;
}
public static void set_(@.org.eclipse.ceylon.compiler.java.metadata.Name("attr4")
final long attr4) {
}
}
|
{
"pile_set_name": "Github"
}
|
---
title: Companion -
---
//[detekt-api](../../../index.md)/[io.gitlab.arturbosch.detekt.api.internal](../../index.md)/[YamlConfig](../index.md)/[Companion](index.md)
# Companion
[jvm] object [Companion](index.md)
## Functions
| Name| Summary|
|---|---|
| [equals](index.md#kotlin/Any/equals/#kotlin.Any?/PointingToDeclaration/)| [jvm] <br>Content <br>open operator override fun [equals](index.md#kotlin/Any/equals/#kotlin.Any?/PointingToDeclaration/)(other: [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) <br><br><br>
| [hashCode](index.md#kotlin/Any/hashCode/#/PointingToDeclaration/)| [jvm] <br>Content <br>open override fun [hashCode](index.md#kotlin/Any/hashCode/#/PointingToDeclaration/)(): [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) <br><br><br>
| [load](load.md)| [jvm] <br>Brief description <br><br><br><br><br>Constructs a [YamlConfig](../index.md) from any [Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html).<br><br><br><br>Note the reader will be consumed and closed.<br><br><br><br> <br>Content <br>fun [load](load.md)(reader: [Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html)): [Config](../../../io.gitlab.arturbosch.detekt.api/-config/index.md) <br><br><br>[jvm] <br>Brief description <br><br><br>Factory method to load a yaml configuration. Given path must exist and point to a readable file.<br><br> <br>Content <br>fun [load](load.md)(path: [Path](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html)): [Config](../../../io.gitlab.arturbosch.detekt.api/-config/index.md) <br><br><br>
| [loadResource](load-resource.md)| [jvm] <br>Brief description <br><br><br>Factory method to load a yaml configuration from a URL.<br><br> <br>Content <br>fun [loadResource](load-resource.md)(url: [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html)): [Config](../../../io.gitlab.arturbosch.detekt.api/-config/index.md) <br><br><br>
| [toString](index.md#kotlin/Any/toString/#/PointingToDeclaration/)| [jvm] <br>Content <br>open override fun [toString](index.md#kotlin/Any/toString/#/PointingToDeclaration/)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) <br><br><br>
|
{
"pile_set_name": "Github"
}
|
/*
* OptParse.java
* <p>
* This file is part of JaCoP.
* <p>
* JaCoP is a Java Constraint Programming solver.
* <p>
* Copyright (C) 2000-2008 Krzysztof Kuchcinski and Radoslaw Szymanek
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* 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 Affero General Public License for more details.
* <p>
* Notwithstanding any other provision of this License, the copyright
* owners of this work supplement the terms of this License with terms
* prohibiting misrepresentation of the origin of this work and requiring
* that modified versions of this work be marked in reasonable ways as
* different from the original version. This supplement of the license
* terms is in accordance with Section 7 of GNU Affero General Public
* License version 3.
* <p>
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.jacop.jasat.utils;
import java.util.*;
/**
* util to parse command-line arguments
*
* @author Simon Cruanes and Radoslaw Szymanek
* @version 4.7
*/
public class OptParse<E> {
// remaining (true) args
public String[] realArgs;
// handlers
private Map<String, OptHandler<E>> handlers = new HashMap<String, OptHandler<E>>();
// the main help string
private String mainHelp = "";
/**
* add a handler for some option
*
* @param handler the handler
*/
public void addHandler(OptHandler<E> handler) {
if (handler.longOpt != null)
handlers.put("--" + handler.longOpt, handler);
if (handler.shortOpt != '\0')
handlers.put("-" + handler.shortOpt, handler);
}
/**
* change the main help string, which will be printed if asked, or
* if a wrong option is given
*
* @param helpString the help string
*/
public void setHelp(String helpString) {
this.mainHelp = helpString;
}
public E parse(String[] args, E e) {
realArgs = new String[args.length];
int realIndex = 0;
// the object
E current = e;
// iterate on arguments
for (int i = 0; i < args.length; i++) {
if (args[i].startsWith("-") || args[i].startsWith("--")) {
if (args[i].equals("-")) {
// exception: this is not an option
realArgs[realIndex++] = args[i];
continue;
}
// parse this as an option
int loc = args[i].indexOf("=");
String key = (loc > 0) ? args[i].substring(0, loc) : args[i];
String value = (loc > 0) ? args[i].substring(loc + 1) : "";
if (!handlers.containsKey(key)) {
// this option is not registered
System.out.println("unknown option: " + key);
printHelp();
return null;
} else {
current = handlers.get(key).handle(this, current, value);
}
} else {
realArgs[realIndex++] = args[i];
}
}
// truncate the "real args" array and return the E value
this.realArgs = Arrays.copyOf(realArgs, realIndex);
return current;
}
/**
* print help of all options
*/
public void printHelp() {
// print the main help message
System.out.println(mainHelp);
System.out.println("options:");
// print (only once for each handler) its help
Set<OptHandler<E>> printedHelps = new HashSet<OptHandler<E>>();
for (OptHandler<E> handler : handlers.values()) {
if (printedHelps.contains(handler))
continue;
else
printedHelps.add(handler);
// print help for this handler
String msg = String.format("-%c, --%-16s %s", handler.shortOpt, handler.longOpt, handler.help);
System.out.println(msg);
}
}
/**
* a handler can call this to interrupt the parsing
*/
public void exitParsing() {
throw new RuntimeException("stop parsing");
}
/**
* a class to handle one option
*
* @param E the object to apply modifications to
* @author simon
*/
public static abstract class OptHandler<E> {
// short name of the option
public char shortOpt;
// long name of the option
public String longOpt;
// help string
public String help;
/**
* handler for the option
*
* @param parser the parser object that called this handler
* @param e the object to modify according to the option
* @param arg the (optional) argument to the option
* @return a value of the good type (not necessarily the given one)
*/
public abstract E handle(OptParse<E> parser, E e, String arg);
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* RelativeMeanAbsoluteDeviationMT.java
* Copyright (C) 2017 University of Porto, Portugal
* @author J. Duarte, J. Gama
*
* 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 moa.classifiers.rules.multilabel.errormeasurers;
import com.yahoo.labs.samoa.instances.Prediction;
/**
* Relative Mean Absolute Deviation for multitarget and with fading factor
*/
public class RelativeMeanAbsoluteDeviationMT extends AbstractMultiTargetErrorMeasurer {
/**
*
*/
protected double weightSeen;
protected double [] sumError;
protected double [] sumY;
protected double [] sumErrorToTargetMean;
private static final long serialVersionUID = 1L;
protected boolean hasStarted;
protected int numLearnedOutputs;
@Override
public void addPrediction(Prediction prediction, Prediction trueClass, double weight) {
int numOutputs=prediction.numOutputAttributes();
if (!hasStarted){
sumError=new double[numOutputs];
sumY=new double[numOutputs];
sumErrorToTargetMean=new double[numOutputs];
hasStarted=true;
for(int i=0; i<numOutputs;i++)
if(prediction.hasVotesForAttribute(i))
++numLearnedOutputs;
hasStarted=true;
}
weightSeen=weight+fadingErrorFactor*weightSeen;
for(int i=0; i<numOutputs;i++){
if(prediction.hasVotesForAttribute(i)){
sumError[i]=Math.abs(prediction.getVote(i, 0)-trueClass.getVote(i, 0))*weight+fadingErrorFactor*sumError[i];
sumY[i]=trueClass.getVote(i, 0)*weight+fadingErrorFactor*sumY[i];
double errorOutputTM=Math.abs(prediction.getVote(i, 0)-sumY[i]/weightSeen); //error to target mean
sumErrorToTargetMean[i]=errorOutputTM*weight+fadingErrorFactor*sumErrorToTargetMean[i];
}
}
}
@Override
public double getCurrentError() {
if(weightSeen==0)
return Double.MAX_VALUE;
else
{
double sum=0;
int numOutputs=sumError.length;
for (int i=0; i<numOutputs; i++)
sum+=getCurrentError(i);
return sum/numLearnedOutputs;
}
}
@Override
public double getCurrentError(int index) {
return sumError[index]/sumErrorToTargetMean[index];
}
@Override
public double[] getCurrentErrors() {
double [] errors=null;
if(sumError!=null){
errors=new double[sumError.length];
for (int i=0;i<sumError.length; i++)
errors[i]=getCurrentError(i);
}
return errors;
}
}
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.