text:
package com.google.cloud.errorreporting.v1beta1;

import static com.google.cloud.errorreporting.v1beta1.PagedResponseWrappers.ListEventsPagedResponse;
import static com.google.cloud.errorreporting.v1beta1.PagedResponseWrappers.ListGroupStatsPagedResponse;

import com.google.api.core.ApiFuture;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.PropertiesProvider;
import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.grpc.CallContext;
import com.google.api.gax.grpc.ChannelProvider;
import com.google.api.gax.grpc.ClientSettings;
import com.google.api.gax.grpc.ExecutorProvider;
import com.google.api.gax.grpc.InstantiatingChannelProvider;
import com.google.api.gax.grpc.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.PageContext;
import com.google.api.gax.grpc.PagedCallSettings;
import com.google.api.gax.grpc.PagedListDescriptor;
import com.google.api.gax.grpc.PagedListResponseFactory;
import com.google.api.gax.grpc.SimpleCallSettings;
import com.google.api.gax.grpc.UnaryCallSettings;
import com.google.api.gax.grpc.UnaryCallable;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.devtools.clouderrorreporting.v1beta1.DeleteEventsRequest;
import com.google.devtools.clouderrorreporting.v1beta1.DeleteEventsResponse;
import com.google.devtools.clouderrorreporting.v1beta1.ErrorEvent;
import com.google.devtools.clouderrorreporting.v1beta1.ErrorGroupStats;
import com.google.devtools.clouderrorreporting.v1beta1.ListEventsRequest;
import com.google.devtools.clouderrorreporting.v1beta1.ListEventsResponse;
import com.google.devtools.clouderrorreporting.v1beta1.ListGroupStatsRequest;
import com.google.devtools.clouderrorreporting.v1beta1.ListGroupStatsResponse;
import com.google.protobuf.ExperimentalApi;
import io.grpc.Status;
import java.io.IOException;
import java.util.List;
import javax.annotation.Generated;
import org.threeten.bp.Duration;

// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
 * Settings class to configure an instance of {@link ErrorStatsServiceClient}.
 *
 *
The default instance has everything set to sensible defaults:
 *
 *

 *
The default service address (clouderrorreporting.googleapis.com) and default port (443) are
 *       used.
 *
Credentials are acquired automatically through Application Default Credentials.
 *
Retries are configured for idempotent methods but not for non-idempotent methods.
 *

 *
 *
The builder of this class is recursive, so contained classes are themselves builders. When
 * build() is called, the tree of builders is called to create the complete settings object. For
 * example, to set the total timeout of deleteEvents to 30 seconds:
 *
 *

 *
 * ErrorStatsServiceSettings.Builder errorStatsServiceSettingsBuilder =
 *     ErrorStatsServiceSettings.defaultBuilder();
 * errorStatsServiceSettingsBuilder.deleteEventsSettings().getRetrySettingsBuilder()
 *     .setTotalTimeout(Duration.ofSeconds(30));
 * ErrorStatsServiceSettings errorStatsServiceSettings = errorStatsServiceSettingsBuilder.build();
 *
 *

 */
@Generated("by GAPIC v0.0.5")
@ExperimentalApi
public class ErrorStatsServiceSettings extends ClientSettings {
  /** The default scopes of the service. */
  private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES =
      ImmutableList.<String>builder().add("https://www.googleapis.com/auth/cloud-platform").build();

  private static final String DEFAULT_GAPIC_NAME = "gapic";
  private static final String DEFAULT_GAPIC_VERSION = "";

  private static final String PROPERTIES_FILE =
      "/com/google/cloud/errorreporting/project.properties";
  private static final String META_VERSION_KEY = "artifact.version";

  private static String gapicVersion;

  private static final io.grpc.MethodDescriptor<ListGroupStatsRequest, ListGroupStatsResponse>
      METHOD_LIST_GROUP_STATS =
          io.grpc.MethodDescriptor.create(
              io.grpc.MethodDescriptor.MethodType.UNARY,
              "google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/ListGroupStats",
              io.grpc.protobuf.ProtoUtils.marshaller(ListGroupStatsRequest.getDefaultInstance()),
              io.grpc.protobuf.ProtoUtils.marshaller(ListGroupStatsResponse.getDefaultInstance()));
  private static final io.grpc.MethodDescriptor<ListEventsRequest, ListEventsResponse>
      METHOD_LIST_EVENTS =
          io.grpc.MethodDescriptor.create(
              io.grpc.MethodDescriptor.MethodType.UNARY,
              "google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/ListEvents",
              io.grpc.protobuf.ProtoUtils.marshaller(ListEventsRequest.getDefaultInstance()),
              io.grpc.protobuf.ProtoUtils.marshaller(ListEventsResponse.getDefaultInstance()));
  private static final io.grpc.MethodDescriptor<DeleteEventsRequest, DeleteEventsResponse>
      METHOD_DELETE_EVENTS =
          io.grpc.MethodDescriptor.create(
              io.grpc.MethodDescriptor.MethodType.UNARY,
              "google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/DeleteEvents",
              io.grpc.protobuf.ProtoUtils.marshaller(DeleteEventsRequest.getDefaultInstance()),
              io.grpc.protobuf.ProtoUtils.marshaller(DeleteEventsResponse.getDefaultInstance()));

  private final PagedCallSettings<
          ListGroupStatsRequest, ListGroupStatsResponse, ListGroupStatsPagedResponse>
      listGroupStatsSettings;
  private final PagedCallSettings<ListEventsRequest, ListEventsResponse, ListEventsPagedResponse>
      listEventsSettings;
  private final SimpleCallSettings<DeleteEventsRequest, DeleteEventsResponse> deleteEventsSettings;

  /** Returns the object with the settings used for calls to listGroupStats. */
  public PagedCallSettings<
          ListGroupStatsRequest, ListGroupStatsResponse, ListGroupStatsPagedResponse>
      listGroupStatsSettings() {
    return listGroupStatsSettings;
  }

  /** Returns the object with the settings used for calls to listEvents. */
  public PagedCallSettings<ListEventsRequest, ListEventsResponse, ListEventsPagedResponse>
      listEventsSettings() {
    return listEventsSettings;
  }

  /** Returns the object with the settings used for calls to deleteEvents. */
  public SimpleCallSettings<DeleteEventsRequest, DeleteEventsResponse> deleteEventsSettings() {
    return deleteEventsSettings;
  }

  /** Returns a builder for the default ExecutorProvider for this service. */
  public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
    return InstantiatingExecutorProvider.newBuilder();
  }

  /** Returns the default service endpoint. */
  public static String getDefaultEndpoint() {
    return "clouderrorreporting.googleapis.com:443";
  }

  /** Returns the default service scopes. */
  public static List<String> getDefaultServiceScopes() {
    return DEFAULT_SERVICE_SCOPES;
  }

  /** Returns a builder for the default credentials for this service. */
  public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
    return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
  }

  /** Returns a builder for the default ChannelProvider for this service. */
  public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder() {
    return InstantiatingChannelProvider.newBuilder()
        .setEndpoint(getDefaultEndpoint())
        .setGeneratorHeader(DEFAULT_GAPIC_NAME, getGapicVersion())
        .setCredentialsProvider(defaultCredentialsProviderBuilder().build());
  }

  private static String getGapicVersion() {
    if (gapicVersion == null) {
      gapicVersion =
          PropertiesProvider.loadProperty(
              ErrorStatsServiceSettings.class, PROPERTIES_FILE, META_VERSION_KEY);
      gapicVersion = gapicVersion == null ? DEFAULT_GAPIC_VERSION : gapicVersion;
    }
    return gapicVersion;
  }

  /** Returns a builder for this class with recommended defaults. */
  public static Builder defaultBuilder() {
    return Builder.createDefault();
  }

  /** Returns a new builder for this class. */
  public static Builder newBuilder() {
    return new Builder();
  }

  /** Returns a builder containing all the values of this settings class. */
  public Builder toBuilder() {
    return new Builder(this);
  }

  private ErrorStatsServiceSettings(Builder settingsBuilder) throws IOException {
    super(settingsBuilder.getExecutorProvider(), settingsBuilder.getChannelProvider());

    listGroupStatsSettings = settingsBuilder.listGroupStatsSettings().build();
    listEventsSettings = settingsBuilder.listEventsSettings().build();
    deleteEventsSettings = settingsBuilder.deleteEventsSettings().build();
  }

  private static final PagedListDescriptor<
          ListGroupStatsRequest, ListGroupStatsResponse, ErrorGroupStats>
      LIST_GROUP_STATS_PAGE_STR_DESC =
          new PagedListDescriptor<
              ListGroupStatsRequest, ListGroupStatsResponse, ErrorGroupStats>() {
            @Override
            public String emptyToken() {
              return "";
            }

            @Override
            public ListGroupStatsRequest injectToken(ListGroupStatsRequest payload, String token) {
              return ListGroupStatsRequest.newBuilder(payload).setPageToken(token).build();
            }

            @Override
            public ListGroupStatsRequest injectPageSize(
                ListGroupStatsRequest payload, int pageSize) {
              return ListGroupStatsRequest.newBuilder(payload).setPageSize(pageSize).build();
            }

            @Override
            public Integer extractPageSize(ListGroupStatsRequest payload) {
              return payload.getPageSize();
            }

            @Override
            public String extractNextToken(ListGroupStatsResponse payload) {
              return payload.getNextPageToken();
            }

            @Override
            public Iterable<ErrorGroupStats> extractResources(ListGroupStatsResponse payload) {
              return payload.getErrorGroupStatsList();
            }
          };

  private static final PagedListDescriptor<ListEventsRequest, ListEventsResponse, ErrorEvent>
      LIST_EVENTS_PAGE_STR_DESC =
          new PagedListDescriptor<ListEventsRequest, ListEventsResponse, ErrorEvent>() {
            @Override
            public String emptyToken() {
              return "";
            }

            @Override
            public ListEventsRequest injectToken(ListEventsRequest payload, String token) {
              return ListEventsRequest.newBuilder(payload).setPageToken(token).build();
            }

            @Override
            public ListEventsRequest injectPageSize(ListEventsRequest payload, int pageSize) {
              return ListEventsRequest.newBuilder(payload).setPageSize(pageSize).build();
            }

            @Override
            public Integer extractPageSize(ListEventsRequest payload) {
              return payload.getPageSize();
            }

            @Override
            public String extractNextToken(ListEventsResponse payload) {
              return payload.getNextPageToken();
            }

            @Override
            public Iterable<ErrorEvent> extractResources(ListEventsResponse payload) {
              return payload.getErrorEventsList();
            }
          };

  private static final PagedListResponseFactory<
          ListGroupStatsRequest, ListGroupStatsResponse, ListGroupStatsPagedResponse>
      LIST_GROUP_STATS_PAGE_STR_FACT =
          new PagedListResponseFactory<
              ListGroupStatsRequest, ListGroupStatsResponse, ListGroupStatsPagedResponse>() {
            @Override
            public ApiFuture<ListGroupStatsPagedResponse> getFuturePagedResponse(
                UnaryCallable<ListGroupStatsRequest, ListGroupStatsResponse> callable,
                ListGroupStatsRequest request,
                CallContext context,
                ApiFuture<ListGroupStatsResponse> futureResponse) {
              PageContext<ListGroupStatsRequest, ListGroupStatsResponse, ErrorGroupStats>
                  pageContext =
                      PageContext.create(
                          callable, LIST_GROUP_STATS_PAGE_STR_DESC, request, context);
              return ListGroupStatsPagedResponse.createAsync(pageContext, futureResponse);
            }
          };

  private static final PagedListResponseFactory<
          ListEventsRequest, ListEventsResponse, ListEventsPagedResponse>
      LIST_EVENTS_PAGE_STR_FACT =
          new PagedListResponseFactory<
              ListEventsRequest, ListEventsResponse, ListEventsPagedResponse>() {
            @Override
            public ApiFuture<ListEventsPagedResponse> getFuturePagedResponse(
                UnaryCallable<ListEventsRequest, ListEventsResponse> callable,
                ListEventsRequest request,
                CallContext context,
                ApiFuture<ListEventsResponse> futureResponse) {
              PageContext<ListEventsRequest, ListEventsResponse, ErrorEvent> pageContext =
                  PageContext.create(callable, LIST_EVENTS_PAGE_STR_DESC, request, context);
              return ListEventsPagedResponse.createAsync(pageContext, futureResponse);
            }
          };

  /** Builder for ErrorStatsServiceSettings. */
  public static class Builder extends ClientSettings.Builder {
    private final ImmutableList<UnaryCallSettings.Builder> unaryMethodSettingsBuilders;

    private final PagedCallSettings.Builder<
            ListGroupStatsRequest, ListGroupStatsResponse, ListGroupStatsPagedResponse>
        listGroupStatsSettings;
    private final PagedCallSettings.Builder<
            ListEventsRequest, ListEventsResponse, ListEventsPagedResponse>
        listEventsSettings;
    private final SimpleCallSettings.Builder<DeleteEventsRequest, DeleteEventsResponse>
        deleteEventsSettings;

    private static final ImmutableMap<String, ImmutableSet<Status.Code>> RETRYABLE_CODE_DEFINITIONS;

    static {
      ImmutableMap.Builder<String, ImmutableSet<Status.Code>> definitions = ImmutableMap.builder();
      definitions.put(
          "idempotent",
          Sets.immutableEnumSet(
              Lists.<Status.Code>newArrayList(
                  Status.Code.DEADLINE_EXCEEDED, Status.Code.UNAVAILABLE)));
      definitions.put(
          "non_idempotent",
          Sets.immutableEnumSet(Lists.<Status.Code>newArrayList(Status.Code.UNAVAILABLE)));
      RETRYABLE_CODE_DEFINITIONS = definitions.build();
    }

    private static final ImmutableMap<String, RetrySettings.Builder> RETRY_PARAM_DEFINITIONS;

    static {
      ImmutableMap.Builder<String, RetrySettings.Builder> definitions = ImmutableMap.builder();
      RetrySettings.Builder settingsBuilder = null;
      settingsBuilder =
          RetrySettings.newBuilder()
              .setInitialRetryDelay(Duration.ofMillis(100L))
              .setRetryDelayMultiplier(1.3)
              .setMaxRetryDelay(Duration.ofMillis(60000L))
              .setInitialRpcTimeout(Duration.ofMillis(20000L))
              .setRpcTimeoutMultiplier(1.0)
              .setMaxRpcTimeout(Duration.ofMillis(20000L))
              .setTotalTimeout(Duration.ofMillis(600000L));
      definitions.put("default", settingsBuilder);
      RETRY_PARAM_DEFINITIONS = definitions.build();
    }

    private Builder() {
      super(defaultChannelProviderBuilder().build());

      listGroupStatsSettings =
          PagedCallSettings.newBuilder(METHOD_LIST_GROUP_STATS, LIST_GROUP_STATS_PAGE_STR_FACT);

      listEventsSettings =
          PagedCallSettings.newBuilder(METHOD_LIST_EVENTS, LIST_EVENTS_PAGE_STR_FACT);

      deleteEventsSettings = SimpleCallSettings.newBuilder(METHOD_DELETE_EVENTS);

      unaryMethodSettingsBuilders =
          ImmutableList.<UnaryCallSettings.Builder>of(
              listGroupStatsSettings, listEventsSettings, deleteEventsSettings);
    }

    private static Builder createDefault() {
      Builder builder = new Builder();

      builder
          .listGroupStatsSettings()
          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
          .setRetrySettingsBuilder(RETRY_PARAM_DEFINITIONS.get("default"));

      builder
          .listEventsSettings()
          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
          .setRetrySettingsBuilder(RETRY_PARAM_DEFINITIONS.get("default"));

      builder
          .deleteEventsSettings()
          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
          .setRetrySettingsBuilder(RETRY_PARAM_DEFINITIONS.get("default"));

      return builder;
    }

    private Builder(ErrorStatsServiceSettings settings) {
      super(settings);

      listGroupStatsSettings = settings.listGroupStatsSettings.toBuilder();
      listEventsSettings = settings.listEventsSettings.toBuilder();
      deleteEventsSettings = settings.deleteEventsSettings.toBuilder();

      unaryMethodSettingsBuilders =
          ImmutableList.<UnaryCallSettings.Builder>of(
              listGroupStatsSettings, listEventsSettings, deleteEventsSettings);
    }

    @Override
    public Builder setExecutorProvider(ExecutorProvider executorProvider) {
      super.setExecutorProvider(executorProvider);
      return this;
    }

    @Override
    public Builder setChannelProvider(ChannelProvider channelProvider) {
      super.setChannelProvider(channelProvider);
      return this;
    }

    /**
     * Applies the given settings to all of the unary API methods in this service. Only values that
     * are non-null will be applied, so this method is not capable of un-setting any values.
     *
     *
Note: This method does not support applying settings to streaming methods.
     */
    public Builder applyToAllUnaryMethods(UnaryCallSettings.Builder unaryCallSettings)
        throws Exception {
      super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, unaryCallSettings);
      return this;
    }

    /** Returns the builder for the settings used for calls to listGroupStats. */
    public PagedCallSettings.Builder<
            ListGroupStatsRequest, ListGroupStatsResponse, ListGroupStatsPagedResponse>
        listGroupStatsSettings() {
      return listGroupStatsSettings;
    }

    /** Returns the builder for the settings used for calls to listEvents. */
    public PagedCallSettings.Builder<ListEventsRequest, ListEventsResponse, ListEventsPagedResponse>
        listEventsSettings() {
      return listEventsSettings;
    }

    /** Returns the builder for the settings used for calls to deleteEvents. */
    public SimpleCallSettings.Builder<DeleteEventsRequest, DeleteEventsResponse>
        deleteEventsSettings() {
      return deleteEventsSettings;
    }

    @Override
    public ErrorStatsServiceSettings build() throws IOException {
      return new ErrorStatsServiceSettings(this);
    }
  }
}


text:
/*============================================================================*/
/*!
 * @file dp_conf.h
 *
 * @brief Configuartion Module for DuinoPro (DP)
 *
 * Handles dynamic configuration of DP
 *
 * @date 2017/10/01
 * @author Jamie K. Phan
 *
 */
/*============================================================================*/

#ifndef DP_CONF_H_
#define DP_CONF_H_

#include <stdint.h>

/*******************************************************************************
 * DP Look-Up Table
 ******************************************************************************/
#define DP_LUT__N_PARAM 11

#define DP_LUT__COL_FIELD_LEN 0
#define DP_LUT__COL_MAX_VAL 1
#define DP_LUT__COL_MIN_VAL 2

#define LUT_IDX__LOG_LEVEL               0x00
#define LUT_IDX__SAMPLE_PERIOD           0x01
#define LUT_IDX__SLEEP_OVERHEAD          0x02
#define LUT_IDX__SENSOR_COMM_TYPE        0x03
#define LUT_IDX__SENSOR_RESOLUTION       0x04
#define LUT_IDX__SENSOR_CLK_SPEED        0x05
#define LUT_IDX__WSN_JOIN_DC_INIT        0x06
#define LUT_IDX__WSN_JOIN_DC_DECR        0x07
#define LUT_IDX__WSN_JOIN_WAIT_INIT      0x08
#define LUT_IDX__WSN_JOIN_WAIT_INCR      0x09
#define LUT_IDX__SLEEP_GUARD_TIMEOUT     0x10

//=====================================
/** @brief Ensures configuration parameters are set. If not set, default
 *         parameters are loaded from non-volatile memory. Once set, if a packet
 *         payload is passed as an argument, then the payload is parsed and the
 *         parameters contained therein are updated accordingly.
 *
 * @param package_payload The full packet payload received in a configuration
 *                        packet sent by the Dusty network manager
 *
 * @return 0 on success, 1 on failure
 */
uint8_t dp_conf_set(char *);

 //=====================================
 /** @brief Loads configuration from non-volatile memory and sets their values in
  *         volatile memory
  *
  * Default configurations will be set in non-volatile memory to ensure that the
  * device does not need to rely on a central host to broadcast configuration
  * information at startup. This will drastically reduce network startup loads.
  *
  * @return 0 on success, 1 on failure
  */
uint8_t dp_conf_default(void);

 //=====================================
 /** @brief Set the parameter's value in volatile memory
  *
  * @param param the parameter type byte received in the configuration packet
  * @param value the parameter value byte(s) received in the configuration packet
  *
  * @return 0 on success, 1 on failure
  */
uint8_t dp_conf_param_set(uint8_t, uint8_t);

 //=====================================
 /** @brief Get the current value of the param set in volatile memory
  *
  * @param param the parameter index
  *
  * @return the current value of the parameter
  */
uint8_t dp_conf_param_get_cur(uint8_t);

 //=====================================
 /** @brief Get a parameter's maximum allowable value
  *
  * This should be privately called
  *
  * @param param the parameter index
  *
  * @return the maximum value of the parameter
  */
uint8_t dp_conf_param_lookup_max(uint8_t);

 //=====================================
 /** @brief Get a parameter's minimum allowable value
  *
  * This should be privately called
  *
  * @param param the parameter index
  *
  * @return the minimum value of the parameter
  */
uint8_t dp_conf_param_lookup_min(uint8_t);

#endif /* DP_CONF_H_ */

redpajama_set_name: RedPajamaGithub


text:
from yowsup.common.http.warequest import WARequest
from yowsup.common.http.waresponseparser import JSONResponseParser
from yowsup.env import YowsupEnv
import os

class WAExistsRequest(WARequest):

    def __init__(self,cc, p_in, idx):
        super(WAExistsRequest,self).__init__()

        self.addParam("cc", cc)
        self.addParam("in", p_in)
        self.addParam("id", idx)
        self.addParam("lg", "en")
        self.addParam("lc", "GB")
        self.addParam("token", YowsupEnv.getCurrent().getToken(p_in))
        self.addParam("mistyped", '6')
        self.addParam('network_radio_type', '1')
        self.addParam('simnum', '1')
        self.addParam('s', '')
        self.addParam('copiedrc', '1')
        self.addParam('hasinrc', '1')
        self.addParam('rcmatch', '1')
        self.addParam('pid', os.getpid())
        self.addParam('extexist', '1')
        self.addParam('extstate', '1')

        self.url = "v.whatsapp.net/v2/exist"

        self.pvars = ["status", "reason", "sms_length", "voice_length", "result","param", "pw", "login", "type", "expiration", "kind",
                    "price", "cost", "currency", "price_expiration"
                    ]

        self.setParser(JSONResponseParser())

    def send(self, parser = None):
        res = super(WAExistsRequest, self).send(parser)
        return res


text:
require 'net/http'

module Camb
  module Runner
    class Local
      def initialize(options = {})
        @options = options
      end

      def client
        @client ||= Camb::Client.new(@options)
      end

      def run
        start = Time.now
        response = client.response
        {
          :timestamp => (start.to_f * 1000).to_i,
          :total_time => Time.new - start
        }.to_json
      end
    end
  end
end


text:
package com.amazonaws.services.mediapackagevod.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.mediapackagevod.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * EncryptionContractConfigurationMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class EncryptionContractConfigurationMarshaller {

    private static final MarshallingInfo<String> PRESETSPEKE20AUDIO_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("presetSpeke20Audio").build();
    private static final MarshallingInfo<String> PRESETSPEKE20VIDEO_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("presetSpeke20Video").build();

    private static final EncryptionContractConfigurationMarshaller instance = new EncryptionContractConfigurationMarshaller();

    public static EncryptionContractConfigurationMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(EncryptionContractConfiguration encryptionContractConfiguration, ProtocolMarshaller protocolMarshaller) {

        if (encryptionContractConfiguration == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(encryptionContractConfiguration.getPresetSpeke20Audio(), PRESETSPEKE20AUDIO_BINDING);
            protocolMarshaller.marshall(encryptionContractConfiguration.getPresetSpeke20Video(), PRESETSPEKE20VIDEO_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
package com.aspose.slides.examples.Shapes;

import com.aspose.slides.*;
import com.aspose.slides.examples.Utils;

public class ConnectorLineAngle
{
    public static void main(String[] args) throws Exception {
        // The path to the documents directory.
        String dataDir = Utils.getDataDir(ConnectorLineAngle.class);

        Presentation pres = new Presentation(dataDir + "LineExample.pptx");
        Slide slide = (Slide) pres.getSlides().get_Item(0);
        Shape shape;
        for (int i = 0; i < slide.getShapes().size(); i++) {
            double dir = 0.0;
            shape = (Shape) slide.getShapes().get_Item(i);
            if (shape instanceof AutoShape) {
                AutoShape ashp = (AutoShape) shape;
                if (ashp.getShapeType() == (byte) ShapeType.Line) {
                //    dir = getDirection(ashp.getWidth(), ashp.getHeight(), ashp.getFrame().getFlipH(), ashp.getFrame().getFlipV());
                }
            } else if (shape instanceof Connector) {
                Connector ashp = (Connector) shape;
                //dir = getDirection(ashp.getWidth(), ashp.getHeight(), ashp.getFrame().getFlipH(), ashp.getFrame().getFlipV());
            }

            System.out.println(dir);
            System.out.println("Program executed successfully");

        }
    }

        public static double getDirection(float w, float h, boolean flipH, boolean flipV)
        {
            float endLineX = w * (flipH ? -1 : 1);
            float endLineY = h * (flipV ? -1 : 1);
            float endYAxisX = 0;
            float endYAxisY = h;
            double angle = (java.lang.Math.atan2(endYAxisY, endYAxisX) - java.lang.Math.atan2(endLineY, endLineX));
            if (angle < 0) angle += 2 * Math.PI;
            return angle * 180.0 / Math.PI;
        }
    }


text:
<?php
    /**
     * @package content
     */

    /**
     * The AjaxLog page accepts $_POST requests to write information to the
     * Symphony Log.
     */
    class contentAjaxLog extends TextPage
    {
        public function view()
        {
            if ($_REQUEST['error'] && Symphony::Log()) {
                Symphony::Log()->error(sprintf(
                    '%s - %s%s%s',
                    'Javascript',
                    $_REQUEST['error'],
                    ($_REQUEST['url'] ? " in file " . $_REQUEST['url'] : null),
                    ($_REQUEST['line'] ? " on line " . $_REQUEST['line'] : null)
                ));
            }
        }
    }


text:
package org.apache.isis.objectstore.jdo.datanucleus.scenarios.adaptermanager;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

import org.junit.Rule;
import org.junit.Test;

import org.apache.isis.core.integtestsupport.IsisSystemWithFixtures;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.oid.TypedOid;
import org.apache.isis.core.tck.dom.refs.UnidirReferencedEntity;
import org.apache.isis.core.tck.dom.refs.UnidirReferencedEntityRepository;
import org.apache.isis.core.tck.dom.refs.UnidirReferencingEntity;
import org.apache.isis.core.tck.dom.refs.UnidirReferencingEntityRepository;
import org.apache.isis.objectstore.jdo.datanucleus.Utils;

public class Persistence_persistentAdapterFor {

    private UnidirReferencingEntityRepository referencingRepo = new UnidirReferencingEntityRepository();
    private UnidirReferencedEntityRepository referencedRepo = new UnidirReferencedEntityRepository();

    @Rule
    public IsisSystemWithFixtures iswf = Utils.systemBuilder()
        .with(Utils.listenerToDeleteFrom("UNIDIRREFERENCINGENTITY"))
        .with(Utils.listenerToDeleteFrom("UNIDIRREFERENCEDENTITY"))
        .withServices(referencingRepo, referencedRepo)
        .build();

    @Test
    public void persist_then_update_using_persistentAdapterFor() throws Exception {

        iswf.beginTran();
        UnidirReferencedEntity referencedEntity1 = referencedRepo.newEntity();
        referencedEntity1.setName("Referenced 1");
        UnidirReferencedEntity referencedEntity2 = referencedRepo.newEntity();
        referencedEntity2.setName("Referenced 2");

        UnidirReferencingEntity referencingEntity1 = referencingRepo.newEntity();
        referencingEntity1.setName("Referencing 1");
        referencingEntity1.setReferenced(referencedEntity1);
        UnidirReferencingEntity referencingEntity2 = referencingRepo.newEntity();
        referencingEntity2.setName("Referencing 2");
        referencingEntity2.setReferenced(referencedEntity1);
        UnidirReferencingEntity referencingEntity3 = referencingRepo.newEntity();
        referencingEntity3.setName("Referencing 3");
        referencingEntity3.setReferenced(referencedEntity2);

        iswf.commitTran();

        TypedOid referencingOid2 = (TypedOid) iswf.adapterFor(referencingEntity2).getOid();

        TypedOid referencedOid1 = (TypedOid) iswf.adapterFor(referencedEntity1).getOid();
        TypedOid referencedOid2 = (TypedOid) iswf.adapterFor(referencedEntity2).getOid();

        // when ...
        iswf.bounceSystem();

        iswf.beginTran();

        ObjectAdapter referencingAdapter2 = iswf.getAdapterManager().adapterFor(referencingOid2);
        referencingEntity2 = (UnidirReferencingEntity) referencingAdapter2.getObject();

		UnidirReferencedEntity referenced = referencingEntity2.getReferenced();

		ObjectAdapter referencedAdapter1 = iswf.getAdapterManager().adapterFor(referencedOid1);
		assertThat(referenced, is(referencedAdapter1.getObject()));

        // ...switch to refer to other

		ObjectAdapter referencedAdapter2 = iswf.getAdapterManager().adapterFor(referencedOid2);
		referencedEntity2 = (UnidirReferencedEntity) referencedAdapter2.getObject();

		referencingEntity2.setReferenced(referencedEntity2);
        iswf.commitTran();

        // then...
        iswf.bounceSystem();

        iswf.beginTran();

        referencingAdapter2 = iswf.getAdapterManager().adapterFor(referencingOid2);
        referencingEntity2 = (UnidirReferencingEntity) referencingAdapter2.getObject();

		referenced = referencingEntity2.getReferenced();

		referencedAdapter2 = iswf.getAdapterManager().adapterFor(referencedOid2);

        // ...is switched
		assertThat(referenced, is(referencedAdapter2.getObject()));

        iswf.commitTran();
    }

}


text:
import java.net.*;
import java.io.*;

public class UDPServer{
    public static void main(String args[]){
    	DatagramSocket aSocket = null;
		try{
	    	aSocket = new DatagramSocket(6789);
					// create socket at agreed port
			byte[] buffer = new byte[1000];
 			while(true){
 				DatagramPacket request = new DatagramPacket(buffer, buffer.length);
  				aSocket.receive(request);
    			DatagramPacket reply = new DatagramPacket(request.getData(), request.getLength(),
    				request.getAddress(), request.getPort());
    			aSocket.send(reply);
    		}
		}catch (SocketException e){System.out.println("Socket: " + e.getMessage());
		}catch (IOException e) {System.out.println("IO: " + e.getMessage());
		}finally {if(aSocket != null) aSocket.close();}
    }
}


text: Nice web client for e-mail


text:
void signal_callback_handler(int signum)
{
  printf("Caught signal %d\n", signum);
  dxl_terminate();
  exit(signum);
}

int main(int argc, char *argv[])
{
  // For handling Ctrl+C nicely
  signal(SIGINT, signal_callback_handler);

  // Create the Dimitri robot object connected
  // to /dev/ttyUSB0
  Dimitri robot(0, 4);

  // Set low torque
  robot.setMaxTorque(0.0);

  // Control mode is off
  robot.setControlMode(OFF);

  // This array stores the pose angles
  float pose[13];

  // Main loop
  while (true)
  {
    // Performs update
    robot.update();

    // Gets the pose angles
    robot.getPose( pose );

    // Print the pose angles
    for (int i = 0 ; i < 13 ; i++)
    {
      printf("%+04.0f,", RAD2DEG(pose[i]));
    }
    printf("\n");

  }

  return 0;
}


text:
import {Inspector, Runtime} from "https://cdn.jsdelivr.net/npm/@observablehq/runtime@4/dist/runtime.js";

if (window.self !== window.top) {
    const observableNotebookJS = JSON.parse(document.getElementById("observableNotebookJS").textContent);
    const selectedCells = JSON.parse(document.getElementById("observableCells").textContent);
    const evaluations = JSON.parse(document.getElementById("evaluations").textContent);

    function setErrorMessage(msg) {
        const alert = document.getElementById("observableAlert");
        alert.textContent = msg
        alert.classList.remove("d-none");

        const cells = document.getElementsByClassName("observableCell");
        while (cells.length > 0) cells[0].remove();
    }

    import(observableNotebookJS).then(
        module => {
            const runtime = new Runtime()
            let main

            if (selectedCells.length === 1 && selectedCells.every((c) => c === "*")) {
                const cell = document.querySelector("#observableCell");
                cell.textContent = "";
                cell.classList.remove("text-center");
                main = runtime.module(module.default, Inspector.into(cell));
            } else {
                main = runtime.module(module.default, (name) => {
                    let selected = selectedCells.indexOf(name);
                    if (selected > -1) {
                        const id = selectedCells[selected].replace(/[\s*]/g, "");  // remove spaces and * from cell names
                        let cell = document.querySelector("#observableCell" + id);
                        cell.classList.remove("text-center");
                        return new Inspector(cell);
                    }
                });
            }

            try {
                main.redefine("evaluations", evaluations);
            } catch (error) {
                setErrorMessage("The variable 'evaluations' has not been defined in the provided notebook.");
            }
        }
    ).catch(() => {
            setErrorMessage("Could not load notebook.");
        }
    );
}


text:
package technology.tikal.customers.model.name;

import org.springframework.beans.BeanUtils;
import technology.tikal.customers.model.OfyEntity;
import com.googlecode.objectify.annotation.Subclass;

/**
 *
 * @author Nekorp
 *
 */
@Subclass
public class OrganizationNameOfy extends OrganizationName implements OfyEntity<OrganizationName> {

    private OrganizationNameOfy() {
        super();
    }
    public OrganizationNameOfy(OrganizationName source) {
        this();
        this.update(source);
    }
    @Override
    public String toString() {
        return this.getName();
    }
    @Override
    public void update(OrganizationName source) {
        BeanUtils.copyProperties(source, this);
    }
}


text:
import {isEmpty} from "lodash"
import {createSelector} from "reselect"
import ProcessUtils from "../../common/ProcessUtils"
import NodeUtils from "../../components/graph/NodeUtils"
import ProcessStateUtils from "../../components/Process/ProcessStateUtils"
import {Process} from "../../types"
import {ProcessCounts} from "../graph"
import {RootState} from "../index"
import {getProcessState, isProcessStateLoaded} from "./scenarioState";

export const getGraph = (state: RootState): RootState["graphReducer"] => state.graphReducer

export const getFetchedProcessDetails = createSelector(getGraph, g => g.fetchedProcessDetails)
export const getProcessToDisplay = createSelector(getGraph, g => g.processToDisplay || {} as Process)
export const getProcessNodesIds = createSelector(getProcessToDisplay, p => NodeUtils.nodesFromProcess(p).map(n => n.id))
export const getProcessId = createSelector(getFetchedProcessDetails, d => d?.name)
export const getProcessName = getProcessId
export const getProcessUnsavedNewName = createSelector(getGraph, (g) => g?.unsavedNewName)
export const getProcessVersionId = createSelector(getFetchedProcessDetails, d => d?.processVersionId)
export const getProcessCategory = createSelector(getFetchedProcessDetails, d => d?.processCategory || "")

export const isLatestProcessVersion = createSelector(getFetchedProcessDetails, d => d?.isLatestVersion)
export const isSubprocess = createSelector(getProcessToDisplay, p => p.properties?.isSubprocess)
export const isArchived = createSelector(getFetchedProcessDetails, p => p?.isArchived)
export const isPristine = (state: RootState): boolean => ProcessUtils.nothingToSave(state) && !isProcessRenamed(state)
export const hasError = createSelector(getProcessToDisplay, p => !ProcessUtils.hasNoErrors(p))
export const hasWarnings = createSelector(getProcessToDisplay, p => !ProcessUtils.hasNoWarnings(p))
export const hasPropertiesErrors = createSelector(getProcessToDisplay, p => !ProcessUtils.hasNoPropertiesErrors(p))
export const getSelectionState = createSelector(getGraph, g => g.selectionState)
export const getSelection = createSelector(getSelectionState, getProcessToDisplay, (s, p) => NodeUtils.getAllNodesByIdWithEdges(s, p))
export const canModifySelectedNodes = createSelector(getSelectionState, (s) => !isEmpty(s))
export const getHistory = createSelector(getGraph, g => g.history)

export const isProcessRenamed = createSelector(
  getProcessName,
  getProcessUnsavedNewName,
  (currentName, unsavedNewName) => unsavedNewName && unsavedNewName !== currentName,
)

export const getFetchedProcessState = createSelector(
  getFetchedProcessDetails,
  isProcessStateLoaded,
  getProcessState,
  (fetchedProcessDetails, isStateLoaded, processState) => isStateLoaded ? processState : fetchedProcessDetails?.state,
)

export const isSaveDisabled = createSelector(
  [isPristine, isLatestProcessVersion],
  (pristine, latest) => pristine && latest,
)
export const isDeployPossible = createSelector(
  [isSaveDisabled, hasError, getFetchedProcessState, isSubprocess],
  (saveDisabled, error, state, subprocess) => !subprocess && saveDisabled && !error && ProcessStateUtils.canDeploy(state),
)
export const isMigrationPossible = createSelector(
  [isSaveDisabled, hasError, getFetchedProcessState],
  (saveDisabled, error, state) => saveDisabled && !error && ProcessStateUtils.canDeploy(state),
)
export const isCancelPossible = createSelector(getFetchedProcessState, state => ProcessStateUtils.canCancel(state))
export const isArchivePossible = createSelector(getFetchedProcessState, state => ProcessStateUtils.canArchive(state))
export const getTestCapabilities = createSelector(getGraph, g => g.testCapabilities || {})
export const getTestResults = createSelector(getGraph, g => g.testResults)
export const getProcessCounts = createSelector(getGraph, (g): ProcessCounts => g.processCounts || {} as ProcessCounts)
export const getShowRunProcessDetails = createSelector(
  [getTestResults, getProcessCounts],
  (testResults, processCounts) => testResults || processCounts,
)

export const getVersions = createSelector(getFetchedProcessDetails, details => details?.history || [])
export const hasOneVersion = createSelector(getVersions, h => h.length <= 1)
export const getAdditionalFields = createSelector(getProcessToDisplay, p => p.properties?.additionalFields)

export const getLayout = createSelector(getGraph, state => state.layout || [])


text:
.PHONY:	build push

REPO = mesosphere
IMAGE = kubernetes-keygen
TAG = $(shell git describe --abbrev=0 --tags)

build:
	docker build -t $(REPO)/$(IMAGE):$(TAG) .

push: build
	docker push $(REPO)/$(IMAGE):$(TAG)

all: push


text:
/** 403. Frog Jump
A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water.

Given a list of stones' positions (in units) in sorted ascending order, determine if the frog is able to cross the river by landing on the last stone. Initially, the frog is on the first stone and assume the first jump must be 1 unit.

If the frog's last jump was k units, then its next jump must be either k - 1, k, or k + 1 units. Note that the frog can only jump in the forward direction.

Note:

The number of stones is ≥ 2 and is < 1,100.
Each stone's position will be a non-negative integer < 231.
The first stone's position is always 0.

Example 1:

[0,1,3,5,6,8,12,17]

There are a total of 8 stones.
The first stone at the 0th unit, second stone at the 1st unit,
third stone at the 3rd unit, and so on...
The last stone at the 17th unit.

Return true. The frog can jump to the last stone by jumping
1 unit to the 2nd stone, then 2 units to the 3rd stone, then
2 units to the 4th stone, then 3 units to the 6th stone,
4 units to the 7th stone, and 5 units to the 8th stone.

Example 2:

[0,1,2,3,4,8,9,11]

Return false. There is no way to jump to the last stone as
the gap between the 5th and 6th stone is too large.

**/

#include <iostream>
#include "../utils.h"
using namespace std;

class Solution {
public:
    bool canCross(vector<int>& stones) {

    }
};

int main() {
    Solution s;
    return 0;
}


text:
from ..baseapi import BaseApi

class ReportAbuse(BaseApi):

    """
    Reports Abuse Collection
        A list of abuse complaints for a specific campaign.
        http://kb.mailchimp.com/api/resources/reports/abuse/reports-abuse-collection
    Reports Abuse Instance
        A specific abuse report associated with a specific campaign.
        http://kb.mailchimp.com/api/resources/reports/abuse/reports-abuse-instance
    """

    def __init__(self, *args, **kwargs):
        super(ReportAbuse, self).__init__(*args, **kwargs)
        self.endpoint = 'reports'

    def all(self, campaign_id):
        """
        Returns the last 10 abuse reports by date.
        """
        return self._mc_client._get(url=self._build_path(campaign_id, 'abuse-report'))

    def get(self, campaign_id, abuse_id):
        """
        Returns an individual abuse report.
        """
        return self._mc_client._get(url=self._build_path(campaign_id, 'abuse-report', abuse_id))


text:
package org.apache.servicecomb.provider.pojo.reference;

import org.apache.servicecomb.foundation.common.exceptions.ServiceCombException;
import org.apache.servicecomb.provider.pojo.Invoker;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;

public class PojoReferenceMeta implements FactoryBean<Object>, InitializingBean {
  // 原始数据
  private String microserviceName;

  private String schemaId;

  private Class<?> consumerIntf;

  // 根据intf创建出来的动态代理
  // TODO:未实现本地优先(本地场景下,应该跳过handler机制)
  private Object proxy;

  public Object getProxy() {
    return getObject();
  }

  @Override
  public Object getObject() {
    return proxy;
  }

  @Override
  public Class<?> getObjectType() {
    return consumerIntf;
  }

  @Override
  public boolean isSingleton() {
    return true;
  }

  public void setConsumerIntf(Class<?> intf) {
    this.consumerIntf = intf;
  }

  public void setMicroserviceName(String microserviceName) {
    this.microserviceName = microserviceName;
  }

  public void setSchemaId(String schemaId) {
    this.schemaId = schemaId;
  }

  @Override
  public void afterPropertiesSet() {
    if (consumerIntf == null) {
      throw new ServiceCombException(
          String.format(
              "microserviceName=%s, schemaid=%s, \n"
                  + "do not support implicit interface anymore, \n"
                  + "because that caused problems:\n"
                  + "  1.the startup process relies on other microservices\n"
                  + "  2.cyclic dependent microservices can not be deployed\n"
                  + "suggest to use @RpcReference or "
                  + "<cse:rpc-reference id=\"...\" microservice-name=\"...\" schema-id=\"...\" interface=\"...\"></cse:rpc-reference>.",
              microserviceName,
              schemaId));
    }

    proxy = Invoker.createProxy(microserviceName, schemaId, consumerIntf);
  }
}


text:
module Data.MSM (
    module Data.MSM.Parser,
    module Data.MSM.Types
) where

import Data.MSM.Parser
import Data.MSM.Types


text:
class EventsController < ApplicationController

  before_filter :authenticate,            :except => [ 'show', 'register' ]
  before_filter :authenticate_with_admin, :except => [ 'show', 'register' ]

  before_action :set_event, only: [ :show, :edit, :update, :destroy, :publish, :register, :unregister, :admin_view, :add_organizer, :remove_organizer, :register_someone, :attendance_printout ]

  def index
    @events = Event.by_recent.paginate page: params[:page], per_page: 20
    switch_to_admin_layout
  end

  def admin_view
    @registration = Registration.new
    switch_to_admin_layout
  end

  def show
  end

  def new
    @event = Event.new
    switch_to_admin_layout
  end

  def edit
    switch_to_admin_layout
  end

  def create
    @event = Event.new(event_params)

    respond_to do |format|
      if @event.save
        format.html { redirect_to @event, notice: 'Event was successfully created.' }
        format.json { render action: 'show', status: :created, location: @event }
      else
        format.html { render action: 'new' }
        format.json { render json: @event.errors, status: :unprocessable_entity }
      end
    end
  end

  def update
    respond_to do |format|
      if @event.update(event_params)
        format.html { redirect_to @event, notice: 'Event was successfully updated.' }
        format.json { head :no_content }
      else
        format.html { render action: 'edit' }
        format.json { render json: @event.errors, status: :unprocessable_entity }
      end
    end
  end

  def destroy
    @event.destroy
    respond_to do |format|
      format.html { redirect_to events_url }
      format.json { head :no_content }
    end
  end

  def duplicate
    Event.duplicate(params[:id])
    redirect_to events_path, notice: 'Your event has been duplicated.'
  end

  def publish
    @event.published = true
    @event.save
    redirect_to @event, notice: 'This event was published'
  end

  def add_organizer
    event_organizer = EventOrganizer.create event_id: @event.id, organizer_id: params[:event][:organizer_id]
    if event_organizer
      redirect_to admin_view_event_path(@event), notice: " Success A new organizer has been added to this event.".html_safe
    else
      redirect_to admin_view_event_path(@event), warning: " Attention There was a problem adding the organizer to the event. Please try again.".html_safe
    end
  end

  def remove_organizer
    event_organizer = EventOrganizer.find_by event_id: @event.id, organizer_id: params[:organizer_id]
    event_organizer.destroy
    redirect_to admin_view_event_path(@event), notice: " Success The organizer has been removed.".html_safe
  end

  def register
    unless current_user # straight email registration for most people who are not logged in
      if params[:event][:email].present?
        user = Member.find_or_create_by email: params[:event][:email]
        registration = Registration.create event_id: @event.id, registrant_id: user.id
        if user && registration
          Activity.create doer_id: user.id, message: "registered for the event entitled: #{view_context.link_to @event.short_name, @event}"
          send_confirmation_email(user)
          redirect_to @event, notice: " Success You have been registered for this event. Please check your inbox or spam folder for your confirmation.".html_safe
        else
          redirect_to @event, alert: " Attention There was a problem recording your registration. Please try again.".html_safe
        end
      else
        redirect_to @event, alert: " Attention You need to provide a valid email address in order to register for this program.".html_safe
      end
    else # the user is already logged in
      registration = Registration.create event_id: @event.id, registrant_id: current_user.id
      if registration
        Activity.create doer_id: current_user.id, message: "registered for the event entitled: #{view_context.link_to @event.short_name, @event}"
        send_confirmation_email(current_user)
        redirect_to @event, notice: " Success You have been registered for this event. Please check your inbox or spam folder for your confirmation.".html_safe
      else
        redirect_to @event, warning: " Attention There was a problem recording your registration. Please try again.".html_safe
      end
    end
  end

  def register_someone
    registration = Registration.create event_id: @event.id, registrant_id: Registrant.find_by( email: params[:registration][:registrant_email]).id
      if registration
        Activity.create doer_id: current_user.id, message: "registered #{view_context.link_to registration.registrant.name_or_email, member_path(registration.registrant)} for the event entitled: #{view_context.link_to @event.short_name, @event}."
        # send_confirmation_email(current_user) # OPTIMIZE - may be implement this as an option later
        redirect_to admin_view_event_path(@event), notice: " Success You have registered #{view_context.link_to registration.registrant.name_or_email, member_path(registration.registrant)} for this event. ".html_safe
      else
        redirect_to admin_view_event_path(@event), warning: " Attention There was a problem registering this person for this event".html_safe
      end
  end

  def unregister
    registration = Registration.find params[:registration_id]
    event = registration.event
    quitter = registration.registrant
    registration.destroy
    Activity.create doer_id: current_user.id, message: "cancelled #{view_context.link_to quitter.name_or_email, member_path(registration.registrant)}'s registration for the event entitled: #{view_context.link_to @event.short_name, @event}."
    redirect_to admin_view_event_path(@event), notice: " Success The registration has been deleted.".html_safe
  end

  def attendance_printout
    @registrants = @event.registrants
    respond_to do |format|
      format.pdf do
        pdf = AttendanceListPdf.new(@event, @registrants)
        send_data pdf.render, filename: 'attendance_list.pdf', type: 'application/pdf'
      end
    end

  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_event
      @event = Event.find(params[:id])
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def event_params
      # email attribute is an attr-reader used in the event registration partials
      params.require(:event).permit( :name, :nickname, :tiny_name, :description, :body, :starts_at, :price, :maximum_number_of_registrants, :confirmation_emails_text, :confirmation_emails_html, :published, :image, :email )
    end

    def send_confirmation_email(participant)
      begin
        EventMailer.confirmation(participant, @event).deliver_now
      rescue Exception => e
        AdminMailer.rescued_exceptions(e, "Some exception occurred while trying to send an event confirmation email.").deliver_now
      end
    end
end


text:
package org.apache.flink.runtime.rest.handler.legacy.files;

import org.apache.flink.runtime.rest.HttpMethodWrapper;
import org.apache.flink.runtime.rest.handler.RestHandlerSpecification;

/** Rest handler specification for the web content handler. */
public final class WebContentHandlerSpecification implements RestHandlerSpecification {

    private static final WebContentHandlerSpecification INSTANCE =
            new WebContentHandlerSpecification();

    private WebContentHandlerSpecification() {}

    @Override
    public HttpMethodWrapper getHttpMethod() {
        return HttpMethodWrapper.GET;
    }

    @Override
    public String getTargetRestEndpointURL() {
        return "/:*";
    }

    public static WebContentHandlerSpecification getInstance() {
        return INSTANCE;
    }
}


text:
/* -- Import Basic Documentstructure CSS ---------- */

@import url('content_documentstructure.css');

/* -- Language Specific Settings ---------- */

body#tinymce h1:before          { content: "Nadpis 1"; }
body#tinymce h2:before          { content: "Nadpis 2"; }
body#tinymce h3:before          { content: "Nadpis 3"; }
body#tinymce h4:before          { content: "Nadpis 4"; }
body#tinymce ol:before          { content: "Seřazený seznam"; }
body#tinymce ul:before          { content: "Neseřazený seznam"; }
body#tinymce p:before           { content: "Odstavec"; }
body#tinymce code:before        { content: "Kód programu"; }
body#tinymce pre:before         { content: "Předformátovaný text"; }
body#tinymce blockquote:before  { content: "Citace"; }
body#tinymce div:before         { content: "Div"; }


text:
angular.module('kkApp')
.factory('Submission', ['$resource', function($resource) {
  return $resource('/api/submission/:id', {id : '@id'},
    {query:
      {method: 'GET',
      transformResponse: function (data) {
        return angular.fromJson(data).objects},
      isArray: false},
    update: {method:'PUT'}});
}]);

angular.module('kkApp')
.factory('QueriedSubmissionLoader', ['Submission', '$q',
  function(Submission, $q) {
    return function(query) {
      var delay = $q.defer();
      Submission.query({q: angular.toJson(query)}, function(submissions) {
        delay.resolve(submissions.objects);
      }, function() {
        delay.reject('Unable to fetch submissions');
      });
      return delay.promise;
    };
  }]);


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>Module: Erubis::XmlHelper</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />

          Module
          Erubis::XmlHelper

            In:

                erubis/helper.rb

helper for xml

Methods

      escape_xml
      escape_xml2
      h
      html_escape
      u
      url_encode

Constants

          ESCAPE_TABLE
          =
          {       '&' => '&amp;',       '<' => '&lt;',       '>' => '&gt;',       '"' => '&quot;',       "'" => '&#039;',     }

Public Instance methods

          escape_xml(value)

[Source]

# File erubis/helper.rb, line 25
    def escape_xml(value)
      value.to_s.gsub(/[&<>"]/) { |s| ESCAPE_TABLE[s] }   # or /[&<>"']/
      #value.to_s.gsub(/[&<>"]/) { ESCAPE_TABLE[$&] }
    end

          escape_xml2(value)

[Source]

# File erubis/helper.rb, line 30
    def escape_xml2(value)
      return value.to_s.gsub(/\&/,'&amp;').gsub(/</,'&lt;').gsub(/>/,'&gt;').gsub(/"/,'&quot;')
    end

          h(value)

Alias for escape_xml

          html_escape(value)

Alias for escape_xml

          u(str)

Alias for url_encode

          url_encode(str)

[Source]

# File erubis/helper.rb, line 37
    def url_encode(str)
      return str.gsub(/[^-_.a-zA-Z0-9]+/) { |s|
        s.unpack('C*').collect { |i| "%%%02X" % i }.join
      }
    end

[Validate]


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="generator" content="Hugo 0.25.1 with theme Tranquilpeak 0.4.3-BETA">
    <title>Elements showcase</title>
    <meta name="author" content="Nicole Jean Smith">
    <meta name="keywords" content="">

    <link rel="icon" href="https://nicolejeansmith.github.io/favicon.png">

    <meta name="description" content="Check out how Tranquilpeak theme display well HTML elements (title, paragraph, blockquote, table and more..). It’s simple and elegant.
">
    <meta property="og:description" content="Check out how Tranquilpeak theme display well HTML elements (title, paragraph, blockquote, table and more..). It’s simple and elegant.
">
    <meta property="og:type" content="blog">
    <meta property="og:title" content="Elements showcase">
    <meta property="og:url" content="/2015/05/elements-showcase/">
    <meta property="og:site_name" content="Nicole Jean Smith">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:title" content="Nicole Jean Smith">
    <meta name="twitter:description" content="Check out how Tranquilpeak theme display well HTML elements (title, paragraph, blockquote, table and more..). It’s simple and elegant.
">

      <meta property="og:image" content="https://nicolejeansmith.github.io/images/nicole_smith_website_round90.png">

      <meta property="og:image" content="//d1u9biwaxjngwg.cloudfront.net/elements-showcase/vintage-140.jpg">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.4/jquery.fancybox.min.css" integrity="sha256-vuXZ9LGmmwtjqFX1F+EKin1ThZMub58gKULUyf0qECk=" crossorigin="anonymous" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.4/helpers/jquery.fancybox-thumbs.min.css" integrity="sha256-SEa4XYAHihTcEP1f5gARTB2K26Uk8PsndQYHQC1f4jU=" crossorigin="anonymous" />

    <link rel="stylesheet" href="https://nicolejeansmith.github.io/css/style-jsjn0006wyhpyzivf6yceb31gvpjatbcs3qzjvlumobfnugccvobqwxnnaj8.min.css" />

    Nicole Jean Smith

Nicole Jean Smith

Spatial data enthusiast

      Home

      Categories

      Tags

      Archives

      About

      GitHub

      RSS

      Elements showcase

      <time itemprop="datePublished" datetime="2015-05-28T00:00:00Z">

  May 28, 2015

      </time>

    in

      tranquilpeak,

      features

Check out how Tranquilpeak theme display well HTML elements (title, paragraph, blockquote, table and more..). It’s simple and elegant.

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5

Heading 6

Paragraph

Lorem ipsum dolor sit amet, [test link]() consectetur adipiscing elit. Strong text pellentesque ligula commodo viverra vehicula. Italic text at ullamcorper enim. Morbi a euismod nibh. Underline text non elit nisl. Deleted text tristique, sem id condimentum tempus, metus lectus venenatis mauris, sit amet semper lorem felis a eros. Fusce egestas nibh at sagittis auctor. Sed ultricies ac arcu quis molestie. Donec dapibus nunc in nibh egestas, vitae volutpat sem iaculis. Curabitur sem tellus, elementum nec quam id, fermentum laoreet mi. Ut mollis ullamcorper turpis, vitae facilisis velit ultricies sit amet. Etiam laoreet dui odio, id tempus justo tincidunt id. Phasellus scelerisque nunc sed nunc ultricies accumsan.

Interdum et malesuada fames ac ante ipsum primis in faucibus. Sed erat diam, blandit eget felis aliquam, rhoncus varius urna. Donec tellus sapien, sodales eget ante vitae, feugiat ullamcorper urna. Praesent auctor dui vitae dapibus eleifend. Proin viverra mollis neque, ut ullamcorper elit posuere eget.

List Types

Definition List (dl)

Definition List Title

This is a definition list division.

Ordered List (ol)

List Item 1

List Item 2

List Item 3

Unordered List (ul)

List Item 1

List Item 2

List Item 3

Table

Header 1
Header 2
Header 3

Division 1
Division 2
Division 3

Division 1
Division 2
Division 3

Division 1
Division 2
Division 3

Division 1
Division 2
Division 3

Misc Stuff - abbr, acronym, sub, sup, etc.

Lorem superscript dolor subscript amet, consectetuer adipiscing <kdb>ctrl + c</kdb>. Nullam dignissim convallis est. Quisque aliquam. cite. Nunc iaculis suscipit dui.
 Nam
sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus. Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. <acronym title="National Basketball Association">NBA</acronym> Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus.  AVE

                    TAGGED IN

  html elements

  markdown

                  NEXT

                  PREVIOUS

  Please enable JavaScript to view the comments powered by Disqus.

    © 2018 Nicole Smith. All Rights Reserved

                  NEXT

                  PREVIOUS

          Share on Facebook

          Share on Twitter

          Share on Google+

Nicole Jean Smith

Spatial data enthusiast

        GIS Analyst at Michigan State University

        Lansing, Michigan

        by

      <form id="algolia-search-form">
        <input type="text" id="algolia-search-input" name="search"
          class="form-control input--large search-input" placeholder="Search" />
      </form>

no post found

test post

                  Jan 1, 2018

This is a test post. This is the second sentence.

Hello R Markdown

                  Jul 7, 2015

R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
You can embed an R code chunk like this:
summary(cars)
## speed dist ## Min. : 4.0 Min. : 2.00 ## 1st Qu.:12.0 1st Qu.: 26.00 ## Median :15.0 Median : 36.00 ## Mean :15.4 Mean : 42.98 ## 3rd Qu.

Welcome to Tranquilpeak 0.4.3-BETA

                  Jun 6, 2015

Tranquilpeak is a gorgeous responsive theme for Hugo blog framework. It has many features and integrated services to improve user experience.

Elements showcase

                  May 5, 2015

Check out how Tranquilpeak theme display well HTML elements (title, paragraph, blockquote, table and more..). It’s simple and elegant.

Cover image showcase

                  May 5, 2015

Tranquilpeak integrate a unique “cover image” feature. Open this post to see how this feature sublimate your article.

highlighted code showcase

                  Mar 3, 2015

Tranquilpeak Hugo theme have its own theme to highlight source code. It’s based on GitHub theme: simple and elegant. Check out how it sublimate source codes.

Tags plugins showcase

                  Oct 10, 2014

This post is used to show how tag plugins are displayed. See docs for more info.

Hidden social section showcase

                  Aug 8, 2014

This post is used to show how a site looks if the social section is hidden.

Hidden tag section showcase

                  Aug 8, 2014

This post is used to show how a site looks if the tag section is hidden.

Hidden pagination showcase

                  Aug 8, 2014

This post is used to show how a site looks if the pagination is hidden.

         14 posts found


text:
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/paper-styles/typography.html">

<link rel="import" href="../transaction-table/transaction-table.html">

<dom-module id="profile-user">
  <template>

{{name}}

Notificaciones de cambio: {{notifications}}

    <transaction-table title="Transactions"></transaction-table>
  </template>

</dom-module>