text:
<?xml version="1.0"?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<!--
  This file contains some false positive bugs detected by findbugs. Their
  false positive nature has been analyzed individually and they have been
  put here to instruct findbugs to ignore them.
-->
<FindBugsFilter>
  <!-- findbugs thinks these is naked, but they are not -->
  <Match>
    <Class name="org.apache.commons.pool.impl.GenericKeyedObjectPool" />
    <Method name="allocate"/>
    <Bug pattern="NN_NAKED_NOTIFY" />
  </Match>
  <Match>
    <Class name="org.apache.commons.pool.impl.GenericKeyedObjectPool" />
    <Method name="close"/>
    <Bug pattern="NN_NAKED_NOTIFY" />
  </Match>
  <Match>
    <Class name="org.apache.commons.pool.impl.GenericObjectPool" />
    <Method name="close"/>
    <Bug pattern="NN_NAKED_NOTIFY" />
  </Match>
  <!-- Iteration has to be over keys here -->
  <Match>
    <Class name="org.apache.commons.pool.impl.GenericKeyedObjectPool" />
    <Method name="destroy"/>
    <Bug pattern="WMI_WRONG_MAP_ITERATOR" />
  </Match>
  <!-- compareTo is implemented consistently with object equals in this case -->
  <Match>
    <Class name="org.apache.commons.pool.impl.GenericKeyedObjectPool$ObjectTimestampPair" />
    <Bug pattern="EQ_COMPARETO_USE_OBJECT_EQUALS" />
  </Match>
  <!-- findbugs thinks this is naked, but it is not -->
  <Match>
    <Class name="org.apache.commons.pool.impl.GenericObjectPool" />
    <Method name="allocate"/>
    <Bug pattern="NN_NAKED_NOTIFY" />
  </Match>
</FindBugsFilter>


text:
/*
 * Authors:
 *   Rickard E. (Rik) Faith <faith@redhat.com>
 *
 */

/** \file
 * Interface to USB keyboard driver. \see usb-keyboard.c \see usb-common.c */

#ifndef _USB_KEYBOARD_H_
#define _USB_KEYBOARD_H_
extern void    kbdUSBInit(DevicePtr pDev);
extern void    kbdUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
extern int     kbdUSBOn(DevicePtr pDev);
extern void    kbdUSBRead(DevicePtr pDev,
                          dmxMotionProcPtr motion,
                          dmxEnqueueProcPtr enqueue,
                          dmxCheckSpecialProcPtr checkspecial,
                          DMXBlockType block);
extern void    kbdUSBCtrl(DevicePtr pDev, KeybdCtrl *ctrl);
#endif

redpajama_set_name: RedPajamaGithub


text:
package com.example.studentprofile;

import java.util.ArrayList;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHandler extends SQLiteOpenHelper {

	// All Static variables
	// Database Version
	private static final int DATABASE_VERSION = 1;

	// Database Name
	private static final String DATABASE_NAME = "profileManager";

	// Contacts table name
	private static final String TABLE_PROFILE = "profile";

	// Contacts Table Columns names
	private static final String KEY_ID = "id";
	private static final String KEY_NAME = "name";
	private static final String KEY_F_NAME = "fathersName";
	private static final String KEY_M_NAME = "mothersName";
	private static final String KEY_DOB = "dateOfBirth";
	private static final String KEY_GENDER = "gender";
	private static final String KEY_WEIGHT = "weight";
	private static final String KEY_F_HEIGHT = "height";

	public DatabaseHandler(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	// Creating Tables
	@Override
	public void onCreate(SQLiteDatabase db) {
		String CREATE_PROFILES_TABLE = "CREATE TABLE " + TABLE_PROFILE + "("
				+ KEY_ID + " INTEGER PRIMARY KEY," + KEY_NAME + " TEXT,"
				+ KEY_F_NAME + " TEXT" + KEY_M_NAME + " TEXT" + KEY_DOB
				+ " TEXT" + KEY_GENDER + " TEXT" + KEY_WEIGHT + " TEXT"
				+ KEY_F_HEIGHT + " TEXT" + ")";
		db.execSQL(CREATE_PROFILES_TABLE);
	}

	// Upgrading database
	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// Drop older table if existed
		db.execSQL("DROP TABLE IF EXISTS " + TABLE_PROFILE);

		// Create tables again
		onCreate(db);
	}

	/**
	 * All CRUD(Create, Read, Update, Delete) Operations
	 */

	// Adding new contact
	void addProfile(Profile p) {
		SQLiteDatabase db = this.getWritableDatabase();

		ContentValues values = new ContentValues();
		values.put(KEY_NAME, p.getName()); // Profile Name
		values.put(KEY_F_NAME, p.getFathersName()); // Contact Phone
		values.put(KEY_M_NAME, p.getMothersName());
		values.put(KEY_DOB, p.getDateOfBirth());
		values.put(KEY_GENDER, p.getGender());
		values.put(KEY_WEIGHT, p.getWeight());
		values.put(KEY_F_HEIGHT, p.getHeight());

		// Inserting Row
		db.insert(TABLE_PROFILE, null, values);
		db.close(); // Closing database connection
	}

	// Getting single contact
	Profile getProfile(int id) {
		SQLiteDatabase db = this.getReadableDatabase();

		Cursor cursor = db.query(TABLE_PROFILE, new String[] { KEY_ID,
				KEY_NAME, KEY_F_NAME, KEY_M_NAME, KEY_DOB, KEY_GENDER,
				KEY_WEIGHT, KEY_F_HEIGHT }, KEY_ID + "=?",
				new String[] { String.valueOf(id) }, null, null, null, null);
		if (cursor != null)
			cursor.moveToFirst();

		Profile p = new Profile(Integer.parseInt(cursor.getString(0)),
				cursor.getString(1), cursor.getString(2),cursor.getString(3),cursor.getString(4),cursor.getString(5),cursor.getString(6),cursor.getString(7));
		// return contact
		return p;
	}

	// Getting All Contacts
	public ArrayList<Profile> getAllProfiles() {
		ArrayList<Profile> profileList = new ArrayList<Profile>();
		// Select All Query
		String selectQuery = "SELECT  * FROM " + TABLE_PROFILE;

		SQLiteDatabase db = this.getWritableDatabase();
		Cursor cursor = db.rawQuery(selectQuery, null);

		// looping through all rows and adding to list
		if (cursor.moveToFirst()) {
			do {
				Profile p = new Profile();
				p.setId(Integer.parseInt(cursor.getString(0)));
				p.setName(cursor.getString(1));
				p.setFathersName(cursor.getString(2));
				p.setMothersName(cursor.getString(3));
				p.setDateOfBirth(cursor.getString(4));
				p.setGender(cursor.getString(5));
				p.setWeight(cursor.getString(6));
				p.setHeight(cursor.getString(7));
				// Adding contact to list
				profileList.add(p);
			} while (cursor.moveToNext());
		}

		// return contact list
		return profileList;
	}

	// Updating single contact
	public int updateContact(Profile p) {
		SQLiteDatabase db = this.getWritableDatabase();

		ContentValues values = new ContentValues();
		values.put(KEY_NAME, p.getName());
		values.put(KEY_F_NAME, p.getFathersName());
		values.put(KEY_M_NAME, p.getMothersName());
		values.put(KEY_DOB, p.getDateOfBirth());
		values.put(KEY_GENDER, p.getGender());
		values.put(KEY_WEIGHT, p.getWeight());
		values.put(KEY_F_HEIGHT, p.getHeight());

		// updating row
		return db.update(TABLE_PROFILE, values, KEY_ID + " = ?",
				new String[] { String.valueOf(p.getId()) });
	}

	// Deleting single contact
	public void deleteContact(Profile p) {
		SQLiteDatabase db = this.getWritableDatabase();
		db.delete(TABLE_PROFILE, KEY_ID + " = ?",
				new String[] { String.valueOf(p.getId()) });
		db.close();
	}

	// Getting contacts Count
	public int getProfileCount() {
		String countQuery = "SELECT  * FROM " + TABLE_PROFILE;
		SQLiteDatabase db = this.getReadableDatabase();
		Cursor cursor = db.rawQuery(countQuery, null);
		cursor.close();

		// return count
		return cursor.getCount();
	}

}


text:
#include "fennel/common/CommonPreamble.h"
#include "fennel/farrago/JavaThreadTracker.h"
#include "fennel/farrago/JniUtil.h"
#include "fennel/farrago/JavaExcn.h"

FENNEL_BEGIN_CPPFILE("$Id$");

void JavaThreadTracker::onThreadStart()
{
    JniEnvAutoRef pEnv;
    // We want to stay attached for the duration of the timer thread,
    // so suppress detach here and do it explicitly in onThreadEnd
    // instead.  See comments on suppressDetach about the need for a
    // cleaner approach to attaching native-spawned threads.
    pEnv.suppressDetach();
}

void JavaThreadTracker::onThreadEnd()
{
    JniUtil::detachJavaEnv();
}

FennelExcn *JavaThreadTracker::cloneExcn(std::exception &ex)
{
    JavaExcn *pJavaExcn = dynamic_cast<JavaExcn *>(&ex);
    if (!pJavaExcn) {
        return ThreadTracker::cloneExcn(ex);
    }
    return new JavaExcn(pJavaExcn->getJavaException());
}

FENNEL_END_CPPFILE("$Id$");

// End JavaThreadTracker.cpp


text:
@extends('layout.dashboard')

@section('content')

Perbarui Profil

            <form action="{{ URL . 'auth/profileUpdate' }}" class="form-horizontal" method="post">
                <input type="hidden" value="{{ Auth::user()->id }}" name="id">

                    Nama

                        <input type="text" class="form-control" name="fullname" value="{{ Auth::user()->fullname }}">

                            <input type="radio" name="gender" value="1" {{ Auth::user()->gender != 1 ?: 'checked' }}> Pria

                            <input type="radio" name="gender" value="2" {{ Auth::user()->gender == 1 ?: 'checked' }}> Wanita

                    Email

                        <input type="email" class="form-control" name="email" id="reg-username" value="{{ Auth::user()->email }}">

                    Password

                        <input type="password" class="form-control" name="password" id="reg-password">

                    Ulangi password

                        <input type="password" class="form-control" id="reg-password-verify">

                    Pertanyaan Rahasia

                        <select name="question" id="question" class="form-control">
                            <option value="">Pilih salah satu</option>
                            @foreach($questions as $question)
                                <option value="{{ $question->id }}"
                                        {{ Auth::user()->security_question_id !== $question->id ?: 'selected' }}>{{ $question->name }}</option>
                            @endforeach
                        </select>

                    Jawaban

                        <input type="text" class="form-control" id="answer" name="answer" value="{{ Auth::user()->answer }}">

                    Batal
                    <button type="submit" class="btn btn-primary pull-right">Perbarui</button>

            </form>

@endsection


text:
public class Roulette { //create class
  public static void main(String args[]) { //create
    int countLostAll = 0; //initialize count vars
    int countLostSome = 0;
    int countWonSome = 0;
    int totalWinnings = 0; //var to carry sum of winnings
    for (int i=0;i<1000;i++) { //play 1000 games
      int gameSum = 0; //initalize game sum every game
      int bet = (int)(Math.random()*38); //random bet
      for (int j=0;j<100;j++) { //100 rounds per game
        int spin = (int)(Math.random()*38); //random spin
        if (bet == spin) { //if spin hits your number
          gameSum += 36; //add winnings to game sum
        }
      }
      if (gameSum > 100) {
        countWonSome++; //increment count rounds with positive winnings
      }
      else if (gameSum == 0) {
        countLostAll++; //didnt win anything
      }
      else {
        countLostSome++; //won less than put in
      }
      totalWinnings += gameSum; //add game sum to total sum
    }
    // print section
    System.out.println("Games with wins less than $100: " + countLostSome);
    System.out.println("Games with zero winnings: " + countLostAll);
    System.out.println("Games with positive winnings: " + countWonSome);
    System.out.println("Total winnings (out of $100,000): " + totalWinnings);
  }
}


text:
#ifndef DART_GUI_OSG_RENDER_BOXSHAPENODE_HPP_
#define DART_GUI_OSG_RENDER_BOXSHAPENODE_HPP_

#include <osg/MatrixTransform>

#include "dart/gui/osg/render/ShapeNode.hpp"

namespace dart {

namespace dynamics {
class BoxShape;
} // namespace dynamics

namespace gui {
namespace osg {
namespace render {

class BoxShapeGeode;
class BoxShapeDrawable;

class BoxShapeNode : public ShapeNode, public ::osg::Group
{
public:
  BoxShapeNode(
      std::shared_ptr<dart::dynamics::BoxShape> shape, ShapeFrameNode* parent);

  void refresh();
  void extractData(bool firstTime);

protected:
  virtual ~BoxShapeNode();

  std::shared_ptr<dart::dynamics::BoxShape> mBoxShape;
  BoxShapeGeode* mGeode;
};

} // namespace render
} // namespace osg
} // namespace gui
} // namespace dart

#endif // DART_GUI_OSG_RENDER_BOXSHAPENODE_HPP_


text:
Rewrite the GH code snippet with Service
========================================

Remember the GH code snippet to request user information (`api.github.com/user`)?
This section continues using GH as example.

::

    Cycle.get("https://api.github.com/user/",
        requestProcessors: [BasicAuthProcessor(username: "user", password: "pass")],
        responseProcessors: [JSONProcessor()],
        completionHandler: { (cycle, error) in
          // ...
        })

Use `Service`, the code can be simplified as::

  var service = GH()
  service.requestResource("user",
     completionHandler: { (cycle, error) in
       // ...
     })

.. note:: GH is a Service subclass. It requires a Profile to work properly.
          we will discuss Profile in the following sections.

Base URL, URI templates, request processors and response processors are the
attributes that various GH cycles share. These attributes are provided by the
Service subclass (GH and its Profile) so you don't have to. You can also set
other attributes, like HTTP headers, in class GH which isn't revealed here.

Besides the ability of setting a base URL (property `baseURL` of Service), the
benefit of using a Service doesn't seem obvious in the code snippet above. But
if your app needs to interact with a set of similar "endpoints", like an API,
using a Service subclass can be convenient because you don't have to repeat
yourself. Here is another code snippet for GitHub searching::

  var service = GH()
  service.requestResource("search", URIValues = ["q": "cycles"],
     completionHandler: { (cycle, error) in
         println("\(cycle.response.object)")
     })

You need class `GH`_ and profile `GH.plist`_ to make the code snippets above work.
The following sections explains how to create a Service subclass and its profile.

.. _`GH`: https://github.com/weipin/Cycles/blob/master/CyclesTouch/GH.swift
.. _`GH.plist`: https://github.com/weipin/Cycles/blob/master/CyclesTouch/GH.plist

.. note:: While we use GitHub API as examples, this project isn't affiliated with GitHub.


text:
\section{Previous Work}

\subsection{The Nimble type inferencer}

Henry Baker describes the Nimble type inferencer
\footnote{Unpublished technical report.  See for instance
  http://www.pipeline.com/~hbaker1/TInference.html.}.  His technique
works for the pre-standard \commonlisp{} language, and works by
annotating source code with type information in the form of
\emph{type declarations}.

Nimble tracks control flow in both directions and maintains both
upper and lower bounds on inferred type information, and could take exponential time. This was compensated for by Baker's team by
reducing type computations to specialized linear bit-vector
arithmetic, but the algorithm was still noticeably slow (on the
computers of the time). A comparison of efficiency with our technique
has not been made.

The advantage of Baker's technique is that it can be used with any
conforming \commonlisp{} implementation, except that it would need some
minor work in order to be applicable to code in the standardized
language.

\subsection{\sbcl{}}

The \sbcl{} implementation of \commonlisp{} is known to have excellent
type-inference capabilities. Its ``constraint propagation'' algorithm
is similar to that described here, but instead operates at control-flow
level of basic blocks, and can propagate constraints other than types.
Rather than inlining, \sbcl{} relies on type derivation functions
associated with higher-level built-in operators. These are necessarily
more complex, but removing the necessity of inlining may decrease
code size.


text:
A taskbar application to quickly (dis)connect an android device to adb over wifi

**Not working yet**, use the cli-tool

[https://github.com/Urucas/adb-tcp-quick](https://github.com/Urucas/adb-tcp-quick)


text:
package com.anteoy.jmtest.other;

public class C extends B{

}


text:
module Azure::VMwareCloudSimple::Mgmt::V2019_04_01
  #
  # Description of the new service
  #
  class DedicatedCloudServices
    include MsRestAzure

    #
    # Creates and initializes a new instance of the DedicatedCloudServices class.
    # @param client service class for accessing basic functionality.
    #
    def initialize(client)
      @client = client
    end

    # @return [VMwareCloudSimpleClient] reference to the VMwareCloudSimpleClient
    attr_reader :client

    #
    # Implements list of dedicatedCloudService objects within subscription method
    #
    # Returns list of dedicated cloud services within a subscription
    #
    # @param filter [String] The filter to apply on the list operation
    # @param top [Integer] The maximum number of record sets to return
    # @param skip_token [String] to be used by nextLink implementation
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [Array<DedicatedCloudService>] operation results.
    #
    def list_by_subscription(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
      first_page = list_by_subscription_as_lazy(filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers)
      first_page.get_all_items
    end

    #
    # Implements list of dedicatedCloudService objects within subscription method
    #
    # Returns list of dedicated cloud services within a subscription
    #
    # @param filter [String] The filter to apply on the list operation
    # @param top [Integer] The maximum number of record sets to return
    # @param skip_token [String] to be used by nextLink implementation
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
    #
    def list_by_subscription_with_http_info(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
      list_by_subscription_async(filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
    end

    #
    # Implements list of dedicatedCloudService objects within subscription method
    #
    # Returns list of dedicated cloud services within a subscription
    #
    # @param filter [String] The filter to apply on the list operation
    # @param top [Integer] The maximum number of record sets to return
    # @param skip_token [String] to be used by nextLink implementation
    # @param [Hash{String => String}] A hash of custom headers that will be added
    # to the HTTP request.
    #
    # @return [Concurrent::Promise] Promise object which holds the HTTP response.
    #
    def list_by_subscription_async(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
      fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
      fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?

      request_headers = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # Set Headers
      request_headers['x-ms-client-request-id'] = SecureRandom.uuid
      request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
      path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'subscriptionId' => @client.subscription_id},
          query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skipToken' => skip_token},
          headers: request_headers.merge(custom_headers || {}),
          base_url: request_url
      }
      promise = @client.make_request_async(:get, path_template, options)

      promise = promise.then do |result|
        http_response = result.response
        status_code = http_response.status
        response_content = http_response.body
        unless status_code == 200
          error_model = JSON.load(response_content)
          fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
        end

        result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
        # Deserialize Response
        if status_code == 200
          begin
            parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
            result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudServiceListResponse.mapper()
            result.body = @client.deserialize(result_mapper, parsed_response)
          rescue Exception => e
            fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
          end
        end

        result
      end

      promise.execute
    end

    #
    # Implements list of dedicatedCloudService objects within RG method
    #
    # Returns list of dedicated cloud services within a resource group
    #
    # @param resource_group_name [String] The name of the resource group
    # @param filter [String] The filter to apply on the list operation
    # @param top [Integer] The maximum number of record sets to return
    # @param skip_token [String] to be used by nextLink implementation
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [Array<DedicatedCloudService>] operation results.
    #
    def list_by_resource_group(resource_group_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
      first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers)
      first_page.get_all_items
    end

    #
    # Implements list of dedicatedCloudService objects within RG method
    #
    # Returns list of dedicated cloud services within a resource group
    #
    # @param resource_group_name [String] The name of the resource group
    # @param filter [String] The filter to apply on the list operation
    # @param top [Integer] The maximum number of record sets to return
    # @param skip_token [String] to be used by nextLink implementation
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
    #
    def list_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
      list_by_resource_group_async(resource_group_name, filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
    end

    #
    # Implements list of dedicatedCloudService objects within RG method
    #
    # Returns list of dedicated cloud services within a resource group
    #
    # @param resource_group_name [String] The name of the resource group
    # @param filter [String] The filter to apply on the list operation
    # @param top [Integer] The maximum number of record sets to return
    # @param skip_token [String] to be used by nextLink implementation
    # @param [Hash{String => String}] A hash of custom headers that will be added
    # to the HTTP request.
    #
    # @return [Concurrent::Promise] Promise object which holds the HTTP response.
    #
    def list_by_resource_group_async(resource_group_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
      fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
      fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
      fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?

      request_headers = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # Set Headers
      request_headers['x-ms-client-request-id'] = SecureRandom.uuid
      request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
      path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
          query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skipToken' => skip_token},
          headers: request_headers.merge(custom_headers || {}),
          base_url: request_url
      }
      promise = @client.make_request_async(:get, path_template, options)

      promise = promise.then do |result|
        http_response = result.response
        status_code = http_response.status
        response_content = http_response.body
        unless status_code == 200
          error_model = JSON.load(response_content)
          fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
        end

        result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
        # Deserialize Response
        if status_code == 200
          begin
            parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
            result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudServiceListResponse.mapper()
            result.body = @client.deserialize(result_mapper, parsed_response)
          rescue Exception => e
            fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
          end
        end

        result
      end

      promise.execute
    end

    #
    # Implements dedicatedCloudService GET method
    #
    # Returns Dedicate Cloud Service
    #
    # @param resource_group_name [String] The name of the resource group
    # @param dedicated_cloud_service_name [String] dedicated cloud Service name
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [DedicatedCloudService] operation results.
    #
    def get(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
      response = get_async(resource_group_name, dedicated_cloud_service_name, custom_headers:custom_headers).value!
      response.body unless response.nil?
    end

    #
    # Implements dedicatedCloudService GET method
    #
    # Returns Dedicate Cloud Service
    #
    # @param resource_group_name [String] The name of the resource group
    # @param dedicated_cloud_service_name [String] dedicated cloud Service name
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
    #
    def get_with_http_info(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
      get_async(resource_group_name, dedicated_cloud_service_name, custom_headers:custom_headers).value!
    end

    #
    # Implements dedicatedCloudService GET method
    #
    # Returns Dedicate Cloud Service
    #
    # @param resource_group_name [String] The name of the resource group
    # @param dedicated_cloud_service_name [String] dedicated cloud Service name
    # @param [Hash{String => String}] A hash of custom headers that will be added
    # to the HTTP request.
    #
    # @return [Concurrent::Promise] Promise object which holds the HTTP response.
    #
    def get_async(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
      fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
      fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
      fail ArgumentError, 'dedicated_cloud_service_name is nil' if dedicated_cloud_service_name.nil?
      fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?

      request_headers = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # Set Headers
      request_headers['x-ms-client-request-id'] = SecureRandom.uuid
      request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
      path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'dedicatedCloudServiceName' => dedicated_cloud_service_name},
          query_params: {'api-version' => @client.api_version},
          headers: request_headers.merge(custom_headers || {}),
          base_url: request_url
      }
      promise = @client.make_request_async(:get, path_template, options)

      promise = promise.then do |result|
        http_response = result.response
        status_code = http_response.status
        response_content = http_response.body
        unless status_code == 200
          error_model = JSON.load(response_content)
          fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
        end

        result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
        # Deserialize Response
        if status_code == 200
          begin
            parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
            result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudService.mapper()
            result.body = @client.deserialize(result_mapper, parsed_response)
          rescue Exception => e
            fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
          end
        end

        result
      end

      promise.execute
    end

    #
    # Implements dedicated cloud service PUT method
    #
    # Create dedicate cloud service
    #
    # @param resource_group_name [String] The name of the resource group
    # @param dedicated_cloud_service_name [String] dedicated cloud Service name
    # @param dedicated_cloud_service_request [DedicatedCloudService] Create
    # Dedicated Cloud Service request
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [DedicatedCloudService] operation results.
    #
    def create_or_update(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:nil)
      response = create_or_update_async(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:custom_headers).value!
      response.body unless response.nil?
    end

    #
    # Implements dedicated cloud service PUT method
    #
    # Create dedicate cloud service
    #
    # @param resource_group_name [String] The name of the resource group
    # @param dedicated_cloud_service_name [String] dedicated cloud Service name
    # @param dedicated_cloud_service_request [DedicatedCloudService] Create
    # Dedicated Cloud Service request
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
    #
    def create_or_update_with_http_info(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:nil)
      create_or_update_async(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:custom_headers).value!
    end

    #
    # Implements dedicated cloud service PUT method
    #
    # Create dedicate cloud service
    #
    # @param resource_group_name [String] The name of the resource group
    # @param dedicated_cloud_service_name [String] dedicated cloud Service name
    # @param dedicated_cloud_service_request [DedicatedCloudService] Create
    # Dedicated Cloud Service request
    # @param [Hash{String => String}] A hash of custom headers that will be added
    # to the HTTP request.
    #
    # @return [Concurrent::Promise] Promise object which holds the HTTP response.
    #
    def create_or_update_async(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:nil)
      fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
      fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
      fail ArgumentError, 'dedicated_cloud_service_name is nil' if dedicated_cloud_service_name.nil?
      fail ArgumentError, "'dedicated_cloud_service_name' should satisfy the constraint - 'Pattern': '^[-a-zA-Z0-9]+$'" if !dedicated_cloud_service_name.nil? && dedicated_cloud_service_name.match(Regexp.new('^^[-a-zA-Z0-9]+$$')).nil?
      fail ArgumentError, 'dedicated_cloud_service_request is nil' if dedicated_cloud_service_request.nil?
      fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?

      request_headers = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # Set Headers
      request_headers['x-ms-client-request-id'] = SecureRandom.uuid
      request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

      # Serialize Request
      request_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudService.mapper()
      request_content = @client.serialize(request_mapper,  dedicated_cloud_service_request)
      request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

      path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'dedicatedCloudServiceName' => dedicated_cloud_service_name},
          query_params: {'api-version' => @client.api_version},
          body: request_content,
          headers: request_headers.merge(custom_headers || {}),
          base_url: request_url
      }
      promise = @client.make_request_async(:put, path_template, options)

      promise = promise.then do |result|
        http_response = result.response
        status_code = http_response.status
        response_content = http_response.body
        unless status_code == 200
          error_model = JSON.load(response_content)
          fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
        end

        result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
        # Deserialize Response
        if status_code == 200
          begin
            parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
            result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudService.mapper()
            result.body = @client.deserialize(result_mapper, parsed_response)
          rescue Exception => e
            fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
          end
        end

        result
      end

      promise.execute
    end

    #
    # Implements dedicatedCloudService DELETE method
    #
    # Delete dedicate cloud service
    #
    # @param resource_group_name [String] The name of the resource group
    # @param dedicated_cloud_service_name [String] dedicated cloud service name
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    def delete(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
      response = delete_async(resource_group_name, dedicated_cloud_service_name, custom_headers:custom_headers).value!
      nil
    end

    #
    # @param resource_group_name [String] The name of the resource group
    # @param dedicated_cloud_service_name [String] dedicated cloud service name
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [Concurrent::Promise] promise which provides async access to http
    # response.
    #
    def delete_async(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
      # Send request
      promise = begin_delete_async(resource_group_name, dedicated_cloud_service_name, custom_headers:custom_headers)

      promise = promise.then do |response|
        # Defining deserialization method.
        deserialize_method = lambda do |parsed_response|
        end

        # Waiting for response.
        @client.get_long_running_operation_result(response, deserialize_method)
      end

      promise
    end

    #
    # Implements dedicatedCloudService PATCH method
    #
    # Patch dedicated cloud service's properties
    #
    # @param resource_group_name [String] The name of the resource group
    # @param dedicated_cloud_service_name [String] dedicated cloud service name
    # @param dedicated_cloud_service_request [PatchPayload] Patch Dedicated Cloud
    # Service request
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [DedicatedCloudService] operation results.
    #
    def update(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:nil)
      response = update_async(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:custom_headers).value!
      response.body unless response.nil?
    end

    #
    # Implements dedicatedCloudService PATCH method
    #
    # Patch dedicated cloud service's properties
    #
    # @param resource_group_name [String] The name of the resource group
    # @param dedicated_cloud_service_name [String] dedicated cloud service name
    # @param dedicated_cloud_service_request [PatchPayload] Patch Dedicated Cloud
    # Service request
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
    #
    def update_with_http_info(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:nil)
      update_async(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:custom_headers).value!
    end

    #
    # Implements dedicatedCloudService PATCH method
    #
    # Patch dedicated cloud service's properties
    #
    # @param resource_group_name [String] The name of the resource group
    # @param dedicated_cloud_service_name [String] dedicated cloud service name
    # @param dedicated_cloud_service_request [PatchPayload] Patch Dedicated Cloud
    # Service request
    # @param [Hash{String => String}] A hash of custom headers that will be added
    # to the HTTP request.
    #
    # @return [Concurrent::Promise] Promise object which holds the HTTP response.
    #
    def update_async(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:nil)
      fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
      fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
      fail ArgumentError, 'dedicated_cloud_service_name is nil' if dedicated_cloud_service_name.nil?
      fail ArgumentError, 'dedicated_cloud_service_request is nil' if dedicated_cloud_service_request.nil?
      fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?

      request_headers = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # Set Headers
      request_headers['x-ms-client-request-id'] = SecureRandom.uuid
      request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

      # Serialize Request
      request_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::PatchPayload.mapper()
      request_content = @client.serialize(request_mapper,  dedicated_cloud_service_request)
      request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

      path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'dedicatedCloudServiceName' => dedicated_cloud_service_name},
          query_params: {'api-version' => @client.api_version},
          body: request_content,
          headers: request_headers.merge(custom_headers || {}),
          base_url: request_url
      }
      promise = @client.make_request_async(:patch, path_template, options)

      promise = promise.then do |result|
        http_response = result.response
        status_code = http_response.status
        response_content = http_response.body
        unless status_code == 200
          error_model = JSON.load(response_content)
          fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
        end

        result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
        # Deserialize Response
        if status_code == 200
          begin
            parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
            result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudService.mapper()
            result.body = @client.deserialize(result_mapper, parsed_response)
          rescue Exception => e
            fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
          end
        end

        result
      end

      promise.execute
    end

    #
    # Implements dedicatedCloudService DELETE method
    #
    # Delete dedicate cloud service
    #
    # @param resource_group_name [String] The name of the resource group
    # @param dedicated_cloud_service_name [String] dedicated cloud service name
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    #
    def begin_delete(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
      response = begin_delete_async(resource_group_name, dedicated_cloud_service_name, custom_headers:custom_headers).value!
      nil
    end

    #
    # Implements dedicatedCloudService DELETE method
    #
    # Delete dedicate cloud service
    #
    # @param resource_group_name [String] The name of the resource group
    # @param dedicated_cloud_service_name [String] dedicated cloud service name
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
    #
    def begin_delete_with_http_info(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
      begin_delete_async(resource_group_name, dedicated_cloud_service_name, custom_headers:custom_headers).value!
    end

    #
    # Implements dedicatedCloudService DELETE method
    #
    # Delete dedicate cloud service
    #
    # @param resource_group_name [String] The name of the resource group
    # @param dedicated_cloud_service_name [String] dedicated cloud service name
    # @param [Hash{String => String}] A hash of custom headers that will be added
    # to the HTTP request.
    #
    # @return [Concurrent::Promise] Promise object which holds the HTTP response.
    #
    def begin_delete_async(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
      fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
      fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
      fail ArgumentError, 'dedicated_cloud_service_name is nil' if dedicated_cloud_service_name.nil?
      fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?

      request_headers = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # Set Headers
      request_headers['x-ms-client-request-id'] = SecureRandom.uuid
      request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
      path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'dedicatedCloudServiceName' => dedicated_cloud_service_name},
          query_params: {'api-version' => @client.api_version},
          headers: request_headers.merge(custom_headers || {}),
          base_url: request_url
      }
      promise = @client.make_request_async(:delete, path_template, options)

      promise = promise.then do |result|
        http_response = result.response
        status_code = http_response.status
        response_content = http_response.body
        unless status_code == 204
          error_model = JSON.load(response_content)
          fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
        end

        result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

        result
      end

      promise.execute
    end

    #
    # Implements list of dedicatedCloudService objects within subscription method
    #
    # Returns list of dedicated cloud services within a subscription
    #
    # @param next_page_link [String] The NextLink from the previous successful call
    # to List operation.
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [DedicatedCloudServiceListResponse] operation results.
    #
    def list_by_subscription_next(next_page_link, custom_headers:nil)
      response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
      response.body unless response.nil?
    end

    #
    # Implements list of dedicatedCloudService objects within subscription method
    #
    # Returns list of dedicated cloud services within a subscription
    #
    # @param next_page_link [String] The NextLink from the previous successful call
    # to List operation.
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
    #
    def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
      list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
    end

    #
    # Implements list of dedicatedCloudService objects within subscription method
    #
    # Returns list of dedicated cloud services within a subscription
    #
    # @param next_page_link [String] The NextLink from the previous successful call
    # to List operation.
    # @param [Hash{String => String}] A hash of custom headers that will be added
    # to the HTTP request.
    #
    # @return [Concurrent::Promise] Promise object which holds the HTTP response.
    #
    def list_by_subscription_next_async(next_page_link, custom_headers:nil)
      fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?

      request_headers = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # Set Headers
      request_headers['x-ms-client-request-id'] = SecureRandom.uuid
      request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
      path_template = '{nextLink}'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          skip_encoding_path_params: {'nextLink' => next_page_link},
          headers: request_headers.merge(custom_headers || {}),
          base_url: request_url
      }
      promise = @client.make_request_async(:get, path_template, options)

      promise = promise.then do |result|
        http_response = result.response
        status_code = http_response.status
        response_content = http_response.body
        unless status_code == 200
          error_model = JSON.load(response_content)
          fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
        end

        result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
        # Deserialize Response
        if status_code == 200
          begin
            parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
            result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudServiceListResponse.mapper()
            result.body = @client.deserialize(result_mapper, parsed_response)
          rescue Exception => e
            fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
          end
        end

        result
      end

      promise.execute
    end

    #
    # Implements list of dedicatedCloudService objects within RG method
    #
    # Returns list of dedicated cloud services within a resource group
    #
    # @param next_page_link [String] The NextLink from the previous successful call
    # to List operation.
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [DedicatedCloudServiceListResponse] operation results.
    #
    def list_by_resource_group_next(next_page_link, custom_headers:nil)
      response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
      response.body unless response.nil?
    end

    #
    # Implements list of dedicatedCloudService objects within RG method
    #
    # Returns list of dedicated cloud services within a resource group
    #
    # @param next_page_link [String] The NextLink from the previous successful call
    # to List operation.
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
    #
    def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
      list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
    end

    #
    # Implements list of dedicatedCloudService objects within RG method
    #
    # Returns list of dedicated cloud services within a resource group
    #
    # @param next_page_link [String] The NextLink from the previous successful call
    # to List operation.
    # @param [Hash{String => String}] A hash of custom headers that will be added
    # to the HTTP request.
    #
    # @return [Concurrent::Promise] Promise object which holds the HTTP response.
    #
    def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
      fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?

      request_headers = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # Set Headers
      request_headers['x-ms-client-request-id'] = SecureRandom.uuid
      request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
      path_template = '{nextLink}'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          skip_encoding_path_params: {'nextLink' => next_page_link},
          headers: request_headers.merge(custom_headers || {}),
          base_url: request_url
      }
      promise = @client.make_request_async(:get, path_template, options)

      promise = promise.then do |result|
        http_response = result.response
        status_code = http_response.status
        response_content = http_response.body
        unless status_code == 200
          error_model = JSON.load(response_content)
          fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
        end

        result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
        result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
        result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
        # Deserialize Response
        if status_code == 200
          begin
            parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
            result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudServiceListResponse.mapper()
            result.body = @client.deserialize(result_mapper, parsed_response)
          rescue Exception => e
            fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
          end
        end

        result
      end

      promise.execute
    end

    #
    # Implements list of dedicatedCloudService objects within subscription method
    #
    # Returns list of dedicated cloud services within a subscription
    #
    # @param filter [String] The filter to apply on the list operation
    # @param top [Integer] The maximum number of record sets to return
    # @param skip_token [String] to be used by nextLink implementation
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [DedicatedCloudServiceListResponse] which provide lazy access to
    # pages of the response.
    #
    def list_by_subscription_as_lazy(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
      response = list_by_subscription_async(filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
      unless response.nil?
        page = response.body
        page.next_method = Proc.new do |next_page_link|
          list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
        end
        page
      end
    end

    #
    # Implements list of dedicatedCloudService objects within RG method
    #
    # Returns list of dedicated cloud services within a resource group
    #
    # @param resource_group_name [String] The name of the resource group
    # @param filter [String] The filter to apply on the list operation
    # @param top [Integer] The maximum number of record sets to return
    # @param skip_token [String] to be used by nextLink implementation
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [DedicatedCloudServiceListResponse] which provide lazy access to
    # pages of the response.
    #
    def list_by_resource_group_as_lazy(resource_group_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
      response = list_by_resource_group_async(resource_group_name, filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
      unless response.nil?
        page = response.body
        page.next_method = Proc.new do |next_page_link|
          list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
        end
        page
      end
    end

  end
end


text:
import * as React from 'react';
import { useAsync } from '../hooks';
import { initializeLibrary } from '../initialize';
import { fetchIrisData } from '../vis/stories/Iris.stories';
import { Vis } from '../vis/Vis';
const irisData = fetchIrisData();
export function MainApp() {
    const { status } = useAsync(initializeLibrary, []);
    return React.createElement("div", { style: { width: '100vw', height: '100vh', overflow: 'auto' } }, status === 'success' ? React.createElement(Vis, { columns: irisData }) : null);
}
//# sourceMappingURL=MainApp.js.map


text:
/* jshint expr:true */
import { expect } from 'chai';
import {
    describe,
    it
} from 'mocha';
import Ember from 'ember';
import ValidationEngine from 'ghost/mixins/validation-engine';

const {run} = Ember;

const Subscriber = Ember.Object.extend(ValidationEngine, {
    validationType: 'subscriber',

    email: null
});

describe('Unit: Validator: subscriber', function () {
    it('validates email by default', function () {
        let subscriber = Subscriber.create({});
        let properties = subscriber.get('validators.subscriber.properties');

        console.log(subscriber);

        expect(properties, 'properties').to.include('email');
    });

    it('passes with a valid email', function () {
        let subscriber = Subscriber.create({email: 'test@example.com'});
        let passed = false;

        run(() => {
            subscriber.validate({property: 'email'}).then(() => {
                passed = true;
            });
        });

        expect(passed, 'passed').to.be.true;
        expect(subscriber.get('hasValidated'), 'hasValidated').to.include('email');
    });

    it('validates email presence', function () {
        let subscriber = Subscriber.create({});
        let passed = false;

        run(() => {
            subscriber.validate({property: 'email'}).then(() => {
                passed = true;
            });
        });

        let emailErrors = subscriber.get('errors').errorsFor('email').get(0);
        expect(emailErrors.attribute, 'errors.email.attribute').to.equal('email');
        expect(emailErrors.message, 'errors.email.message').to.equal('Please enter an email.');

        expect(passed, 'passed').to.be.false;
        expect(subscriber.get('hasValidated'), 'hasValidated').to.include('email');
    });

    it('validates email', function () {
        let subscriber = Subscriber.create({email: 'foo'});
        let passed = false;

        run(() => {
            subscriber.validate({property: 'email'}).then(() => {
                passed = true;
            });
        });

        let emailErrors = subscriber.get('errors').errorsFor('email').get(0);
        expect(emailErrors.attribute, 'errors.email.attribute').to.equal('email');
        expect(emailErrors.message, 'errors.email.message').to.equal('Invalid email.');

        expect(passed, 'passed').to.be.false;
        expect(subscriber.get('hasValidated'), 'hasValidated').to.include('email');
    });
});


text:
WARNING: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT. PLEASE MODIFY THE ORIGINAL SOURCE IN THE https://github.com/istio/api REPO
source_repo: https://github.com/istio/api
title: Mixer Client
description: Configuration state for the Mixer client library.
location: https://istio.io/docs/reference/config/policy-and-telemetry/istio.mixer.v1.config.client
layout: protoc-gen-docs
generator: protoc-gen-docs
number_of_entries: 20
---

Describes the configuration state for the Mixer client library that’s built into Envoy.

APIKey

APIKey defines the explicit configuration for generating the
request.api_key attribute from HTTP requests.

See API Keys
for a general overview of API keys as defined by OpenAPI.

Field
Type
Description

query
string (oneof)

API Key is sent as a query parameter. query represents the
query string parameter name.

For example, query=api_key should be used with the
following request:

GET /something?api_key=abcdef12345

header
string (oneof)

API key is sent in a request header. header represents the
header name.

For example, header=X-API-KEY should be used with the
following request:

GET /something HTTP/1.1
X-API-Key: abcdef12345

cookie
string (oneof)

API key is sent in a
cookie,

For example, cookie=X-API-KEY should be used for the
following request:

GET /something HTTP/1.1
Cookie: X-API-KEY=abcdef12345

AttributeMatch

Specifies a match clause to match Istio attributes

Field
Type
Description

clause
map<string, StringMatch>

Map of attribute names to StringMatch type.
Each map element specifies one condition to match.

Example:

clause:
    source.uid:
      exact: SOURCEUID
    request.httpmethod:
      exact: POST

HTTPAPISpec

HTTPAPISpec defines the canonical configuration for generating
API-related attributes from HTTP requests based on the method and
uri templated path matches. It is sufficient for defining the API
surface of a service for the purposes of API attribute
generation. It is not intended to represent auth, quota,
documentation, or other information commonly found in other API
specifications, e.g. OpenAPI.

Existing standards that define operations (or methods) in terms of
HTTP methods and paths can be normalized to this format for use in
Istio. For example, a simple petstore API described by OpenAPIv2
here
can be represented with the following HTTPAPISpec.

apiVersion: config.istio.io/v1alpha2
kind: HTTPAPISpec
metadata:
  name: petstore
  namespace: default
spec:
  attributes:
    attributes:
      api.service:
        stringValue: petstore.swagger.io
      api.version:
        stringValue: 1.0.0
  patterns:
  - attributes:
      attributes:
        api.operation:
          stringValue: findPets
    httpMethod: GET
    uriTemplate: /api/pets
  - attributes:
      attributes:
        api.operation:
          stringValue: addPet
    httpMethod: POST
    uriTemplate: /api/pets
  - attributes:
      attributes:
        api.operation:
          stringValue: findPetById
    httpMethod: GET
    uriTemplate: /api/pets/{id}
  - attributes:
      attributes:
        api.operation:
          stringValue: deletePet
    httpMethod: DELETE
    uriTemplate: /api/pets/{id}
  api_keys:
  - query: api-key

Field
Type
Description

attributes
istio.mixer.v1.Attributes

List of attributes that are generated when any of the HTTP
patterns match. This list typically includes the “api.service”
and “api.version” attributes.

patterns
HTTPAPISpecPattern[]

List of HTTP patterns to match.

apiKeys
APIKey[]

List of APIKey that describes how to extract an API-KEY from an
HTTP request. The first API-Key match found in the list is used,
i.e. ‘OR’ semantics.

The following default policies are used to generate the
request.api_key attribute if no explicit APIKey is defined.

`query: key, `query: api_key`, and then `header: x-api-key`

HTTPAPISpecBinding

HTTPAPISpecBinding defines the binding between HTTPAPISpecs and one or more
IstioService. For example, the following establishes a binding
between the HTTPAPISpec petstore and service foo in namespace bar.

apiVersion: config.istio.io/v1alpha2
kind: HTTPAPISpecBinding
metadata:
  name: my-binding
  namespace: default
spec:
  services:
  - name: foo
    namespace: bar
  api_specs:
  - name: petstore
    namespace: default

Field
Type
Description

services
IstioService[]

REQUIRED. One or more services to map the listed HTTPAPISpec onto.

apiSpecs
HTTPAPISpecReference[]

REQUIRED. One or more HTTPAPISpec references that should be mapped to
the specified service(s). The aggregate collection of match
conditions defined in the HTTPAPISpecs should not overlap.

HTTPAPISpecPattern

HTTPAPISpecPattern defines a single pattern to match against
incoming HTTP requests. The per-pattern list of attributes is
generated if both the httpmethod and uritemplate match. In
addition, the top-level list of attributes in the HTTPAPISpec is also
generated.

pattern:
- attributes
    api.operation: doFooBar
  httpMethod: GET
  uriTemplate: /foo/bar

Field
Type
Description

attributes
istio.mixer.v1.Attributes

List of attributes that are generated if the HTTP request matches
the specified httpmethod and uritemplate. This typically
includes the “api.operation” attribute.

httpMethod
string

HTTP request method to match against as defined by
rfc7231. For
example: GET, HEAD, POST, PUT, DELETE.

uriTemplate
string (oneof)

URI template to match against as defined by
rfc6570. For example, the
following are valid URI templates:

/pets
/pets/{id}
/dictionary/{term:1}/{term}
/search{?q*,lang}

regex
string (oneof)

EXPERIMENTAL:

ecmascript style regex-based match as defined by
EDCA-262. For
example,

"^/pets/(.*?)?"

HTTPAPISpecReference

HTTPAPISpecReference defines a reference to an HTTPAPISpec. This is
typically used for establishing bindings between an HTTPAPISpec and an
IstioService. For example, the following defines an
HTTPAPISpecReference for service foo in namespace bar.

- name: foo
  namespace: bar

Field
Type
Description

name
string

REQUIRED. The short name of the HTTPAPISpec. This is the resource
name defined by the metadata name field.

namespace
string

Optional namespace of the HTTPAPISpec. Defaults to the encompassing
HTTPAPISpecBinding’s metadata namespace field.

HttpClientConfig

Defines the client config for HTTP.

Field
Type
Description

transport
TransportConfig

The transport config.

serviceConfigs
map<string, ServiceConfig>

Map of control configuration indexed by destination.service. This
is used to support per-service configuration for cases where a
mixerclient serves multiple services.

defaultDestinationService
string

Default destination service name if none was specified in the
client request.

mixerAttributes
istio.mixer.v1.Attributes

Default attributes to send to Mixer in both Check and
Report. This typically includes “destination.ip” and
“destination.uid” attributes.

forwardAttributes
istio.mixer.v1.Attributes

Default attributes to forward to upstream. This typically
includes the “source.ip” and “source.uid” attributes.

IstioService

IstioService identifies a service and optionally service version.
The FQDN of the service is composed from the name, namespace, and implementation-specific domain suffix
(e.g. on Kubernetes, “reviews” + “default” + “svc.cluster.local” -> “reviews.default.svc.cluster.local”).

Field
Type
Description

name
string

The short name of the service such as “foo”.

namespace
string

Optional namespace of the service. Defaults to value of metadata namespace field.

domain
string

Domain suffix used to construct the service FQDN in implementations that support such specification.

service
string

The service FQDN.

labels
map<string, string>

Optional one or more labels that uniquely identify the service version.

Note: When used for a VirtualService destination, labels MUST be empty.

NetworkFailPolicy

Specifies the behavior when the client is unable to connect to Mixer.

Field
Type
Description

policy
NetworkFailPolicy.FailPolicy

Specifies the behavior when the client is unable to connect to Mixer.

maxRetry
uint32

Max retries on transport error.

baseRetryWait
google.protobuf.Duration

Base time to wait between retries.  Will be adjusted by exponential
backoff and jitter.

maxRetryWait
google.protobuf.Duration

Max time to wait between retries.

NetworkFailPolicy.FailPolicy

Describes the policy.

Name
Description

FAIL_OPEN

If network connection fails, request is allowed and delivered to the
service.

FAIL_CLOSE

If network connection fails, request is rejected.

Quota

Specifies a quota to use with quota name and amount.

Field
Type
Description

quota
string

The quota name to charge

charge
int64

The quota amount to charge

QuotaRule

Specifies a rule with list of matches and list of quotas.
If any clause matched, the list of quotas will be used.

Field
Type
Description

match
AttributeMatch[]

If empty, match all request.
If any of match is true, it is matched.

quotas
Quota[]

The list of quotas to charge.

QuotaSpec

Determines the quotas used for individual requests.

Field
Type
Description

rules
QuotaRule[]

A list of Quota rules.

QuotaSpecBinding

QuotaSpecBinding defines the binding between QuotaSpecs and one or more
IstioService.

Field
Type
Description

services
IstioService[]

REQUIRED. One or more services to map the listed QuotaSpec onto.

quotaSpecs
QuotaSpecBinding.QuotaSpecReference[]

REQUIRED. One or more QuotaSpec references that should be mapped to
the specified service(s). The aggregate collection of match
conditions defined in the QuotaSpecs should not overlap.

QuotaSpecBinding.QuotaSpecReference

QuotaSpecReference uniquely identifies the QuotaSpec used in the
Binding.

Field
Type
Description

name
string

REQUIRED. The short name of the QuotaSpec. This is the resource
name defined by the metadata name field.

namespace
string

Optional namespace of the QuotaSpec. Defaults to the value of the
metadata namespace field.

ServiceConfig

Defines the per-service client configuration.

Field
Type
Description

disableCheckCalls
bool

If true, do not call Mixer Check.

disableReportCalls
bool

If true, do not call Mixer Report.

mixerAttributes
istio.mixer.v1.Attributes

Send these attributes to Mixer in both Check and Report. This
typically includes the “destination.service” attribute.
In case of a per-route override, per-route attributes take precedence
over the attributes supplied in the client configuration.

httpApiSpec
HTTPAPISpec[]

HTTP API specifications to generate API attributes.

quotaSpec
QuotaSpec[]

Quota specifications to generate quota requirements.

networkFailPolicy
NetworkFailPolicy

Specifies the behavior when the client is unable to connect to Mixer.
This is the service-level policy. It overrides
[mesh-level
policy][istio.mixer.v1.config.client.TransportConfig.networkfailpolicy].

forwardAttributes
istio.mixer.v1.Attributes

Default attributes to forward to upstream. This typically
includes the “source.ip” and “source.uid” attributes.
In case of a per-route override, per-route attributes take precedence
over the attributes supplied in the client configuration.

Forwarded attributes take precedence over the static Mixer attributes.
The full order of application is as follows:
1. static Mixer attributes from the filter config;
2. static Mixer attributes from the route config;
3. forwarded attributes from the source filter config (if any);
4. forwarded attributes from the source route config (if any);
5. derived attributes from the request metadata.

StringMatch

Describes how to match a given string in HTTP headers. Match is
case-sensitive.

Field
Type
Description

exact
string (oneof)

exact string match

prefix
string (oneof)

prefix-based match

regex
string (oneof)

ECMAscript style regex-based match

TcpClientConfig

Defines the client config for TCP.

Field
Type
Description

transport
TransportConfig

The transport config.

mixerAttributes
istio.mixer.v1.Attributes

Default attributes to send to Mixer in both Check and
Report. This typically includes “destination.ip” and
“destination.uid” attributes.

disableCheckCalls
bool

If set to true, disables Mixer check calls.

disableReportCalls
bool

If set to true, disables Mixer check calls.

connectionQuotaSpec
QuotaSpec

Quota specifications to generate quota requirements.
It applies on the new TCP connections.

reportInterval
google.protobuf.Duration

Specify report interval to send periodical reports for long TCP
connections. If not specified, the interval is 10 seconds. This interval
should not be less than 1 second, otherwise it will be reset to 1 second.

TransportConfig

Defines the transport config on how to call Mixer.

Field
Type
Description

disableCheckCache
bool

The flag to disable check cache.

disableQuotaCache
bool

The flag to disable quota cache.

disableReportBatch
bool

The flag to disable report batch.

networkFailPolicy
NetworkFailPolicy

Specifies the behavior when the client is unable to connect to Mixer.
This is the mesh level policy. The default value for policy is FAIL_OPEN.

statsUpdateInterval
google.protobuf.Duration

Specify refresh interval to write Mixer client statistics to Envoy share
memory. If not specified, the interval is 10 seconds.

checkCluster
string

Name of the cluster that will forward check calls to a pool of mixer
servers. Defaults to “mixer_server”. By using different names for
checkCluster and reportCluster, it is possible to have one set of
Mixer servers handle check calls, while another set of Mixer servers
handle report calls.

NOTE: Any value other than the default “mixer_server” will require the
Istio Grafana dashboards to be reconfigured to use the new name.

reportCluster
string

Name of the cluster that will forward report calls to a pool of mixer
servers. Defaults to “mixer_server”. By using different names for
checkCluster and reportCluster, it is possible to have one set of
Mixer servers handle check calls, while another set of Mixer servers
handle report calls.

NOTE: Any value other than the default “mixer_server” will require the
Istio Grafana dashboards to be reconfigured to use the new name.

attributesForMixerProxy
istio.mixer.v1.Attributes

Default attributes to forward to Mixer upstream. This typically
includes the “source.ip” and “source.uid” attributes. These
attributes are consumed by the proxy in front of mixer.

istio.mixer.v1.Attributes

Attributes represents a set of typed name/value pairs. Many of Mixer’s
API either consume and/or return attributes.

Istio uses attributes to control the runtime behavior of services running in the service mesh.
Attributes are named and typed pieces of metadata describing ingress and egress traffic and the
environment this traffic occurs in. An Istio attribute carries a specific piece
of information such as the error code of an API request, the latency of an API request, or the
original IP address of a TCP connection. For example:

request.path: xyz/abc
request.size: 234
request.time: 12:34:56.789 04/17/2017
source.ip: 192.168.0.1
target.service: example

A given Istio deployment has a fixed vocabulary of attributes that it understands.
The specific vocabulary is determined by the set of attribute producers being used
in the deployment. The primary attribute producer in Istio is Envoy, although
specialized Mixer adapters and services can also generate attributes.

The common baseline set of attributes available in most Istio deployments is defined
here.

Attributes are strongly typed. The supported attribute types are defined by
ValueType.
Each type of value is encoded into one of the so-called transport types present
in this message.

Defines a map of attributes in uncompressed format.
Following places may use this message:
1) Configure Istio/Proxy with static per-proxy attributes, such as source.uid.
2) Service IDL definition to extract api attributes for active requests.
3) Forward attributes from client proxy to server proxy for HTTP requests.

Field
Type
Description

attributes
map<string, istio.mixer.v1.Attributes.AttributeValue>

A map of attribute name to its value.


text:
package config

import (
	"time"

	"github.com/elastic/beats/libbeat/common"
	"github.com/elastic/beats/libbeat/common/droppriv"
	"github.com/elastic/beats/packetbeat/procs"
)

type Config struct {
	Packetbeat PacketbeatConfig
}

type PacketbeatConfig struct {
	Interfaces InterfacesConfig
	Flows      *Flows
	Protocols  map[string]*common.Config
	Procs      procs.ProcsConfig
	RunOptions droppriv.RunOptions
}

type InterfacesConfig struct {
	Device         string
	Type           string
	File           string
	With_vlans     bool
	Bpf_filter     string
	Snaplen        int
	Buffer_size_mb int
	TopSpeed       bool
	Dumpfile       string
	OneAtATime     bool
	Loop           int
}

type Flows struct {
	Timeout string
	Period  string
}

type ProtocolCommon struct {
	Ports              []int         `config:"ports"`
	SendRequest        bool          `config:"send_request"`
	SendResponse       bool          `config:"send_response"`
	TransactionTimeout time.Duration `config:"transaction_timeout"`
}


text:
.stepwizard-step p {
    margin-top: 10px;
}
.stepwizard-row {
    display: table-row;
}
.stepwizard {
    display: table;
    width: 50%;
    position: relative;
}
.stepwizard-step button[disabled] {
    opacity: 1 !important;
    filter: alpha(opacity=100) !important;
}
.stepwizard-row:before {
    top: 14px;
    bottom: 0;
    position: absolute;
    content: " ";
    width: 100%;
    height: 1px;
    background-color: #ccc;
    z-order: 0;
}
.stepwizard-step {
    display: table-cell;
    text-align: center;
    position: relative;
}
.btn-circle {
    width: 30px;
    height: 30px;
    text-align: center;
    padding: 6px 0;
    font-size: 12px;
    line-height: 1.428571429;
    border-radius: 15px;
}


text:
//-----------------------------------------------------------------------------
// Copyright (c) 2016 Michael G. Brehm
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//-----------------------------------------------------------------------------

#ifndef __LINUX_SIGINFO_H_
#define __LINUX_SIGINFO_H_
#pragma once

#include "types.h"

#pragma warning(disable:4201)		// nameless struct / union

//-----------------------------------------------------------------------------
// include/uapi/asm-generic/siginfo.h
//-----------------------------------------------------------------------------

//
// TODO: THESE STRUCTURES WILL NEED TO BE SIZE-CHECKED AGAINST GLIBC/BIONIC
//

// todo: void* different sizes on x86/x64
typedef union {

	int32_t		sival_int;
	void*		sival_ptr;

} linux_sigval_t;

#define LINUX_SI_PREAMBLE_SIZE		(3 * sizeof(int32_t))
#define LINUX_SI_MAX_SIZE			128
#define LINUX_SI_PAD_SIZE			((LINUX_SI_MAX_SIZE - LINUX_SI_PREAMBLE_SIZE) / sizeof(int32_t))

#ifndef __ARCH_SI_UID_T
#define __ARCH_SI_UID_T	__kernel_uid32_t
#endif

/*
 * The default "si_band" type is "long", as specified by POSIX.
 * However, some architectures want to override this to "int"
 * for historical compatibility reasons, so we allow that.
 */
#ifndef __ARCH_SI_BAND_T
#define __ARCH_SI_BAND_T long
#endif

#ifndef __ARCH_SI_CLOCK_T
#define __ARCH_SI_CLOCK_T __kernel_clock_t
#endif

typedef struct {

	int32_t			si_signo;
	int32_t			si_errno;
	int32_t			si_code;

	union {

		int32_t		_pad[LINUX_SI_PAD_SIZE];

		/* kill() */
		struct {

			__kernel_pid_t		_pid;			/* sender's pid */
			__kernel_uid32_t	_uid;			/* sender's uid */

		} _kill;

		/* POSIX.1b timers */
		struct {

			__kernel_timer_t	_tid;			/* timer id */
			int32_t				_overrun;		/* overrun count */
			char				_pad[8];		/* sizeof(__kernel_uid32_t) - sizeof(int32_t) */
			linux_sigval_t		_sigval;		/* same as below */
			int32_t				_sys_private;	/* not to be passed to user */

		} _timer;

		/* POSIX.1b signals */
		struct {

			__kernel_pid_t		_pid;			/* sender's pid */
			__kernel_uid32_t	_uid;			/* sender's uid */
			linux_sigval_t		_sigval;

		} _rt;

		/* SIGCHLD */
		struct {

			__kernel_pid_t		_pid;			/* which child */
			__kernel_uid32_t	_uid;			/* sender's uid */
			int32_t				_status;		/* exit code */
			__kernel_clock_t	_utime;
			__kernel_clock_t	_stime;

		} _sigchld;

		/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
		struct {

			void*				_addr;			/* faulting insn/memory ref. */					// <--- void* here, be careful
			int16_t				_addr_lsb;		/* LSB of the reported address */

		} _sigfault;

		/* SIGPOLL */
		struct {

			__ARCH_SI_BAND_T	_band;			/* POLL_IN, POLL_OUT, POLL_MSG */		// <---- LONG here, be careful
			int32_t				_fd;

		} _sigpoll;

		/* SIGSYS */
		struct {

			void*				_call_addr;		/* calling user insn */						// <--- void* here
			int32_t				_syscall;		/* triggering system call number */
			uint32_t			_arch;			/* AUDIT_ARCH_* of syscall */

		} _sigsys;

	} _sifields;

} linux_siginfo32;

#define linux_si_pid			_sifields._kill._pid
#define linux_si_uid			_sifields._kill._uid
#define linux_si_tid			_sifields._timer._tid
#define linux_si_overrun		_sifields._timer._overrun
#define linux_si_sys_private	_sifields._timer._sys_private
#define linux_si_status			_sifields._sigchld._status
#define linux_si_utime			_sifields._sigchld._utime
#define linux_si_stime			_sifields._sigchld._stime
#define linux_si_value			_sifields._rt._sigval
#define linux_si_int			_sifields._rt._sigval.sival_int
#define linux_si_ptr			_sifields._rt._sigval.sival_ptr
#define linux_si_addr			_sifields._sigfault._addr
#define linux_si_addr_lsb		_sifields._sigfault._addr_lsb
#define linux_si_band			_sifields._sigpoll._band
#define linux_si_fd				_sifields._sigpoll._fd

#define LINUX_CLD_EXITED		1				/* child has exited */
#define LINUX_CLD_KILLED		2				/* child was killed */
#define LINUX_CLD_DUMPED		3				/* child terminated abnormally */
#define LINUX_CLD_TRAPPED		4				/* traced child has trapped */
#define LINUX_CLD_STOPPED		5				/* child has stopped */
#define LINUX_CLD_CONTINUED		6				/* stopped child has continued */
#define LINUX_NSIGCHLD			6

#if !defined(__midl) && defined(__cplusplus)
namespace uapi {

	// todo
	typedef linux_siginfo32		siginfo;

}	// namespace uapi
#endif	// !defined(__midl) && defined(__cplusplus)

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

#endif		// __LINUX_SIGINFO_H_


text:
<!DOCTYPE html>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Princeton ACM</title>
    <link href="https://fonts.googleapis.com/css?family=Droid+Sans:400,700" rel="stylesheet" type="text/css">
    <link type="text/css" rel="stylesheet" href="/assets/main.css">
    <link rel="icon" type="image/x-icon" href="/myfavicon.ico"/>
    <link rel="shortcut icon" type="image/x-icon" href="/myfavicon.ico"/>
    <link rel="apple-touch-icon" href="/images/acm_with_chapter.png"/>
    <link href="/feed.xml" rel="alternate" type="application/rss+xml" title="Princeton ACM" />
    <meta name="title" content="CKM Advisors ">
    <link rel="canonical" href="http://princeton.acm.org/broadcast/2013/09/12/ckm-advisors/">
    <meta property="og:title" content="CKM Advisors "/>
    <meta property="og:url" content="http://princeton.acm.org/broadcast/2013/09/12/ckm-advisors/"/>

    <meta property="og:site_name" content="Princeton ACM">

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

Home

About

Competitive Programming

Events

COSCON

Code@Night

ICPC Training

Interview Prep

Advising

Sponsors

Sponsorship Info

Get Involved

Contact

                <time pubdate datetime="2013-12-September" title="September 12, 2013">September 12, 2013</time>

CKM Advisors

Hello Princeton ACM,

My name is Marshall Louis Reaves (PhD '13), and I am a Consultant with CKM Advisors. CKM is a consulting firm headquartered in New York City that serves clients throughout the United States and around the world. We operate at the forefront of the development and application of analytics and create pioneering methods for strategy development and performance improvement. Our teams are comprised of highly talented individuals with deep expertise in data science and consulting. We are actively recruiting technically talented students to join our team as Consultants or Data Scientists, so I wanted to reach out to ACM because we believe that your members would be an excellent fit.

We are looking for top students with an interest in business and a passion for learning and developing new quantitative techniques to join us as Data Scientists. Students with a passion for analyzing complex business issues and developing recommendations based on rigorous analysis of large and complex data sets typically join our team as Consultants. We hire undergraduates, Masters students, and PhD candidates from a diverse array of academic backgrounds and encourage anyone with an interest in business, problem solving, or complex data analysis to consider the opportunities available at CKM.

We will be visiting Princeton on 9/24 and will have an informational session and interview workshop to further discuss the work that Consultants and Data Scientists do at our firm.  We would appreciate it if you could pass along this information to your listserve so that anyone interested is able to attend. I'll to reach out again as that date approaches.

If you have any questions or would like more information about our firm, please see our website at ckmadvisors.com, read our job postings on Princeton's job board, or email me and I am happy to talk to you further.Thank you very much for your consideration and your help.</p>

Kind Regards,

Marshall Louis Reaves, PhD

        © 2022

            ACM Student Chapter of Princeton, Inc.
            ·About
            ·Join Us

            <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="currentColor" class="bi bi-github" viewBox="0 0 16 16">
                <path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/>
            </svg>


text:
'use strict';

const expect = require('chai').expect;
const FastBoot = require('fastboot');
const fastbootMiddleware = require('./../src/index');
const fixture = require('./helpers/fixture-path');
const TestHTTPServer = require('./helpers/test-http-server');

describe('FastBoot', function() {
  let server;

  this.timeout(10000);

  afterEach(function() {
    if (server) {
      server.stop();
      server = null;
    }
  });

  it('throws an exception if no distPath is provided', function() {
    let fn = function() {
      fastbootMiddleware();
    };

    expect(fn).to.throw(/You must instantiate FastBoot with a distPath option/);
  });

  it('can provide distPath as the first argument', async function() {
    let middleware = fastbootMiddleware(fixture('basic-app'));
    server = new TestHTTPServer(middleware);
    await server.start();

    let html = await server.request('/');
    expect(html).to.match(/Welcome to Ember/);
  });

  it('can provide distPath as an option', async function() {
    let middleware = fastbootMiddleware({
      distPath: fixture('basic-app'),
    });
    server = new TestHTTPServer(middleware);
    await server.start();

    let html = await server.request('/');
    expect(html).to.match(/Welcome to Ember/);
  });

  it('can be provided with a custom FastBoot instance', async function() {
    let fastboot = new FastBoot({
      distPath: fixture('basic-app'),
    });

    let middleware = fastbootMiddleware({
      fastboot: fastboot,
    });

    server = new TestHTTPServer(middleware);
    await server.start();

    let html = await server.request('/');
    expect(html).to.match(/Welcome to Ember/);
  });

  it('can reload the FastBoot instance', async function() {
    let fastboot = new FastBoot({
      distPath: fixture('basic-app'),
    });

    let middleware = fastbootMiddleware({
      fastboot: fastboot,
    });

    server = new TestHTTPServer(middleware);
    await server.start();

    let html = await server.request('/');
    expect(html).to.match(/Welcome to Ember/);

    fastboot.reload({
      distPath: fixture('hot-swap-app'),
    });

    html = await server.request('/');
    expect(html).to.match(/Goodbye from Ember/);
  });

  it('it appends multivalue headers', async function() {
    let middleware = fastbootMiddleware(fixture('multivalue-headers'));
    server = new TestHTTPServer(middleware);
    await server.start();

    let { headers } = await server.request('/', { resolveWithFullResponse: true });
    expect(headers['x-fastboot']).to.eq('a, b, c');
  });

  it('can pass metadata info to the app', async function() {
    let middleware = fastbootMiddleware({
      distPath: fixture('app-with-metadata'),
      visitOptions: {
        metadata: 'Fastboot Metadata',
      },
    });
    server = new TestHTTPServer(middleware);
    await server.start();

    let html = await server.request('/');
    expect(html).to.match(/Fastboot Metadata/);
  });

  // FIXME:
  // TODO:
  // https://github.com/ember-fastboot/ember-cli-fastboot/pull/840#issuecomment-894329631
  it.skip('works without metadata passed', async function() {
    let middleware = fastbootMiddleware({
      distPath: fixture('app-with-metadata'),
    });
    server = new TestHTTPServer(middleware);
    await server.start();

    let html = await server.request('/');
    expect(html).to.match(/Hello Ember!/);
  });

  /* eslint-disable mocha/no-setup-in-describe */
  [true, false].forEach(chunkedResponse => {
    describe(`when chunked response is ${chunkedResponse ? 'enabled' : 'disabled'}`, function() {
      if (chunkedResponse) {
        it('responds with a chunked response', async function() {
          let middleware = fastbootMiddleware({
            distPath: fixture('basic-app'),
            chunkedResponse,
          });
          server = new TestHTTPServer(middleware, { errorHandling: true });
          await server.start();

          let { body, headers } = await server.request('/', { resolveWithFullResponse: true });
          expect(headers['transfer-encoding']).to.eq('chunked');
          expect(body).to.match(/Welcome to Ember/);
        });
      }

      it("returns 404 when navigating to a URL that doesn't exist", async function() {
        let middleware = fastbootMiddleware({
          distPath: fixture('basic-app'),
          chunkedResponse,
        });
        server = new TestHTTPServer(middleware);
        await server.start();

        try {
          await server.request('/foo-bar-baz/non-existent');
        } catch (error) {
          expect(error.statusCode).to.equal(404);
        }
      });

      it('returns a 500 error if an error occurs', async function() {
        let middleware = fastbootMiddleware({
          distPath: fixture('rejected-promise'),
          chunkedResponse,
        });
        server = new TestHTTPServer(middleware);
        await server.start();

        try {
          await server.request('/');
        } catch (error) {
          expect(error.message).to.match(/Rejected on purpose/);
        }
      });

      describe('when resilient mode is enabled', function() {
        it('renders no FastBoot markup', async function() {
          let middleware = fastbootMiddleware({
            distPath: fixture('rejected-promise'),
            resilient: true,
            chunkedResponse,
          });
          server = new TestHTTPServer(middleware);
          await server.start();

          let html = await server.request('/');
          expect(html).to.not.match(/error/);
        });

        it('propagates to error handling middleware', async function() {
          let middleware = fastbootMiddleware({
            distPath: fixture('rejected-promise'),
            resilient: true,
            chunkedResponse,
          });
          server = new TestHTTPServer(middleware, { errorHandling: true });
          await server.start();

          let { body, statusCode, headers } = await server.request('/', {
            resolveWithFullResponse: true,
          });
          expect(statusCode).to.equal(200);
          expect(headers['x-test-error']).to.match(/error handler called/);
          expect(body).to.match(/hello world/);
        });

        it('is does not propagate errors when and there is no error handling middleware', async function() {
          let middleware = fastbootMiddleware({
            distPath: fixture('rejected-promise'),
            resilient: true,
            chunkedResponse,
          });
          server = new TestHTTPServer(middleware, { errorHandling: false });
          await server.start();

          let { body, statusCode, headers } = await server.request('/', {
            resolveWithFullResponse: true,
          });
          expect(statusCode).to.equal(200);
          expect(headers['x-test-error']).to.not.match(/error handler called/);
          expect(body).to.not.match(/error/);
          expect(body).to.match(/hello world/);
        });

        it('allows post-fastboot middleware to recover the response when it fails', async function() {
          let middleware = fastbootMiddleware({
            distPath: fixture('rejected-promise'),
            resilient: true,
            chunkedResponse,
          });
          server = new TestHTTPServer(middleware, { recoverErrors: true });
          await server.start();

          let { body, statusCode, headers } = await server.request('/', {
            resolveWithFullResponse: true,
          });
          expect(statusCode).to.equal(200);
          expect(headers['x-test-recovery']).to.match(/recovered response/);
          expect(body).to.match(/hello world/);
        });
      });

      describe('when resilient mode is disabled', function() {
        it('propagates to error handling middleware', async function() {
          let middleware = fastbootMiddleware({
            distPath: fixture('rejected-promise'),
            resilient: false,
            chunkedResponse,
          });
          server = new TestHTTPServer(middleware, { errorHandling: true });
          await server.start();

          try {
            await server.request('/', {
              resolveWithFullResponse: true,
            });
          } catch ({ statusCode, response: { headers } }) {
            expect(statusCode).to.equal(500);
            expect(headers['x-test-error']).to.match(/error handler called/);
          }
        });

        it('allows post-fastboot middleware to recover the response when it fails', async function() {
          let middleware = fastbootMiddleware({
            distPath: fixture('rejected-promise'),
            resilient: false,
            chunkedResponse,
          });
          server = new TestHTTPServer(middleware, { recoverErrors: true });
          await server.start();

          let { body, statusCode, headers } = await server.request('/', {
            resolveWithFullResponse: true,
          });
          expect(statusCode).to.equal(200);
          expect(headers['x-test-recovery']).to.match(/recovered response/);
          expect(body).to.match(/hello world/);
        });
      });
    });
  });
  /* eslint-enable mocha/no-setup-in-describe */
});