text:
package org.apache.axis2.jaxws.server.dispatcher;

import org.apache.axis2.AxisFault;
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.binding.BindingUtils;
import org.apache.axis2.jaxws.context.utils.ContextUtils;
import org.apache.axis2.jaxws.core.MessageContext;
import org.apache.axis2.jaxws.core.util.MessageContextUtils;
import org.apache.axis2.jaxws.description.EndpointDescription;
import org.apache.axis2.jaxws.description.OperationDescription;
import org.apache.axis2.jaxws.i18n.Messages;
import org.apache.axis2.jaxws.marshaller.MethodMarshaller;
import org.apache.axis2.jaxws.marshaller.factory.MethodMarshallerFactory;
import org.apache.axis2.jaxws.message.Message;
import org.apache.axis2.jaxws.message.Protocol;
import org.apache.axis2.jaxws.registry.FactoryRegistry;
import org.apache.axis2.jaxws.server.EndpointCallback;
import org.apache.axis2.jaxws.server.EndpointInvocationContext;
import org.apache.axis2.jaxws.server.InvocationHelper;
import org.apache.axis2.jaxws.server.ServerConstants;
import org.apache.axis2.jaxws.server.endpoint.Utils;
import org.apache.axis2.jaxws.spi.Constants;
import org.apache.axis2.jaxws.utility.ExecutorFactory;
import org.apache.axis2.jaxws.utility.SingleThreadedExecutor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.lang.reflect.Method;
import java.util.concurrent.Executor;
import java.util.concurrent.FutureTask;
import java.security.PrivilegedExceptionAction;
import java.security.PrivilegedActionException;

/**
 * The JavaBeanDispatcher is used to manage creating an instance of a JAX-WS service implementation
 * bean and dispatching the inbound request to that instance.
 */
public class JavaBeanDispatcher extends JavaDispatcher {

    private static final Log log = LogFactory.getLog(JavaBeanDispatcher.class);

    private EndpointDescription endpointDesc = null;

    public JavaBeanDispatcher(Class implClass, Object serviceInstance) {
        super(implClass, serviceInstance);
    }

    /*
    * (non-Javadoc)
    * @see org.apache.axis2.jaxws.server.EndpointDispatcher#invoke(org.apache.axis2.jaxws.core.MessageContext)
    */
    public MessageContext invoke(MessageContext mc) throws Exception {
        if (log.isDebugEnabled()) {
            log.debug("Invoking service endpoint: " + serviceImplClass.getName());
            log.debug("Invocation pattern: two way, sync");
        }

        initialize(mc);

        OperationDescription operationDesc = Utils.getOperationDescription(mc);

        Object[] methodInputParams = createRequestParameters(mc);

        Method target = getJavaMethod(mc, serviceImplClass);
        if (log.isDebugEnabled()) {
            // At this point, the OpDesc includes everything we know, including the actual method
            // on the service impl we will delegate to; it was set by getJavaMethod(...) above.
            log.debug("JavaBeanDispatcher about to invoke using OperationDesc: " +
                    operationDesc.toString());
        }

        // We have the method that is going to be invoked and the parameter data to invoke it
        // with, so just invoke the operation.
        boolean faultThrown = false;
        Throwable fault = null;
        Object output = null;
        try {
            output = invokeTargetOperation(target, methodInputParams);
        }
        catch (Throwable e) {
            faultThrown = true;
            fault = e;
            if (log.isDebugEnabled()) {
              log.debug("Caught exception from 'invokeTargetOperation': " + fault.toString());
            }
        }

        MessageContext response = null;
        if (operationDesc.isOneWay()) {
            // If the operation is one-way, then we can just return null because
            // we cannot create a MessageContext for one-way responses.
            return null;
        } else if (faultThrown) {
            if (log.isDebugEnabled()) {
              log.debug("Processing fault response: " + fault.toString());
            }

            response = createFaultResponse(mc, mc.getMessage().getProtocol(), fault);
            setExceptionProperties(response, target, fault);
        } else {
            response = createResponse(mc, mc.getMessage().getProtocol(), methodInputParams, output);
        }

        if (log.isDebugEnabled()) {
          log.debug("Returning from JavaBeanDispatcher.invoke()...");
        }
        return response;
    }

    public void invokeOneWay(MessageContext request) {
        if (log.isDebugEnabled()) {
            log.debug("Invoking service endpoint: " + serviceImplClass.getName());
            log.debug("Invocation pattern: one way");
        }

        initialize(request);

        OperationDescription operationDesc = Utils.getOperationDescription(request);

        Object[] methodInputParams = createRequestParameters(request);

        Method target = getJavaMethod(request, serviceImplClass);
        if (log.isDebugEnabled()) {
            // At this point, the OpDesc includes everything we know, including the actual method
            // on the service impl we will delegate to; it was set by getJavaMethod(...) above.
            log.debug("JavaBeanDispatcher about to invoke using OperationDesc: "
                    + operationDesc.toString());
        }

        EndpointInvocationContext eic = (EndpointInvocationContext) request.getInvocationContext();
        ClassLoader cl = getContextClassLoader();

        AsyncInvocationWorker worker = new AsyncInvocationWorker(target,
                                                                 methodInputParams,
                                                                 cl, eic);
        FutureTask task = new FutureTask<AsyncInvocationWorker>(worker);

        ExecutorFactory ef = (ExecutorFactory) FactoryRegistry.getFactory(ExecutorFactory.class);
        Executor executor = ef.getExecutorInstance(ExecutorFactory.SERVER_EXECUTOR);

        // If the property has been set to disable thread switching, then we can
        // do so by using a SingleThreadedExecutor instance to continue processing
        // work on the existing thread.
        Boolean disable = (Boolean)
            request.getProperty(ServerConstants.SERVER_DISABLE_THREAD_SWITCH);
        if (disable != null && disable.booleanValue()) {
            if (log.isDebugEnabled()) {
                log.debug("Server side thread switch disabled.  " +
                                "Setting Executor to the SingleThreadedExecutor.");
            }
            executor = new SingleThreadedExecutor();
        }

        executor.execute(task);
        return;
    }

    public void invokeAsync(MessageContext request, EndpointCallback callback) {
        if (log.isDebugEnabled()) {
            log.debug("Invoking service endpoint: " + serviceImplClass.getName());
            log.debug("Invocation pattern: two way, async");
        }

        initialize(request);

        OperationDescription operationDesc = Utils.getOperationDescription(request);

        Object[] methodInputParams = createRequestParameters(request);

        Method target = getJavaMethod(request, serviceImplClass);
        if (log.isDebugEnabled()) {
            // At this point, the OpDesc includes everything we know, including the actual method
            // on the service impl we will delegate to; it was set by getJavaMethod(...) above.
            log.debug("JavaBeanDispatcher about to invoke using OperationDesc: "
                    + operationDesc.toString());
        }

        EndpointInvocationContext eic = (EndpointInvocationContext) request.getInvocationContext();
        ClassLoader cl = getContextClassLoader();

        AsyncInvocationWorker worker = new AsyncInvocationWorker(target, methodInputParams, cl, eic);
        FutureTask task = new FutureTask<AsyncInvocationWorker>(worker);

        ExecutorFactory ef = (ExecutorFactory) FactoryRegistry.getFactory(ExecutorFactory.class);
        Executor executor = ef.getExecutorInstance(ExecutorFactory.SERVER_EXECUTOR);
        // If the property has been set to disable thread switching, then we can
        // do so by using a SingleThreadedExecutor instance to continue processing
        // work on the existing thread.
        Boolean disable = (Boolean) request.getProperty(ServerConstants.SERVER_DISABLE_THREAD_SWITCH);
        if (disable != null && disable.booleanValue()) {
            if (log.isDebugEnabled()) {
                log.debug("Server side thread switch disabled.  Setting Executor to the SingleThreadedExecutor.");
            }
            executor = new SingleThreadedExecutor();
        }
        executor.execute(task);

        return;
    }

    protected void initialize(MessageContext mc) {
        mc.setOperationName(mc.getAxisMessageContext().getAxisOperation().getName());
        mc.setOperationDescription(Utils.getOperationDescription(mc));
        endpointDesc = mc.getEndpointDescription();
        if (endpointDesc.isMTOMEnabled()) {
            mc.getMessage().setMTOMEnabled(true);
        }

        //Set SOAP Operation Related properties in SOAPMessageContext.
        ContextUtils.addWSDLProperties(mc);
    }

    private MethodMarshaller getMethodMarshaller(Protocol protocol,
                                                 OperationDescription operationDesc,
                                                 MessageContext mc) {
        javax.jws.soap.SOAPBinding.Style styleOnSEI =
                endpointDesc.getEndpointInterfaceDescription().getSoapBindingStyle();
        javax.jws.soap.SOAPBinding.Style styleOnMethod = operationDesc.getSoapBindingStyle();
        if (styleOnMethod != null && styleOnSEI != styleOnMethod) {
            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("proxyErr2"));
        }

        // check for a stored classloader to be used as the cache key
        ClassLoader cl = null;
        if(mc != null) {
            cl = (ClassLoader) mc.getProperty(Constants.CACHE_CLASSLOADER);
        }
        return MethodMarshallerFactory.getMarshaller(operationDesc, false, cl);
    }

    protected Method getJavaMethod(MessageContext mc, Class serviceImplClass) {

        OperationDescription opDesc = mc.getOperationDescription();
        if (opDesc == null) {
            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("proxyErr3"));
        }

        Method returnMethod = opDesc.getMethodFromServiceImpl(serviceImplClass);
        if (returnMethod == null) {
            throw ExceptionFactory
                    .makeWebServiceException(Messages.getMessage("JavaBeanDispatcherErr1"));
        }

        return returnMethod;
    }

    private Object[] createRequestParameters(MessageContext request) {
        // Get the appropriate MethodMarshaller for the WSDL type.  This will reflect
        // the "style" and "use" of the WSDL.
        Protocol requestProtocol = request.getMessage().getProtocol();
        MethodMarshaller methodMarshaller =
                getMethodMarshaller(requestProtocol, request.getOperationDescription(),
                                    request);

        // The MethodMarshaller will return the input parameters that are needed to
        // invoke the target method.
        Object[] methodInputParams =
                methodMarshaller.demarshalRequest(request.getMessage(), request.getOperationDescription());

        if (log.isDebugEnabled()) {
            log.debug("Unmarshalled parameters for request");
            if (methodInputParams != null) {
                log.debug(methodInputParams.length + " parameters were found.");
            }
        }

        return methodInputParams;
    }

    public MessageContext createResponse(MessageContext request, Object[] input, Object output) {
        return createResponse(request, request.getMessage().getProtocol(), input, output);
    }

    public MessageContext createResponse(MessageContext request, Protocol p, Object[] params, Object output) {
        OperationDescription operationDesc = request.getOperationDescription();
        Method method = operationDesc.getMethodFromServiceImpl(serviceImplClass);

        // Create the appropriate response message, using the protocol from the
        // request message.
        MethodMarshaller marshaller = getMethodMarshaller(p, request.getOperationDescription(),
                                                          request);
        Message m = null;
        if (method.getReturnType().getName().equals("void")) {
            m = marshaller.marshalResponse(null, params, operationDesc, p);
        } else {
            m = marshaller.marshalResponse(output, params, operationDesc, p);
        }

        // We'll need a MessageContext configured based on the response.
        MessageContext response = MessageContextUtils.createResponseMessageContext(request);
        response.setMessage(m);

        // Enable MTOM for the response if necessary.
        // (MTOM is not enabled it this operation has SWA parameters

        EndpointDescription epDesc = request.getEndpointDescription();
        String bindingType = epDesc.getBindingType();
        boolean isMTOMBinding = epDesc.isMTOMEnabled();
        boolean isDoingSWA = m.isDoingSWA();
        if (log.isDebugEnabled()) {
            log.debug("EndpointDescription = " + epDesc.toString());
            log.debug("BindingType = " + bindingType);
            log.debug("isMTOMBinding = " + isMTOMBinding);
            log.debug("isDoingSWA = " + isDoingSWA);
        }
        if (!m.isDoingSWA() && isMTOMBinding) {
            if (log.isDebugEnabled()) {
                log.debug("MTOM enabled for the response message.");
            }
            m.setMTOMEnabled(true);
        }

        return response;
    }

    public MessageContext createFaultResponse(MessageContext request, Throwable t) {
        return createFaultResponse(request, request.getMessage().getProtocol(), t);
    }

    public MessageContext createFaultResponse(MessageContext request, Protocol p, Throwable t) {
        if (log.isDebugEnabled()) {
          log.debug("Entered JavaBeanDispatcher.createFaultResponse()...");
        }

        // call the InvocationListener instances before marshalling
        // the fault into a message
        // call the InvocationListener instances before marshalling
        // the fault into a message
        Throwable faultMessage = InvocationHelper.determineMappedException(t, request);
        if(faultMessage != null) {
            t = faultMessage;
        }

        MethodMarshaller marshaller = getMethodMarshaller(p, request.getOperationDescription(),
                                                          request);

        Message m = marshaller.marshalFaultResponse(t, request.getOperationDescription(), p);

        MessageContext response = MessageContextUtils.createFaultMessageContext(request);
        response.setMessage(m);

        AxisFault axisFault = new AxisFault("The endpoint returned a fault when invoking the target operation.",
                                            response.getAxisMessageContext(),
                                            t);

        response.setCausedByException(axisFault);

        setFaultResponseAction(t, request, response);

        if (log.isDebugEnabled()) {
          log.debug("Leaving JavaBeanDispatcher.createFaultResponse()...");
        }

        return response;
    }

    /**
     * @return ClassLoader
     */
    private static ClassLoader getContextClassLoader() {
        // NOTE: This method must remain private because it uses AccessController
        ClassLoader cl = null;
        try {
            cl = (ClassLoader) org.apache.axis2.java.security.AccessController.doPrivileged(new PrivilegedExceptionAction() {
                public Object run() throws ClassNotFoundException {
                    return Thread.currentThread().getContextClassLoader();
                }
            });
        } catch (PrivilegedActionException e) {
            // The privileged method will throw a PriviledgedActionException which
            // contains the actual exception.
            if (log.isDebugEnabled()) {
                log.debug("Exception thrown from AccessController: " + e);
            }
            Exception wrappedE = e.getException();
            if (wrappedE instanceof RuntimeException) {
                throw (RuntimeException) wrappedE;
            } else {
                throw new RuntimeException(wrappedE);
            }
        }

        return cl;
    }

}


text:
package org.nschmidt.ldparteditor.enumtype;

/**
 * Task indicator for a pressed key
 */
public enum TextTask {
    EDITORTEXT_REPLACE_VERTEX,
    EDITORTEXT_ESC,
    EDITORTEXT_QUICKFIX,
    EDITORTEXT_SELECTALL,
    EDITORTEXT_INLINE,
    EDITORTEXT_ROUND,
    EDITORTEXT_UNDO,
    EDITORTEXT_REDO,
    EDITORTEXT_SAVE,
    EDITORTEXT_FIND,
    EDITORTEXT_INSERT_HISTORY,
    EDITORTEXT_INSERT_KEYWORD,
    EDITORTEXT_INSERT_REFERENCE,
    EDITORTEXT_LINE_UP,
    EDITORTEXT_LINE_DOWN
}

redpajama_set_name: RedPajamaGithub


text:
module Haskeroids.Controls
    ( keyTurnRight
    , keyTurnLeft
    , keyThruster
    , keyShoot
    ) where

import Graphics.UI.GLUT (Key(..), SpecialKey(..))

keyTurnRight = SpecialKey KeyRight
keyTurnLeft  = SpecialKey KeyLeft
keyThruster  = SpecialKey KeyUp
keyShoot     = Char ' '


text:
package kafka.server

import kafka.log._
import java.io.File

import org.apache.kafka.common.metrics.Metrics
import org.apache.kafka.common.utils.Utils
import org.junit.jupiter.api._
import org.junit.jupiter.api.Assertions._
import kafka.utils.{KafkaScheduler, MockTime, TestUtils}
import java.util.concurrent.atomic.AtomicBoolean

import kafka.cluster.Partition
import kafka.server.metadata.CachedConfigRepository
import org.apache.kafka.common.TopicPartition
import org.apache.kafka.common.record.SimpleRecord

class HighwatermarkPersistenceTest {

  val configs = TestUtils.createBrokerConfigs(2, TestUtils.MockZkConnect).map(KafkaConfig.fromProps)
  val topic = "foo"
  val configRepository = new CachedConfigRepository()
  val logManagers = configs map { config =>
    TestUtils.createLogManager(
      logDirs = config.logDirs.map(new File(_)),
      cleanerConfig = CleanerConfig())
  }

  val logDirFailureChannels = configs map { config =>
    new LogDirFailureChannel(config.logDirs.size)
  }

  val alterIsrManager = TestUtils.createAlterIsrManager()

  @AfterEach
  def teardown(): Unit = {
    for (manager <- logManagers; dir <- manager.liveLogDirs)
      Utils.delete(dir)
  }

  @Test
  def testHighWatermarkPersistenceSinglePartition(): Unit = {
    // create kafka scheduler
    val scheduler = new KafkaScheduler(2)
    scheduler.startup()
    val metrics = new Metrics
    val time = new MockTime
    val quotaManager = QuotaFactory.instantiate(configs.head, metrics, time, "")
    // create replica manager
    val replicaManager = new ReplicaManager(configs.head, metrics, time, None, scheduler,
      logManagers.head, new AtomicBoolean(false), quotaManager,
      new BrokerTopicStats, MetadataCache.zkMetadataCache(configs.head.brokerId), logDirFailureChannels.head, alterIsrManager,
      configRepository)
    replicaManager.startup()
    try {
      replicaManager.checkpointHighWatermarks()
      var fooPartition0Hw = hwmFor(replicaManager, topic, 0)
      assertEquals(0L, fooPartition0Hw)
      val tp0 = new TopicPartition(topic, 0)
      val partition0 = replicaManager.createPartition(tp0)
      // create leader and follower replicas
      val log0 = logManagers.head.getOrCreateLog(new TopicPartition(topic, 0), topicId = None)
      partition0.setLog(log0, isFutureLog = false)

      partition0.updateAssignmentAndIsr(
        assignment = Seq(configs.head.brokerId, configs.last.brokerId),
        isr = Set(configs.head.brokerId),
        addingReplicas = Seq.empty,
        removingReplicas = Seq.empty
      )

      replicaManager.checkpointHighWatermarks()
      fooPartition0Hw = hwmFor(replicaManager, topic, 0)
      assertEquals(log0.highWatermark, fooPartition0Hw)
      // set the high watermark for local replica
      partition0.localLogOrException.updateHighWatermark(5L)
      replicaManager.checkpointHighWatermarks()
      fooPartition0Hw = hwmFor(replicaManager, topic, 0)
      assertEquals(log0.highWatermark, fooPartition0Hw)
    } finally {
      // shutdown the replica manager upon test completion
      replicaManager.shutdown(false)
      quotaManager.shutdown()
      metrics.close()
      scheduler.shutdown()
    }
  }

  @Test
  def testHighWatermarkPersistenceMultiplePartitions(): Unit = {
    val topic1 = "foo1"
    val topic2 = "foo2"
    // create kafka scheduler
    val scheduler = new KafkaScheduler(2)
    scheduler.startup()
    val metrics = new Metrics
    val time = new MockTime
    val quotaManager = QuotaFactory.instantiate(configs.head, metrics, time, "")
    // create replica manager
    val replicaManager = new ReplicaManager(configs.head, metrics, time, None,
      scheduler, logManagers.head, new AtomicBoolean(false), quotaManager,
      new BrokerTopicStats, MetadataCache.zkMetadataCache(configs.head.brokerId), logDirFailureChannels.head, alterIsrManager, configRepository)
    replicaManager.startup()
    try {
      replicaManager.checkpointHighWatermarks()
      var topic1Partition0Hw = hwmFor(replicaManager, topic1, 0)
      assertEquals(0L, topic1Partition0Hw)
      val t1p0 = new TopicPartition(topic1, 0)
      val topic1Partition0 = replicaManager.createPartition(t1p0)
      // create leader log
      val topic1Log0 = logManagers.head.getOrCreateLog(t1p0, topicId = None)
      // create a local replica for topic1
      topic1Partition0.setLog(topic1Log0, isFutureLog = false)
      replicaManager.checkpointHighWatermarks()
      topic1Partition0Hw = hwmFor(replicaManager, topic1, 0)
      assertEquals(topic1Log0.highWatermark, topic1Partition0Hw)
      // set the high watermark for local replica
      append(topic1Partition0, count = 5)
      topic1Partition0.localLogOrException.updateHighWatermark(5L)
      replicaManager.checkpointHighWatermarks()
      topic1Partition0Hw = hwmFor(replicaManager, topic1, 0)
      assertEquals(5L, topic1Log0.highWatermark)
      assertEquals(5L, topic1Partition0Hw)
      // add another partition and set highwatermark
      val t2p0 = new TopicPartition(topic2, 0)
      val topic2Partition0 = replicaManager.createPartition(t2p0)
      // create leader log
      val topic2Log0 = logManagers.head.getOrCreateLog(t2p0, topicId = None)
      // create a local replica for topic2
      topic2Partition0.setLog(topic2Log0, isFutureLog = false)
      replicaManager.checkpointHighWatermarks()
      var topic2Partition0Hw = hwmFor(replicaManager, topic2, 0)
      assertEquals(topic2Log0.highWatermark, topic2Partition0Hw)
      // set the highwatermark for local replica
      append(topic2Partition0, count = 15)
      topic2Partition0.localLogOrException.updateHighWatermark(15L)
      assertEquals(15L, topic2Log0.highWatermark)
      // change the highwatermark for topic1
      append(topic1Partition0, count = 5)
      topic1Partition0.localLogOrException.updateHighWatermark(10L)
      assertEquals(10L, topic1Log0.highWatermark)
      replicaManager.checkpointHighWatermarks()
      // verify checkpointed hw for topic 2
      topic2Partition0Hw = hwmFor(replicaManager, topic2, 0)
      assertEquals(15L, topic2Partition0Hw)
      // verify checkpointed hw for topic 1
      topic1Partition0Hw = hwmFor(replicaManager, topic1, 0)
      assertEquals(10L, topic1Partition0Hw)
    } finally {
      // shutdown the replica manager upon test completion
      replicaManager.shutdown(false)
      quotaManager.shutdown()
      metrics.close()
      scheduler.shutdown()
    }
  }

  private def append(partition: Partition, count: Int): Unit = {
    val records = TestUtils.records((0 to count).map(i => new SimpleRecord(s"$i".getBytes)))
    partition.localLogOrException.appendAsLeader(records, leaderEpoch = 0)
  }

  private def hwmFor(replicaManager: ReplicaManager, topic: String, partition: Int): Long = {
    replicaManager.highWatermarkCheckpoints(new File(replicaManager.config.logDirs.head).getAbsolutePath).read().getOrElse(
      new TopicPartition(topic, partition), 0L)
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>EphemeralKeyPair (Bouncy Castle Library 1.54 API Specification)</title>
<meta name="date" content="2015-12-29">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Bouncy Castle Cryptography Library 1.54

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.bouncycastle.crypto

Class EphemeralKeyPair

java.lang.Object

org.bouncycastle.crypto.EphemeralKeyPair

public class EphemeralKeyPair
extends java.lang.Object

Constructor Summary

Constructors

Constructor and Description

EphemeralKeyPair(AsymmetricCipherKeyPair keyPair,
                KeyEncoder publicKeyEncoder)

Method Summary

Methods

Modifier and Type
Method and Description

byte[]
getEncodedPublicKey()

AsymmetricCipherKeyPair
getKeyPair()

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EphemeralKeyPair

public EphemeralKeyPair(AsymmetricCipherKeyPair keyPair,
                KeyEncoder publicKeyEncoder)

Method Detail

getKeyPair

public AsymmetricCipherKeyPair getKeyPair()

getEncodedPublicKey

public byte[] getEncodedPublicKey()

Overview

Package

Class

Tree

Deprecated

Index

Help

Bouncy Castle Cryptography Library 1.54

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package com.mapswithme.maps.bookmarks.data;

import android.support.annotation.IntDef;
import android.support.annotation.NonNull;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

public class BookmarkSharingResult
{
  @Retention(RetentionPolicy.SOURCE)
  @IntDef({ SUCCESS, EMPTY_CATEGORY, ARCHIVE_ERROR, FILE_ERROR })
  public @interface Code {}

  public static final int SUCCESS = 0;
  public static final int EMPTY_CATEGORY = 1;
  public static final int ARCHIVE_ERROR = 2;
  public static final int FILE_ERROR = 3;

  private final long mCategoryId;
  @Code
  private final int mCode;
  @NonNull
  private final String mSharingPath;
  @NonNull
  private final String mErrorString;

  private BookmarkSharingResult(long categoryId, @Code int code,
                                @NonNull String sharingPath,
                                @NonNull String errorString)
  {
    mCategoryId = categoryId;
    mCode = code;
    mSharingPath = sharingPath;
    mErrorString = errorString;
  }

  public long getCategoryId()
  {
    return mCategoryId;
  }

  public int getCode()
  {
    return mCode;
  }

  @NonNull
  public String getSharingPath()
  {
    return mSharingPath;
  }

  @NonNull
  public String getErrorString()
  {
    return mErrorString;
  }
}


text:
package org.apache.pulsar.functions.worker;

import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;

import java.net.UnknownHostException;
import java.util.concurrent.LinkedBlockingQueue;

import org.apache.distributedlog.api.namespace.Namespace;
import org.apache.pulsar.functions.proto.Function;
import org.apache.pulsar.functions.proto.Function.PackageLocationMetaData;
import org.apache.pulsar.functions.runtime.Runtime;
import org.apache.pulsar.functions.runtime.RuntimeFactory;
import org.apache.pulsar.functions.runtime.ThreadRuntimeFactory;
import org.testng.annotations.Test;
import static org.apache.pulsar.common.functions.Utils.FILE;

/**
 * Unit test of {@link FunctionActioner}.
 */
public class FunctionActionerTest {

    /**
     * Validates FunctionActioner tries to download file from bk.
     *
     * @throws Exception
     */
    @Test
    public void testStartFunctionWithDLNamespace() throws Exception {

        WorkerConfig workerConfig = new WorkerConfig();
        workerConfig.setWorkerId("worker-1");
        workerConfig.setThreadContainerFactory(new WorkerConfig.ThreadContainerFactory().setThreadGroupName("test"));
        workerConfig.setPulsarServiceUrl("pulsar://localhost:6650");
        workerConfig.setStateStorageServiceUrl("foo");
        workerConfig.setFunctionAssignmentTopicName("assignments");

        ThreadRuntimeFactory factory = mock(ThreadRuntimeFactory.class);
        Namespace dlogNamespace = mock(Namespace.class);
        // throw exception when dlogNamespace is accessed by actioner and verify it
        final String exceptionMsg = "dl namespace not-found";
        doThrow(new IllegalArgumentException(exceptionMsg)).when(dlogNamespace).openLog(any());
        LinkedBlockingQueue<FunctionAction> queue = new LinkedBlockingQueue<>();

        @SuppressWarnings("resource")
        FunctionActioner actioner = new FunctionActioner(workerConfig, factory, dlogNamespace, queue,
                new ConnectorsManager(workerConfig));
        Runtime runtime = mock(Runtime.class);
        Function.FunctionMetaData function1 = Function.FunctionMetaData.newBuilder()
                .setFunctionDetails(Function.FunctionDetails.newBuilder().setTenant("test-tenant")
                        .setNamespace("test-namespace").setName("func-1"))
                .build();
        Function.Instance instance = Function.Instance.newBuilder().setFunctionMetaData(function1).setInstanceId(0)
                .build();
        FunctionRuntimeInfo functionRuntimeInfo = mock(FunctionRuntimeInfo.class);
        doReturn(instance).when(functionRuntimeInfo).getFunctionInstance();

        // actioner should try to download file from bk-dlogNamespace and fails with exception
        try {
            actioner.startFunction(functionRuntimeInfo);
            fail("should have failed with dlogNamespace open");
        } catch (IllegalArgumentException ie) {
            assertEquals(ie.getMessage(), exceptionMsg);
        }
    }

    @Test
    public void testStartFunctionWithPkgUrl() throws Exception {

        WorkerConfig workerConfig = new WorkerConfig();
        workerConfig.setWorkerId("worker-1");
        workerConfig.setThreadContainerFactory(new WorkerConfig.ThreadContainerFactory().setThreadGroupName("test"));
        workerConfig.setPulsarServiceUrl("pulsar://localhost:6650");
        workerConfig.setStateStorageServiceUrl("foo");
        workerConfig.setFunctionAssignmentTopicName("assignments");
        String downloadDir = this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath();
        workerConfig.setDownloadDirectory(downloadDir);

        RuntimeFactory factory = mock(RuntimeFactory.class);
        Runtime runtime = mock(Runtime.class);
        doReturn(runtime).when(factory).createContainer(any(), any(), any(), any());
        doNothing().when(runtime).start();
        Namespace dlogNamespace = mock(Namespace.class);
        final String exceptionMsg = "dl namespace not-found";
        doThrow(new IllegalArgumentException(exceptionMsg)).when(dlogNamespace).openLog(any());
        LinkedBlockingQueue<FunctionAction> queue = new LinkedBlockingQueue<>();

        @SuppressWarnings("resource")
        FunctionActioner actioner = new FunctionActioner(workerConfig, factory, dlogNamespace, queue,
                new ConnectorsManager(workerConfig));

        // (1) test with file url. functionActioner should be able to consider file-url and it should be able to call
        // RuntimeSpawner
        String pkgPathLocation = FILE + ":/user/my-file.jar";
        Function.FunctionMetaData function1 = Function.FunctionMetaData.newBuilder()
                .setFunctionDetails(Function.FunctionDetails.newBuilder().setTenant("test-tenant")
                        .setNamespace("test-namespace").setName("func-1"))
                .setPackageLocation(PackageLocationMetaData.newBuilder().setPackagePath(pkgPathLocation).build())
                .build();
        Function.Instance instance = Function.Instance.newBuilder().setFunctionMetaData(function1).setInstanceId(0)
                .build();
        FunctionRuntimeInfo functionRuntimeInfo = mock(FunctionRuntimeInfo.class);
        doReturn(instance).when(functionRuntimeInfo).getFunctionInstance();

        actioner.startFunction(functionRuntimeInfo);
        verify(runtime, times(1)).start();

        // (2) test with http-url, downloading file from http should fail with UnknownHostException due to invalid url
        pkgPathLocation = "http://invalid/my-file.jar";
        function1 = Function.FunctionMetaData.newBuilder()
                .setFunctionDetails(Function.FunctionDetails.newBuilder().setTenant("test-tenant")
                        .setNamespace("test-namespace").setName("func-1"))
                .setPackageLocation(PackageLocationMetaData.newBuilder().setPackagePath(pkgPathLocation).build())
                .build();
        instance = Function.Instance.newBuilder().setFunctionMetaData(function1).setInstanceId(0).build();
        functionRuntimeInfo = mock(FunctionRuntimeInfo.class);
        doReturn(instance).when(functionRuntimeInfo).getFunctionInstance();

        try {
            actioner.startFunction(functionRuntimeInfo);
            fail("Function-Actioner should have tried to donwload file from http-location");
        } catch (UnknownHostException ue) {
            // ok
        }
    }

}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>da Baixa Verde</logradouro><bairro>Derby</bairro><cidade>Recife</cidade><uf>PE</uf><cep>52010250</cep></feed>


text:
@implementation OMISC
- (instancetype)initWithPresenter:(id<OMIPresenterInterface>)presenter{
    if (self = [super init]){
    }
    self->_presenter = presenter;
    return self;
}

- (NSInteger)numberOfItems{
    return 1;
}

- (CGSize)sizeForItemAtIndex:(NSInteger)index{
    return CGSizeZero;
}

- (__kindof UICollectionViewCell *)cellForItemAtIndex:(NSInteger)index{
    return nil;
}

- (void)didUpdateToObject:(id)object{

}

- (void)didSelectItemAtIndex:(NSInteger)index{

}
@end
@implementation OMIAsyncSC

- (CGSize)sizeForItemAtIndex:(NSInteger)index{
    return [NSClassFromString(@"ASIGListSectionControllerMethods") sizeForItemAtIndex:index];
}

- (__kindof UICollectionViewCell *)cellForItemAtIndex:(NSInteger)index{
    return [NSClassFromString(@"ASIGListSectionControllerMethods") cellForItemAtIndex:index sectionController:self];
}

-(ASSizeRange)sizeRangeForItemAtIndex:(NSInteger)index{
    return ASSizeRangeZero;
}
- (ASCellNodeBlock)nodeBlockForItemAtIndex:(NSInteger)index{
    NSAssert(NO, @"missing implement");
    return nil;
}
@end


text:
use std::io;
use std::path::Path;
use std::os::unix::io::RawFd;

use nix::fcntl;
use libc::{open, renameat};

use crate::config::volumes::PersistentInfo;
use crate::file_util::{Lock, Dir};
use crate::container::util::clean_dir;
use crate::path_util::ToCString;

pub trait Guard {
    fn commit(&self) -> Result<(), String>;
}

pub struct PersistentVolumeGuard {
    #[allow(dead_code)]  // we store lock here to keep it alive
    lock: Lock,
    volumes_base: RawFd,
    volume_name: String,
}

impl PersistentVolumeGuard {
    #[cfg(feature="containers")]
    pub fn new(vol: &PersistentInfo)
        -> io::Result<Option<PersistentVolumeGuard>>
    {
        let volbase = Path::new("/vagga/base/.volumes");
        let path = volbase.join(&vol.name);
        if path.exists() {
            return Ok(None);
        }
        Dir::new(&volbase).create()?;
        let lockfile = volbase.join(format!(".tmp.{}.lock", vol.name));
        let lock = Lock::exclusive(lockfile)?;
        if path.exists() {
            return Ok(None);
        }
        let tmpdir = volbase.join(format!(".tmp.{}", vol.name));
        if tmpdir.exists() {
            clean_dir(&tmpdir, false)
                .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
        }
        Dir::new(&tmpdir)
            .uid(vol.owner_uid)
            .gid(vol.owner_gid)
            .create()?;
        let volumes_base = unsafe {
            open(volbase.to_cstring().as_ptr(), fcntl::OFlag::O_PATH.bits())
        };
        if volumes_base < 0 {
            return Err(io::Error::last_os_error());
        }
        Ok(Some(PersistentVolumeGuard {
            lock: lock,
            volumes_base: volumes_base,
            volume_name: vol.name.clone(),
        }))
    }
    #[cfg(not(feature="containers"))]
    pub fn new(vol: &PersistentInfo)
        -> io::Result<Option<PersistentVolumeGuard>>
    {
        unimplemented!()
    }
}

impl Guard for PersistentVolumeGuard {
    fn commit(&self) -> Result<(), String> {
        let rc = unsafe {
            renameat(self.volumes_base,
                format!(".tmp.{}", self.volume_name).to_cstring().as_ptr(),
                self.volumes_base, self.volume_name.to_cstring().as_ptr())
        };
        if rc < 0 {
            return Err(format!("Error commiting volume: {}",
                               io::Error::last_os_error()));
        }
        Ok(())
    }
}


text:
package org.elasticsearch.xpack.idp.saml.rest.action;

import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.license.License;
import org.elasticsearch.license.LicenseUtils;
import org.elasticsearch.license.XPackLicenseState;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.BytesRestResponse;
import org.elasticsearch.rest.RestRequest;

import java.io.IOException;

public abstract class IdpBaseRestHandler extends BaseRestHandler {

    private static License.OperationMode MINIMUM_ALLOWED_LICENSE = License.OperationMode.ENTERPRISE;

    protected final XPackLicenseState licenseState;

    protected IdpBaseRestHandler(XPackLicenseState licenseState) {
        this.licenseState = licenseState;
    }

    protected final RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {
        RestChannelConsumer consumer = innerPrepareRequest(request, client);
        if (isIdpFeatureAllowed()) {
            return consumer;
        } else {
            return channel -> channel.sendResponse(new BytesRestResponse(channel,
                LicenseUtils.newComplianceException("Identity Provider")));
        }
    }

    protected boolean isIdpFeatureAllowed() {
        return licenseState.isAllowedByLicense(MINIMUM_ALLOWED_LICENSE);
    }

    /**
     * Implementers should implement this method as they normally would for
     * {@link BaseRestHandler#prepareRequest(RestRequest, NodeClient)} and ensure that all request
     * parameters are consumed prior to returning a value.
     */
    protected abstract RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException;
}


text:
/**
 * @file
 * Raw Video Codec
 */

#ifndef AVCODEC_RAW_H
#define AVCODEC_RAW_H

#include "avcodec.h"
#include "libavutil/internal.h"

typedef struct PixelFormatTag {
    enum AVPixelFormat pix_fmt;
    unsigned int fourcc;
} PixelFormatTag;

extern av_export const PixelFormatTag ff_raw_pix_fmt_tags[];
#if LIBAVCODEC_VERSION_MAJOR < 55
enum AVPixelFormat ff_find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc);
#endif
enum AVPixelFormat avpriv_find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc);

#endif /* AVCODEC_RAW_H */


text:
namespace Google.Cloud.Compute.V1.Snippets
{
    using Google.Api.Gax;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using lro = Google.LongRunning;

    /// Generated snippets.
    public sealed class AllGeneratedNodeTemplatesClientSnippets
    {
        /// Snippet for AggregatedList
        public void AggregatedListRequestObject()
        {
            // Snippet: AggregatedList(AggregatedListNodeTemplatesRequest, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            AggregatedListNodeTemplatesRequest request = new AggregatedListNodeTemplatesRequest
            {
                OrderBy = "",
                Project = "",
                Filter = "",
                IncludeAllScopes = false,
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedEnumerable<NodeTemplateAggregatedList, KeyValuePair<string, NodeTemplatesScopedList>> response = nodeTemplatesClient.AggregatedList(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (KeyValuePair<string, NodeTemplatesScopedList> item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (NodeTemplateAggregatedList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (KeyValuePair<string, NodeTemplatesScopedList> item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            }

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page<KeyValuePair<string, NodeTemplatesScopedList>> singlePage = response.ReadPage(pageSize);
            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (KeyValuePair<string, NodeTemplatesScopedList> item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }

        /// Snippet for AggregatedListAsync
        public async Task AggregatedListRequestObjectAsync()
        {
            // Snippet: AggregatedListAsync(AggregatedListNodeTemplatesRequest, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            AggregatedListNodeTemplatesRequest request = new AggregatedListNodeTemplatesRequest
            {
                OrderBy = "",
                Project = "",
                Filter = "",
                IncludeAllScopes = false,
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedAsyncEnumerable<NodeTemplateAggregatedList, KeyValuePair<string, NodeTemplatesScopedList>> response = nodeTemplatesClient.AggregatedListAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((KeyValuePair<string, NodeTemplatesScopedList> item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((NodeTemplateAggregatedList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (KeyValuePair<string, NodeTemplatesScopedList> item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page<KeyValuePair<string, NodeTemplatesScopedList>> singlePage = await response.ReadPageAsync(pageSize);
            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (KeyValuePair<string, NodeTemplatesScopedList> item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }

        /// Snippet for AggregatedList
        public void AggregatedList()
        {
            // Snippet: AggregatedList(string, string, int?, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            string project = "";
            // Make the request
            PagedEnumerable<NodeTemplateAggregatedList, KeyValuePair<string, NodeTemplatesScopedList>> response = nodeTemplatesClient.AggregatedList(project);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (KeyValuePair<string, NodeTemplatesScopedList> item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (NodeTemplateAggregatedList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (KeyValuePair<string, NodeTemplatesScopedList> item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            }

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page<KeyValuePair<string, NodeTemplatesScopedList>> singlePage = response.ReadPage(pageSize);
            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (KeyValuePair<string, NodeTemplatesScopedList> item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }

        /// Snippet for AggregatedListAsync
        public async Task AggregatedListAsync()
        {
            // Snippet: AggregatedListAsync(string, string, int?, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            string project = "";
            // Make the request
            PagedAsyncEnumerable<NodeTemplateAggregatedList, KeyValuePair<string, NodeTemplatesScopedList>> response = nodeTemplatesClient.AggregatedListAsync(project);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((KeyValuePair<string, NodeTemplatesScopedList> item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((NodeTemplateAggregatedList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (KeyValuePair<string, NodeTemplatesScopedList> item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page<KeyValuePair<string, NodeTemplatesScopedList>> singlePage = await response.ReadPageAsync(pageSize);
            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (KeyValuePair<string, NodeTemplatesScopedList> item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }

        /// Snippet for Delete
        public void DeleteRequestObject()
        {
            // Snippet: Delete(DeleteNodeTemplateRequest, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            DeleteNodeTemplateRequest request = new DeleteNodeTemplateRequest
            {
                RequestId = "",
                Region = "",
                Project = "",
                NodeTemplate = "",
            };
            // Make the request
            lro::Operation<Operation, Operation> response = nodeTemplatesClient.Delete(request);

            // Poll until the returned long-running operation is complete
            lro::Operation<Operation, Operation> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Operation result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            lro::Operation<Operation, Operation> retrievedResponse = nodeTemplatesClient.PollOnceDelete(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }

        /// Snippet for DeleteAsync
        public async Task DeleteRequestObjectAsync()
        {
            // Snippet: DeleteAsync(DeleteNodeTemplateRequest, CallSettings)
            // Additional: DeleteAsync(DeleteNodeTemplateRequest, CancellationToken)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            DeleteNodeTemplateRequest request = new DeleteNodeTemplateRequest
            {
                RequestId = "",
                Region = "",
                Project = "",
                NodeTemplate = "",
            };
            // Make the request
            lro::Operation<Operation, Operation> response = await nodeTemplatesClient.DeleteAsync(request);

            // Poll until the returned long-running operation is complete
            lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
            // Retrieve the operation result
            Operation result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            lro::Operation<Operation, Operation> retrievedResponse = await nodeTemplatesClient.PollOnceDeleteAsync(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }

        /// Snippet for Delete
        public void Delete()
        {
            // Snippet: Delete(string, string, string, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            string project = "";
            string region = "";
            string nodeTemplate = "";
            // Make the request
            lro::Operation<Operation, Operation> response = nodeTemplatesClient.Delete(project, region, nodeTemplate);

            // Poll until the returned long-running operation is complete
            lro::Operation<Operation, Operation> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Operation result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            lro::Operation<Operation, Operation> retrievedResponse = nodeTemplatesClient.PollOnceDelete(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }

        /// Snippet for DeleteAsync
        public async Task DeleteAsync()
        {
            // Snippet: DeleteAsync(string, string, string, CallSettings)
            // Additional: DeleteAsync(string, string, string, CancellationToken)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            string project = "";
            string region = "";
            string nodeTemplate = "";
            // Make the request
            lro::Operation<Operation, Operation> response = await nodeTemplatesClient.DeleteAsync(project, region, nodeTemplate);

            // Poll until the returned long-running operation is complete
            lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
            // Retrieve the operation result
            Operation result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            lro::Operation<Operation, Operation> retrievedResponse = await nodeTemplatesClient.PollOnceDeleteAsync(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }

        /// Snippet for Get
        public void GetRequestObject()
        {
            // Snippet: Get(GetNodeTemplateRequest, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            GetNodeTemplateRequest request = new GetNodeTemplateRequest
            {
                Region = "",
                Project = "",
                NodeTemplate = "",
            };
            // Make the request
            NodeTemplate response = nodeTemplatesClient.Get(request);
            // End snippet
        }

        /// Snippet for GetAsync
        public async Task GetRequestObjectAsync()
        {
            // Snippet: GetAsync(GetNodeTemplateRequest, CallSettings)
            // Additional: GetAsync(GetNodeTemplateRequest, CancellationToken)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            GetNodeTemplateRequest request = new GetNodeTemplateRequest
            {
                Region = "",
                Project = "",
                NodeTemplate = "",
            };
            // Make the request
            NodeTemplate response = await nodeTemplatesClient.GetAsync(request);
            // End snippet
        }

        /// Snippet for Get
        public void Get()
        {
            // Snippet: Get(string, string, string, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            string project = "";
            string region = "";
            string nodeTemplate = "";
            // Make the request
            NodeTemplate response = nodeTemplatesClient.Get(project, region, nodeTemplate);
            // End snippet
        }

        /// Snippet for GetAsync
        public async Task GetAsync()
        {
            // Snippet: GetAsync(string, string, string, CallSettings)
            // Additional: GetAsync(string, string, string, CancellationToken)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            string project = "";
            string region = "";
            string nodeTemplate = "";
            // Make the request
            NodeTemplate response = await nodeTemplatesClient.GetAsync(project, region, nodeTemplate);
            // End snippet
        }

        /// Snippet for GetIamPolicy
        public void GetIamPolicyRequestObject()
        {
            // Snippet: GetIamPolicy(GetIamPolicyNodeTemplateRequest, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            GetIamPolicyNodeTemplateRequest request = new GetIamPolicyNodeTemplateRequest
            {
                Region = "",
                Resource = "",
                Project = "",
                OptionsRequestedPolicyVersion = 0,
            };
            // Make the request
            Policy response = nodeTemplatesClient.GetIamPolicy(request);
            // End snippet
        }

        /// Snippet for GetIamPolicyAsync
        public async Task GetIamPolicyRequestObjectAsync()
        {
            // Snippet: GetIamPolicyAsync(GetIamPolicyNodeTemplateRequest, CallSettings)
            // Additional: GetIamPolicyAsync(GetIamPolicyNodeTemplateRequest, CancellationToken)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            GetIamPolicyNodeTemplateRequest request = new GetIamPolicyNodeTemplateRequest
            {
                Region = "",
                Resource = "",
                Project = "",
                OptionsRequestedPolicyVersion = 0,
            };
            // Make the request
            Policy response = await nodeTemplatesClient.GetIamPolicyAsync(request);
            // End snippet
        }

        /// Snippet for GetIamPolicy
        public void GetIamPolicy()
        {
            // Snippet: GetIamPolicy(string, string, string, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            string project = "";
            string region = "";
            string resource = "";
            // Make the request
            Policy response = nodeTemplatesClient.GetIamPolicy(project, region, resource);
            // End snippet
        }

        /// Snippet for GetIamPolicyAsync
        public async Task GetIamPolicyAsync()
        {
            // Snippet: GetIamPolicyAsync(string, string, string, CallSettings)
            // Additional: GetIamPolicyAsync(string, string, string, CancellationToken)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            string project = "";
            string region = "";
            string resource = "";
            // Make the request
            Policy response = await nodeTemplatesClient.GetIamPolicyAsync(project, region, resource);
            // End snippet
        }

        /// Snippet for Insert
        public void InsertRequestObject()
        {
            // Snippet: Insert(InsertNodeTemplateRequest, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            InsertNodeTemplateRequest request = new InsertNodeTemplateRequest
            {
                RequestId = "",
                NodeTemplateResource = new NodeTemplate(),
                Region = "",
                Project = "",
            };
            // Make the request
            lro::Operation<Operation, Operation> response = nodeTemplatesClient.Insert(request);

            // Poll until the returned long-running operation is complete
            lro::Operation<Operation, Operation> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Operation result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            lro::Operation<Operation, Operation> retrievedResponse = nodeTemplatesClient.PollOnceInsert(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }

        /// Snippet for InsertAsync
        public async Task InsertRequestObjectAsync()
        {
            // Snippet: InsertAsync(InsertNodeTemplateRequest, CallSettings)
            // Additional: InsertAsync(InsertNodeTemplateRequest, CancellationToken)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            InsertNodeTemplateRequest request = new InsertNodeTemplateRequest
            {
                RequestId = "",
                NodeTemplateResource = new NodeTemplate(),
                Region = "",
                Project = "",
            };
            // Make the request
            lro::Operation<Operation, Operation> response = await nodeTemplatesClient.InsertAsync(request);

            // Poll until the returned long-running operation is complete
            lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
            // Retrieve the operation result
            Operation result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            lro::Operation<Operation, Operation> retrievedResponse = await nodeTemplatesClient.PollOnceInsertAsync(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }

        /// Snippet for Insert
        public void Insert()
        {
            // Snippet: Insert(string, string, NodeTemplate, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            string project = "";
            string region = "";
            NodeTemplate nodeTemplateResource = new NodeTemplate();
            // Make the request
            lro::Operation<Operation, Operation> response = nodeTemplatesClient.Insert(project, region, nodeTemplateResource);

            // Poll until the returned long-running operation is complete
            lro::Operation<Operation, Operation> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Operation result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            lro::Operation<Operation, Operation> retrievedResponse = nodeTemplatesClient.PollOnceInsert(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }

        /// Snippet for InsertAsync
        public async Task InsertAsync()
        {
            // Snippet: InsertAsync(string, string, NodeTemplate, CallSettings)
            // Additional: InsertAsync(string, string, NodeTemplate, CancellationToken)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            string project = "";
            string region = "";
            NodeTemplate nodeTemplateResource = new NodeTemplate();
            // Make the request
            lro::Operation<Operation, Operation> response = await nodeTemplatesClient.InsertAsync(project, region, nodeTemplateResource);

            // Poll until the returned long-running operation is complete
            lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
            // Retrieve the operation result
            Operation result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            lro::Operation<Operation, Operation> retrievedResponse = await nodeTemplatesClient.PollOnceInsertAsync(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }

        /// Snippet for List
        public void ListRequestObject()
        {
            // Snippet: List(ListNodeTemplatesRequest, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            ListNodeTemplatesRequest request = new ListNodeTemplatesRequest
            {
                Region = "",
                OrderBy = "",
                Project = "",
                Filter = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedEnumerable<NodeTemplateList, NodeTemplate> response = nodeTemplatesClient.List(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (NodeTemplate item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (NodeTemplateList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (NodeTemplate item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            }

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page<NodeTemplate> singlePage = response.ReadPage(pageSize);
            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (NodeTemplate item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }

        /// Snippet for ListAsync
        public async Task ListRequestObjectAsync()
        {
            // Snippet: ListAsync(ListNodeTemplatesRequest, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            ListNodeTemplatesRequest request = new ListNodeTemplatesRequest
            {
                Region = "",
                OrderBy = "",
                Project = "",
                Filter = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedAsyncEnumerable<NodeTemplateList, NodeTemplate> response = nodeTemplatesClient.ListAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((NodeTemplate item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((NodeTemplateList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (NodeTemplate item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page<NodeTemplate> singlePage = await response.ReadPageAsync(pageSize);
            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (NodeTemplate item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }

        /// Snippet for List
        public void List()
        {
            // Snippet: List(string, string, string, int?, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            string project = "";
            string region = "";
            // Make the request
            PagedEnumerable<NodeTemplateList, NodeTemplate> response = nodeTemplatesClient.List(project, region);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (NodeTemplate item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (NodeTemplateList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (NodeTemplate item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            }

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page<NodeTemplate> singlePage = response.ReadPage(pageSize);
            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (NodeTemplate item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }

        /// Snippet for ListAsync
        public async Task ListAsync()
        {
            // Snippet: ListAsync(string, string, string, int?, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            string project = "";
            string region = "";
            // Make the request
            PagedAsyncEnumerable<NodeTemplateList, NodeTemplate> response = nodeTemplatesClient.ListAsync(project, region);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((NodeTemplate item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((NodeTemplateList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (NodeTemplate item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page<NodeTemplate> singlePage = await response.ReadPageAsync(pageSize);
            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (NodeTemplate item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }

        /// Snippet for SetIamPolicy
        public void SetIamPolicyRequestObject()
        {
            // Snippet: SetIamPolicy(SetIamPolicyNodeTemplateRequest, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            SetIamPolicyNodeTemplateRequest request = new SetIamPolicyNodeTemplateRequest
            {
                Region = "",
                Resource = "",
                Project = "",
                RegionSetPolicyRequestResource = new RegionSetPolicyRequest(),
            };
            // Make the request
            Policy response = nodeTemplatesClient.SetIamPolicy(request);
            // End snippet
        }

        /// Snippet for SetIamPolicyAsync
        public async Task SetIamPolicyRequestObjectAsync()
        {
            // Snippet: SetIamPolicyAsync(SetIamPolicyNodeTemplateRequest, CallSettings)
            // Additional: SetIamPolicyAsync(SetIamPolicyNodeTemplateRequest, CancellationToken)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            SetIamPolicyNodeTemplateRequest request = new SetIamPolicyNodeTemplateRequest
            {
                Region = "",
                Resource = "",
                Project = "",
                RegionSetPolicyRequestResource = new RegionSetPolicyRequest(),
            };
            // Make the request
            Policy response = await nodeTemplatesClient.SetIamPolicyAsync(request);
            // End snippet
        }

        /// Snippet for SetIamPolicy
        public void SetIamPolicy()
        {
            // Snippet: SetIamPolicy(string, string, string, RegionSetPolicyRequest, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            string project = "";
            string region = "";
            string resource = "";
            RegionSetPolicyRequest regionSetPolicyRequestResource = new RegionSetPolicyRequest();
            // Make the request
            Policy response = nodeTemplatesClient.SetIamPolicy(project, region, resource, regionSetPolicyRequestResource);
            // End snippet
        }

        /// Snippet for SetIamPolicyAsync
        public async Task SetIamPolicyAsync()
        {
            // Snippet: SetIamPolicyAsync(string, string, string, RegionSetPolicyRequest, CallSettings)
            // Additional: SetIamPolicyAsync(string, string, string, RegionSetPolicyRequest, CancellationToken)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            string project = "";
            string region = "";
            string resource = "";
            RegionSetPolicyRequest regionSetPolicyRequestResource = new RegionSetPolicyRequest();
            // Make the request
            Policy response = await nodeTemplatesClient.SetIamPolicyAsync(project, region, resource, regionSetPolicyRequestResource);
            // End snippet
        }

        /// Snippet for TestIamPermissions
        public void TestIamPermissionsRequestObject()
        {
            // Snippet: TestIamPermissions(TestIamPermissionsNodeTemplateRequest, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            TestIamPermissionsNodeTemplateRequest request = new TestIamPermissionsNodeTemplateRequest
            {
                Region = "",
                Resource = "",
                Project = "",
                TestPermissionsRequestResource = new TestPermissionsRequest(),
            };
            // Make the request
            TestPermissionsResponse response = nodeTemplatesClient.TestIamPermissions(request);
            // End snippet
        }

        /// Snippet for TestIamPermissionsAsync
        public async Task TestIamPermissionsRequestObjectAsync()
        {
            // Snippet: TestIamPermissionsAsync(TestIamPermissionsNodeTemplateRequest, CallSettings)
            // Additional: TestIamPermissionsAsync(TestIamPermissionsNodeTemplateRequest, CancellationToken)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            TestIamPermissionsNodeTemplateRequest request = new TestIamPermissionsNodeTemplateRequest
            {
                Region = "",
                Resource = "",
                Project = "",
                TestPermissionsRequestResource = new TestPermissionsRequest(),
            };
            // Make the request
            TestPermissionsResponse response = await nodeTemplatesClient.TestIamPermissionsAsync(request);
            // End snippet
        }

        /// Snippet for TestIamPermissions
        public void TestIamPermissions()
        {
            // Snippet: TestIamPermissions(string, string, string, TestPermissionsRequest, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            string project = "";
            string region = "";
            string resource = "";
            TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
            // Make the request
            TestPermissionsResponse response = nodeTemplatesClient.TestIamPermissions(project, region, resource, testPermissionsRequestResource);
            // End snippet
        }

        /// Snippet for TestIamPermissionsAsync
        public async Task TestIamPermissionsAsync()
        {
            // Snippet: TestIamPermissionsAsync(string, string, string, TestPermissionsRequest, CallSettings)
            // Additional: TestIamPermissionsAsync(string, string, string, TestPermissionsRequest, CancellationToken)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = await NodeTemplatesClient.CreateAsync();
            // Initialize request argument(s)
            string project = "";
            string region = "";
            string resource = "";
            TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
            // Make the request
            TestPermissionsResponse response = await nodeTemplatesClient.TestIamPermissionsAsync(project, region, resource, testPermissionsRequestResource);
            // End snippet
        }
    }
}


text:
This module enables connectivity with hbase via thrift and happybase.
It is the core module to consume NCDC rest services


text:
namespace NutriStore.Model.Data.RepositorioBase
{
    public interface IRepositorio<T> where T : class
    {
        void Save(T entidade);

        void Delete(T entidade);

        T Get(int id);
    }
}


text:
var UnbufferedFd = exports
var processSend = require('./processSend')

UnbufferedFd.of = function(fd) {
  return fd
}

UnbufferedFd.send = function(fd, message, callback) {
  processSend(fd, message, callback)
}

UnbufferedFd.discard = function() {
}


text:
// MESSAGE HIL_CONTROLS PACKING
package com.MAVLink.Messages.ardupilotmega;

import com.MAVLink.Messages.MAVLinkMessage;
import com.MAVLink.Messages.MAVLinkPayload;
import com.MAVLink.Messages.MAVLinkPacket;
//import android.util.Log;

/**
* Sent from autopilot to simulation. Hardware in the loop control outputs
*/
public class msg_hil_controls extends MAVLinkMessage{

	public static final int MAVLINK_MSG_ID_HIL_CONTROLS = 91;
	public static final int MAVLINK_MSG_LENGTH = 42;
	private static final long serialVersionUID = MAVLINK_MSG_ID_HIL_CONTROLS;

 	/**
	* Timestamp (microseconds since UNIX epoch or microseconds since system boot)
	*/
	public long time_usec;
 	/**
	* Control output -1 .. 1
	*/
	public float roll_ailerons;
 	/**
	* Control output -1 .. 1
	*/
	public float pitch_elevator;
 	/**
	* Control output -1 .. 1
	*/
	public float yaw_rudder;
 	/**
	* Throttle 0 .. 1
	*/
	public float throttle;
 	/**
	* Aux 1, -1 .. 1
	*/
	public float aux1;
 	/**
	* Aux 2, -1 .. 1
	*/
	public float aux2;
 	/**
	* Aux 3, -1 .. 1
	*/
	public float aux3;
 	/**
	* Aux 4, -1 .. 1
	*/
	public float aux4;
 	/**
	* System mode (MAV_MODE)
	*/
	public byte mode;
 	/**
	* Navigation mode (MAV_NAV_MODE)
	*/
	public byte nav_mode;

	/**
	 * Generates the payload for a mavlink message for a message of this type
	 * @return
	 */
	public MAVLinkPacket pack(){
		MAVLinkPacket packet = new MAVLinkPacket();
		packet.len = MAVLINK_MSG_LENGTH;
		packet.sysid = 255;
		packet.compid = 190;
		packet.msgid = MAVLINK_MSG_ID_HIL_CONTROLS;
		packet.payload.putLong(time_usec);
		packet.payload.putFloat(roll_ailerons);
		packet.payload.putFloat(pitch_elevator);
		packet.payload.putFloat(yaw_rudder);
		packet.payload.putFloat(throttle);
		packet.payload.putFloat(aux1);
		packet.payload.putFloat(aux2);
		packet.payload.putFloat(aux3);
		packet.payload.putFloat(aux4);
		packet.payload.putByte(mode);
		packet.payload.putByte(nav_mode);
		return packet;
	}

    /**
     * Decode a hil_controls message into this class fields
     *
     * @param payload The message to decode
     */
    public void unpack(MAVLinkPayload payload) {
        payload.resetIndex();
	    time_usec = payload.getLong();
	    roll_ailerons = payload.getFloat();
	    pitch_elevator = payload.getFloat();
	    yaw_rudder = payload.getFloat();
	    throttle = payload.getFloat();
	    aux1 = payload.getFloat();
	    aux2 = payload.getFloat();
	    aux3 = payload.getFloat();
	    aux4 = payload.getFloat();
	    mode = payload.getByte();
	    nav_mode = payload.getByte();
    }

     /**
     * Constructor for a new message, just initializes the msgid
     */
    public msg_hil_controls(){
    	msgid = MAVLINK_MSG_ID_HIL_CONTROLS;
    }

    /**
     * Constructor for a new message, initializes the message with the payload
     * from a mavlink packet
     *
     */
    public msg_hil_controls(MAVLinkPacket mavLinkPacket){
        this.sysid = mavLinkPacket.sysid;
        this.compid = mavLinkPacket.compid;
        this.msgid = MAVLINK_MSG_ID_HIL_CONTROLS;
        unpack(mavLinkPacket.payload);
        //Log.d("MAVLink", "HIL_CONTROLS");
        //Log.d("MAVLINK_MSG_ID_HIL_CONTROLS", toString());
    }

    /**
     * Returns a string with the MSG name and data
     */
    public String toString(){
    	return "MAVLINK_MSG_ID_HIL_CONTROLS -"+" time_usec:"+time_usec+" roll_ailerons:"+roll_ailerons+" pitch_elevator:"+pitch_elevator+" yaw_rudder:"+yaw_rudder+" throttle:"+throttle+" aux1:"+aux1+" aux2:"+aux2+" aux3:"+aux3+" aux4:"+aux4+" mode:"+mode+" nav_mode:"+nav_mode+"";
    }
}


text:
<?php

namespace Websoftwares\Domain\Mail\Payload;

use FOA\DomainPayload\AbstractPayload;

/**
 * Delivered.
 *
 * @license http://opensource.org/licenses/MIT
 * @author Boris <boris@websoftwar.es>
 */
class Delivered extends AbstractPayload
{
}


text:
CKEDITOR.plugins.setLang( 'toolbar', 'de', {
	toolbarCollapse: 'Symbolleiste einklappen',
	toolbarExpand: 'Symbolleiste ausklappen',
	toolbarGroups: {
		document: 'Dokument',
		clipboard: 'Zwischenablage/Rückgängig',
		editing: 'Editieren',
		forms: 'Formularen',
		basicstyles: 'Grundstile',
		paragraph: 'Absatz',
		links: 'Links',
		insert: 'Einfügen',
		styles: 'Stile',
		colors: 'Farben',
		tools: 'Werkzeuge'
	},
	toolbars: 'Editor Symbolleisten'
} );


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

        <title>
      Design
      Methodology and Design Practice
    </title>

            Design
      Methodology and Design Practice

      Authors

      Jonas Löwgren, Erik Stolterman

      Notes

      Stolterman seems to be at the intersection of Interaction Design and
      Participatory design, co-publishing for example with Fallman.

      Field of Study

      Concepts

      Quotations

      "For several decades, the field of design methodology has addressed
      design processes, epistemological considerations, and work practices in
      the design disciplines [2, 10, 11, 13]. There are good reasons for
      considering the development of software as a design discipline [7, 14]."

      "our purpose here is to argue that software design could benefit from
      other, more traditional design disciplines"

      References

      Methodology


text:
using System;
using System.Reflection;
using System.Diagnostics;
using System.Collections.Generic;
using System.Reflection.Runtime.General;

using Internal.Reflection.Tracing;

using Internal.Metadata.NativeFormat;

namespace System.Reflection.Runtime.TypeInfos
{
    internal sealed partial class RuntimeGenericParameterTypeInfoForTypes : RuntimeGenericParameterTypeInfo
    {
        private RuntimeGenericParameterTypeInfoForTypes(MetadataReader reader, GenericParameterHandle genericParameterHandle, RuntimeTypeInfo declaringRuntimeNamedTypeInfo)
           : base(reader, genericParameterHandle)
        {
            _declaringRuntimeNamedTypeInfo = declaringRuntimeNamedTypeInfo;
        }

        public sealed override MethodBase DeclaringMethod
        {
            get
            {
#if ENABLE_REFLECTION_TRACE
                if (ReflectionTrace.Enabled)
                    ReflectionTrace.TypeInfo_DeclaringMethod(this);
#endif
                return null;
            }
        }

        internal sealed override Type InternalDeclaringType
        {
            get
            {
                return _declaringRuntimeNamedTypeInfo.AsType();
            }
        }

        internal sealed override TypeContext TypeContext
        {
            get
            {
                return _declaringRuntimeNamedTypeInfo.TypeContext;
            }
        }

        private readonly RuntimeTypeInfo _declaringRuntimeNamedTypeInfo;
    }
}


text:
layout: splash
permalink: /portfolio/
title: Tyler Ehrlich's Teaching Portfolio
header:
  overlay_image:  /assets/images/portfolio2.jpg
  overlay_color: "#000"
  overlay_filter: "0.5"
  actions:
  - label: "Contact: ehrlich@cornell.edu"
    url: "mailto:tylerlehrlich@gmail.com"
excerpt: "Applicant - Director of Bands, Decatur High School"
intro1:
- excerpt: 'These first examples are resources created through video editing and our online learning platform (Microsoft Teams) to connect with students during the COVID-19 school closure. We have been successful in continuing to engage students and support them through formal and informal methods.'
feature_row:
- image_path: /assets/images/eighthgraders.gif
  alt: "Incoming Ninth Grader Band Placement Information"
  title: "Incoming Ninth Grader Band Placements"
  excerpt: "This video reviewed information for rising ninth graders regarding optional placement auditions."
  url: "https://www.youtube.com/watch?v=esW6fMKnzWA&feature=youtu.be"
  btn_label: "YouTube Link"
  btn_class: "btn--primary"
- image_path: assets/images/mbvideo.gif
  alt: "Marching Band Recruitment Video"
  title: 'Marching Band Recruitment Video'
  excerpt: "This is a new recruitment video designed for Fall 2020. Students submitted personal videos and I cut them with previous footage."
  url: "https://www.youtube.com/watch?v=sRMU5mK8LVs"
  btn_label: "YouTube Link"
  btn_class: "btn--primary"
- image_path: /assets/images/announcements.gif
  title: "March 30 – Band Announcements"
  excerpt: "This video shares important band announcements for students to watch remotely."
  url: "https://www.youtube.com/watch?v=Uxo8t3qsHI4"
  btn_label: "YouTube Link"
  btn_class: "btn--primary"
intro2:
  - excerpt: 'Here are additional resources representing my teaching experiences at Centennial High School and Emory University.'
feature_row2:
- image_path: /assets/images/midwest.gif
  alt: "December 2019 Presentation at the International Midwest Band and Orchestra Clinic"
  title: "December 2019 Presentation at the International Midwest Band and Orchestra Clinic"
  excerpt: 'This past December I gave a presentation at the International Midwest Band and Orchestra Clinic in Chicago, IL. Over 18,000 music educators attend this clinic, and my session had over 100 people in attendance. I shared my slides and resources at the below link.'
  url: "/musictech-resources/"
  btn_label: "Blog Post"
  btn_class: "btn--primary"
feature_row3:
- image_path: /assets/images/febconcert.gif
  alt: "Emory Wind Ensemble Concert – Feb 21, 2019"
  title: "Emory Wind Ensemble Concert – Feb 21, 2019"
  excerpt: 'Here is the live stream for the February 21 Emory Wind Ensemble concert. (Decatur High School alumnus Elise Kulers is playing clarinet here!)'
  url: "https://www.youtube.com/watch?v=LoHzK5X5814"
  btn_label: "YouTube Link"
  btn_class: "btn--primary"
feature_row4:
- image_path: /assets/images/threeyearplan.gif
  alt: "Centennial Band 3-Year Plan"
  title: "Centennial Band 3-Year Plan"
  excerpt: 'After my first year at Centennial, I compiled a document that assessed where we were as a band program, where we want to be, and methods to achieve those goals. I presented this to the principal to discuss ways the school administration could assist in improving the overall student experience for those in band.'
  url: "assets/threeyear.pdf"
  btn_label: "PDF Link"
  btn_class: "btn--primary"

---
{% include feature_row id="intro1" type="center" %}

{% include feature_row %}

{% include feature_row id="intro2" type="center" %}

{% include feature_row id="feature_row2" type="left" %}

{% include feature_row id="feature_row3" type="right" %}

{% include feature_row id="feature_row4" type="left" %}


text:
"use strict";

const conversions = require("webidl-conversions");
const utils = require("./utils.js");

const impl = utils.implSymbol;

class Slotable {
  constructor() {
    throw new TypeError("Illegal constructor");
  }

  get assignedSlot() {
    if (!this || !module.exports.is(this)) {
      throw new TypeError("Illegal invocation");
    }

    return utils.tryWrapperForImpl(this[impl]["assignedSlot"]);
  }
}
Object.defineProperties(Slotable.prototype, {
  assignedSlot: { enumerable: true },
  [Symbol.toStringTag]: { value: "Slotable", configurable: true }
});
const iface = {
  // When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
  // method into this array. It allows objects that directly implements *those* interfaces to be recognized as
  // implementing this mixin interface.
  _mixedIntoPredicates: [],
  is(obj) {
    if (obj) {
      if (utils.hasOwn(obj, impl) && obj[impl] instanceof Impl.implementation) {
        return true;
      }
      for (const isMixedInto of module.exports._mixedIntoPredicates) {
        if (isMixedInto(obj)) {
          return true;
        }
      }
    }
    return false;
  },
  isImpl(obj) {
    if (obj) {
      if (obj instanceof Impl.implementation) {
        return true;
      }

      const wrapper = utils.wrapperForImpl(obj);
      for (const isMixedInto of module.exports._mixedIntoPredicates) {
        if (isMixedInto(wrapper)) {
          return true;
        }
      }
    }
    return false;
  },
  convert(obj, { context = "The provided value" } = {}) {
    if (module.exports.is(obj)) {
      return utils.implForWrapper(obj);
    }
    throw new TypeError(`${context} is not of type 'Slotable'.`);
  },

  create(constructorArgs, privateData) {
    let obj = Object.create(Slotable.prototype);
    obj = this.setup(obj, constructorArgs, privateData);
    return obj;
  },
  createImpl(constructorArgs, privateData) {
    let obj = Object.create(Slotable.prototype);
    obj = this.setup(obj, constructorArgs, privateData);
    return utils.implForWrapper(obj);
  },
  _internalSetup(obj) {},
  setup(obj, constructorArgs, privateData) {
    if (!privateData) privateData = {};

    privateData.wrapper = obj;

    this._internalSetup(obj);
    Object.defineProperty(obj, impl, {
      value: new Impl.implementation(constructorArgs, privateData),
      configurable: true
    });

    obj[impl][utils.wrapperSymbol] = obj;
    if (Impl.init) {
      Impl.init(obj[impl], privateData);
    }
    return obj;
  },
  interface: Slotable,
  expose: {
    Window: { Slotable }
  }
}; // iface
module.exports = iface;

const Impl = require("../nodes/Slotable-impl.js");


text:
using Newtonsoft.Json;

namespace Disqus.NET.Models
{
    public class DisqusThreadVoteStats
    {
        [JsonProperty("id")]
        public string Id { get; set; }

        [JsonProperty("vote")]
        public int Vote { get; set; }

        [JsonProperty("delta")]
        public int Delta { get; set; }

        [JsonProperty("likesDelta")]
        public int LikesDelta { get; set; }

        [JsonProperty("dislikesDelta")]
        public int DislikesDelta { get; set; }

        [JsonProperty("thread")]
        public DisqusThread Thread { get; set; }
    }
}


text:
<?php

namespace Drupal\dblog\Form;

use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\Core\Database\Connection;
use Drupal\Core\Form\ConfirmFormBase;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Provides a confirmation form before clearing out the logs.
 */
class DblogClearLogConfirmForm extends ConfirmFormBase {

  /**
   * The database connection.
   *
   * @var \Drupal\Core\Database\Connection
   */
  protected $connection;

  /**
   * Constructs a new DblogClearLogConfirmForm.
   *
   * @param \Drupal\Core\Database\Connection $connection
   *   The database connection.
   */
  public function __construct(Connection $connection) {
    $this->connection = $connection;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static(
      $container->get('database')
    );
  }

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'dblog_confirm';
  }

  /**
   * {@inheritdoc}
   */
  public function getQuestion() {
    return $this->t('Are you sure you want to delete the recent logs?');
  }

  /**
   * {@inheritdoc}
   */
  public function getCancelUrl() {
    return new Url('dblog.overview');
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $_SESSION['dblog_overview_filter'] = array();
    $this->connection->delete('watchdog')->execute();
    drupal_set_message($this->t('Database log cleared.'));
    $form_state->setRedirectUrl($this->getCancelUrl());
  }

}