text:
package com.fererlab.nio.service;

import com.fererlab.nio.listener.ConnectionListener;
import com.fererlab.nio.listener.MessageListener;
import com.fererlab.nio.listener.NIOStateListener;

import java.io.IOException;

/**
 * this service has at least two implementations, NIO as server and NIO as client
 */
public interface NIOService {

    /**
     * hostname for server implementation indicates the domain name or ip address to listen,
     * for client implementation this is the host's name or ip address to connect
     *
     * @param hostname domain name or ip address
     */
    void setHostname(String hostname);

    /**
     * port is the listening port for server implementation, and it is the connection port for client implementation
     *
     * @param port connection port
     */
    void setPort(Integer port);

    /**
     * without this method call NIO will not start
     *
     * @throws IOException
     */
    void start() throws IOException;

    /**
     * should close connection(s) and notify listeners
     */
    void stop();

    /**
     * server implementation will broadcast message to all clients, client implementation will send the message to server
     *
     * @param bytesToSend message to be send
     */
    void send(byte[] bytesToSend);

    /**
     * this method is useful for NIO server implementation, it can be used to send message to specific client instead of broadcasting
     *
     * @param bytesToSend    message to send
     * @param clientUniqueId UUID of the client
     */
    void send(byte[] bytesToSend, String clientUniqueId);

    /**
     * useful for NIO server implementation check if the client with id is connected
     * NIO client implementation will return its connection state
     *
     * @param clientId client UUID
     * @return will return true if client is connected and available for reading and writing
     */
    boolean isConnected(String clientId);

    /**
     * useful for NIO server implementation, get the status of the client
     * NIO client implementation will always return its state
     *
     * @param clientId client UUID
     * @return will return this client's state, either 0 or a SelectionKey value like SelectionKey.OP_READ
     */
    int getCurrentState(String clientId);

    /**
     * adds a message listener, they will be called upon new message
     *
     * @param listener
     */
    void addMessageListener(MessageListener listener);

    /**
     * adds a connection listener, they will be called upon connect disconnect
     *
     * @param listener
     */
    void addConnectionListener(ConnectionListener listener);

    /**
     * adds an NIOStateListener, they will be called at NIOServiceLifecycle points
     *
     * @param listener
     */
    void addNIOStateListener(NIOStateListener listener);

}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="{% block meta_description %}{% endblock %}">

  <meta property="og:title" content="SnoopSnoo{% block title %}{% endblock %}"/>
  <meta property="og:url" content="https://snoopsnoo.com"/>
  <meta property="og:site_name" content="SnoopSnoo"/>
  <meta property="og:image" content="https://snoopsnoo.com/static/icons/favicon-192x192.png"/>

  <meta name="twitter:card" content="summary" />
  <meta name="twitter:site" content="@SnoopSnooApp" />
  <meta name="twitter:title" content="SnoopSnoo" />
  <meta name="twitter:description" content="{{self.meta_description()}}" />
  <meta name="twitter:image" content="https://snoopsnoo.com/static/icons/favicon-192x192.png" />

  <title>SnoopSnoo{{self.title()}}</title>

  <link href="/static/css/bootstrap.min.css?v={{''|current_version}}" rel="stylesheet">

  <link
    href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"
    rel="stylesheet">

  <link href="/static/css/curious.min.css?v={{''|current_version}}" rel="stylesheet">

  {% include 'includes/jquery-ui.html' %}

  {% include 'includes/jstz.html' %}
  {% include 'includes/d3.html' %}
  {% include 'includes/select2.html' %}

  <link rel="apple-touch-icon" sizes="57x57" href="/static/icons/apple-touch-icon-57x57.png">
  <link rel="apple-touch-icon" sizes="114x114" href="/static/icons/apple-touch-icon-114x114.png">
  <link rel="apple-touch-icon" sizes="72x72" href="/static/icons/apple-touch-icon-72x72.png">
  <link rel="apple-touch-icon" sizes="144x144" href="/static/icons/apple-touch-icon-144x144.png">
  <link rel="apple-touch-icon" sizes="60x60" href="/static/icons/apple-touch-icon-60x60.png">
  <link rel="apple-touch-icon" sizes="120x120" href="/static/icons/apple-touch-icon-120x120.png">
  <link rel="apple-touch-icon" sizes="76x76" href="/static/icons/apple-touch-icon-76x76.png">
  <link rel="apple-touch-icon" sizes="152x152" href="/static/icons/apple-touch-icon-152x152.png">
  <link rel="apple-touch-icon" sizes="180x180" href="/static/icons/apple-touch-icon-180x180.png">
  <link rel="shortcut icon" href="/static/icons/favicon.ico">
  <link rel="icon" type="image/png" href="/static/icons/favicon-192x192.png" sizes="192x192">
  <link rel="icon" type="image/png" href="/static/icons/favicon-160x160.png" sizes="160x160">
  <link rel="icon" type="image/png" href="/static/icons/favicon-96x96.png" sizes="96x96">
  <link rel="icon" type="image/png" href="/static/icons/favicon-16x16.png" sizes="16x16">
  <link rel="icon" type="image/png" href="/static/icons/favicon-32x32.png" sizes="32x32">
  <meta name="msapplication-TileColor" content="#00a300">
  <meta name="msapplication-TileImage" content="/static/icons/mstile-144x144.png">
  <meta name="msapplication-config" content="/static/icons/browserconfig.xml">

  {% block page_includes %}
  {% endblock %}

        <button
          type="button"
          class="navbar-toggle"
          data-toggle="collapse"
          data-target="#navbar-collapse">
          Toggle navigation

        </button>

          SnoopSnoo

            Home

            Subreddits

Blog

            About

  {% block content %}
  {% endblock %}

v0.3

© 2017 /u/orionmelt

  {% include 'includes/google-analytics.html' %}

redpajama_set_name: RedPajamaGithub


text:
@interface UITextFieldBNCreditCardTests : XCTestCase

@end

@implementation UITextFieldBNCreditCardTests

- (void)testValidateValidCardNumber {

    // Given:
    BNCreditCardNumberTextField *cardNumberTextField = [BNCreditCardNumberTextField new];
    cardNumberTextField.text = @"4002620000000005";

    // When:
    BOOL cardNumberValidity = [cardNumberTextField validCardNumber];

    // Then:
    XCTAssert(cardNumberValidity == true, "The validation should have succeeded.");

}

- (void)testInvalidateValidCardNumber {

    // Given:
    BNCreditCardNumberTextField *cardNumberTextField = [BNCreditCardNumberTextField new];
    cardNumberTextField.text = @"874905873945872380495234987235902340957230984572309845720938475093287450928347509283475098237459082374523452345";

    // When:
    BOOL cardNumberValidity = [cardNumberTextField validCardNumber];

    // Then:
    XCTAssert(cardNumberValidity == false, "The validation should have failed.");
}

- (void)testValidateValidExpiryDate {

    // Given:
    BNCreditCardExpiryTextField *expiryTextField = [BNCreditCardExpiryTextField new];
    expiryTextField.text = @"01/31";

    // When:
    BOOL expiryDateValidity = [expiryTextField validExpiryDate];

    // Then:
    XCTAssert(expiryDateValidity == true, "The validation should have succeeded.");
}

- (void)testValidateInvalidExpiryDate {

    // Given:
    BNCreditCardExpiryTextField *expiryTextField = [BNCreditCardExpiryTextField new];
    expiryTextField.text = @"00/00";

    // When:
    BOOL expiryDateValidity = [expiryTextField validExpiryDate];

    // Then:
    XCTAssert(expiryDateValidity == false, "The validation should have failed.");
}

- (void)testValidateValidCVC {

    // Given:
    BNCreditCardExpiryTextField *cvcTextField = [BNCreditCardExpiryTextField new];
    cvcTextField.text = @"123";

    // When:
    BOOL cvcValidity = [cvcTextField validCVC];

    // Then:
    XCTAssert(cvcValidity == true, "The validation should have succeeded.");
}

- (void)testValidateInvalidCVC {

    // Given:
    BNBaseTextField *cvcTextField = [BNBaseTextField new];
    cvcTextField.text = @"98769876986698769867";

    // When:
    BOOL cvcValidity = [cvcTextField validCVC];

    // Then:
    XCTAssert(cvcValidity == false, "The validation should have failed.");
}

- (void)testVISAValidation {

    // Given:
    BNCreditCardNumberTextField *cardNumberTextField = [BNCreditCardNumberTextField new];
    cardNumberTextField.text = @"4002620000000005";

    // When:
    BOOL cardNumberValidity = [cardNumberTextField isVisaCardNumber:cardNumberTextField.text];

    // Then:
    XCTAssert(cardNumberValidity == true, "The validation should have succeeded.");
}

- (void)testVISAValidationNegativeTest {

    // Given:
    BNCreditCardNumberTextField *cardNumberTextField = [BNCreditCardNumberTextField new];
    cardNumberTextField.text = @"5125860000000006";

    // When:
    BOOL cardNumberValidity = [cardNumberTextField isVisaCardNumber:cardNumberTextField.text];

    // Then:
    XCTAssert(cardNumberValidity == false, "The validation should have failed.");
}

- (void)testMasterCardValidation {

    // Given:
    BNCreditCardNumberTextField *cardNumberTextField = [BNCreditCardNumberTextField new];
    cardNumberTextField.text = @"5125860000000006";

    // When:
    BOOL cardNumberValidity = [cardNumberTextField isMasterCardNumber:cardNumberTextField.text];

    // Then:
    XCTAssert(cardNumberValidity == true, "The validation should have succeeded.");

}

- (void)testMasterCardValidationNegativeTest {

    // Given:
    BNCreditCardNumberTextField *cardNumberTextField = [BNCreditCardNumberTextField new];
    cardNumberTextField.text = @"4002620000000005";

    // When:
    BOOL cardNumberValidity = [cardNumberTextField isMasterCardNumber:cardNumberTextField.text];

    // Then:
    XCTAssert(cardNumberValidity == false, "The validation should have failed.");

}

- (void)testTextColorInValidTextField {

    // Given:
    BNCreditCardNumberTextField *cardNumberTextField = [BNCreditCardNumberTextField new];

    // When:
    [cardNumberTextField setTextfieldValid:true];

    // Then:
    XCTAssert(cardNumberTextField.textColor == [UIColor blackColor], "The text color should have been black.");

}

- (void)testTextColorInInvalidTextField {
    // Given:
    BNCreditCardNumberTextField *cardNumberTextField = [BNCreditCardNumberTextField new];

    // When:
    [cardNumberTextField setTextfieldValid:false];

    // Then:
    XCTAssert(cardNumberTextField.textColor == [UIColor redColor], "The text color should have been red.");

}

- (void)testTextFieldStyling {

    // Given:
    BNCreditCardNumberTextField *cardNumberTextField = [BNCreditCardNumberTextField new];

    // When:
    [cardNumberTextField applyStyle];

    // Then:
    XCTAssert(CGColorEqualToColor(cardNumberTextField.layer.borderColor, [[UIColor colorWithRed:220/255.f green:221/255.f blue:222/255.f alpha:1] CGColor]),
              "Incorrect tintColor - it should have been UIColor colorWithRed:220/255.f green:221/255.f blue:222/255.f alpha:1]");

    XCTAssert(cardNumberTextField.layer.borderWidth == 1.f,
              "Incorrect layer.borderWidth value - it shuould have been 1.f.");

    XCTAssert(cardNumberTextField.keyboardType == UIKeyboardTypeNumberPad,
              "Incorrect keyboardType - it should have been UIKeyboardTypeNumberPad.");

    XCTAssert(CGColorEqualToColor(cardNumberTextField.tintColor.CGColor,[UIColor BNPurpleColor].CGColor),
              "Incorrect tintColor - it should have been [UIColor BNPurpleColor].");

    XCTAssert(cardNumberTextField.font == [UIFont systemFontOfSize:16.f],
              "Incorrect font - it should have been [UIFont systemFontOfSize:16.f].");
}

@end


text:
/**
 *
 */
package de.hpi.bpmn.sese;

import de.hpi.bpmn.ANDGateway;
import de.hpi.bpmn.SequenceFlow;
import de.hpi.bpmn.analysis.BPMNSESENormalizer;

/**
 * This class represents an {@link ANDGateway} with a splitting nature.
 *
 * It is used by the {@link BPMNSESENormalizer} and export to BPEL.
 *
 * @author Sven Wagner-Boysen
 */
public class ANDGatewaySplit extends ANDGateway implements Split {

	public SequenceFlow getIncomingSequenceFlow() {
		if(this.getIncomingSequenceFlows().size() != 1) {
			return null;
		}
		return this.getIncomingSequenceFlows().get(0);
	}
}


text:
'use strict';

var controllers = angular.module('commentiumControllers',
  ['ngSanitize', 'commentiumFilters', 'commentiumServices']);

/* Controllers */
controllers.controller('CommentListCtrl', ['$scope', '$http', 'commentiumTags',
  function($scope, $http, tagsProvider) {

    $scope.load = function (url) {
      $http.get(url).success(function(data) {
        $scope.commentList = data;
        $scope.loaded = {when: new Date(), what: url};
        $scope.touch();
      });
    };

    $scope.touch = function () {
      var data = $scope.commentList,
        tags = {};
      $scope.commentListCount = data.length;
      tags = tagsProvider.load(data);
      tags = tagsProvider.rank(tags);
      $scope.tags = tags;
      $scope.tagList = Object.keys(tags).sort();
      $scope.touched = {when: new Date()};
      return true;
    };
    $scope.load('resources/comments.json');

    $scope.clear = function(){$scope.load('resources/comments-clear.json');};

    $scope.getComment = function(id) {
      var comment = {};
      if (typeof id === "number" || typeof id === "string") {
        comment = $scope.commentList.find(function(item) {
          return item.id == id; // Keep this loose to allow strings and numbers to match
        });
      }
      return comment || {};
    };

    $scope.editComment = function(comment) {
      comment.editing = true;
      comment.working = {
        id: comment.id,
        title: comment.title,
        text: comment.text,
        tags: comment.tags
      };
      return true;
    };
    $scope.cancel = function(comment) {
      comment.editing = false;
    };

    $scope.saveComment = function(newComment) {
      var id = newComment.id,
        index = -1,
        comment = {},
        oldComment = {};

      // If a matching id is found, save it in place.
      index = $scope.commentList.findIndex(function(item) {
        return item.id == id;
      });
      if (index > -1) {
        oldComment = $scope.commentList[index];
      } else {
        index = $scope.commentList.length; // Append
        if (typeof newComment.id === "undefined") {
          newComment.id = (new Date()).getTime();
        }
      }
      $scope.audit(newComment, oldComment);

      // Limit the update to specific fields.
      comment = angular.copy(oldComment);
      comment.id = newComment.id;
      comment.title = newComment.title;
      comment.text = newComment.text;
      comment.tags = newComment.tags;

      $scope.commentList[index] = comment;
      $scope.touch();

      oldComment.editing = false;

      return true;
    };

    $scope.audit = function(newItem, oldItem) {
      // TODO log changes for humans.
      return true;
    };

    $scope.validateComment = function(comment) {
      // TODO validate embedded HTML and tags.
      return true;
    };

    $scope.tagClick = function(tag) {
      $scope.tagSearch = ($scope.tagSearch === tag.name) ? '' : tag.name;
    };

  }
]);

controllers.controller('CommentDetailCtrl', ['$scope', '$routeParams',
  function($scope, $routeParams) {
    var id = $routeParams.id,
        data = $scope.commentList.find(function(item) {return item.id === id;});

    $scope.commentId = id;
    $scope.commentDetail = data || {};
  }
]);

controllers.controller('CommentEditCtrl', ['$scope', '$routeParams',
  function($scope, $routeParams) {
    var CommentListCtrl = $scope.$parent;

    $scope.saveComment = function (item) {
      CommentListCtrl.saveComment(item);
    };

    $scope.addTagToComment = function(name) {
      name = name.replace(/\s/g, '');
      if (name !== '') {
        if ($scope.comment.working.tags.indexOf(name) === -1) {
          $scope.comment.working.tags.push(name);
        }
      }

      $scope.newTag = ''; // Clear it
      return true;
    };

    $scope.existingTags = angular.copy(CommentListCtrl.tagList);
  }
]);


text:
#pragma once
#include <aws/sagemaker/SageMaker_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/sagemaker/model/TrainingInputMode.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/sagemaker/model/MetricDefinition.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace SageMaker
{
namespace Model
{

  /**
   *
Specifies which training algorithm to use for training jobs that a
   * hyperparameter tuning job launches and the metrics to monitor.

See
   * Also:
   AWS
   * API Reference

   */
  class AWS_SAGEMAKER_API HyperParameterAlgorithmSpecification
  {
  public:
    HyperParameterAlgorithmSpecification();
    HyperParameterAlgorithmSpecification(Aws::Utils::Json::JsonView jsonValue);
    HyperParameterAlgorithmSpecification& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
 The registry path of the Docker image that contains the training algorithm.
     * For information about Docker registry paths for built-in algorithms, see Algorithms
     * Provided by Amazon SageMaker: Common Parameters. SageMaker supports both
     * registry/repository[:tag] and
     * registry/repository[@digest] image path formats. For more
     * information, see Using
     * Your Own Algorithms with Amazon SageMaker.

     */
    inline const Aws::String& GetTrainingImage() const{ return m_trainingImage; }

    /**
     *
 The registry path of the Docker image that contains the training algorithm.
     * For information about Docker registry paths for built-in algorithms, see Algorithms
     * Provided by Amazon SageMaker: Common Parameters. SageMaker supports both
     * registry/repository[:tag] and
     * registry/repository[@digest] image path formats. For more
     * information, see Using
     * Your Own Algorithms with Amazon SageMaker.

     */
    inline bool TrainingImageHasBeenSet() const { return m_trainingImageHasBeenSet; }

    /**
     *
 The registry path of the Docker image that contains the training algorithm.
     * For information about Docker registry paths for built-in algorithms, see Algorithms
     * Provided by Amazon SageMaker: Common Parameters. SageMaker supports both
     * registry/repository[:tag] and
     * registry/repository[@digest] image path formats. For more
     * information, see Using
     * Your Own Algorithms with Amazon SageMaker.

     */
    inline void SetTrainingImage(const Aws::String& value) { m_trainingImageHasBeenSet = true; m_trainingImage = value; }

    /**
     *
 The registry path of the Docker image that contains the training algorithm.
     * For information about Docker registry paths for built-in algorithms, see Algorithms
     * Provided by Amazon SageMaker: Common Parameters. SageMaker supports both
     * registry/repository[:tag] and
     * registry/repository[@digest] image path formats. For more
     * information, see Using
     * Your Own Algorithms with Amazon SageMaker.

     */
    inline void SetTrainingImage(Aws::String&& value) { m_trainingImageHasBeenSet = true; m_trainingImage = std::move(value); }

    /**
     *
 The registry path of the Docker image that contains the training algorithm.
     * For information about Docker registry paths for built-in algorithms, see Algorithms
     * Provided by Amazon SageMaker: Common Parameters. SageMaker supports both
     * registry/repository[:tag] and
     * registry/repository[@digest] image path formats. For more
     * information, see Using
     * Your Own Algorithms with Amazon SageMaker.

     */
    inline void SetTrainingImage(const char* value) { m_trainingImageHasBeenSet = true; m_trainingImage.assign(value); }

    /**
     *
 The registry path of the Docker image that contains the training algorithm.
     * For information about Docker registry paths for built-in algorithms, see Algorithms
     * Provided by Amazon SageMaker: Common Parameters. SageMaker supports both
     * registry/repository[:tag] and
     * registry/repository[@digest] image path formats. For more
     * information, see Using
     * Your Own Algorithms with Amazon SageMaker.

     */
    inline HyperParameterAlgorithmSpecification& WithTrainingImage(const Aws::String& value) { SetTrainingImage(value); return *this;}

    /**
     *
 The registry path of the Docker image that contains the training algorithm.
     * For information about Docker registry paths for built-in algorithms, see Algorithms
     * Provided by Amazon SageMaker: Common Parameters. SageMaker supports both
     * registry/repository[:tag] and
     * registry/repository[@digest] image path formats. For more
     * information, see Using
     * Your Own Algorithms with Amazon SageMaker.

     */
    inline HyperParameterAlgorithmSpecification& WithTrainingImage(Aws::String&& value) { SetTrainingImage(std::move(value)); return *this;}

    /**
     *
 The registry path of the Docker image that contains the training algorithm.
     * For information about Docker registry paths for built-in algorithms, see Algorithms
     * Provided by Amazon SageMaker: Common Parameters. SageMaker supports both
     * registry/repository[:tag] and
     * registry/repository[@digest] image path formats. For more
     * information, see Using
     * Your Own Algorithms with Amazon SageMaker.

     */
    inline HyperParameterAlgorithmSpecification& WithTrainingImage(const char* value) { SetTrainingImage(value); return *this;}

    inline const TrainingInputMode& GetTrainingInputMode() const{ return m_trainingInputMode; }

    inline bool TrainingInputModeHasBeenSet() const { return m_trainingInputModeHasBeenSet; }

    inline void SetTrainingInputMode(const TrainingInputMode& value) { m_trainingInputModeHasBeenSet = true; m_trainingInputMode = value; }

    inline void SetTrainingInputMode(TrainingInputMode&& value) { m_trainingInputModeHasBeenSet = true; m_trainingInputMode = std::move(value); }

    inline HyperParameterAlgorithmSpecification& WithTrainingInputMode(const TrainingInputMode& value) { SetTrainingInputMode(value); return *this;}

    inline HyperParameterAlgorithmSpecification& WithTrainingInputMode(TrainingInputMode&& value) { SetTrainingInputMode(std::move(value)); return *this;}

    /**
     *
The name of the resource algorithm to use for the hyperparameter tuning job.
     * If you specify a value for this parameter, do not specify a value for
     * TrainingImage.

     */
    inline const Aws::String& GetAlgorithmName() const{ return m_algorithmName; }

    /**
     *
The name of the resource algorithm to use for the hyperparameter tuning job.
     * If you specify a value for this parameter, do not specify a value for
     * TrainingImage.

     */
    inline bool AlgorithmNameHasBeenSet() const { return m_algorithmNameHasBeenSet; }

    /**
     *
The name of the resource algorithm to use for the hyperparameter tuning job.
     * If you specify a value for this parameter, do not specify a value for
     * TrainingImage.

     */
    inline void SetAlgorithmName(const Aws::String& value) { m_algorithmNameHasBeenSet = true; m_algorithmName = value; }

    /**
     *
The name of the resource algorithm to use for the hyperparameter tuning job.
     * If you specify a value for this parameter, do not specify a value for
     * TrainingImage.

     */
    inline void SetAlgorithmName(Aws::String&& value) { m_algorithmNameHasBeenSet = true; m_algorithmName = std::move(value); }

    /**
     *
The name of the resource algorithm to use for the hyperparameter tuning job.
     * If you specify a value for this parameter, do not specify a value for
     * TrainingImage.

     */
    inline void SetAlgorithmName(const char* value) { m_algorithmNameHasBeenSet = true; m_algorithmName.assign(value); }

    /**
     *
The name of the resource algorithm to use for the hyperparameter tuning job.
     * If you specify a value for this parameter, do not specify a value for
     * TrainingImage.

     */
    inline HyperParameterAlgorithmSpecification& WithAlgorithmName(const Aws::String& value) { SetAlgorithmName(value); return *this;}

    /**
     *
The name of the resource algorithm to use for the hyperparameter tuning job.
     * If you specify a value for this parameter, do not specify a value for
     * TrainingImage.

     */
    inline HyperParameterAlgorithmSpecification& WithAlgorithmName(Aws::String&& value) { SetAlgorithmName(std::move(value)); return *this;}

    /**
     *
The name of the resource algorithm to use for the hyperparameter tuning job.
     * If you specify a value for this parameter, do not specify a value for
     * TrainingImage.

     */
    inline HyperParameterAlgorithmSpecification& WithAlgorithmName(const char* value) { SetAlgorithmName(value); return *this;}

    /**
     *
An array of MetricDefinition objects that specify the metrics that the
     * algorithm emits.

     */
    inline const Aws::Vector<MetricDefinition>& GetMetricDefinitions() const{ return m_metricDefinitions; }

    /**
     *
An array of MetricDefinition objects that specify the metrics that the
     * algorithm emits.

     */
    inline bool MetricDefinitionsHasBeenSet() const { return m_metricDefinitionsHasBeenSet; }

    /**
     *
An array of MetricDefinition objects that specify the metrics that the
     * algorithm emits.

     */
    inline void SetMetricDefinitions(const Aws::Vector<MetricDefinition>& value) { m_metricDefinitionsHasBeenSet = true; m_metricDefinitions = value; }

    /**
     *
An array of MetricDefinition objects that specify the metrics that the
     * algorithm emits.

     */
    inline void SetMetricDefinitions(Aws::Vector<MetricDefinition>&& value) { m_metricDefinitionsHasBeenSet = true; m_metricDefinitions = std::move(value); }

    /**
     *
An array of MetricDefinition objects that specify the metrics that the
     * algorithm emits.

     */
    inline HyperParameterAlgorithmSpecification& WithMetricDefinitions(const Aws::Vector<MetricDefinition>& value) { SetMetricDefinitions(value); return *this;}

    /**
     *
An array of MetricDefinition objects that specify the metrics that the
     * algorithm emits.

     */
    inline HyperParameterAlgorithmSpecification& WithMetricDefinitions(Aws::Vector<MetricDefinition>&& value) { SetMetricDefinitions(std::move(value)); return *this;}

    /**
     *
An array of MetricDefinition objects that specify the metrics that the
     * algorithm emits.

     */
    inline HyperParameterAlgorithmSpecification& AddMetricDefinitions(const MetricDefinition& value) { m_metricDefinitionsHasBeenSet = true; m_metricDefinitions.push_back(value); return *this; }

    /**
     *
An array of MetricDefinition objects that specify the metrics that the
     * algorithm emits.

     */
    inline HyperParameterAlgorithmSpecification& AddMetricDefinitions(MetricDefinition&& value) { m_metricDefinitionsHasBeenSet = true; m_metricDefinitions.push_back(std::move(value)); return *this; }

  private:

    Aws::String m_trainingImage;
    bool m_trainingImageHasBeenSet = false;

    TrainingInputMode m_trainingInputMode;
    bool m_trainingInputModeHasBeenSet = false;

    Aws::String m_algorithmName;
    bool m_algorithmNameHasBeenSet = false;

    Aws::Vector<MetricDefinition> m_metricDefinitions;
    bool m_metricDefinitionsHasBeenSet = false;
  };

} // namespace Model
} // namespace SageMaker
} // namespace Aws


text:
Have questions about the design and build process? We'd love to help.

Contact Us


text:
using System;
using System.Xml.Serialization;

namespace dk.nita.saml20.Schema.XmlDSig
{
    /// <summary>
    /// The optional Transforms element contains an ordered list of Transform elements; these describe how the
    /// signer obtained the data object that was digested. The output of each Transform serves as input to the
    /// next Transform. The input to the first Transform is the result of dereferencing the URI attribute of the
    /// Reference element. The output from the last Transform is the input for the DigestMethod algorithm. When
    /// transforms are applied the signer is not signing the native (original) document but the resulting
    /// (transformed) document. (See Only What is Signed is Secure (section 8.1).)
    ///
    /// Each Transform consists of an Algorithm attribute and content parameters, if any, appropriate for the
    /// given algorithm. The Algorithm attribute value specifies the name of the algorithm to be performed, and
    /// the Transform content provides additional data to govern the algorithm's processing of the transform
    /// input. (See Algorithm Identifiers and Implementation Requirements (section 6).)
    ///
    /// As described in The Reference Processing Model (section  4.3.3.2), some transforms take an XPath node-set
    /// as input, while others require an octet stream. If the actual input matches the input needs of the
    /// transform, then the transform operates on the unaltered input. If the transform input requirement differs
    /// from the format of the actual input, then the input must be converted.
    ///
    /// Some Transforms may require explicit MIME type, charset (IANA registered "character set"), or other such
    /// information concerning the data they are receiving from an earlier Transform or the source data, although
    /// no Transform algorithm specified in this document needs such explicit information. Such data
    /// characteristics are provided as parameters to the Transform algorithm and should be described in the
    /// specification for the algorithm.
    ///
    /// Examples of transforms include but are not limited to base64 decoding [MIME], canonicalization [XML-C14N],
    /// XPath filtering [XPath], and XSLT [XSLT]. The generic definition of the Transform element also allows
    /// application-specific transform algorithms. For example, the transform could be a decompression routine
    /// given by a Java class appearing as a base64 encoded parameter to a Java Transform algorithm. However,
    /// applications should refrain from using application-specific transforms if they wish their signatures to
    /// be verifiable outside of their application domain. Transform Algorithms (section 6.6) defines the list
    /// of standard transformations.
    ///
    /// </summary>
    [Serializable]
    [XmlType(Namespace=Saml20Constants.XMLDSIG)]
    [XmlRoot(ELEMENT_NAME, Namespace=Saml20Constants.XMLDSIG, IsNullable=false)]
    public class Transform
    {
        /// <summary>
        /// The XML Element name of this class
        /// </summary>
        public const string ELEMENT_NAME = "Transform";

        private string algorithmField;
        private object[] itemsField;

        private string[] textField;

        /// <summary>
        /// Gets or sets the items.
        /// </summary>
        /// <value>The items.</value>
        [XmlAnyElement]
        [XmlElement("XPath", typeof (string))]
        public object[] Items
        {
            get { return itemsField; }
            set { itemsField = value; }
        }

        /// <summary>
        /// Gets or sets the text.
        /// </summary>
        /// <value>The text.</value>
        [XmlText]
        public string[] Text
        {
            get { return textField; }
            set { textField = value; }
        }

        /// <summary>
        /// Gets or sets the algorithm.
        /// </summary>
        /// <value>The algorithm.</value>
        [XmlAttribute(DataType="anyURI")]
        public string Algorithm
        {
            get { return algorithmField; }
            set { algorithmField = value; }
        }
    }
}


text:
export class PlatformMock {
    public ready(): any {
        return new Promise((resolve: Function) => {
            resolve();
        });
    }
}


text:
package com.graphhopper.converter.api;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * @author David Masclet
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class GisgraphySearchEntry {

    @JsonProperty("feature_id")
    private long featureId;
    private double lat;
    private double lng;
    private String name;

    @JsonProperty("country_code")
    private String countryCode;

    private String country;

    @JsonProperty("is_in")
    private String isIn;

    @JsonProperty("is_in_place")
    private String isInPlace;

    @JsonProperty("is_in_zip")
    private List<String> isInZip;

    @JsonProperty("adm1_name")
    private String adm1Name;

    @JsonProperty("zip_code")
    private List<String> zipCodes;

    @JsonProperty("house_numbers")
    private List<String> houseNumbers = new ArrayList<String>();

    public List<String> getHouseNumbers() {
        return houseNumbers;
    }

    public void setHouseNumbers(List<String> houseNumbers) {
        this.houseNumbers = houseNumbers;
    }

    @JsonProperty("house_number")
    private String houseNumber;

    @JsonProperty("label")
    private String label;

    public long getFeatureId() {
        return featureId;
    }

    public void setFeatureId(long featureId) {
        this.featureId = featureId;
    }

    public double getLat() {
        return lat;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }
    public double getLng() {
        return lng;
    }

    public void setLng(double lng) {
        this.lng = lng;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCountryCode() {
        return countryCode;
    }

    public void setCountryCode(String countryCode) {
        this.countryCode = countryCode;
    }

    public String getIsIn() {
        return isIn;
    }

    public void setIsIn(String isIn) {
        this.isIn = isIn;
    }
    @JsonProperty("is_in_place")
    public String getIsInPlace() {
        return isInPlace;
    }

    @JsonProperty("is_in_place")
    public void setIsInPlace(String isInPlace) {
        this.isInPlace = isInPlace;
    }

    @JsonProperty("is_in_zip")
    public List<String> getIsInZip() {
        return isInZip;
    }

    @JsonProperty("is_in_zip")
    public void setIsInZip(List<String> isInZip) {
        this.isInZip = isInZip;
    }

    public String getAdm1Name() {
        return adm1Name;
    }

    public void setAdm1Name(String adm1Name) {
        this.adm1Name = adm1Name;
    }

    public List<String> getZipCodes() {
        return zipCodes;
    }

    public void setZipCodes(List<String> zipCodes) {
        this.zipCodes = zipCodes;
    }

    public void setCountry(String country){
        this.country = country;
    }

    public String getCountry() {
       return country;
    }

    @JsonProperty("house_number")
    public String getHouseNumber() {
        return houseNumber;
    }

    @JsonProperty("house_number")
    public void setHouseNumber(String houseNumber) {
        this.houseNumber = houseNumber;
    }

    public String getZipCode() {
        if (isInZip!=null && isInZip.size()>0){
            return isInZip.get(0);
        }
        if (zipCodes!=null && zipCodes.size()>0){
            return zipCodes.get(0);
        }
        return null;
    }

    @JsonProperty("label")
    public String getLabel() {
        return label;
    }

    @JsonProperty("label")
    public void setLabel(String label) {
        this.label = label;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("GisgraphySearchEntry [featureId=");
        builder.append(featureId);
        builder.append(", ");
        if (name != null) {
            builder.append("name=");
            builder.append(name);
            builder.append(", ");
        }
        if (isIn != null) {
            builder.append("isIn=");
            builder.append(isIn);
            builder.append(", ");
        }
        builder.append("]");
        return builder.toString();
    }

}


text:
// Copyright © 2011 - Present RealDimensions Software, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
//
// You may obtain a copy of the License at
//
// 	http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace chocolatey.infrastructure.app.services
{
    using configuration;

    public interface INugetService : ISourceRunner
    {
        /// <summary>
        ///   Run pack in noop mode.
        /// </summary>
        /// <param name="config">The configuration.</param>
        void pack_noop(ChocolateyConfiguration config);

        /// <summary>
        ///   Packages up a nuspec into a compiled nupkg.
        /// </summary>
        /// <param name="config">The configuration.</param>
        void pack_run(ChocolateyConfiguration config);

        /// <summary>
        ///   Push_noops the specified configuration.
        /// </summary>
        /// <param name="config">The configuration.</param>
        void push_noop(ChocolateyConfiguration config);

        /// <summary>
        ///   Push_runs the specified configuration.
        /// </summary>
        /// <param name="config">The configuration.</param>
        void push_run(ChocolateyConfiguration config);

        /// <summary>
        ///   Remove the rollback directory for a package if it exists
        /// </summary>
        /// <param name="packageName">Name of the package.</param>
        void remove_rollback_directory_if_exists(string packageName);
    }
}


text:
module ActiveTools
  module CoreExtension

    module MethodDigger
      module ObjectExtension
        def method_digger(tree, &block)
          tree.stringify_keys!
          tree.each do |method, value|
            if method.last == "*"
              method = method[0..-2]
              cycle_call(method) do |nested|
                yield self, method, nested, value
                if value.is_a?(Hash) && !nested.nil?
                  nested.method_digger(value, &block)
                end
              end
            else
              response = try(method)
              yield self, method, response, value
              if value.is_a?(Hash) && !response.nil?
                response.method_digger(value, &block)
              end
            end
          end
        end

        def cycle_call(method, &block)
          object = self
          export = []
          while object = object.try(method)
            yield object if block_given?
            export << object
          end
          export
        end

      end

      ::Object.send(:include, ObjectExtension)
    end
  end
end


text:
module DSL.Abstract.Core
    ( Model(..)
    , attacking
    , consistent
    , acceptable
    , admissible
    , acceptees
    , heads
    , attackers
    , tails
    , attackees
    , attacked
    , unattacked
    ) where

import Data.Extension.Ord (intersect, nub, subset, (\\))

-- * Abstract argumentation model.
-- | The model consists of the following axioms.
--   1. "Attackability"
--   2. "Consistability"
--   3. "Acceptability"
--   4. "Admissibility"
data Model arg = Abst [arg] [(arg, arg)] deriving (Show)

-- * "Attackability"
-- | A set S < Arguments is attacking x, iff, y <- S s.t. [y, x] <- Attacks.
attacking :: Eq arg => Model arg -> [arg] -> arg -> Bool
attacking (Abst _ atcks) args arg =
    or [y == arg | (x, y) <- atcks, x `elem` args]

-- * "Consistability"
-- | A set S < Arguments is called consistent, iff, there are no x, y in S s.t.
--   (x, y) <- Attacks.
consistent :: Eq arg => Model arg -> [arg] -> Bool
consistent (Abst _ atcks) args =
    null [(x, y) | (x, y) <- atcks, x `elem` args, y `elem` args]

-- * "Acceptability"
-- | A set S < Arguments accepts x, iff, for all arguments y <- Arguments:
--   if (y, x) <- Attacks then there exists z <- S for which (z, y) <- Attacks.
acceptable :: Eq arg => Model arg -> arg -> [arg] -> Bool
acceptable model@(Abst _ atcks) x args =
    and [attacking model args y | (y, x') <- atcks, x == x']

-- * "Admissibility"
-- | A consistent set of arguments S is admissible, iff, every argument x <- S
--   is scceptable with respect to S, i.e., S <- F_{mode} (S)
admissible :: Ord arg => Model arg -> [arg] -> Bool
admissible model args =
    consistent model args && args `subset` acceptees model args

-- * "Acceptees - Characteristic Function"
-- | The function "acceptees" of arguments with respect to the model,
--   F_{model} : Arguments -> Arguments, is a function s.t. given a set of arguments S,
--   F_{model} (S) = {x | x is acceptable with respect to S}
acceptees :: Eq arg => Model arg -> [arg] -> [arg]
acceptees model@(Abst args' _) args =
    [x | x <- args', acceptable model x args]

-- * "Head Endpoints"
-- | The function "heads" of an argument with respect to the model,
--   F_{Model} : Argument -> Arguments, is a function s.t. given an argument a,
--   F_{Model} (a) = {x | x is attacking a}
heads :: Eq arg => Model arg -> arg -> [arg]
heads (Abst _ atcks) arg =
    [x | (x, arg') <- atcks, arg == arg']

-- * "Attackers - Characteristic Function"
-- | The function "attackers" of arguments with respect to the model,
--   F_{Model} : Arguments -> Arguments, is a function s.t. given arguments S,
--   F_{Model} (S) = {x | x is attacking a <- S}
attackers :: Ord arg => Model arg -> [arg] -> [arg]
attackers model =
    nub . concatMap (heads model)

-- * "Tail Endpoints"
-- | The function "tails" of an argument with respect to the model,
--   F_{Model} : Argument -> Arguments, is a function s.t. given an argument a,
--   F_{Model} (a) = {x | x is attacked by a}
tails :: Eq arg => Model arg -> arg -> [arg]
tails (Abst _ atcks) arg =
    [x | (arg', x) <- atcks, arg == arg']

-- * "Attackees - Characteristic Function"
-- | The function "attackees" of arguments with respect to the model,
--   F_{Model} : Arguments -> Arguments, is a function s.t. given arguments S,
--   F_{Model} (S) = {x | x is attacked by a <- S}
attackees :: Ord arg => Model arg -> [arg] -> [arg]
attackees model =
    nub . concatMap (tails model)

-- * "Attacked"
-- | The function "attacked" of arguments with respect to the model,
--   given a list of arguments 'args', an argument 'arg' is attacked if there
--   exists an attacker that is args.
attacked :: Ord arg => [arg] -> Model arg -> arg -> Bool
attacked args (Abst _ atcks) arg =
    let atckrs = [x | (x, y) <- atcks, arg == y]
    in  not (null (atckrs `intersect` args))

-- * "Unattacked"
-- | The function "unattacked" of arguments with respect to the model,
--   given a list of arguments 'args', an argument 'arg' is unattacked if there
--   does not exist any attacker that is args.
unattacked :: Ord arg => [arg] -> Model arg -> arg -> Bool
unattacked args (Abst _ atcks) arg =
    let atckrs = [a | (a, b) <- atcks, arg == b]
    in  null (atckrs \\ args)


text:
html, body { font-size: 14pt; padding: 10px 2.5%;}
.hide { display: none; }
form .who { width: 10%; }
form .what { width: 80%; }
ul { list-style: none; padding: 0; }
ul .when {color: #555; font-size: 12pt; float: right; display: none; }
li:hover .when {display: inline;}


text:
/*
* (C) 2021 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/

#include "cli.h"

#if defined(BOTAN_HAS_ZFEC) && defined(BOTAN_HAS_SHA2_64)
   #include <botan/zfec.h>
   #include <botan/hash.h>
   #include <botan/internal/loadstor.h>
   #include <fstream>
   #include <sstream>
#endif

namespace Botan_CLI {

#if defined(BOTAN_HAS_ZFEC) && defined(BOTAN_HAS_SHA2_64)

static const uint32_t FEC_MAGIC = 0xFECC0DEC;
const char* const FEC_SHARE_HASH = "SHA-512-256";

class FEC_Share final
   {
   public:
      FEC_Share() :
         m_share(0),
         m_k(0),
         m_n(0),
         m_padding(0),
         m_bits()
         {}

      FEC_Share(size_t share, size_t k, size_t n,
                 size_t padding,
                 const uint8_t bits[], size_t len) :
         m_share(share),
         m_k(k),
         m_n(n),
         m_padding(padding),
         m_bits(bits, bits + len)
         {
         }

      size_t share_id() const { return m_share; }
      size_t k() const { return m_k; }
      size_t n() const { return m_n; }
      size_t padding() const { return m_padding; }
      size_t share_size() const { return m_bits.size(); }
      const uint8_t* share_data() const { return m_bits.data(); }

      static FEC_Share deserialize(const uint8_t bits[], size_t len,
                                   Botan::HashFunction& hash)
         {
         const size_t hash_len = hash.output_length();

         if(len < FEC_SHARE_HEADER_LEN + hash_len)
            throw CLI_Error("FEC share is too short to be valid");

         if(Botan::load_be<uint32_t>(bits, 0) != FEC_MAGIC)
            throw CLI_Error("FEC share does not have expected magic bytes");

         // verify that reserved bytes are zero
         for(size_t i = 8; i != 12; ++i)
            {
            if(bits[i] != 0)
               throw CLI_Error("FEC share has reserved header bytes set");
            }

         size_t share_id = bits[4];
         size_t k = bits[5];
         size_t n = bits[6];
         size_t padding = bits[7];

         if(share_id >= n || k >= n || padding >= k)
            throw CLI_Error("FEC share has invalid k/n/padding fields");

         hash.update(bits, len - hash_len);
         auto share_hash = hash.final();

         const bool digest_ok = Botan::same_mem(
            share_hash.data(), &bits[len - hash_len], hash_len);

         if(!digest_ok)
            throw CLI_Error("FEC share has invalid hash");

         return FEC_Share(share_id, k, n, padding,
                          bits + FEC_SHARE_HEADER_LEN,
                          len - (FEC_SHARE_HEADER_LEN + hash_len));
         }

      void serialize_to(Botan::HashFunction& hash, std::ostream& out) const
         {
         uint8_t header[FEC_SHARE_HEADER_LEN] = { 0 };

         Botan::store_be(FEC_MAGIC, header);
         header[4] = static_cast<uint8_t>(m_share);
         header[5] = static_cast<uint8_t>(m_k);
         header[6] = static_cast<uint8_t>(m_n);
         header[7] = static_cast<uint8_t>(m_padding);
         // bytes 8..12 left as zero/reserved

         out.write(reinterpret_cast<const char*>(header), sizeof(header));
         out.write(reinterpret_cast<const char*>(m_bits.data()), m_bits.size());

         hash.update(header, sizeof(header));
         hash.update(m_bits);
         auto digest = hash.final();

         out.write(reinterpret_cast<const char*>(digest.data()), digest.size());
         }

   private:
      static const size_t FEC_SHARE_HEADER_LEN = 12;

      size_t m_share;
      size_t m_k;
      size_t m_n;
      size_t m_padding;
      std::vector<uint8_t> m_bits;
   };

class FEC_Encode final : public Command
   {
   public:
      FEC_Encode() : Command("fec_encode --suffix=fec --prefix= --output-dir= k n input") {}

      std::string group() const override
         {
         return "fec";
         }

      std::string description() const override
         {
         return "Forward error encode a file";
         }

      void go() override
         {
         const size_t k = get_arg_sz("k");
         const size_t n = get_arg_sz("n");

         const std::string suffix = get_arg("suffix");
         const std::string prefix = get_arg("prefix");
         const std::string input = get_arg("input");
         const std::string output_dir = get_arg("output-dir");

         Botan::ZFEC fec(k, n); // checks k/n for validity

         auto hash = Botan::HashFunction::create_or_throw(FEC_SHARE_HASH);

         auto input_data = slurp_file(get_arg("input"));

         // append a hash of the input
         hash->update(input_data);
         const auto hash_of_input = hash->final();
         input_data.insert(input_data.end(),
                           hash_of_input.begin(),
                           hash_of_input.end());

         // add padding 0x00 bytes as needed to round up to k multiple
         size_t padding = 0;
         while(input_data.size() % k != 0)
            {
            padding += 1;
            input_data.push_back(0x00);
            }

         auto encoder_fn = [&](size_t share,
                               const uint8_t bits[], size_t len)
            {
            std::ostringstream output_fsname;

            if(!output_dir.empty())
               output_fsname << output_dir << "/";

            if(!prefix.empty())
               output_fsname << prefix;
            else
               output_fsname << input;

            output_fsname << "." << (share + 1) << "_" << n;

            if(!suffix.empty())
               output_fsname << "." << suffix;

            std::ofstream output(output_fsname.str(), std::ios::binary);

            FEC_Share fec_share(share, k, n, padding, bits, len);
            fec_share.serialize_to(*hash, output);
            };

         fec.encode(input_data.data(), input_data.size(), encoder_fn);
         }
   };

BOTAN_REGISTER_COMMAND("fec_encode", FEC_Encode);

class FEC_Decode final : public Command
   {
   public:
      FEC_Decode() : Command("fec_decode *shares") {}

      std::string group() const override
         {
         return "fec";
         }

      std::string description() const override
         {
         return "Recover data from FEC shares";
         }

      void go() override
         {
         auto hash = Botan::HashFunction::create_or_throw(FEC_SHARE_HASH);
         const size_t hash_len = hash->output_length();

         std::vector<FEC_Share> shares;

         for(const auto& share_fsname: get_arg_list("shares"))
            {
            const auto share_bits = slurp_file(share_fsname);

            try
               {
               auto share = FEC_Share::deserialize(share_bits.data(),
                                                   share_bits.size(),
                                                   *hash);
               shares.push_back(share);
               }
            catch(std::exception& e)
               {
               error_output() << "Ignoring invalid share '" << share_fsname
                              << "': " << e.what() << "\n";
               }
            }

         if(shares.empty())
            {
            error_output() << "Must provide a list of at least k shares\n";
            this->set_return_code(1);
            return;
            }

         size_t k = 0;
         size_t n = 0;
         size_t padding = 0;
         size_t share_size = 0;

         for(const auto& share: shares)
            {
            if(k == 0 && n == 0 && padding == 0)
               {
               k = share.k();
               n = share.n();
               padding = share.padding();
               share_size = share.share_size();
               }
            else
               {
               if(share.k() != k ||
                  share.n() != n ||
                  share.padding() != padding ||
                  share.share_size() != share_size)
                  {
                  error_output() << "Shares have mismatched k/n/padding/size values\n";
                  this->set_return_code(2);
                  return;
                  }
               }
            }

         if(shares.size() < k)
            {
            error_output() << "At least " << k << " shares are required for recovery\n";
            this->set_return_code(2);
            return;
            }

         Botan::ZFEC fec(k, n);

         std::vector<uint8_t> decoded(share_size * k);

         auto decoder_fn = [&](size_t share,
                               const uint8_t bits[], size_t len)
            {
            std::memcpy(&decoded[share * share_size],
                          bits, len);
            };

         std::map<size_t, const uint8_t*> share_ptrs;

         for(auto& share: shares)
            share_ptrs[share.share_id()] = share.share_data();

         fec.decode_shares(share_ptrs, share_size, decoder_fn);

         auto decoded_digest = hash->process(
            decoded.data(), decoded.size() - (hash_len + padding));

         if(!Botan::same_mem(decoded_digest.data(),
                             &decoded[decoded.size() - (hash_len + padding)],
                             hash_len))
            throw CLI_Error("Recovered data failed digest check");

         for(size_t i = 0; i != padding; ++i)
            if(decoded[decoded.size() - padding + i] != 0)
               throw CLI_Error("Recovered data had non-zero padding bytes");

         output().write(reinterpret_cast<const char*>(decoded.data()),
                        decoded.size() - (hash_len + padding));
         }
   };

BOTAN_REGISTER_COMMAND("fec_decode", FEC_Decode);

class FEC_Info final : public Command
   {
   public:
      FEC_Info() : Command("fec_info share") {}

      std::string group() const override
         {
         return "fec";
         }

      std::string description() const override
         {
         return "Display information about a FEC share";
         }

      void go() override
         {
         auto hash = Botan::HashFunction::create_or_throw(FEC_SHARE_HASH);

         const std::string share_fsname = get_arg("share");
         const auto share_bits = slurp_file(share_fsname);

         try
            {
            auto share = FEC_Share::deserialize(share_bits.data(),
                                                share_bits.size(),
                                                *hash);
            output() << "FEC share " << share.share_id() + 1 << "/"
                     << share.n() << " with " << share.k()
                     << " needed for recovery\n";
            }
         catch(std::exception& e)
            {
            error_output() << "Invalid share '" << share_fsname
                           << "': " << e.what() << "\n";
            }
         }
   };

BOTAN_REGISTER_COMMAND("fec_info", FEC_Info);

#endif

}


text:
erlangio
=============

**Proof of technology mechanism to connect Erlang VM to Linux kernel driver**

Author: The Profitware Group / Sergey Sobko <S.Sobko@profitware.ru>

The code is mainly written as a part of my very special coursework at
Moscow Institute of Electronics and Mathematics (MIEM HSE).

## Introduction

This is a proof of technology that might show how to connect Erlang VM to Linux kernel device driver.
The main idea is to connect Erlang application to device driver through procfs.
As for device driver, it is simple misc_device.

## Getting the code

The code is hosted at [GitHub](https://github.com/MIEMHSE/erlangio/).

Check out the latest development version anonymously with:

```
 $ git clone git://github.com/MIEMHSE/erlangio.git
 $ cd erlangio
```

## Building

From source:

Install the dependencies:

- [Rebar](https://github.com/basho/rebar/) (may be installed using your package manager)
- [Inotify](https://github.com/sheyll/inotify/)

Getting dependencies (after Rebar is installed):

    $ rebar get-deps

Compilation:

    $ rebar compile

## Usage

To run development environment
```
$ sudo insmod priv/erlangio.ko
$ erl -pa ebin deps/*/ebin -eval "application:start(erlangio)"
$ sudo rmmod erlangio
```

To test technology while application is running

```
$ echo 'Hello, world!' | sudo tee --append /dev/erlangio > /dev/null
```


text:
title: API Clients
parent: COVIDcast Main Endpoint
nav_order: 1
---

# COVIDcast Libraries

Dedicated COVIDcast access and analysis libraries are available for several languages:

* R: [covidcast](https://cmu-delphi.github.io/covidcast/covidcastR/)
* Python: [covidcast](https://cmu-delphi.github.io/covidcast/covidcast-py/html/)

These packages provide a convenient way to obtain COVIDcast data as a data frame
ready to be used in further analyses and provide convenient mapping and
analysis functions. For installation instructions and examples, consult their
respective webpages.

To access Epidata datasets on other diseases, visit our [Epidata API Client Libraries)](client_libraries.md) documentation.


text:
.. _rst_tables:

======
Tables
======

This section describes several types of tables that you can use in the
OpenStack documentation. Each table must have a title. Name a table using
the ``table`` directive. See corresponding subsections for the title
formatting details.

.. seealso::

   For the style guidelines on table titles, see :ref:`figure_table_titles`.

Graphic tables
~~~~~~~~~~~~~~

Use the graphic table formatting for the content that presupposes short
lines of text and a small number of rows and columns.

.. note::

   As the graphic tables are rather difficult to create and maintain,
   give the preference to list and CSV tables over the graphic ones,
   or format the content as definition lists where possible.

**Input**

.. code-block:: none

   .. table:: **Default flavors**

    ============  =========  ===============  =============
     Flavor         VCPUs      Disk (in GB)     RAM (in MB)
    ============  =========  ===============  =============
     m1.tiny        1          1                512
     m1.small       1          20               2048
     m1.medium      2          40               4096
     m1.large       4          80               8192
     m1.xlarge      8          160              16384
    ============  =========  ===============  =============

**Output**

.. table:: **Default flavors**

 ============  =========  ===============  =============
  Flavor         VCPUs      Disk (in GB)     RAM (in MB)
 ============  =========  ===============  =============
  m1.tiny        1          1                1
  m1.small       1          20               2048
  m1.medium      2          40               4096
  m1.large       4          80               8192
  m1.xlarge      8          160              16384
 ============  =========  ===============  =============

List tables
~~~~~~~~~~~

Use the ``list-table`` directive to create a table that contains a large
number of rows and columns with the long lines within the cells.

**Input**

.. code-block:: none

   .. list-table:: **Quota descriptions**
      :widths: 10 25 10
      :header-rows: 1

      * - Quota Name
        - Defines the number of
        - Service
      * - Gigabytes
        - Volume gigabytes allowed for each project
        - Block Storage
      * - Instances
        - Instances allowed for each project.
        - Compute
      * - Injected File Content Bytes
        - Content bytes allowed for each injected file.
        - Compute

**Output**

.. list-table:: **Quota descriptions**
      :widths: 10 25 10
      :header-rows: 1

      * - Quota Name
        - Defines the number of
        - Service
      * - Gigabytes
        - Volume gigabytes allowed for each project
        - Block Storage
      * - Instances
        - Instances allowed for each project.
        - Compute
      * - Injected File Content Bytes
        - Content bytes allowed for each injected file.
        - Compute

CSV tables
~~~~~~~~~~

The ``csv-table`` directive enables creating a table from CSV
(comma-separated values) data. It also supports RST inline markups,
such as, emphasis, strong emphasis markups, code, command, and other
directives.

**Input**

.. code-block:: none

   .. csv-table:: **ipv6_ra_mode and ipv6_address_mode combinations**
      :header: ipv6 ra mode, ipv6 address mode, "radvd A,M,O", "External Router A,M,O", Description
      :widths: 2, 2, 2, 2, 4

      *N/S*, *N/S*, Off, Not Defined, Backwards compatibility with pre-Juno IPv6 behavior.
      *N/S*, slaac, Off, "1,0,0", Guest instance obtains IPv6 address from non-OpenStack
      *N/S*, dhcpv6-stateful, Off, "0,1,1", Not currently implemented in the reference implementation.

**Output**

.. csv-table:: **ipv6_ra_mode and ipv6_address_mode combinations**
   :header: ipv6 ra mode, ipv6 address mode, "radvd A,M,O", "External Router A,M,O", Description
   :widths: 2, 2, 2, 2, 4

   *N/S*, *N/S*, Off, Not Defined, Backwards compatibility with pre-Juno IPv6 behavior.
   *N/S*, slaac, Off, "1,0,0", Guest instance obtains IPv6 address from non-OpenStack
   *N/S*, dhcpv6-stateful, Off, "0,1,1", Not currently implemented in the reference implementation.

Useful links on table formatting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* `Graphic tables formatting details
  <http://docutils.sourceforge.net/docs/user/rst/quickref.html#tables>`_
* `List tables formatting details
  <http://docutils.sourceforge.net/docs/ref/rst/directives.html#list-table>`_
* `CSV tables formatting details
  <http://docutils.sourceforge.net/docs/ref/rst/directives.html#id48>`_


text:
/**
 * @fileoverview Brings in all ES6 String polyfills.
 */
'require es6/string/codepointat';
'require es6/string/endswith';
'require es6/string/fromcodepoint';
'require es6/string/includes';
'require es6/string/padend';
'require es6/string/padstart';
'require es6/string/repeat';
'require es6/string/startswith';


text:
<content-header title-name="User Management"></content-header>

            <left-action theme-button="themeButton"></left-action>

                <grid-table grid-info="gridInfo"></grid-table>

            <right-action theme-button="themeButton" full-action="false"></right-action>

            <form class="form-horizontal row">

                        Login Name

                            <input type="email" class="form-control" id="inputEmail3" placeholder="Email">

                        Password

                            <input type="password" class="form-control" id="inputPassword3" placeholder="Password">

                        Email

                            <input type="email" class="form-control" id="Email1" placeholder="Email">

            </form>

Role

                                Function
                                View
                                Add
                                Edit
                                Delete
                                Orther

                                User Mangager

                                        <input type="checkbox" class="minimal" checked />

                                        <input type="checkbox" class="minimal" checked />

                                        <input type="checkbox" class="minimal" checked />

                                        <input type="checkbox" class="minimal" checked />

                                        <input type="checkbox" class="minimal" checked />

                <button type="button" class="btn ng-binding" ng-class="themeButton" ng-show="user.id==0" ng-click="resetUser();">

                    Reset Password
                </button>


text:
from __future__ import absolute_import
import hashlib

from django.template.base import Template
try:
    from django.template.exceptions import TemplateDoesNotExist
except ImportError:  # Django < 1.9
    from django.template.base import TemplateDoesNotExist

try:
    from django.template.loaders.base import Loader as BaseLoader
except ImportError:  # Django < 1.9
    from django.template.loader import BaseLoader

try:
    from django.template.engine import Engine
except ImportError:  # Django < 1.8
    pass
import os

from django.conf import settings
from .compiler import Compiler

from pyjade.utils import process

try:
    from django.template.loader import make_origin
except ImportError:  # Django >= 1.9
    try:
        from django.template import Origin

        def make_origin(display_name, loader, name, dirs):
            return Origin(
                name=display_name,
                template_name=name,
                loader=loader,
            )
    except ImportError:  # Django 1.8.x
        make_origin = Engine.get_default().make_origin

class Loader(BaseLoader):
    is_usable = True

    def __init__(self, engine, loaders):
        self.template_cache = {}
        self._loaders = loaders
        self._cached_loaders = []

        try:
            from django.template.loader import find_template_loader as _find_template_loader
        except:
            _find_template_loader = Engine.get_default().find_template_loader
        self._find_template_loader = _find_template_loader

    @property
    def loaders(self):
        # Resolve loaders on demand to avoid circular imports
        if not self._cached_loaders:
            # Set self._cached_loaders atomically. Otherwise, another thread
            # could see an incomplete list. See #17303.
            cached_loaders = []
            for loader in self._loaders:
                cached_loaders.append(self._find_template_loader(loader))
            self._cached_loaders = cached_loaders
        return self._cached_loaders

    def find_template(self, name, dirs=None):
        for loader in self.loaders:
            try:
                template, display_name = loader(name, dirs)
                return (template, make_origin(display_name, loader,
                                              name, dirs))
            except TemplateDoesNotExist:
                pass
        raise TemplateDoesNotExist(name)

    def load_template_source(self, template_name, template_dirs=None):
        for loader in self.loaders:
            try:
                return loader.load_template_source(template_name,
                                                   template_dirs)
            except TemplateDoesNotExist:
                pass
        raise TemplateDoesNotExist(template_name)

    def load_template(self, template_name, template_dirs=None):
        key = template_name
        if template_dirs:
            # If template directories were specified, use a hash to differentiate
            key = '-'.join([template_name, hashlib.sha1('|'.join(template_dirs)).hexdigest()])

        if settings.DEBUG or key not in self.template_cache:

            if os.path.splitext(template_name)[1] in ('.jade',):
                try:
                    source, display_name = self.load_template_source(template_name, template_dirs)
                    source = process(source,filename=template_name,compiler=Compiler)
                    origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
                    template = Template(source, origin, template_name)
                except NotImplementedError:
                    template, origin = self.find_template(template_name, template_dirs)
            else:
                template, origin = self.find_template(template_name, template_dirs)
            if not hasattr(template, 'render'):
                try:
                    template = Template(process(source,filename=template_name,compiler=Compiler), origin, template_name)
                except (TemplateDoesNotExist, UnboundLocalError):
                    # If compiling the template we found raises TemplateDoesNotExist,
                    # back off to returning he source and display name for the template
                    # we were asked to load. This allows for correct identification (later)
                    # of the actual template that does not exist.
                    return template, origin
            self.template_cache[key] = template
        return self.template_cache[key], None

    def reset(self):
        """Empty the template cache."""
        self.template_cache.clear()