text:
#pragma once

#include <experimental/source_location>
#include <memory>
#include <sstream>
#include <stdexcept>
#include <string_view>
#include <type_traits>

#include "lw/io/stream/buffer.h"

namespace lw {

class Error;
template <typename ErrorType>
ErrorType wrap(
  const Error& sub_error,
  const std::experimental::source_location& loc =
    std::experimental::source_location::current()
);
template <typename ErrorType>
ErrorType wrap(
  Error&& sub_error,
  const std::experimental::source_location& loc =
    std::experimental::source_location::current()
);

class ErrorStack {
public:
  class Iterator {
  public:
    Iterator() = default;
    explicit Iterator(const ErrorStack& stack): _stack{&stack} {}

    bool operator==(const Iterator& rhs) const { return _stack == rhs._stack; }
    bool operator!=(const Iterator& rhs) const { return !(*this == rhs); }
    Iterator& operator++() {
      if (_stack) _stack = _stack->_previous.get();
      return *this;
    }
    Iterator operator++(int) {
      Iterator it{*this};
      ++(*this);
      return it;
    }

    const ErrorStack& operator*() const { return *_stack; }
    const ErrorStack* operator->() const { return _stack; }

  private:
    const ErrorStack* _stack = nullptr;
  };

  explicit ErrorStack(const std::experimental::source_location& loc);
  ErrorStack(const ErrorStack& other);
  ErrorStack& operator=(const ErrorStack& rhs);
  ErrorStack(ErrorStack&&) = default;
  ErrorStack& operator=(ErrorStack&&) = default;

  std::string_view message() const { return _buffer.string(); }
  const std::experimental::source_location& location() const noexcept {
    return _location;
  }

  Iterator begin() const { return Iterator{*this}; }
  Iterator end() const { return Iterator{}; }

private:
  friend class Error;
  friend class Iterator;

  std::experimental::source_location _location;
  io::stream::StringBuffer _buffer;
  std::unique_ptr<ErrorStack> _previous;
};

/**
 * @brief Base class for all exceptions thrown within liblw.
 *
 * It is a subclass of `std::runtime_error` with the addition of stream-like
 * error message formatting.
 */
class Error: public std::runtime_error {
public:
  Error(const Error& other);
  Error(Error&& other);
  Error& operator=(const Error& other);
  Error& operator=(Error&& other);

  const char* what() const noexcept override {
    return _stack._buffer.c_str();
  }
  const std::experimental::source_location& where() const noexcept {
    return _stack._location;
  }
  std::string_view what_string() const noexcept {
    return _stack._buffer.string();
  }

  const ErrorStack& stack() const { return _stack; }

protected:
  Error(std::string_view name, const std::experimental::source_location& loc);

private:
  template <typename T>
  friend Error& operator<<(Error&, T&&);
  template <typename T>
  friend Error&& operator<<(Error&&, T&&);
  template <typename ErrorType>
  friend ErrorType wrap(
    const Error&,
    const std::experimental::source_location&
  );
  template <typename ErrorType>
  friend ErrorType wrap(Error&&, const std::experimental::source_location&);

  void _set_previous(ErrorStack previous);

  ErrorStack _stack;
  std::ostream _stream;
};

// -------------------------------------------------------------------------- //

template <typename T>
Error& operator<<(Error& err, T&& val) {
  err._stream << std::forward<T>(val);
  return err;
}

template <typename T>
Error&& operator<<(Error&& err, T&& val) {
  err._stream << std::forward<T>(val);
  return std::move(err);
}

inline Error& operator<<(Error& err, const Error& rhs) {
  return err << rhs.what_string();
}

inline Error&& operator<<(Error&& err, const Error& rhs) {
  return std::move(err) << rhs.what_string();
}

template <
  typename ErrorType,
  typename T,
  std::enable_if<std::is_base_of<Error, ErrorType>::value>::type* = nullptr
>
ErrorType& operator<<(ErrorType& err, T&& val) {
  static_cast<Error&>(err) << std::forward<T>(val);
  return err;
}

template <
  typename ErrorType,
  typename T,
  std::enable_if<std::is_base_of<Error, ErrorType>::value>::type* = nullptr
>
ErrorType&& operator<<(ErrorType&& err, T&& val) {
  static_cast<Error&>(err) << std::forward<T>(val);
  return std::move(err);
}

/**
 * @brief Creates a new error object and pushes the given one onto the error
 * stack.
 *
 * @tparam ErrorType The resulting error type.
 *
 * @param sub_error
 *  The previous error which is being wrapped.
 * @param loc
 *  Source file location. Defaults to the call site.
 */
template <typename ErrorType>
ErrorType wrap(
  const Error& sub_error,
  const std::experimental::source_location& loc
) {
  static_assert(
    std::is_base_of_v<Error, ErrorType>,
    "Can only wrap with another liblw error class."
  );
  ErrorType err{loc};
  err._set_previous(sub_error._stack);
  return err;
}

template <typename ErrorType>
ErrorType wrap(
  Error&& sub_error,
  const std::experimental::source_location& loc
) {
  static_assert(
    std::is_base_of_v<Error, ErrorType>,
    "Can only wrap with another liblw error class."
  );
  ErrorType err{loc};
  err._set_previous(std::move(sub_error._stack));
  return err;
}

}


text:
<?php

/**
 * Doctrine Adapter for Zend_Auth
 *
 * @category   Zend
 * @package    Zend_Auth
 * @subpackage Zend_Auth_Adapter
 * @license    New BSD http://www.opensource.org/licenses/bsd-license.php
 * @author     spekkionu <spekkionu@gmail.com>
 * @version    2.0 08/20/2011
 *
 */
class Auth_Adapter_Doctrine implements Zend_Auth_Adapter_Interface {

  /**
   * $_tableName - the table name to check
   *
   * @var string
   */
  protected $_tableName = null;

  /**
   * $_identityColumn - the column to use as the identity
   *
   * @var string
   */
  protected $_identityColumn = null;

  /**
   * $_credentialColumns - columns to be used as the credentials
   *
   * @var string
   */
  protected $_credentialColumn = null;

  /**
   * $_identity - Identity value
   *
   * @var string
   */
  protected $_identity = null;

  /**
   * $_credential - Credential values
   *
   * @var string
   */
  protected $_credential = null;

  /**
   * $_authenticateResultInfo
   *
   * @var array
   */
  protected $_authenticateResultInfo = null;

  /**
   * $_resultRow - Results of database authentication query
   *
   * @var array
   */
  protected $_resultRow = null;

  /**
   * Doctrine query for finding user account
   * @var Doctrine_Query $_query
   */
  protected $_query = null;

  /**
   *
   *@param string     $tableName
   *@param string     $identityColumn
   *@param string     $credentialColumn
   *@return void
   */
  public function __construct($tableName = null, $identityColumn = null, $credentialColumn = null) {

    if(null !== $tableName) {
      $this->setTableName($tableName);
    }

    if(null !== $identityColumn) {
      $this->setIdentityColumn($identityColumn);
    }

    if(null !== $credentialColumn) {
      $this->setCredentialColumn($credentialColumn);
    }

    $this->createQuery();
  }

  /**
   * Sets Doctrine Query
   * @return Doctrine_Query
   */
  protected function createQuery() {
    // Create Doctrine Query
    $q = Doctrine_Query::create();
    $q->from($this->_tableName);
    $q->where("{$this->_identityColumn} = :username");
    $q->where("{$this->_credentialColumn} = :password");
    $this->_query = $q;
    return $q;
  }

  /**
   * getDoctrineQuery() - Return the preauthentication Db Select object for userland select query modification
   *
   * @return Doctrine_Query
   */
  public function getDoctrineQuery() {
    if($this->_query == null) {
      $this->_query = $this->createQuery();
    }
    return $this->_query;
  }

  /**
   *
   * @throws Zend_Auth_Adapter_Exception If authentication cannot be performed
   * @return Zend_Auth_Result
   * @see Zend_Auth_Adapter_Interface::authenticate()
   */
  public function authenticate() {
    $this->_authenticateSetup();
    $tableName = $this->_tableName;
    $identityColumn = $this->_identityColumn;
    $credentialColumn = $this->_credentialColumn;
    // Execute Query
    $identity = $this->getDoctrineQuery()
      ->fetchOne(array(
      ':username' => $this->_identity, ':password' => $this->_credential
    ), Doctrine::HYDRATE_ARRAY);
    if(!$identity) {
      // Not found
      return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, $this->_identity, array(
        "Account with username $this->_identity not found."
      ));
    }
    $this->_resultRow = $identity;
    return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $this->_identity, array());
  }

  /**
   * _authenticateSetup() - This method abstracts the steps involved with making sure
   * that this adapter was indeed setup properly with all required peices of information.
   *
   * @throws Zend_Auth_Adapter_Exception - in the event that setup was not done properly
   * @return true
   */
  protected function _authenticateSetup() {
    $exception = null;

    if($this->_tableName == '') {
      $exception = 'A table must be supplied for the Auth_Doctrine authentication adapter.';
    } elseif($this->_identityColumn == '') {
      $exception = 'An identity column must be supplied for the Auth_Doctrine authentication adapter.';
    } elseif($this->_credentialColumn == '') {
      $exception = 'A credential column must be supplied for the Auth_Doctrine authentication adapter.';
    } elseif($this->_identity == '') {
      $exception = 'A value for the identity was not provided prior to authentication with Auth_Doctrine.';
    } elseif($this->_credential === null) {
      $exception = 'A credential value was not provided prior to authentication with Auth_Doctrine.';
    }
    if(is_null($this->_query)) {
      $this->createQuery();
    }

    if(null !== $exception) {
      /**
       * @see Zend_Auth_Adapter_Exception
       */
      throw new Zend_Auth_Adapter_Exception($exception);
    }

    $this->_authenticateResultInfo = array(
      'code' => Zend_Auth_Result::FAILURE, 'identity' => $this->_identity, 'messages' => array()
    );

    return true;
  }

  /**
   * setTableName() - set the table name to be used in the select query
   *
   * @param  string $tableName
   * @return Auth_Adapter_Doctrine Provides a fluent interface
   */
  public function setTableName($tableName) {
    $this->_tableName = $tableName;
    return $this;
  }

  /**
   * setIdentityColumn() - set the column name to be used as the identity column
   *
   * @param  string $identityColumn
   * @return Auth_Adapter_Doctrine Provides a fluent interface
   */
  public function setIdentityColumn($identityColumn) {
    $this->_identityColumn = $identityColumn;
    return $this;
  }

  /**
   * setCredentialColumn() - set the column name to be used as the credential column
   *
   * @param  string $credentialColumn
   * @return Auth_Adapter_Doctrine Provides a fluent interface
   */
  public function setCredentialColumn($credentialColumn) {
    $this->_credentialColumn = $credentialColumn;
    return $this;
  }

  /**
   * setIdentity() - set the value to be used as the identity
   *
   * @param  string $value
   * @return Auth_Adapter_Doctrine Provides a fluent interface
   */
  public function setIdentity($value) {
    $this->_identity = $value;
    return $this;
  }

  /**
   * setCredential() - set the credential value to be used
   *
   * @param  string $credential
   * @return Auth_Adapter_Doctrine Provides a fluent interface
   */
  public function setCredential($credential) {
    $this->_credential = $credential;
    return $this;
  }

  /**
   * getResultRowObject() - Returns the result row as a stdClass object
   *
   * @param  string|array $returnColumns
   * @param  string|array $omitColumns
   * @return stdClass|boolean
   */
  public function getResultRowObject($returnColumns = null, $omitColumns = null) {
    if(!$this->_resultRow) {
      return false;
    }

    $returnObject = new stdClass();

    if(null !== $returnColumns) {

      $availableColumns = array_keys($this->_resultRow);
      foreach ((array) $returnColumns as $returnColumn) {
        if(in_array($returnColumn, $availableColumns)) {
          $returnObject->{$returnColumn} = $this->_resultRow[$returnColumn];
        }
      }
      return $returnObject;

    } elseif(null !== $omitColumns) {

      $omitColumns = (array) $omitColumns;
      foreach ($this->_resultRow as $resultColumn => $resultValue) {
        if(!in_array($resultColumn, $omitColumns)) {
          $returnObject->{$resultColumn} = $resultValue;
        }
      }
      return $returnObject;

    } else {

      foreach ($this->_resultRow as $resultColumn => $resultValue) {
        $returnObject->{$resultColumn} = $resultValue;
      }
      return $returnObject;

    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
/* global document, setInterval */

define(['react', 'filterForm', 'scatterPlot'], function (React, filterForm, scatterPlot) {
    "use strict";

    var r = React.DOM;

    var filterBldgs = function(criteria) {
        return function(d) {
            return criteria.minSF < d.BLDG_FLOOR_AREA &&
                d.BLDG_FLOOR_AREA < criteria.maxSF &&
                criteria.minEui < d.SITE_EUI &&
                d.SITE_EUI < criteria.maxEui;
        };
    };

    return React.createClass({
        displayName: 'filterGraph',
        render: function() {
            return r.div({},
                         // graph, fed data as props with filter
                         scatterPlot({
                             data: _.filter(this.state.data, filterBldgs(this.state)),
                             xKey: _.property('BLDG_FLOOR_AREA'),
                             yKey: _.property('SITE_EUI')
                         }),
                         filterForm({
                             minSF: this.state.minSF,
                             maxSF: this.state.maxSF,
                             minEui: this.state.minEui,
                             maxEui: this.state.maxEui,
                             setMinSF: this.setMinSF,
                             setMaxSF: this.setMaxSF,
                             setMinEui: this.setMinEui,
                             setMaxEui: this.setMaxEui
                         }));
        },

        componentDidMount: function() {
            // load the JSON data into State
            d3.csv("Benchmarking_Data_Public.csv", function(error, json) {
                var numeric = function(d) {
                    _.forEach(['ASSET_ID', 'BLDG_FLOOR_AREA', 'SITE_EUI'], function(key) {
                        d[key] = parseFloat(d[key]);
                    });
                    return d;
                };

                if (error) return console.warn(error);
                var data = _.map(json, numeric);
                this.setState({
                    data: data,
                    minSF: _.min(data, _.property('BLDG_FLOOR_AREA')).BLDG_FLOOR_AREA,
                    maxSF: _.max(data, _.property('BLDG_FLOOR_AREA')).BLDG_FLOOR_AREA,
                    minEui: _.min(data, _.property('SITE_EUI')).SITE_EUI,
                    maxEui: _.max(data, _.property('SITE_EUI')).SITE_EUI
                });
            }.bind(this));
        },

        getInitialState: function() {
            return {
                minSF: 0,
                maxSF: 20000,
                minEui: 0,
                maxEui: 3000,
                data: _.map([[0,0], [2,5], [10,5], [15,20]], function(d) {
                    return {'x': d[0], 'y': d[1]};
                })};
        },

        setMinSF: function(event) {
            this.setState({minSF: parseInt(event.target.value)});
        },
        setMaxSF: function(event) {
            this.setState({maxSF: parseInt(event.target.value)});
        },
        setMinEui: function(event) {
            this.setState({minEui: parseInt(event.target.value)});
        },
        setMaxEui: function(event) {
            this.setState({maxEui: parseInt(event.target.value)});
        }

    });
});


text:
"use strict";
var BattleAxe = {
  races: {},
  professions: {},

  furnace: function (collection, definition) {
    // Defining the prototype for all furnaced objects (if needed)
    var proto = {
      /**
       * Factory method for objects
       *
       */
      forge: function (name) {
        var forged = Object.create(this).quench(Array.prototype.slice.call(arguments, 1));

        if (name) {
          collection[name] = forged;
          Object.defineProperty(forged, "name", { value: name });
        }

        return forged;
      },
      quench: function (options) {
        return this; // noop
      }
    }

    // Creating the furnaced object itself
    var furnacedObject = Object.create(proto);

    // Mixing in the definition
    Object.getOwnPropertyNames(definition).forEach(function (prop) {
      if (!furnacedObject.hasOwnProperty(prop)) {
        furnacedObject[prop] = definition[prop];
      }
    }, this);

    return furnacedObject;
  },
};

// Shortcuts
var BX = BattleAxe;


text:
import React from 'react';
import styled from '@emotion/styled';
import groupBy from 'lodash/groupBy';
import moment from 'moment';

import {Client} from 'app/api';
import ActivityItem from 'app/components/activity/item';
import Note from 'app/components/activity/note';
import NoteInputWithStorage from 'app/components/activity/note/inputWithStorage';
import {CreateError} from 'app/components/activity/note/types';
import ErrorBoundary from 'app/components/errorBoundary';
import LoadingError from 'app/components/loadingError';
import TimeSince from 'app/components/timeSince';
import {t} from 'app/locale';
import space from 'app/styles/space';
import {User} from 'app/types';
import {NoteType} from 'app/types/alerts';

import {ActivityType, Incident, IncidentActivityType} from '../../types';

import ActivityPlaceholder from './activityPlaceholder';
import DateDivider from './dateDivider';
import StatusItem from './statusItem';

type NoteProps = React.ComponentProps<typeof Note>;

type Props = {
  api: Client;
  alertId: string;
  incident?: Incident;
  loading: boolean;
  error: boolean;
  me: User;
  activities: null | ActivityType[];
  noteInputId: string;
  noteInputProps?: object;

  createError: boolean;
  createBusy: boolean;
  createErrorJSON: null | CreateError;
  onCreateNote: (note: NoteType) => void;
  onUpdateNote: (note: NoteType, activity: ActivityType) => void;
  onDeleteNote: (activity: ActivityType) => void;
};

/**
 * Activity component on Incident Details view
 * Allows user to leave a comment on an alertId as well as
 * fetch and render existing activity items.
 */
class Activity extends React.Component<Props> {
  handleUpdateNote = (note: NoteType, {activity}: NoteProps) => {
    const {onUpdateNote} = this.props;
    onUpdateNote(note, activity as ActivityType);
  };

  handleDeleteNote = ({activity}: NoteProps) => {
    const {onDeleteNote} = this.props;
    onDeleteNote(activity as ActivityType);
  };

  render() {
    const {
      loading,
      error,
      me,
      alertId,
      incident,
      activities,
      noteInputId,
      createBusy,
      createError,
      createErrorJSON,
      onCreateNote,
    } = this.props;

    const noteProps = {
      minHeight: 80,
      projectSlugs: (incident && incident.projects) || [],
      ...this.props.noteInputProps,
    };
    const activitiesByDate = groupBy(activities, ({dateCreated}) =>
      moment(dateCreated).format('ll')
    );
    const today = moment().format('ll');

    return (
      <div>
        <ActivityItem author={{type: 'user', user: me}}>
          {() => (
            <NoteInputWithStorage
              key={noteInputId}
              storageKey="incidentIdinput"
              itemKey={alertId}
              onCreate={onCreateNote}
              busy={createBusy}
              error={createError}
              errorJSON={createErrorJSON}
              placeholder={t(
                'Leave a comment, paste a tweet, or link any other relevant information about this alert...'
              )}
              {...noteProps}
            />
          )}
        </ActivityItem>

        {error && <LoadingError message={t('There was a problem loading activities')} />}

        {loading && (
          <React.Fragment>
            <ActivityPlaceholder />
            <ActivityPlaceholder />
            <ActivityPlaceholder />
          </React.Fragment>
        )}

        {!loading &&
          !error &&
          Object.entries(activitiesByDate).map(([date, activitiesForDate]) => {
            const title =
              date === today ? (
                t('Today')
              ) : (
                <React.Fragment>
                  {date} <StyledTimeSince date={date} />
                </React.Fragment>
              );
            return (
              <React.Fragment key={date}>
                <DateDivider>{title}</DateDivider>
                {activitiesForDate &&
                  activitiesForDate.map(activity => {
                    const authorName = activity.user?.name ?? 'Sentry';

                    if (activity.type === IncidentActivityType.COMMENT) {
                      return (
                        <ErrorBoundary mini key={`note-${activity.id}`}>
                          <Note
                            showTime
                            user={activity.user as User}
                            modelId={activity.id}
                            text={activity.comment || ''}
                            dateCreated={activity.dateCreated}
                            activity={activity}
                            authorName={authorName}
                            onDelete={this.handleDeleteNote}
                            onUpdate={this.handleUpdateNote}
                            {...noteProps}
                          />
                        </ErrorBoundary>
                      );
                    } else {
                      return (
                        <ErrorBoundary mini key={`note-${activity.id}`}>
                          <StatusItem
                            showTime
                            incident={incident}
                            authorName={authorName}
                            activity={activity}
                          />
                        </ErrorBoundary>
                      );
                    }
                  })}
              </React.Fragment>
            );
          })}
      </div>
    );
  }
}

export default Activity;

const StyledTimeSince = styled(TimeSince)`
  color: ${p => p.theme.gray300};
  font-size: ${p => p.theme.fontSizeSmall};
  margin-left: ${space(0.5)};
`;


text:
package actor

import (
	"github.com/davyxu/actornet/mailbox"
	"github.com/davyxu/actornet/proto"
	"github.com/davyxu/actornet/util"
)

type Process interface {
	Tell(interface{})

	Stop()

	PID() *PID

	Relation
}

type LocalProcess struct {
	*RelationImplement
	mailbox mailbox.MailBox

	pid *PID

	a Actor
}

func (self *LocalProcess) Serialize(ser Serializer) {
	self.a.(Serializable).OnSerialize(ser)
}

func (self *LocalProcess) notifySystem(data interface{}) {
	self.Tell(&Message{
		Data:      data,
		SourcePID: self.pid,
		TargetPID: self.pid,
	})
}

func (self *LocalProcess) CreateRPC(waitCallID int64) *util.Future {

	f := util.NewFuture()

	self.mailbox.Hijack(func(rpcBack interface{}) bool {

		rpcMsg := rpcBack.(*Message)
		if rpcMsg.CallID == waitCallID {

			self.mailbox.Hijack(nil)
			f.Done(rpcMsg)
			return true
		}

		return false
	})

	return f
}

func (self *LocalProcess) PID() *PID {
	return self.pid
}

func (self *LocalProcess) Tell(data interface{}) {

	if EnableDebug {
		log.Debugf("#notify %s", data.(Context).String())
	}

	self.mailbox.Post(data)
}

func (self *LocalProcess) Stop() {

	self.notifySystem(&proto.Stop{})
}

func (self *LocalProcess) OnRecv(data interface{}) {

	ctx := data.(Context)

	if EnableDebug {
		log.Debugf("#recv %s", data.(Context).String())
	}

	self.a.OnRecv(ctx)
}

func (self *LocalProcess) Init(a Actor, pid *PID, dm *Domain) *LocalProcess {

	self.RelationImplement = NewRelation(self, dm)

	self.mailbox = mailbox.NewUnbouned()
	self.a = a
	self.pid = pid

	self.mailbox.Start(self)

	self.notifySystem(&proto.Start{})

	return self
}


text:
@class CTAssetView;
@class ALAsset;

@protocol CTAssetViewDelegate <NSObject>

@optional
- (void)assetViewDidSingleTouch:(CTAssetView *)assetView;

@end

@interface CTAssetView : UIScrollView

@property (nonatomic, strong) ALAsset *asset;
@property (nonatomic, weak) id<CTAssetViewDelegate> customDelegate;

@end


text:
package org.jboss.pnc.dto.validation.constraints;

import javax.validation.Constraint;
import javax.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.jboss.pnc.dto.validation.validators.SCMUrlValidator;

/**
 * Author: Michal Szynkiewicz, michal.l.szynkiewicz@gmail.com Date: 3/12/16 Time: 5:01 PM
 */
@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR,
        ElementType.PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = SCMUrlValidator.class)
public @interface SCMUrl {
    String message() default "{org.jboss.pnc.rest.validation.InvalidScmUrl.message}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}


text:
package gui;

import data.ConstantsManager;
import data.Project;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.text.Text;
import javafx.stage.Stage;

/**
 * Repräsentiert ein Fenster, mit dem die Projekteinstellungen bearbeitet werden können.
 *
 */

public class ProjectSettings extends Stage {
	/** Das aktuelle Project wird aus dem {@link data.ConstantsManager} abgefragt und in
	 * dieser Variable zwischengespeichert. */
	private Project project = ConstantsManager.getConstants().getProject();
	/** Das root-Element der Stage, die durch diese Klasse repräsentiert wird. */
	private BorderPane root;
	/** Eine HBox, die die Steuerelemente am unteren Fensterrand beherbergt (OK-Button). */
	private HBox bottom;
	/** Der Knopf mit der Aufschrift "OK", welcher die Eingaben übernimmt und das Fenster schließt. */
	private Button ok;
	/** Der Knopf mit der Aufschrift "Cancel", welcher die Eingaben verwirft und das Fenster schließt. */
	private Button cancel;
	/** Das GridPane, welches die wesentlichen Steuerelemente im Fenster enthält. */
	private GridPane center;
	/** Ein Label, welches das nachstehende Textfeld als Projektnamen beschreibt. */
	private Text projectNameText;
	/** Ein TextFeld, in welchem der Projektname eingegeben wird */
	private TextField projectNameBox;
	/** Ein Label, welches das nachstehende Textfeld als Projektbeschreibung beschreibt. */
	private Text projectDescriptionText;
	/** Eine TextArea, in das die Projektbeschreibung eingegeben werden kann. */
	private TextArea projectDescriptionArea;
	/** Ein Panel, welches in das Hauptpanel hineingesetzt wird, und die Steuerelemente für die
	 * Konfiguration der Babysteps enthält.
	 */
	private GridPane babysteps_pane;
	/** Eine CheckBox, die für das Aktivieren / Deaktivieren der Babysteps steht. Bei Aktivieren
	 * zeigt sie zusätzliche Steuerelemente zur Konfiguration der Babysteps. @see #hide_show_duration_settings
	 */
	private CheckBox babystepsCheckBox;
	/** Ein Label, welches das nachfolgende Textfeld zur Eingabe der Duration (Integer-Zahl) auffordert. */
	private Text durationText;
	/** Ein Textfeld, in das die Dauer der Babysteps eingegeben werden kann. */
	private TextField durationField;
	/** Eine CheckBox, welche den Status der aktuellen Tracking-Einstellungen repräsentiert und modifizieren lässt. */
	private CheckBox tracking;

	/**
	 * Der Konstruktor dieser Klasse erzeugt ein neues Fenster zur Einstellung der Projekteinstellungen,
	 * und zeigt es sofort an. Das Fenster bleibt so lange offen, bis es manuell geschlossen wird, dies
	 * geschieht entweder durch den Schließen-Button des Betriebssystems oder den Abbrechen-Button
	 */
	public ProjectSettings(){
		super();
		setScene(create_scene());
		showAndWait();
	}

	private Scene create_scene(){
		create_root();
		return new Scene(root, 500, 500);
	}

	private void create_root(){
		root = new BorderPane();
		root.setPadding(new Insets(10, 10, 10, 10));
		create_center();
		create_bottom();
		root.setBottom(bottom);
		root.setCenter(center);

	}

	private void create_bottom(){
		bottom = new HBox();
		bottom.setAlignment(Pos.CENTER_RIGHT);

		ok = new Button("OK");
		bottom.getChildren().add(ok);

		cancel = new Button("Cancel");
		bottom.getChildren().add(cancel);

		ok.setOnAction(e -> {
			//Schließt das Fenster, speichert vorher
			saveValues();
			close();
		});

		cancel.setOnAction((event) -> {
			close(); //Schließt das Fenster einfach nur
		});
	}

	private void create_center(){
		center = new GridPane();
		center.setHgap(10d);
		center.setVgap(10d);

		//Label in 0, 0
		projectNameText = new Text("Project name:");
		center.add(projectNameText, 0, 0);

		//TextField in 1, 0
		projectNameBox = new TextField(project.getName());
//		projectNameBox.setMinWidth(Double.MAX_VALUE);
		center.add(projectNameBox, 1, 0);
		center.setFillWidth(projectNameBox, true);
		GridPane.setHgrow(projectNameBox, Priority.ALWAYS);

		//Label in 0, 1
		projectDescriptionText = new Text("Project description:");
		center.add(projectDescriptionText, 0, 1);

		//TextArea in 0, 2
		projectDescriptionArea = new TextArea(project.getDescription());
		center.add(projectDescriptionArea, 0, 2, 2, 1);

		//GridPane in 0, 3
		babysteps_pane = new GridPane();
		babysteps_pane.setVgap(10d);
		babysteps_pane.setHgap(10d);
		babystepsCheckBox = new CheckBox("Use Babysteps");

		//Prevents text from overrunning
		babystepsCheckBox.setMinSize(babystepsCheckBox.USE_PREF_SIZE, babystepsCheckBox.USE_PREF_SIZE);

		durationText = new Text("Duration per Stage:");
		durationField = new TextField(String.valueOf(project.getDuration()));

		babystepsCheckBox.selectedProperty().addListener((event) -> {
			hide_show_duration_settings();
		});

		babystepsCheckBox.setSelected(project.getBabysteps());
		hide_show_duration_settings();

		babysteps_pane.add(babystepsCheckBox, 0, 0);
		babysteps_pane.add(durationText, 1, 0);
		babysteps_pane.add(durationField, 2, 0);
		center.add(babysteps_pane, 0, 3, 2, 1);

		//CheckBox in 0, 4
		tracking = new CheckBox("Use Tracking");
		tracking.setSelected(project.getTracking());
		center.add(tracking, 0, 4);
	}

	/**
	 * Überprüft, ob die {@link #babystepsCheckBox} gerade positiv oder negativ ist,
	 * und zeigt bzw. versteckt die dazugehörigen Elemente, um die Dauer der Babysteps
	 * zu konfigurieren.
	 *
	 * @see #babystepsCheckBox
	 * @see #durationText
	 * @see #durationField
	 */
	private void hide_show_duration_settings(){
		if (babystepsCheckBox.selectedProperty().getValue()){
			durationText.setVisible(true);
			durationField.setVisible(true);
		} else {
			durationText.setVisible(false);
			durationField.setVisible(false);
		}
	}

	private void saveValues(){
		project.setName(projectNameBox.getText());
		project.setDescription(projectDescriptionArea.getText());
		project.setBabysteps(babystepsCheckBox.selectedProperty().getValue());
		try {
			project.setDuration(Integer.parseInt(durationField.getText()));

		} catch (NumberFormatException ex){
			//TODO: Fehlermeldung anzeigen!
		}
		project.setTracking(tracking.selectedProperty().getValue());
	}

	public Project getProject(){
		return project;
	}
}


text:
namespace base {
class ListValue;
template<class T> class PropertyAccessor;
}

namespace content {
class WebContents;
class WebUIMessageHandler;
struct ContextMenuParams;
}

namespace gfx {
class Size;
}

class WebDialogDelegate;

// Displays file URL contents inside a modal web dialog.
//
// This application really should not use WebContents + WebUI. It should instead
// just embed a RenderView in a dialog and be done with it.
//
// Before loading a URL corresponding to this WebUI, the caller should set its
// delegate as a property on the WebContents. This WebUI will pick it up from
// there and call it back. This is a bit of a hack to allow the dialog to pass
// its delegate to the Web UI without having nasty accessors on the WebContents.
// The correct design using RVH directly would avoid all of this.
class WebDialogUI : public content::WebUIController {
 public:
  struct WebDialogParams {
    // The URL for the content that will be loaded in the dialog.
    GURL url;
    // Width of the dialog.
    int width;
    // Height of the dialog.
    int height;
    // The JSON input to pass to the dialog when showing it.
    std::string json_input;
  };

  // When created, the property should already be set on the WebContents.
  explicit WebDialogUI(content::WebUI* web_ui);
  virtual ~WebDialogUI();

  // Close the dialog, passing the specified arguments to the close handler.
  void CloseDialog(const base::ListValue* args);

  // Returns the PropertyBag accessor object used to write the delegate pointer
  // into the WebContents (see class-level comment above).
  static base::PropertyAccessor<WebDialogDelegate*>& GetPropertyAccessor();

 private:
  // WebUIController
  virtual void RenderViewCreated(
      content::RenderViewHost* render_view_host) OVERRIDE;

  // JS message handler.
  void OnDialogClosed(const base::ListValue* args);

  DISALLOW_COPY_AND_ASSIGN(WebDialogUI);
};

// Displays external URL contents inside a modal web dialog.
//
// Intended to be the place to collect the settings and lockdowns
// necessary for running external UI components securely (e.g., the
// cloud print dialog).
class ExternalWebDialogUI : public WebDialogUI {
 public:
  explicit ExternalWebDialogUI(content::WebUI* web_ui);
  virtual ~ExternalWebDialogUI();
};

#endif  // CHROME_BROWSER_UI_WEBUI_WEB_DIALOG_UI_H_


text:
<?php
declare(strict_types=1);

namespace Lcobucci\JWT\Signer\Ecdsa;

use Lcobucci\JWT\Signer\Ecdsa;

use const OPENSSL_ALGO_SHA512;

final class Sha512 extends Ecdsa
{
    public function algorithmId(): string
    {
        return 'ES512';
    }

    public function algorithm(): int
    {
        return OPENSSL_ALGO_SHA512;
    }

    public function pointLength(): int
    {
        return 132;
    }

    public function expectedKeyLength(): int
    {
        // ES512 means ECDSA using P-521 and SHA-512.
        // The key size is indeed 521 bits.
        return 521;
    }
}


text: export * from './redux-utils';


text:
<?php

namespace Codete\FormGeneratorBundle\DependencyInjection\Compiler;

/**
 * @author Maciej Malarz <malarzm@gmail.com>
 */
class FieldResolversCompilerPass extends AbstractCompilerPass
{
    const TAG = 'form_generator.field_resolver';

    /**
     * @inheritdoc
     */
    protected function getMethodToCall()
    {
        return 'addFormFieldResolver';
    }

    /**
     * @inheritdoc
     */
    protected function getTagName()
    {
        return self::TAG;
    }
}


text:
//----------------------------------------------------------------------
//This code is developed as part of the Java CoG Kit project
//The terms of the license can be found at http://www.cogkit.org/license
//This message may not be removed or altered.
//----------------------------------------------------------------------

/*
 * Created on Oct 6, 2005
 */
package org.globus.cog.coaster.test;

import java.io.IOException;

import org.globus.cog.coaster.GSSService;
import org.globus.cog.coaster.Service;
import org.globus.gsi.gssapi.auth.SelfAuthorization;

public class Services {

	public static void main(String[] args) {
		Service s1, s2, s3;
		try {
			s1 = newService(50001);
			s2 = newService(50002);
			s3 = newService(50003);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}

	private static Service newService(int port) throws IOException {
		GSSService service = new GSSService(port);
		service.setAuthorization(new SelfAuthorization());
		service.initialize();
		System.out.println("port: " + service.getPort());
		return service;
	}
}


text:
class AddFileLocationToCiJobArtifacts < ActiveRecord::Migration[4.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def change
    add_column :ci_job_artifacts, :file_location, :integer, limit: 2
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>

<rootTag>
  <Award>
    <AwardTitle>Student Travel Award for SenSys (The 11th ACM Conference on Embedded Networked Sensor Systems) 2013</AwardTitle>
    <AwardEffectiveDate>09/01/2013</AwardEffectiveDate>
    <AwardExpirationDate>08/31/2014</AwardExpirationDate>
    <AwardAmount>20000</AwardAmount>
    <AwardInstrument>
      <Value>Standard Grant</Value>
    </AwardInstrument>
    <Organization>
      05050000
      <Directorate>
        <LongName>Direct For Computer & Info Scie & Enginr</LongName>
      </Directorate>
      <Division>
        <LongName>Division Of Computer and Network Systems</LongName>
      </Division>
    </Organization>
    <ProgramOfficer>
      <SignBlockName>Thyagarajan Nandagopal</SignBlockName>
    </ProgramOfficer>
    <AbstractNarration>The proposed grant will promote the design, development and analysis of embedded and networked sensor technologies, systems, and applications by encouraging student participation in the ACM Sensys 2013 conference. Besides technical paper presentations, Sensys, through this grant, will be able to stimulate several intellectual activities by students. Furthermore, the conference offers several opportunities for intellectually stimulating discussions between the students and researchers from around the world. <br/><br/>The participation of students in Sensys can have an important impact on their development as a junior researcher. The grant will also promote diversity by encouraging and enabling women and other underrepresented minorities to participate.</AbstractNarration>
    <MinAmdLetterDate>08/20/2013</MinAmdLetterDate>
    <MaxAmdLetterDate>08/20/2013</MaxAmdLetterDate>
    <ARRAAmount/>
    <AwardID>1346597</AwardID>
    <Investigator>
      <FirstName>Radu</FirstName>
      <LastName>Stoleru</LastName>
      <EmailAddress>stoleru@cse.tamu.edu</EmailAddress>
      <StartDate>08/20/2013</StartDate>
      <EndDate/>
      <RoleCode>Principal Investigator</RoleCode>
    </Investigator>
    <Institution>
      <Name>Texas A&M Engineering Experiment Station</Name>
      <CityName>College Station</CityName>
      <ZipCode>778454645</ZipCode>
      <PhoneNumber>9798477635</PhoneNumber>
      <StreetAddress>TEES State Headquarters Bldg.</StreetAddress>
      <CountryName>United States</CountryName>
      <StateName>Texas</StateName>
      <StateCode>TX</StateCode>
    </Institution>
    <ProgramElement>
      1640
      <Text>INFORMATION TECHNOLOGY RESEARC</Text>
    </ProgramElement>
    <ProgramElement>
      7363
      <Text>RES IN NETWORKING TECH & SYS</Text>
    </ProgramElement>
    <ProgramReference>
      7363
      <Text>RES IN NETWORKING TECH & SYS</Text>
    </ProgramReference>
    <ProgramReference>
      7556
      <Text>CONFERENCE AND WORKSHOPS</Text>
    </ProgramReference>
  </Award>
</rootTag>


text:
+++
title 		= "Hugo - kleine Kurztipps"
date 		= "2017-02-05"
lastmod     = "2019-03-21"
description = "Eine kleine Sammlung von Codeschnipseln und Hinweisen, die immer mal wieder nützlich sein können"
keywords    = "Hugo, Webseite, Datum, Format, Variablen"
software 	= ["Webseiten"]
programme	= ["Hugo"]

+++

Ich möchte hier eine kleine Sammlung anlegen von Dingen, die mir bei der Arbeit mit Hugo _in die Quere gekommen_ sind. Die Sammlung wird wohl immer wieder mal erweitert werden ...

### Index
* [Zeit/Datum formatieren]({{< ref "#datum-zeit-formatieren" >}})
* [Seitenindex erstellen]({{<ref "#seitenindex-erstellen" >}})
* [Falsches Template? Erstmal Variablen ermitteln]({{<ref "#falsches-template-erstmal-variablen-ermitteln" >}})
* [Shortcodes dokumentieren]({{<ref "#shortcodes-dokumentieren" >}})

## Datum/Zeit formatieren
Wird Hugo mit einem Standard-Thema verwendet, dann erscheinen Datumsangaben meist in der Form

> Mon, Jan 2, 2006

Das ist auf deutschsprachigen Webseiten nicht schön. Tages- und Monatsnamen zu übersetzen ist mit gewissem Programmier-Aufwand verbunden, aber es ist einfach, das Datum in die eher gewohnte Form

> 02.01.2006

zu bringen.

In der `Go language` ist ein [Referenzdatum](https://golang.org/pkg/time/#pkg-constants) definiert:

    Mon Jan 2 15:04:05 MST 2006

Durch einfaches Umstellen oder Weglassen der einzelnen Komponenten kann man sich  sein Wunschformat _zurechtrücken_ und in der seitenweiten Konfigurationsdatei `config.toml` festlegen:
```
[params]
    DateForm = "02.01.2006"
```
In den Templates wird dann jeweils an den Stellen, an denen das Artikel-Datum erscheinen soll (aus dem jeweiligen Seitenkopf des zugehörigen Markdown-Dokuments), zum Beispiel folgendes notiert:

    veröffentlicht am {{ .Date.Format .Site.Params.DateForm }}

und es erscheint z. B. für diesen Artikel zum Tage der Erstveröffentlichung:

> veröffentlicht am 05.02.2017

... das ist einfach.

## Seitenindex erstellen
Lange Seiten mit vielen Kapiteln und Unterkapiteln werden schnell unübersichtlich. Da ist es nützlich, am Seitenanfang einen Index, also ein kleines Inhaltsverzeichnis zu erstellen. Das kann eine Liste sein, die Links zu den einzelnen Kapitelüberschriften enthält.

Hugo erstellt die Sprungmarken an den Überschriften automatisch, so wird z. B. aus dem Markdown-Text

    ## Datum/Zeit formatieren

ein HTML-Quelltext in der Form:

Datum/Zeit formatieren

Im Index muß dann nur noch ein Eintrag in dieser Form erstellt werden - dabei wird der Hugo Shortcode `ref` benutzt:

    * [Zeit/Datum formatieren]({{</* ref "#datum-zeit-formatieren" */>}})

und es erscheint ein anklickbarer Verzeichniseintrag:

> * [Zeit/Datum formatieren]({{<ref "#datum-zeit-formatieren" >}})

## Falsches Template? Erstmal Variablen ermitteln
Hugo verfügt über klare Richtlinien, welches Template für die Darstellung welchen Inhalts verwendet wird. Manchmal wundert man sich trotzdem, warum "das falsche Template" gewählt wird.

Hier hilft es, erstmal die entsprechenden Variablen der jeweiligen Seite zu ermitteln, um zu erfahren, "_was sich Hugo so denkt_". Diese habe ich zu einer kleinen HTML-formatierten Tabelle zusammengestellt, die an geeigneter Stelle in einem Template eingefügt werden kann:

```
<table>
<tr><td>Site-Titel: </td><td>{{ .Site.Title }}</td></tr> <!-- Titel aus config.toml -->
<tr><td>Seitentitel (.Title): </td><td>{{ .Title }}</td></tr> <!-- Einzelseite, aus Frontmatter entnommen -->
<tr><td>Art der Seite (.Kind): </td><td>{{ .Kind }}</td></tr> <!-- page, home, section, taxonomy oder taxonomyTerm -->
<tr><td>Sektion: </td><td>{{ .Section }}</td></tr> <!-- gibt den Bereich aus -->
<tr><td>Type: </td><td>{{ .Type }}</td></tr> <!-- gibt den Typ aus -->
<tr><td>Home: </td><td>{{ .IsHome }}</td></tr> <!-- wahr, falls Homepage -->
<tr><td>Node: </td><td>{{ .IsNode  }}</td></tr> <!-- wahr, falls die Seite ein "Node" ist -->
<tr><td>Content: </td><td>{{ .IsPage }}</td></tr> <!-- wahr, falls es eine Inhaltsseite ist -->
<tr><td>nächste Seite: </td><td>{{ .Next }}</td></tr> <!-- nächste Seite nach Datum -->
<tr><td>nächste Sect.Seite: </td><td>{{ .NextInSection }}</td></tr> <!-- nächste Seite im Bereich nach Datum -->
<tr><td>vorher. Seite: </td><td>{{ .Prev }}</td></tr> <!-- vorherige Seite nach Datum -->
<tr><td>vorher. Sect.Seite: </td><td>{{ .PrevInSection }}</td></tr> <!-- vorherige Seite im Bereich nach Datum -->
<tr><td>Permalink: </td><td>{{ .Permalink }}</td></tr> <!-- absoluter Permalink -->
<tr><td>Rel. Permalink: </td><td>{{ .RelPermalink }}</td></tr> <!-- relativer Link als Permalink -->
<tr><td>URL: </td><td>{{ .URL }}</td></tr> <!-- aktuelle Adresse der Seite -->
</table>
```
Die Ausgabe für diese Blogseite lautet im Hugo-Server-Mode zum Beispiel:

> Site-Titel: 	Iveco Daily 4x4, Hunde und multithematisches Blog - Bernhard Albicker
Seitentitel (.Title): 	Hugo - kleine Kurztipps
Art der Seite (.Kind): 	page
Sektion: 	blog
Type: 	blog
Home: 	false
Node: 	false
Content: 	true
nächste Seite: 	Page("Hugo und PHP?")
nächste Sect.Seite: 	Page("Soso, die NATO fühlt sich bedroht")
vorher. Seite: 	Page("Soso, die NATO fühlt sich bedroht")
vorher. Sect.Seite: 	Page("Hugo und PHP?")
Permalink: 	http://localhost:1313/blog/2017-02-05-hugo-kleine-kurztipps.html
Rel. Permalink: 	/blog/2017-02-05-hugo-kleine-kurztipps.html
URL: 	/blog/2017-02-05-hugo-kleine-kurztipps.html

## Shortcodes dokumentieren
Hugo kennt sog. [Shortcodes](https://gohugo.io/content-management/shortcodes/#readout), mit denen man Funktionalitäten vereinfachen kann.

Diese können z. B. so aussehen (hier: ein youtube-Video einbinden):
```
{{</* youtube w7Ft2ymGmfc */>}}
```
Aber wie kann ich einen solchen Shortcode dokumentieren - z. B. hier im Blog in einem Beitrag zu einem Tutorial?
Unter bestimmten Bedingungen wird der Shortcode auch innerhalb eines Code-Blocks ausgeführt.

Hugo kennt dazu ein Feature, das die Begrenzungen des Shortcodes auskommentieren läßt: Dazu muß dem jeweiligen Start- und Schluß-Zeichen des Shortcodes (`<`/`>` bzw. `%`) am Anfang des Shortcodes ein Kommentarzeichen folgen (so: `</*`) bzw. am Ende desselben vorangestellt werden (`*/>`).


text:
'use strict';

module.exports = require.requireActual('filterExclusiveKeys');


text:
package main

import (
	"log"

	"github.com/gernest/authboss"
)

type AccountAuth struct {
	Store         Storage
	AccountBucket string
	TokensBucket  string
}

func (a AccountAuth) Create(key string, attr authboss.Attributes) error {
	user := new(Account)
	if err := attr.Bind(user, true); err != nil {
		log.Panicln(err)
		return err
	}
	user.Store = a.Store
	user.Bucket = a.AccountBucket
	return user.Save()
}

func (a AccountAuth) Put(key string, attr authboss.Attributes) error {
	return a.Create(key, attr)
}

func (a AccountAuth) Get(key string) (result interface{}, err error) {
	user := NewAccount(a.AccountBucket, a.Store)
	user.UserName = key
	err = user.Get()
	if err != nil {
		return nil, authboss.ErrUserNotFound
	}
	return user, nil
}

func (a AccountAuth) PutOAuth(uid, provider string, attr authboss.Attributes) error {
	var user = NewAccount(a.AccountBucket, a.Store)
	if err := attr.Bind(user, true); err != nil {
		return err
	}
	return user.CreateOauth(uid, provider)
}

func (a AccountAuth) GetOAuth(uid, provider string) (result interface{}, err error) {
	var acc = NewAccount(a.AccountBucket, a.Store)
	user, err := acc.GetOauth(uid, provider)
	if err != nil {
		return nil, authboss.ErrUserNotFound
	}
	return user, nil
}

func (a AccountAuth) AddToken(key, token string) error {
	tk := a.Store.CreateDataRecord(a.TokensBucket, key, []byte(token))
	return tk.Error
}

func (a AccountAuth) DelTokens(key string) error {
	tk := a.Store.RemoveDataRecord(a.TokensBucket, key)
	return tk.Error
}

func (a AccountAuth) UseToken(givenKey, token string) error {
	tk := a.Store.GetDataRecord(a.TokensBucket, givenKey)
	if tk.Error != nil {
		return authboss.ErrTokenNotFound
	} else if tk.Data == nil {
		return authboss.ErrTokenNotFound
	}
	if string(a.Store.Data) == token {
		tk.RemoveDataRecord(a.TokensBucket, givenKey)
		return nil
	}
	return authboss.ErrTokenNotFound
}

func (a AccountAuth) ConfirmUser(tok string) (result interface{}, err error) {
	return nil, authboss.ErrUserNotFound
}

func (a AccountAuth) RecoverUser(rec string) (result interface{}, err error) {
	return nil, authboss.ErrUserNotFound
}


text:
<?php

declare(strict_types=1);

namespace StructType;

use InvalidArgumentException;
use WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for ResponseObjectCoreType StructType
 * Meta information extracted from the WSDL
 * - documentation: Internal abstract base type for reply objects. Should not appear in client code
 * @package Ews
 * @subpackage Structs
 * @author WsdlToPhp <contact@wsdltophp.com>
 */
abstract class EwsResponseObjectCoreType extends EwsMessageType
{
    /**
     * The ReferenceItemId
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\EwsItemIdType|null
     */
    protected ?\StructType\EwsItemIdType $ReferenceItemId = null;
    /**
     * Constructor method for ResponseObjectCoreType
     * @uses EwsResponseObjectCoreType::setReferenceItemId()
     * @param \StructType\EwsItemIdType $referenceItemId
     */
    public function __construct(?\StructType\EwsItemIdType $referenceItemId = null)
    {
        $this
            ->setReferenceItemId($referenceItemId);
    }
    /**
     * Get ReferenceItemId value
     * @return \StructType\EwsItemIdType|null
     */
    public function getReferenceItemId(): ?\StructType\EwsItemIdType
    {
        return $this->ReferenceItemId;
    }
    /**
     * Set ReferenceItemId value
     * @param \StructType\EwsItemIdType $referenceItemId
     * @return \StructType\EwsResponseObjectCoreType
     */
    public function setReferenceItemId(?\StructType\EwsItemIdType $referenceItemId = null): self
    {
        $this->ReferenceItemId = $referenceItemId;

        return $this;
    }
}


text:
package com.github.edipermadi.bcdocs.asn1.basic.bitstring;

import com.github.edipermadi.bcdocs.AbstractTest;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.lang3.RandomUtils;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.DERBitString;
import org.testng.Assert;
import org.testng.annotations.Test;

import java.io.IOException;

/**
 * ASN.1 bit-string DER encoding
 *
 * @author Edi Permadi
 */
public class DerFormat extends AbstractTest {
    private byte[] value;
    private byte[] encoded;

    @Test
    public void encode() throws IOException {
        value = RandomUtils.nextBytes(8);
        final DERBitString obj = new DERBitString(value);

        encoded = encodeDer(obj);
        log("bitstring DER encoding : %s -> %s", Hex.encodeHexString(value), Hex.encodeHexString(encoded));
    }

    @Test(dependsOnMethods = {"encode"})
    public void decode() throws IOException {
        final ASN1Primitive tmp = decode(encoded);
        final DERBitString obj = DERBitString.getInstance(tmp);
        final byte[] bytes = obj.getBytes();

        log("bitstring DER decoding : %s -> %s", Hex.encodeHexString(encoded), Hex.encodeHexString(bytes));
        Assert.assertEquals(bytes, value);
    }
}


text:
package de.appplant.cordova.plugin.notification.trigger;

import java.util.Calendar;
import java.util.Date;

/**
 * Trigger class for interval based notification. Trigger by a fixed interval
 * from now.
 */
public class IntervalTrigger extends DateTrigger {

    // The number of ticks per interval
    private final int ticks;

    // The unit of the ticks
    final Unit unit;

    /**
     * Interval trigger based from now.
     *
     * @param ticks The number of ticks per interval.
     * @param unit  The unit of the ticks.
     */
    public IntervalTrigger(int ticks, Unit unit) {
        this.ticks = ticks;
        this.unit  = unit;
    }

    /**
     * Gets the next trigger date.
     *
     * @param base The date from where to calculate the trigger date.
     *
     * @return null if there's none next trigger date.
     */
    @Override
    public Date getNextTriggerDate(Date base) {
        Calendar cal = getCal(base);

        addInterval(cal);
        incOccurrence();

        return cal.getTime();
    }

    /**
     * Adds the amount of ticks to the calendar.
     *
     * @param cal The calendar to manipulate.
     */
    void addInterval(Calendar cal) {
        switch (unit) {
            case SECOND:
                cal.add(Calendar.SECOND, ticks);
                break;
            case MINUTE:
                cal.add(Calendar.MINUTE, ticks);
                break;
            case HOUR:
                cal.add(Calendar.HOUR_OF_DAY, ticks);
                break;
            case DAY:
                cal.add(Calendar.DAY_OF_YEAR, ticks);
                break;
            case WEEK:
                cal.add(Calendar.WEEK_OF_YEAR, ticks);
                break;
            case MONTH:
                cal.add(Calendar.MONTH, ticks);
                break;
            case QUARTER:
                cal.add(Calendar.MONTH, ticks * 3);
                break;
            case YEAR:
                cal.add(Calendar.YEAR, ticks);
                break;
        }
    }

}


text:
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar

from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models as _models
from ..._vendor import _convert_request
from ...operations._build_service_operations import build_create_or_update_build_request, build_get_build_request, build_get_build_result_log_request, build_get_build_result_request, build_get_build_service_request, build_get_resource_upload_url_request, build_get_supported_buildpack_request, build_get_supported_stack_request, build_list_build_results_request, build_list_build_services_request, build_list_builds_request, build_list_supported_buildpacks_request, build_list_supported_stacks_request
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

class BuildServiceOperations:
    """BuildServiceOperations async operations.

    You should not instantiate this class directly. Instead, you should create a Client instance that
    instantiates it for you and attaches it as an attribute.

    :ivar models: Alias to model classes used in this operation group.
    :type models: ~azure.mgmt.appplatform.v2022_05_01_preview.models
    :param client: Client for service requests.
    :param config: Configuration of service client.
    :param serializer: An object model serializer.
    :param deserializer: An object model deserializer.
    """

    models = _models

    def __init__(self, client, config, serializer, deserializer) -> None:
        self._client = client
        self._serialize = serializer
        self._deserialize = deserializer
        self._config = config

    @distributed_trace
    def list_build_services(
        self,
        resource_group_name: str,
        service_name: str,
        **kwargs: Any
    ) -> AsyncIterable["_models.BuildServiceCollection"]:
        """List build services resource.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param service_name: The name of the Service resource.
        :type service_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either BuildServiceCollection or the result of
         cls(response)
        :rtype:
         ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildServiceCollection]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = kwargs.pop('api_version', "2022-05-01-preview")  # type: str

        cls = kwargs.pop('cls', None)  # type: ClsType["_models.BuildServiceCollection"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        def prepare_request(next_link=None):
            if not next_link:

                request = build_list_build_services_request(
                    subscription_id=self._config.subscription_id,
                    resource_group_name=resource_group_name,
                    service_name=service_name,
                    api_version=api_version,
                    template_url=self.list_build_services.metadata['url'],
                )
                request = _convert_request(request)
                request.url = self._client.format_url(request.url)

            else:

                request = build_list_build_services_request(
                    subscription_id=self._config.subscription_id,
                    resource_group_name=resource_group_name,
                    service_name=service_name,
                    api_version=api_version,
                    template_url=next_link,
                )
                request = _convert_request(request)
                request.url = self._client.format_url(request.url)
                request.method = "GET"
            return request

        async def extract_data(pipeline_response):
            deserialized = self._deserialize("BuildServiceCollection", pipeline_response)
            list_of_elem = deserialized.value
            if cls:
                list_of_elem = cls(list_of_elem)
            return deserialized.next_link or None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)

            pipeline_response = await self._client._pipeline.run(  # pylint: disable=protected-access
                request,
                stream=False,
                **kwargs
            )
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=ARMErrorFormat)

            return pipeline_response

        return AsyncItemPaged(
            get_next, extract_data
        )
    list_build_services.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices"}  # type: ignore

    @distributed_trace_async
    async def get_build_service(
        self,
        resource_group_name: str,
        service_name: str,
        build_service_name: str,
        **kwargs: Any
    ) -> "_models.BuildService":
        """Get a build service resource.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param service_name: The name of the Service resource.
        :type service_name: str
        :param build_service_name: The name of the build service resource.
        :type build_service_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: BuildService, or the result of cls(response)
        :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildService
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.BuildService"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))

        api_version = kwargs.pop('api_version', "2022-05-01-preview")  # type: str

        request = build_get_build_service_request(
            subscription_id=self._config.subscription_id,
            resource_group_name=resource_group_name,
            service_name=service_name,
            build_service_name=build_service_name,
            api_version=api_version,
            template_url=self.get_build_service.metadata['url'],
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        pipeline_response = await self._client._pipeline.run(  # pylint: disable=protected-access
            request,
            stream=False,
            **kwargs
        )
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        deserialized = self._deserialize('BuildService', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get_build_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}"}  # type: ignore

    @distributed_trace
    def list_builds(
        self,
        resource_group_name: str,
        service_name: str,
        build_service_name: str,
        **kwargs: Any
    ) -> AsyncIterable["_models.BuildCollection"]:
        """List KPack builds.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param service_name: The name of the Service resource.
        :type service_name: str
        :param build_service_name: The name of the build service resource.
        :type build_service_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either BuildCollection or the result of cls(response)
        :rtype:
         ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildCollection]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = kwargs.pop('api_version', "2022-05-01-preview")  # type: str

        cls = kwargs.pop('cls', None)  # type: ClsType["_models.BuildCollection"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        def prepare_request(next_link=None):
            if not next_link:

                request = build_list_builds_request(
                    subscription_id=self._config.subscription_id,
                    resource_group_name=resource_group_name,
                    service_name=service_name,
                    build_service_name=build_service_name,
                    api_version=api_version,
                    template_url=self.list_builds.metadata['url'],
                )
                request = _convert_request(request)
                request.url = self._client.format_url(request.url)

            else:

                request = build_list_builds_request(
                    subscription_id=self._config.subscription_id,
                    resource_group_name=resource_group_name,
                    service_name=service_name,
                    build_service_name=build_service_name,
                    api_version=api_version,
                    template_url=next_link,
                )
                request = _convert_request(request)
                request.url = self._client.format_url(request.url)
                request.method = "GET"
            return request

        async def extract_data(pipeline_response):
            deserialized = self._deserialize("BuildCollection", pipeline_response)
            list_of_elem = deserialized.value
            if cls:
                list_of_elem = cls(list_of_elem)
            return deserialized.next_link or None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)

            pipeline_response = await self._client._pipeline.run(  # pylint: disable=protected-access
                request,
                stream=False,
                **kwargs
            )
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=ARMErrorFormat)

            return pipeline_response

        return AsyncItemPaged(
            get_next, extract_data
        )
    list_builds.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds"}  # type: ignore

    @distributed_trace_async
    async def get_build(
        self,
        resource_group_name: str,
        service_name: str,
        build_service_name: str,
        build_name: str,
        **kwargs: Any
    ) -> "_models.Build":
        """Get a KPack build.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param service_name: The name of the Service resource.
        :type service_name: str
        :param build_service_name: The name of the build service resource.
        :type build_service_name: str
        :param build_name: The name of the build resource.
        :type build_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: Build, or the result of cls(response)
        :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.Build"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))

        api_version = kwargs.pop('api_version', "2022-05-01-preview")  # type: str

        request = build_get_build_request(
            subscription_id=self._config.subscription_id,
            resource_group_name=resource_group_name,
            service_name=service_name,
            build_service_name=build_service_name,
            build_name=build_name,
            api_version=api_version,
            template_url=self.get_build.metadata['url'],
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        pipeline_response = await self._client._pipeline.run(  # pylint: disable=protected-access
            request,
            stream=False,
            **kwargs
        )
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        deserialized = self._deserialize('Build', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get_build.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}"}  # type: ignore

    @distributed_trace_async
    async def create_or_update_build(
        self,
        resource_group_name: str,
        service_name: str,
        build_service_name: str,
        build_name: str,
        build: "_models.Build",
        **kwargs: Any
    ) -> "_models.Build":
        """Create or update a KPack build.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param service_name: The name of the Service resource.
        :type service_name: str
        :param build_service_name: The name of the build service resource.
        :type build_service_name: str
        :param build_name: The name of the build resource.
        :type build_name: str
        :param build: Parameters for the create or update operation.
        :type build: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: Build, or the result of cls(response)
        :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.Build
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.Build"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))

        api_version = kwargs.pop('api_version', "2022-05-01-preview")  # type: str
        content_type = kwargs.pop('content_type', "application/json")  # type: Optional[str]

        _json = self._serialize.body(build, 'Build')

        request = build_create_or_update_build_request(
            subscription_id=self._config.subscription_id,
            resource_group_name=resource_group_name,
            service_name=service_name,
            build_service_name=build_service_name,
            build_name=build_name,
            api_version=api_version,
            content_type=content_type,
            json=_json,
            template_url=self.create_or_update_build.metadata['url'],
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        pipeline_response = await self._client._pipeline.run(  # pylint: disable=protected-access
            request,
            stream=False,
            **kwargs
        )
        response = pipeline_response.http_response

        if response.status_code not in [200, 201]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        if response.status_code == 200:
            deserialized = self._deserialize('Build', pipeline_response)

        if response.status_code == 201:
            deserialized = self._deserialize('Build', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    create_or_update_build.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}"}  # type: ignore

    @distributed_trace
    def list_build_results(
        self,
        resource_group_name: str,
        service_name: str,
        build_service_name: str,
        build_name: str,
        **kwargs: Any
    ) -> AsyncIterable["_models.BuildResultCollection"]:
        """List KPack build results.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param service_name: The name of the Service resource.
        :type service_name: str
        :param build_service_name: The name of the build service resource.
        :type build_service_name: str
        :param build_name: The name of the build resource.
        :type build_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either BuildResultCollection or the result of
         cls(response)
        :rtype:
         ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildResultCollection]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = kwargs.pop('api_version', "2022-05-01-preview")  # type: str

        cls = kwargs.pop('cls', None)  # type: ClsType["_models.BuildResultCollection"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        def prepare_request(next_link=None):
            if not next_link:

                request = build_list_build_results_request(
                    subscription_id=self._config.subscription_id,
                    resource_group_name=resource_group_name,
                    service_name=service_name,
                    build_service_name=build_service_name,
                    build_name=build_name,
                    api_version=api_version,
                    template_url=self.list_build_results.metadata['url'],
                )
                request = _convert_request(request)
                request.url = self._client.format_url(request.url)

            else:

                request = build_list_build_results_request(
                    subscription_id=self._config.subscription_id,
                    resource_group_name=resource_group_name,
                    service_name=service_name,
                    build_service_name=build_service_name,
                    build_name=build_name,
                    api_version=api_version,
                    template_url=next_link,
                )
                request = _convert_request(request)
                request.url = self._client.format_url(request.url)
                request.method = "GET"
            return request

        async def extract_data(pipeline_response):
            deserialized = self._deserialize("BuildResultCollection", pipeline_response)
            list_of_elem = deserialized.value
            if cls:
                list_of_elem = cls(list_of_elem)
            return deserialized.next_link or None, AsyncList(list_of_elem)

        async def get_next(next_link=None):
            request = prepare_request(next_link)

            pipeline_response = await self._client._pipeline.run(  # pylint: disable=protected-access
                request,
                stream=False,
                **kwargs
            )
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, error_format=ARMErrorFormat)

            return pipeline_response

        return AsyncItemPaged(
            get_next, extract_data
        )
    list_build_results.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results"}  # type: ignore

    @distributed_trace_async
    async def get_build_result(
        self,
        resource_group_name: str,
        service_name: str,
        build_service_name: str,
        build_name: str,
        build_result_name: str,
        **kwargs: Any
    ) -> "_models.BuildResult":
        """Get a KPack build result.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param service_name: The name of the Service resource.
        :type service_name: str
        :param build_service_name: The name of the build service resource.
        :type build_service_name: str
        :param build_name: The name of the build resource.
        :type build_name: str
        :param build_result_name: The name of the build result resource.
        :type build_result_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: BuildResult, or the result of cls(response)
        :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildResult
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.BuildResult"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))

        api_version = kwargs.pop('api_version', "2022-05-01-preview")  # type: str

        request = build_get_build_result_request(
            subscription_id=self._config.subscription_id,
            resource_group_name=resource_group_name,
            service_name=service_name,
            build_service_name=build_service_name,
            build_name=build_name,
            build_result_name=build_result_name,
            api_version=api_version,
            template_url=self.get_build_result.metadata['url'],
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        pipeline_response = await self._client._pipeline.run(  # pylint: disable=protected-access
            request,
            stream=False,
            **kwargs
        )
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        deserialized = self._deserialize('BuildResult', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get_build_result.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}"}  # type: ignore

    @distributed_trace_async
    async def get_build_result_log(
        self,
        resource_group_name: str,
        service_name: str,
        build_service_name: str,
        build_name: str,
        build_result_name: str,
        **kwargs: Any
    ) -> "_models.BuildResultLog":
        """Get a KPack build result log download URL.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param service_name: The name of the Service resource.
        :type service_name: str
        :param build_service_name: The name of the build service resource.
        :type build_service_name: str
        :param build_name: The name of the build resource.
        :type build_name: str
        :param build_result_name: The name of the build result resource.
        :type build_result_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: BuildResultLog, or the result of cls(response)
        :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildResultLog
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.BuildResultLog"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))

        api_version = kwargs.pop('api_version', "2022-05-01-preview")  # type: str

        request = build_get_build_result_log_request(
            subscription_id=self._config.subscription_id,
            resource_group_name=resource_group_name,
            service_name=service_name,
            build_service_name=build_service_name,
            build_name=build_name,
            build_result_name=build_result_name,
            api_version=api_version,
            template_url=self.get_build_result_log.metadata['url'],
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        pipeline_response = await self._client._pipeline.run(  # pylint: disable=protected-access
            request,
            stream=False,
            **kwargs
        )
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        deserialized = self._deserialize('BuildResultLog', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get_build_result_log.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl"}  # type: ignore

    @distributed_trace_async
    async def get_resource_upload_url(
        self,
        resource_group_name: str,
        service_name: str,
        build_service_name: str,
        **kwargs: Any
    ) -> "_models.ResourceUploadDefinition":
        """Get an resource upload URL for build service, which may be artifacts or source archive.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param service_name: The name of the Service resource.
        :type service_name: str
        :param build_service_name: The name of the build service resource.
        :type build_service_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: ResourceUploadDefinition, or the result of cls(response)
        :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ResourceUploadDefinition
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.ResourceUploadDefinition"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))

        api_version = kwargs.pop('api_version', "2022-05-01-preview")  # type: str

        request = build_get_resource_upload_url_request(
            subscription_id=self._config.subscription_id,
            resource_group_name=resource_group_name,
            service_name=service_name,
            build_service_name=build_service_name,
            api_version=api_version,
            template_url=self.get_resource_upload_url.metadata['url'],
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        pipeline_response = await self._client._pipeline.run(  # pylint: disable=protected-access
            request,
            stream=False,
            **kwargs
        )
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        deserialized = self._deserialize('ResourceUploadDefinition', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get_resource_upload_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl"}  # type: ignore

    @distributed_trace_async
    async def list_supported_buildpacks(
        self,
        resource_group_name: str,
        service_name: str,
        build_service_name: str,
        **kwargs: Any
    ) -> "_models.SupportedBuildpacksCollection":
        """Get all supported buildpacks.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param service_name: The name of the Service resource.
        :type service_name: str
        :param build_service_name: The name of the build service resource.
        :type build_service_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: SupportedBuildpacksCollection, or the result of cls(response)
        :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SupportedBuildpacksCollection
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.SupportedBuildpacksCollection"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))

        api_version = kwargs.pop('api_version', "2022-05-01-preview")  # type: str

        request = build_list_supported_buildpacks_request(
            subscription_id=self._config.subscription_id,
            resource_group_name=resource_group_name,
            service_name=service_name,
            build_service_name=build_service_name,
            api_version=api_version,
            template_url=self.list_supported_buildpacks.metadata['url'],
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        pipeline_response = await self._client._pipeline.run(  # pylint: disable=protected-access
            request,
            stream=False,
            **kwargs
        )
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        deserialized = self._deserialize('SupportedBuildpacksCollection', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    list_supported_buildpacks.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks"}  # type: ignore

    @distributed_trace_async
    async def get_supported_buildpack(
        self,
        resource_group_name: str,
        service_name: str,
        build_service_name: str,
        buildpack_name: str,
        **kwargs: Any
    ) -> "_models.SupportedBuildpackResource":
        """Get the supported buildpack resource.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param service_name: The name of the Service resource.
        :type service_name: str
        :param build_service_name: The name of the build service resource.
        :type build_service_name: str
        :param buildpack_name: The name of the buildpack resource.
        :type buildpack_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: SupportedBuildpackResource, or the result of cls(response)
        :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SupportedBuildpackResource
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.SupportedBuildpackResource"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))

        api_version = kwargs.pop('api_version', "2022-05-01-preview")  # type: str

        request = build_get_supported_buildpack_request(
            subscription_id=self._config.subscription_id,
            resource_group_name=resource_group_name,
            service_name=service_name,
            build_service_name=build_service_name,
            buildpack_name=buildpack_name,
            api_version=api_version,
            template_url=self.get_supported_buildpack.metadata['url'],
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        pipeline_response = await self._client._pipeline.run(  # pylint: disable=protected-access
            request,
            stream=False,
            **kwargs
        )
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        deserialized = self._deserialize('SupportedBuildpackResource', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get_supported_buildpack.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}"}  # type: ignore

    @distributed_trace_async
    async def list_supported_stacks(
        self,
        resource_group_name: str,
        service_name: str,
        build_service_name: str,
        **kwargs: Any
    ) -> "_models.SupportedStacksCollection":
        """Get all supported stacks.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param service_name: The name of the Service resource.
        :type service_name: str
        :param build_service_name: The name of the build service resource.
        :type build_service_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: SupportedStacksCollection, or the result of cls(response)
        :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SupportedStacksCollection
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.SupportedStacksCollection"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))

        api_version = kwargs.pop('api_version', "2022-05-01-preview")  # type: str

        request = build_list_supported_stacks_request(
            subscription_id=self._config.subscription_id,
            resource_group_name=resource_group_name,
            service_name=service_name,
            build_service_name=build_service_name,
            api_version=api_version,
            template_url=self.list_supported_stacks.metadata['url'],
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        pipeline_response = await self._client._pipeline.run(  # pylint: disable=protected-access
            request,
            stream=False,
            **kwargs
        )
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        deserialized = self._deserialize('SupportedStacksCollection', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    list_supported_stacks.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks"}  # type: ignore

    @distributed_trace_async
    async def get_supported_stack(
        self,
        resource_group_name: str,
        service_name: str,
        build_service_name: str,
        stack_name: str,
        **kwargs: Any
    ) -> "_models.SupportedStackResource":
        """Get the supported stack resource.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param service_name: The name of the Service resource.
        :type service_name: str
        :param build_service_name: The name of the build service resource.
        :type build_service_name: str
        :param stack_name: The name of the stack resource.
        :type stack_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: SupportedStackResource, or the result of cls(response)
        :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SupportedStackResource
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.SupportedStackResource"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))

        api_version = kwargs.pop('api_version', "2022-05-01-preview")  # type: str

        request = build_get_supported_stack_request(
            subscription_id=self._config.subscription_id,
            resource_group_name=resource_group_name,
            service_name=service_name,
            build_service_name=build_service_name,
            stack_name=stack_name,
            api_version=api_version,
            template_url=self.get_supported_stack.metadata['url'],
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        pipeline_response = await self._client._pipeline.run(  # pylint: disable=protected-access
            request,
            stream=False,
            **kwargs
        )
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response, error_format=ARMErrorFormat)

        deserialized = self._deserialize('SupportedStackResource', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get_supported_stack.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}"}  # type: ignore


text:
package gdg.toulouse.attendee.domain;

import gdg.toulouse.data.Try;
import gdg.toulouse.data.Unit;
import gdg.toulouse.design.annotations.ApplicationInterface;

import java.io.OutputStream;

@ApplicationInterface
public interface Badge {

    Try<Unit> generate(OutputStream stream);

}