text:
<!DOCTYPE html>

  <title>Gradience - By Digifreax-Studio</title>
  <meta charset="utf-8">
  <meta content="IE=edge" http-equiv="X-UA-Compatible">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">
  <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
  <link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/styles/shCoreDefault.min.css" />
  <link href="css/bootstrap.css" rel="stylesheet">
  <link href="css/demo.css" rel="stylesheet">
  <link href="https://cdn.datatables.net/plug-ins/1.10.6/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet">

      <button type="button" data-toggle="collapse" data-target="#navbar-top" class="navbar-toggle collapsed" aria-expanded="false" aria-controls="navbar">    </button> Gradience

Components

CSS

JavaScript

Installation

Documentation

Typeahead

Datatable

Modal

Tab

Tooltip

Popover

Alert

Button

Collapse

Carousel

Gradience

Modern skin built with latest bootstrap for all web-design and development projects.

Learn more

Example

Typeahead.js

Gradience allow us to quickly and easily add auto complete to any text input in our web page using typeahead.js. thanks to hyspace their typeahead.js-bootstrap3.less project you can now style typeahead.js component to integrates seamlessly with bootstrap design.

                <input class="form-control" id="typeahead-example" type="text" placeholder="Type Your Favourite Country Name.." autocomplete="off">

            <button data-role="source-anim" class="btn btn-primary" type="button" data-toggle="collapse" data-target="#typeahead-coll" style="margin-bottom: 14px;">  View Source </button>

How to use

<!DOCTYPE html>
<html>
  <head>
    <!--
       Meta tags
    -->
    <!-- Extensions (Required) -->
    <link href="candystrap/css/extensions.min.css" rel="stylesheet">
  </head>
  <body>
    <input id="typeahead-example"class="form-control" type="text" placeholder="Enter popular Indian city name">
    <!--
       jQuery & other libraries
    -->
    <!-- Typeahead.js -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.10.4/typeahead.bundle.min.js" type="text/javascript"></script>
    <script type="text/javascript">
      (function($) {
        var cities, datums;
        datums = function(cities) {
          return function(query, callback) {
            var matches, regex;
            matches = [];
            regex = new RegExp(query, 'i');
            $.each(cities, function(i, city) {
              if (regex.test(city)) {
                return matches.push({
                  value: city
                });
              }
            });
            return callback(matches);
          };
        };
        cities = ["Chennai", "Dehradun", "Delhi", "Bombay", "Kolkata", "Lucknow", "Mirzapur", "Varanasi"];
        $("#typeahead-example").typeahead({
          highlight: true,
          hint: true,
          minLength: 1
        }, {
          displayKey: "value",
          name: "cities",
          source: datums(cities)
        });
      })(jQuery);
    </script>
  </body>
<html>

Example

Datatable

Gradience make is very easy for you to integrate DataTables with in your applications as bootstrap styles for datatables comes pre compiled, thanks to misantron for his project datatables-bootstrap3-plugin see below example and experience how easy it is to get started.   >_

                      Name
                      Position
                      Office
                      Age
                      Start date
                      Salary

                      Name
                      Position
                      Office
                      Age
                      Start date
                      Salary

                      Tiger Nixon
                      System Architect
                      Edinburgh
                      61
                      2011/04/25
                      $320,800

                      Garrett Winters
                      Accountant
                      Tokyo
                      63
                      2011/07/25
                      $170,750

                      Ashton Cox
                      Junior Technical Author
                      San Francisco
                      66
                      2009/01/12
                      $86,000

                      Cedric Kelly
                      Senior Javascript Developer
                      Edinburgh
                      22
                      2012/03/29
                      $433,060

                      Airi Satou
                      Accountant
                      Tokyo
                      33
                      2008/11/28
                      $162,700

                      Brielle Williamson
                      Integration Specialist
                      New York
                      61
                      2012/12/02
                      $372,000

                      Herrod Chandler
                      Sales Assistant
                      San Francisco
                      59
                      2012/08/06
                      $137,500

                      Rhona Davidson
                      Integration Specialist
                      Tokyo
                      55
                      2010/10/14
                      $327,900

                      Colleen Hurst
                      Javascript Developer
                      San Francisco
                      39
                      2009/09/15
                      $205,500

                      Sonya Frost
                      Software Engineer
                      Edinburgh
                      23
                      2008/12/13
                      $103,600

                      Jena Gaines
                      Office Manager
                      London
                      30
                      2008/12/19
                      $90,560

                      Quinn Flynn
                      Support Lead
                      Edinburgh
                      22
                      2013/03/03
                      $342,000

                      Charde Marshall
                      Regional Director
                      San Francisco
                      36
                      2008/10/16
                      $470,600

                      Haley Kennedy
                      Senior Marketing Designer
                      London
                      43
                      2012/12/18
                      $313,500

                      Tatyana Fitzpatrick
                      Regional Director
                      London
                      19
                      2010/03/17
                      $385,750

                      Michael Silva
                      Marketing Designer
                      London
                      66
                      2012/11/27
                      $198,500

                      Paul Byrd
                      Chief Financial Officer (CFO)
                      New York
                      64
                      2010/06/09
                      $725,000

                      Gloria Little
                      Systems Administrator
                      New York
                      59
                      2009/04/10
                      $237,500

                      Bradley Greer
                      Software Engineer
                      London
                      41
                      2012/10/13
                      $132,000

                      Dai Rios
                      Personnel Lead
                      Edinburgh
                      35
                      2012/09/26
                      $217,500

                      Jenette Caldwell
                      Development Lead
                      New York
                      30
                      2011/09/03
                      $345,000

                      Yuri Berry
                      Chief Marketing Officer (CMO)
                      New York
                      40
                      2009/06/25
                      $675,000

                      Caesar Vance
                      Pre-Sales Support
                      New York
                      21
                      2011/12/12
                      $106,450

                      Doris Wilder
                      Sales Assistant
                      Sidney
                      23
                      2010/09/20
                      $85,600

                      Angelica Ramos
                      Chief Executive Officer (CEO)
                      London
                      47
                      2009/10/09
                      $1,200,000

                      Gavin Joyce
                      Developer
                      Edinburgh
                      42
                      2010/12/22
                      $92,575

                      Jennifer Chang
                      Regional Director
                      Singapore
                      28
                      2010/11/14
                      $357,650

                      Brenden Wagner
                      Software Engineer
                      San Francisco
                      28
                      2011/06/07
                      $206,850

                      Fiona Green
                      Chief Operating Officer (COO)
                      San Francisco
                      48
                      2010/03/11
                      $850,000

                      Shou Itou
                      Regional Marketing
                      Tokyo
                      20
                      2011/08/14
                      $163,000

                      Michelle House
                      Integration Specialist
                      Sidney
                      37
                      2011/06/02
                      $95,400

                      Suki Burks
                      Developer
                      London
                      53
                      2009/10/22
                      $114,500

                      Prescott Bartlett
                      Technical Author
                      London
                      27
                      2011/05/07
                      $145,000

                      Gavin Cortez
                      Team Leader
                      San Francisco
                      22
                      2008/10/26
                      $235,500

                      Martena Mccray
                      Post-Sales support
                      Edinburgh
                      46
                      2011/03/09
                      $324,050

                      Unity Butler
                      Marketing Designer
                      San Francisco
                      47
                      2009/12/09
                      $85,675

                      Howard Hatfield
                      Office Manager
                      San Francisco
                      51
                      2008/12/16
                      $164,500

                      Hope Fuentes
                      Secretary
                      San Francisco
                      41
                      2010/02/12
                      $109,850

                      Vivian Harrell
                      Financial Controller
                      San Francisco
                      62
                      2009/02/14
                      $452,500

                      Timothy Mooney
                      Office Manager
                      London
                      37
                      2008/12/11
                      $136,200

                      Jackson Bradshaw
                      Director
                      New York
                      65
                      2008/09/26
                      $645,750

                      Olivia Liang
                      Support Engineer
                      Singapore
                      64
                      2011/02/03
                      $234,500

                      Bruno Nash
                      Software Engineer
                      London
                      38
                      2011/05/03
                      $163,500

                      Sakura Yamamoto
                      Support Engineer
                      Tokyo
                      37
                      2009/08/19
                      $139,575

                      Thor Walton
                      Developer
                      New York
                      61
                      2013/08/11
                      $98,540

                      Finn Camacho
                      Support Engineer
                      San Francisco
                      47
                      2009/07/07
                      $87,500

                      Serge Baldwin
                      Data Coordinator
                      Singapore
                      64
                      2012/04/09
                      $138,575

                      Zenaida Frank
                      Software Engineer
                      New York
                      63
                      2010/01/04
                      $125,250

                      Zorita Serrano
                      Software Engineer
                      San Francisco
                      56
                      2012/06/01
                      $115,000

                      Jennifer Acosta
                      Junior Javascript Developer
                      Edinburgh
                      43
                      2013/02/01
                      $75,650

                      Cara Stevens
                      Sales Assistant
                      New York
                      46
                      2011/12/06
                      $145,600

                      Hermione Butler
                      Regional Director
                      London
                      47
                      2011/03/21
                      $356,250

                      Lael Greer
                      Systems Administrator
                      London
                      21
                      2009/02/27
                      $103,500

                      Jonas Alexander
                      Developer
                      San Francisco
                      30
                      2010/07/14
                      $86,500

                      Shad Decker
                      Regional Director
                      Edinburgh
                      51
                      2008/11/13
                      $183,000

                      Michael Bruce
                      Javascript Developer
                      Singapore
                      29
                      2011/06/27
                      $183,000

                      Donna Snider
                      Customer Support
                      New York
                      27
                      2011/01/25
                      $112,000

                <button data-role="source-anim" class="btn btn-primary" type="button" data-toggle="collapse" data-target="#datatable-coll" style="margin-bottom: 14px;">  View Source </button>

How to use

                    <html>
                      <head>

                      </head>
                      <body>

                            Name
                            Position
                            Office
                            Extension
                            Start Date
                            Salaray

                            Name
                            Position
                            Office
                            Extension
                            Start Date
                            Salaray

                        <script src="https://cdn.datatables.net/1.10.5/js/jquery.dataTables.min.js" type="text/javascript"></script>

                        <script src="https://cdn.rawgit.com/misantron/datatables-bootstrap3-plugin/master/media/js/datatables-bootstrap3.min.js" type="text/javascript"></script>
                        <script type="text/javascript">
                          (function($) {
                            $("#datatable-example").DataTable({
                              ajax: 'your/ajax/source.json'
                            });
                          })(jQuery);
                        </script>
                      </body>
                    <html>

Example

Modals

Static Example

A rendered modal with header, body, and set of actions in the footer.

                            <button type="button" class="close"> × </button>

Modal Title

One fine body…

                            <button type="button" class="btn btn-sm btn-default">Close</button>
                            <button type="button" class="btn btn-sm btn-info">Save changes</button>

Contextual Modal

Use this code .modal-header with .modal-default, .modal-primary, .modal-success, .modal-info, .modal-warning, .modal-danger

                  <button type="button" class="btn btn-default" data-toggle="modal" data-target="#myModal5">Default</button>

                          <button type="button" class="close" data-dismiss="modal">Close</button>

Modal title

                            sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, us odio, vestibulum in vulputate at, t us odio, vestibulum in vulputate at, t us odio, vestibulum in vulputate at, t tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla.

                          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                          <button type="button" class="btn btn-default">Save changes</button>

                  <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">Primary</button>

                        <button type="button" class="close" data-dismiss="modal">Close</button>

Modal title

                          sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, us odio, vestibulum in vulputate at, t us odio, vestibulum in vulputate at, t us odio, vestibulum in vulputate at, t tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla.

                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                        <button type="button" class="btn btn-primary">Save changes</button>

                  <button type="button" class="btn btn-success" data-toggle="modal" data-target="#myModal1">Success</button>

                          <button type="button" class="close" data-dismiss="modal">Close</button>

Modal title

                            sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, us odio, vestibulum in vulputate at, t us odio, vestibulum in vulputate at, t us odio, vestibulum in vulputate at, t tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla.

                          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                          <button type="button" class="btn btn-success">Save changes</button>

                  <button type="button" class="btn btn-info" data-toggle="modal" data-target="#myModal2">info</button>

                          <button type="button" class="close" data-dismiss="modal">Close</button>

Modal title

                            sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, us odio, vestibulum in vulputate at, t us odio, vestibulum in vulputate at, t us odio, vestibulum in vulputate at, t tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla.

                          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                          <button type="button" class="btn btn-info">Save changes</button>

                  <button type="button" class="btn btn-warning" data-toggle="modal" data-target="#myModal3">Warning</button>

                          <button type="button" class="close" data-dismiss="modal">Close</button>

Modal title

                            sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, us odio, vestibulum in vulputate at, t us odio, vestibulum in vulputate at, t us odio, vestibulum in vulputate at, t tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla.

                          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                          <button type="button" class="btn btn-warning">Save changes</button>

                  <button type="button" class="btn btn-danger" data-toggle="modal" data-target="#myModal4">Danger</button>

                          <button type="button" class="close" data-dismiss="modal">Close</button>

Modal title

                            sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, us odio, vestibulum in vulputate at, t us odio, vestibulum in vulputate at, t us odio, vestibulum in vulputate at, t tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla.

                          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                          <button type="button" class="btn btn-danger">Save changes</button>

            <button data-role="source-anim" class="btn btn-primary" type="button" data-toggle="collapse" data-target="#modal-coll" style="margin-bottom: 14px;">  View Source </button>

How to use

Jumbotron

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

Learn more

Example

Tab

Jumbotron a lightweight, flexible component that can optionally extend the entire viewport to showcase key content on your site.

Home

Profile

                    Dropdown

@fat

@mdo

Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.

Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.

            <button data-role="source-anim" class="btn btn-primary" type="button" data-toggle="collapse" data-target="#tab-coll" style="margin-bottom: 14px;">  View Source </button>

How to use

Jumbotron

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

Learn more

Example

Tooltip

Jumbotron a lightweight, flexible component that can optionally extend the entire viewport to showcase key content on your site.

                  <button type="button" class="btn btn-default btn-block" data-toggle="tooltip" data-placement="left" title="" data-original-title="Tooltip on left">Left
                  </button>

                  <button type="button" class="btn btn-info btn-block" data-toggle="tooltip" data-placement="top" title="" data-original-title="Tooltip on top">Top
                  </button>

                  <button type="button" class="btn btn-warning btn-block" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Tooltip on bottom">Bottom
                  </button>

                  <button type="button" class="btn btn-primary btn-block" data-toggle="tooltip" data-placement="right" title="" data-original-title="Tooltip on right">Right
                  </button>

            <button data-role="source-anim" class="btn btn-primary" type="button" data-toggle="collapse" data-target="#tooltip-coll" style="margin-bottom: 14px;">  View Source </button>

How to use

Jumbotron

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

Learn more

Example

Popover

Jumbotron a lightweight, flexible component that can optionally extend the entire viewport to showcase key content on your site.

                  <button type="button" class="btn btn-default btn-block" data-container="body" title="" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." data-original-title="Popover title">
                    Left
                  </button>

                  <button type="button" class="btn btn-success btn-block" data-container="body" title="" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." data-original-title="Popover title">
                    Top
                  </button>

                  <button type="button" class="btn btn-danger btn-block" data-container="body" title="" data-toggle="popover" data-placement="bottom" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." data-original-title="Popover title">
                    Bottom
                  </button>

                  <button type="button" class="btn btn-warning btn-block" data-container="body" title="" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." data-original-title="Popover title">
                    Right
                  </button>

            <button data-role="source-anim" class="btn btn-primary" type="button" data-toggle="collapse" data-target="#popover-coll" style="margin-bottom: 14px;">  View Source </button>

How to use

Jumbotron

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

Learn more

Example

Alert

Jumbotron a lightweight, flexible component that can optionally extend the entire viewport to showcase key content on your site.

                    <button type="button" class="close" data-dismiss="alert">×</button>

 Primary!

                    Heads up! This alert needs your attention, but it's not super important.

                    <button type="button" class="close" data-dismiss="alert">×</button>

 Success!

                    Well done! You successfully read this important alert message.

                    <button type="button" class="close" data-dismiss="alert">×</button>

 Info!

                    Heads up! This alert needs your attention, but it's not super important.

                    <button type="button" class="close" data-dismiss="alert">×</button>

 Warning!

Best check yo self, you're not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

                    <button type="button" class="close" data-dismiss="alert">×</button>

 Danger!

                    Oh snap! Change a few things up and try submitting again.

            <button data-role="source-anim" class="btn btn-primary" type="button" data-toggle="collapse" data-target="#alert-coll" style="margin-bottom: 14px;">  View Source </button>

How to use

Jumbotron

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

Learn more

Example

Buttons

Jumbotron a lightweight, flexible component that can optionally extend the entire viewport to showcase key content on your site.

Stateful

Add data-loading-text="Loading..." to use a loading state on a button.

              <button type="button" id="loading-button" data-loading-text="Loading..." class="btn btn-primary" autocomplete="off">
                Loading state
              </button>

Single toggle

Add data-toggle="button" to activate toggling on a single button.

                  <button type="button" class="btn btn-primary" data-toggle="button" aria-pressed="false">Single toggle</button>

Checkbox / Radio

Add data-toggle="buttons" to a .btn-group containing checkbox or radio inputs to enable toggling in their respective styles.

Checkbox

                      <input type="checkbox"> Checkbox 1 (pre-checked)

                      <input type="checkbox"> Checkbox 2

                      <input type="checkbox"> Checkbox 3

Radio

                      <input type="radio" name="options" id="option1"> Radio 1 (preselected)

                      <input type="radio" name="options" id="option2"> Radio 2

                      <input type="radio" name="options" id="option3"> Radio 3

            <button data-role="source-anim" class="btn btn-primary" type="button" data-toggle="collapse" data-target="#buttons-coll" style="margin-bottom: 14px;">  View Source </button>

How to use

Jumbotron

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

Learn more

Made By Naveen Kumar © 2015.

Code released under the Commercial License.

          Based on Bootstrap. Icons from Font Awesome. Web fonts from Google.


text:
	@if(!empty($params['title'])){{ $params['title'] }}@else{{ $field }}@endif @if(in_array('required', array_keys($params['attributes']))) *@endif
	<input type="date" class="form-control @if(!empty($params['attributes']['class'])){{ $params['attributes']['class'] }}@endif"
		id="{{ $field }}" name="{{ $field }}"
		placeholder="{{ $params['title'] }}" value="{{ $record->$field->toRfc3339String() }}"
		@if(!empty($params['attributes']))
			@foreach($params['attributes'] as $k=>$v)
				@if(!empty($k))
					{{ $k }}="{{ $v }}"
				@endif
			@endforeach
		@endif
	>

redpajama_set_name: RedPajamaGithub


text:
package io.aos.endpoint.socket.bio;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

public class BioTcpKnockKnockServer {

    public static void main(String... args) throws IOException {

        ServerSocket serverSocket = null;

        try {
            serverSocket = new ServerSocket(4444);
        } catch (IOException e) {
            System.err.println("Could not listen on port: 4444.");
            System.exit(1);
        }

        Socket clientSocket = null;

        try {
            clientSocket = serverSocket.accept();
        } catch (IOException e) {
            System.err.println("Accept failed.");
            System.exit(1);
        }

        PrintWriter outputStream = new PrintWriter(clientSocket.getOutputStream(), true);
        BufferedReader inputStream= new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
        String inputLine, outputLine;

        BioTcpKnockKnockProtocol kkp = new BioTcpKnockKnockProtocol();

        outputLine = kkp.processInput(null);
        outputStream.println(outputLine);

        while ((inputLine = inputStream.readLine()) != null) {
            outputLine = kkp.processInput(inputLine);
            outputStream.println(outputLine);
            if (outputLine.equals("Bye."))
                break;
        }

        outputStream.close();
        inputStream.close();

        clientSocket.close();

        serverSocket.close();

    }

}


text:
const { assert, skip, test, module: describe, only } = require('qunit');
const { GPU, utils } = require('../../../../../../src');
const { loadImage, imageToArray, check2DImage } = require('../../../../../browser-test-utils');

describe('feature: to-string unsigned precision constants HTMLImage');

function testArgument(mode, done) {
  loadImages(['jellyfish-1.jpeg', 'jellyfish-2.jpeg'])
    .then(([image1, image2]) => {
      const gpu = new GPU({mode});
      const originalKernel = gpu.createKernel(function () {
        const pixel = this.constants.a[0][0];
        return pixel.b * 255;
      }, {
        output: [1],
        precision: 'unsigned',
        constants: { a: image1 }
      });
      const canvas = originalKernel.canvas;
      const context = originalKernel.context;
      assert.deepEqual(originalKernel()[0], 253);
      const kernelString = originalKernel.toString();
      const newKernel = new Function('return ' + kernelString)()({
        context,
        canvas,
        constants: {
          a: image2
        }
      });
      assert.deepEqual(newKernel()[0], 255);
      gpu.destroy();
      done();
    });
}

(GPU.isWebGLSupported ? test : skip)('webgl', t => {
  testArgument('webgl', t.async());
});

(GPU.isWebGL2Supported ? test : skip)('webgl2', t => {
  testArgument('webgl2', t.async());
});


text:
package org.sjanisch.skillview.core.contribution.api;

/**
 * Defines an exception that could occur during the retrieval process of
 * contributions.
 *
 * @author sebastianjanisch
 *
 */
public class ContributionRetrievalException extends RuntimeException {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	public ContributionRetrievalException(String message, Throwable cause) {
		super(message, cause);
	}

}


text:
var gulp = require('gulp');
var config = require('../config');
var watch = require('gulp-watch');
var _ = require('lodash');

gulp.task('watch', ['setWatch', 'browserSync'], function () {
    var watched = [
        {
            PATH: config.view.files,
            task: "view"
        },
        {
            PATH: config.style.src.less,
            task: "style"
        },
        {
            PATH: config.style.src.scss,
            task: "style"
        },
        {
            PATH: config.images.src,
            task: "images"
        },
        {
            PATH: config.assets.src,
            task: "assets"
        },
        {
            PATH: config.sprites.src,
            task: "sprites"
        },
        {
            PATH: config.angularTemplates.src,
            task: "angular-templates"
        },
        {
            PATH: config.angularComponentTemplates.src,
            task: "angular-components-templates"
        }
    ];

    _.forEach(watched, function (watched) {
        watch(watched.PATH , function () {
            gulp.start(watched.task);
        });
    });
});


text:
package com.chiralbehaviors.janus.testClasses;

/**
 *
 * @author Hal Hildebrand
 *
 */

public interface MixIn1 {
    Composite1 getComposite();

    MixIn2 getFriend1();

    String m11();

    String m12();

    String m13(String arg1, String arg2, String arg3);
}


text:
import os

import logging
import logging.handlers
import logging.config

def get_logger( logroot, app, logging_cfg):
    """
    create all logging files
    """

    logging_cfg['handlers']['debug']['filename'] = os.sep.join([logroot, app+ '_debug.log'])
    logging_cfg['handlers']['info']['filename'] = os.sep.join([logroot, app+ '_info.log'])
    logging_cfg['handlers']['warning']['filename'] = os.sep.join([logroot, app+ '_warning.log'])
    logging_cfg['handlers']['error']['filename'] = os.sep.join([logroot, app+ '_error.log'])
    logging_cfg['handlers']['performance']['filename'] = os.sep.join([logroot, app+ '_performance.log'])

    logging.config.dictConfig( logging_cfg )

    logger = logging.getLogger(app)

    return logger


text:
<TITLE>Review for Mask of Zorro, The (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Mask of Zorro, The (1998)

reviewed by
Seth Bookey

The Mask of Zorro (1998)

Seen on 14 July 1998 with Andrea and Patrick at the UA 64th and Second.
Studio preview.

The Zorro tale has been treated more than two dozen times in movies, since
the silent days. I was not completely familiar with it, though, and until
recently the most exposure I had to it was my plate-and-mug set from
childhood. I liked the marketing, so it follows I would like the movie
too.

The previews for *The Mask of Zorro* were quite long and practically gave
away the whole movie. So I thought I knew what to expect. I was wrong.
There was a lot more intelligence and thought in this recent incarnation.
It's got a lot of humor and wit to go along with all the swashbuckling and
swaggering.

There is some heavyhandedness, melodrama, and even some outright
silliness, but the movie is enjoyable nonetheless. It is fast-paced and
engaging. Perfect for a summer movie, and a lot more rollicking than any
of those comets or lizards bent on destroying New York City.

The story is your basic good-versus-evil tale. Don Rafael Montero (Stuart
Wilson) is an inate baddie who is raping the resources of Mexican-held
California in 1821. He is more than willing to kill innocents to lure the
mysterious Zorro out into the open. But Zorros is able to fend off
countless attackers with vigor and swordsmanship. He gets a little help
from the Murrieta brothers along the way.

Flash ahead to 20 years later. Don Rafael has arrested Don Diego de la
Vega (Anthony Hopkins) and absconded to Spain with Elena de la Vega as his
own daughter. But he returns as governor of California and brings her
fully grown back (with Catherine Zeta-Jones as the full-figured Elena)
with him. De la Vega gets out of prison and is seeking revenge. Along the
way he re-encounters the grown-up Alejandro Murrieta (Antonio Banderas),
now an ungroomed horsethief. A tale of revenge and honor ensues, as worthy
of the tradition as other tales of this ilk, like the better known *Count
of Monte Cristo*. Both Zorros are heroes to the people; the elder Zorro is
a rich man who doesn't have to help anyone, but follows a higher moral
code. I guess that's what makes him so sexy. That, and long hair. It all
depends on whom is asked.

While Don Rafael and a younger baddie, Captain Love (Matthew Letscher)
scheme to use California gold to buy the land from the Mexican government,
using natives to mine in in concentration-camp-like conditions, de la Vega
mentors Murrieta in swordsmanship and charm so they can both exact revenge
on their mortal enemies. These are among the most enjoyable scenes.

There is a lot of swordplay and impossible escapes in *The Mask of Zorro*,
some of them very comic. Some of them are also very heartstopping. It is
all abetted by great music and lavish costumes and set design.

Hopkins is by far the best actor in the bunch. Catherine Zeta Jones is
rather good also (watch for her "cleavage stage right" scene). Bandaras is
pretty good too; it's hard to believe, sometimes, that he's not just there
to look good and make a good percentage of the audience pant with sexual
desire. He's not a bad actor, but he's no Anthony Hopkins, who's not made
a bad movie for the past decade. But, Hopkins and Bandaras are both worthy
successors to the mantle first made famous by Douglas Fairbanks in the
silent era. He did his own stunts though. Today a small army is on hand to
help in that department.

Directed by Martin Campbell; original music by James Horner; production
design by Cecilia Montiel; costume design by Graciela Mazón.

Audience Note: A woman in front of us actually *gasped* when Don Rafael
opened a box to reveal a single bar of gold. Andrea and I could not stop
laughing.

Historical Note: Four years after the fictional Zorro story ends, the US
steals half or Mexico or more and we all lived happily ever after. Except
for the Mexicans.
Copyright (c) 1998, Seth J. Bookey, New York, NY 10021
sethbook@panix.com; http://www.panix.com/~sethbook

More movie reviews by Seth Bookey, with graphics, can be found at
http://www.geocities.com/Athens/2679/kino.html

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.Search.Models
{
    public partial class SearchPrivateLinkResourceProperties
    {
        internal static SearchPrivateLinkResourceProperties DeserializeSearchPrivateLinkResourceProperties(JsonElement element)
        {
            Optional<string> groupId = default;
            Optional<IReadOnlyList<string>> requiredMembers = default;
            Optional<IReadOnlyList<string>> requiredZoneNames = default;
            Optional<IReadOnlyList<ShareableSearchServicePrivateLinkResourceType>> shareablePrivateLinkResourceTypes = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("groupId"))
                {
                    groupId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("requiredMembers"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<string> array = new List<string>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(item.GetString());
                    }
                    requiredMembers = array;
                    continue;
                }
                if (property.NameEquals("requiredZoneNames"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<string> array = new List<string>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(item.GetString());
                    }
                    requiredZoneNames = array;
                    continue;
                }
                if (property.NameEquals("shareablePrivateLinkResourceTypes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List<ShareableSearchServicePrivateLinkResourceType> array = new List<ShareableSearchServicePrivateLinkResourceType>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ShareableSearchServicePrivateLinkResourceType.DeserializeShareableSearchServicePrivateLinkResourceType(item));
                    }
                    shareablePrivateLinkResourceTypes = array;
                    continue;
                }
            }
            return new SearchPrivateLinkResourceProperties(groupId.Value, Optional.ToList(requiredMembers), Optional.ToList(requiredZoneNames), Optional.ToList(shareablePrivateLinkResourceTypes));
        }
    }
}


text:
<?php

namespace SWP\Exchange\Book;

use SimpleBus\Message\Handler\MessageHandler;
use SimpleBus\Message\Message;
use SimpleBus\Message\Recorder\RecordsMessages;
use SimpleES\EventSourcing\Aggregate\Manager\AggregateManager;
use SimpleES\EventSourcing\Aggregate\Manager\ManagesAggregates;
use SWP\Exchange\Command\DiscardBook;
use SWP\Exchange\Exception\InvalidCommandPassedToHandlerException;

final class DiscardBookHandler implements MessageHandler
{
    /**
     * @var ManagesAggregates
     */
    private $manager;

    /**
     * @var RecordsMessages
     */
    private $messageRecorder;

    public function __construct(AggregateManager $manager, RecordsMessages $messageRecorder)
    {
        $this->manager      = $manager;
        $this->messageRecorder = $messageRecorder;
    }

    /**
     * @param Message|DiscardBook $command
     */
    public function handle(Message $command)
    {
        if (!$command instanceof DiscardBook) {
            throw InvalidCommandPassedToHandlerException::make($command, 'DiscardBook');
        }

        /* @var Book $book */
        $book = $this->manager->fetch(BookId::fromString($command->getBookId()));
        $book->discard();

        $this->manager->save($book);
    }
}


text:
import { NgModule, Optional, SkipSelf } from '@angular/core';
import { RouterModule } from '@angular/router';
import { HTTP_INTERCEPTORS, HttpHandler, HttpClient } from '@angular/common/http';

import { SharedModule } from './../shared/shared.module';
import { AuthInterceptor } from './auth.interceptor';
import { NavbarComponent } from './navbar/navbar.component';
import { SidenavComponent } from './sidenav/sidenav.component';
import { ManifestService } from './manifest-service/manifest.service';

@NgModule({
    imports: [
        SharedModule,
        RouterModule
    ],
    declarations: [
        SidenavComponent,
        NavbarComponent
    ],
    exports: [
      SidenavComponent,
      NavbarComponent
    ],
    providers: [
        ManifestService,
        { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true },
    ]
})
export class CoreModule {
    constructor(
        @Optional() @SkipSelf() parentModule: CoreModule) {
        if (parentModule) {
            throw new Error(
                'CoreModule is already loaded. Import it in the AppModule only');
        }
    }
}


text:
package ecs

import (
	"testing"
	"time"

	"github.com/aws/aws-sdk-go/service/ec2"
	"github.com/containous/flaeg/parse"
	"github.com/containous/traefik/old/provider/label"
	"github.com/containous/traefik/old/types"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

func TestSegmentBuildConfiguration(t *testing.T) {
	testCases := []struct {
		desc              string
		instanceInfo      []ecsInstance
		expectedFrontends map[string]*types.Frontend
		expectedBackends  map[string]*types.Backend
	}{
		{
			desc:              "when no container",
			instanceInfo:      []ecsInstance{},
			expectedFrontends: map[string]*types.Frontend{},
			expectedBackends:  map[string]*types.Backend{},
		},
		{
			desc: "simple configuration",
			instanceInfo: []ecsInstance{
				instance(
					ID("123456789abc"),
					name("foo"),
					labels(map[string]string{
						"traefik.sauternes.port":                 "2503",
						"traefik.sauternes.frontend.entryPoints": "http,https",
					}),
					iMachine(
						mState(ec2.InstanceStateNameRunning),
						mPrivateIP("127.0.0.1"),
						mPorts(
							mPort(80, 2503),
						),
					),
				),
			},
			expectedFrontends: map[string]*types.Frontend{
				"frontend-sauternes-foo-sauternes": {
					Backend:        "backend-foo-sauternes",
					PassHostHeader: true,
					EntryPoints:    []string{"http", "https"},
					Routes: map[string]types.Route{
						"route-frontend-sauternes-foo-sauternes": {
							Rule: "Host:foo.ecs.localhost",
						},
					},
				},
			},
			expectedBackends: map[string]*types.Backend{
				"backend-foo-sauternes": {
					Servers: map[string]types.Server{
						"server-foo-123456789abc-863563a2e23c95502862016417ee95ea": {
							URL:    "http://127.0.0.1:2503",
							Weight: label.DefaultWeight,
						},
					},
					CircuitBreaker: nil,
				},
			},
		},
		{
			desc: "auth basic",
			instanceInfo: []ecsInstance{
				instance(
					ID("123456789abc"),
					name("foo"),
					labels(map[string]string{
						"traefik.sauternes.port":                                                "2503",
						"traefik.sauternes.frontend.entryPoints":                                "http,https",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthHeaderField:       "X-WebAuth-User",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthBasicUsers:        "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthBasicUsersFile:    ".htpasswd",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthBasicRemoveHeader: "true",
					}),
					iMachine(
						mState(ec2.InstanceStateNameRunning),
						mPrivateIP("127.0.0.1"),
						mPorts(
							mPort(80, 2503),
						),
					),
				),
			},
			expectedFrontends: map[string]*types.Frontend{
				"frontend-sauternes-foo-sauternes": {
					Backend:        "backend-foo-sauternes",
					PassHostHeader: true,
					EntryPoints:    []string{"http", "https"},
					Routes: map[string]types.Route{
						"route-frontend-sauternes-foo-sauternes": {
							Rule: "Host:foo.ecs.localhost",
						},
					},
					Auth: &types.Auth{
						HeaderField: "X-WebAuth-User",
						Basic: &types.Basic{
							RemoveHeader: true,
							Users: []string{"test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/",
								"test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"},
							UsersFile: ".htpasswd",
						},
					},
				},
			},
			expectedBackends: map[string]*types.Backend{
				"backend-foo-sauternes": {
					Servers: map[string]types.Server{
						"server-foo-123456789abc-863563a2e23c95502862016417ee95ea": {
							URL:    "http://127.0.0.1:2503",
							Weight: label.DefaultWeight,
						},
					},
					CircuitBreaker: nil,
				},
			},
		},
		{
			desc: "auth basic backward compatibility",
			instanceInfo: []ecsInstance{
				instance(
					ID("123456789abc"),
					name("foo"),
					labels(map[string]string{
						"traefik.sauternes.port":                                    "2503",
						"traefik.sauternes.frontend.entryPoints":                    "http,https",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthBasic: "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0",
					}),
					iMachine(
						mState(ec2.InstanceStateNameRunning),
						mPrivateIP("127.0.0.1"),
						mPorts(
							mPort(80, 2503),
						),
					),
				),
			},
			expectedFrontends: map[string]*types.Frontend{
				"frontend-sauternes-foo-sauternes": {
					Backend:        "backend-foo-sauternes",
					PassHostHeader: true,
					EntryPoints:    []string{"http", "https"},
					Routes: map[string]types.Route{
						"route-frontend-sauternes-foo-sauternes": {
							Rule: "Host:foo.ecs.localhost",
						},
					},
					Auth: &types.Auth{
						Basic: &types.Basic{
							Users: []string{"test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/",
								"test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"},
						},
					},
				},
			},
			expectedBackends: map[string]*types.Backend{
				"backend-foo-sauternes": {
					Servers: map[string]types.Server{
						"server-foo-123456789abc-863563a2e23c95502862016417ee95ea": {
							URL:    "http://127.0.0.1:2503",
							Weight: label.DefaultWeight,
						},
					},
					CircuitBreaker: nil,
				},
			},
		},
		{
			desc: "auth digest",
			instanceInfo: []ecsInstance{
				instance(
					ID("123456789abc"),
					name("foo"),
					labels(map[string]string{
						"traefik.sauternes.port":                                                 "2503",
						"traefik.sauternes.frontend.entryPoints":                                 "http,https",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthHeaderField:        "X-WebAuth-User",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthDigestUsers:        "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthDigestUsersFile:    ".htpasswd",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthDigestRemoveHeader: "true",
					}),
					iMachine(
						mState(ec2.InstanceStateNameRunning),
						mPrivateIP("127.0.0.1"),
						mPorts(
							mPort(80, 2503),
						),
					),
				),
			},
			expectedFrontends: map[string]*types.Frontend{
				"frontend-sauternes-foo-sauternes": {
					Backend:        "backend-foo-sauternes",
					PassHostHeader: true,
					EntryPoints:    []string{"http", "https"},
					Routes: map[string]types.Route{
						"route-frontend-sauternes-foo-sauternes": {
							Rule: "Host:foo.ecs.localhost",
						},
					},
					Auth: &types.Auth{
						HeaderField: "X-WebAuth-User",
						Digest: &types.Digest{
							RemoveHeader: true,
							Users: []string{"test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/",
								"test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"},
							UsersFile: ".htpasswd",
						},
					},
				},
			},
			expectedBackends: map[string]*types.Backend{
				"backend-foo-sauternes": {
					Servers: map[string]types.Server{
						"server-foo-123456789abc-863563a2e23c95502862016417ee95ea": {
							URL:    "http://127.0.0.1:2503",
							Weight: label.DefaultWeight,
						},
					},
					CircuitBreaker: nil,
				},
			},
		},
		{
			desc: "auth forward",
			instanceInfo: []ecsInstance{
				instance(
					ID("123456789abc"),
					name("foo"),
					labels(map[string]string{
						"traefik.sauternes.port":                                                           "2503",
						"traefik.sauternes.frontend.entryPoints":                                           "http,https",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthHeaderField:                  "X-WebAuth-User",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardAddress:               "auth.server",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardTrustForwardHeader:    "true",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardTLSCa:                 "ca.crt",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardTLSCaOptional:         "true",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardTLSCert:               "server.crt",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardTLSKey:                "server.key",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardTLSInsecureSkipVerify: "true",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardAuthResponseHeaders:   "X-Auth-User,X-Auth-Token",
					}),
					iMachine(
						mState(ec2.InstanceStateNameRunning),
						mPrivateIP("127.0.0.1"),
						mPorts(
							mPort(80, 2503),
						),
					),
				),
			},
			expectedFrontends: map[string]*types.Frontend{
				"frontend-sauternes-foo-sauternes": {
					Backend:        "backend-foo-sauternes",
					PassHostHeader: true,
					EntryPoints:    []string{"http", "https"},
					Routes: map[string]types.Route{
						"route-frontend-sauternes-foo-sauternes": {
							Rule: "Host:foo.ecs.localhost",
						},
					},
					Auth: &types.Auth{
						HeaderField: "X-WebAuth-User",
						Forward: &types.Forward{
							Address: "auth.server",
							TLS: &types.ClientTLS{
								CA:                 "ca.crt",
								CAOptional:         true,
								Cert:               "server.crt",
								Key:                "server.key",
								InsecureSkipVerify: true,
							},
							TrustForwardHeader:  true,
							AuthResponseHeaders: []string{"X-Auth-User", "X-Auth-Token"},
						},
					},
				},
			},
			expectedBackends: map[string]*types.Backend{
				"backend-foo-sauternes": {
					Servers: map[string]types.Server{
						"server-foo-123456789abc-863563a2e23c95502862016417ee95ea": {
							URL:    "http://127.0.0.1:2503",
							Weight: label.DefaultWeight,
						},
					},
					CircuitBreaker: nil,
				},
			},
		},
		{
			desc: "when all labels are set",
			instanceInfo: []ecsInstance{
				instance(
					ID("123456789abc"),
					name("foo"),
					labels(map[string]string{
						label.Prefix + "sauternes." + label.SuffixPort:     "666",
						label.Prefix + "sauternes." + label.SuffixProtocol: "https",
						label.Prefix + "sauternes." + label.SuffixWeight:   "12",

						label.Prefix + "sauternes." + label.SuffixFrontendAuthBasicRemoveHeader:            "true",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthBasicUsers:                   "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthBasicUsersFile:               ".htpasswd",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthDigestRemoveHeader:           "true",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthDigestUsers:                  "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthDigestUsersFile:              ".htpasswd",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardAddress:               "auth.server",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardTrustForwardHeader:    "true",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardTLSCa:                 "ca.crt",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardTLSCaOptional:         "true",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardTLSCert:               "server.crt",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardTLSKey:                "server.key",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthForwardTLSInsecureSkipVerify: "true",
						label.Prefix + "sauternes." + label.SuffixFrontendAuthHeaderField:                  "X-WebAuth-User",

						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertPem:                         "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosNotBefore:              "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosNotAfter:               "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosSans:                   "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosIssuerCommonName:       "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosIssuerCountry:          "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosIssuerDomainComponent:  "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosIssuerLocality:         "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosIssuerOrganization:     "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosIssuerProvince:         "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosIssuerSerialNumber:     "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosSubjectCommonName:      "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosSubjectCountry:         "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosSubjectDomainComponent: "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosSubjectLocality:        "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosSubjectOrganization:    "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosSubjectProvince:        "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSClientCertInfosSubjectSerialNumber:    "true",

						label.Prefix + "sauternes." + label.SuffixFrontendAuthBasic:                      "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0",
						label.Prefix + "sauternes." + label.SuffixFrontendEntryPoints:                    "http,https",
						label.Prefix + "sauternes." + label.SuffixFrontendPassHostHeader:                 "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPassTLSCert:                    "true",
						label.Prefix + "sauternes." + label.SuffixFrontendPriority:                       "666",
						label.Prefix + "sauternes." + label.SuffixFrontendRedirectEntryPoint:             "https",
						label.Prefix + "sauternes." + label.SuffixFrontendRedirectRegex:                  "nope",
						label.Prefix + "sauternes." + label.SuffixFrontendRedirectReplacement:            "nope",
						label.Prefix + "sauternes." + label.SuffixFrontendRedirectPermanent:              "true",
						label.Prefix + "sauternes." + label.SuffixFrontendWhiteListSourceRange:           "10.10.10.10",
						label.Prefix + "sauternes." + label.SuffixFrontendWhiteListIPStrategyExcludedIPS: "10.10.10.10,10.10.10.11",
						label.Prefix + "sauternes." + label.SuffixFrontendWhiteListIPStrategyDepth:       "5",

						label.Prefix + "sauternes." + label.SuffixFrontendRequestHeaders:                 "Access-Control-Allow-Methods:POST,GET,OPTIONS || Content-type: application/json; charset=utf-8",
						label.Prefix + "sauternes." + label.SuffixFrontendResponseHeaders:                "Access-Control-Allow-Methods:POST,GET,OPTIONS || Content-type: application/json; charset=utf-8",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersSSLProxyHeaders:         "Access-Control-Allow-Methods:POST,GET,OPTIONS || Content-type: application/json; charset=utf-8",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersAllowedHosts:            "foo,bar,bor",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersHostsProxyHeaders:       "foo,bar,bor",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersSSLHost:                 "foo",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersCustomFrameOptionsValue: "foo",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersContentSecurityPolicy:   "foo",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersPublicKey:               "foo",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersReferrerPolicy:          "foo",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersCustomBrowserXSSValue:   "foo",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersSTSSeconds:              "666",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersSSLForceHost:            "true",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersSSLRedirect:             "true",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersSSLTemporaryRedirect:    "true",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersSTSIncludeSubdomains:    "true",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersSTSPreload:              "true",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersForceSTSHeader:          "true",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersFrameDeny:               "true",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersContentTypeNosniff:      "true",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersBrowserXSSFilter:        "true",
						label.Prefix + "sauternes." + label.SuffixFrontendHeadersIsDevelopment:           "true",

						label.Prefix + "sauternes." + label.BaseFrontendErrorPage + "foo." + label.SuffixErrorPageStatus:  "404",
						label.Prefix + "sauternes." + label.BaseFrontendErrorPage + "foo." + label.SuffixErrorPageBackend: "foobar",
						label.Prefix + "sauternes." + label.BaseFrontendErrorPage + "foo." + label.SuffixErrorPageQuery:   "foo_query",
						label.Prefix + "sauternes." + label.BaseFrontendErrorPage + "bar." + label.SuffixErrorPageStatus:  "500,600",
						label.Prefix + "sauternes." + label.BaseFrontendErrorPage + "bar." + label.SuffixErrorPageBackend: "foobar",
						label.Prefix + "sauternes." + label.BaseFrontendErrorPage + "bar." + label.SuffixErrorPageQuery:   "bar_query",

						label.Prefix + "sauternes." + label.SuffixFrontendRateLimitExtractorFunc:                          "client.ip",
						label.Prefix + "sauternes." + label.BaseFrontendRateLimit + "foo." + label.SuffixRateLimitPeriod:  "6",
						label.Prefix + "sauternes." + label.BaseFrontendRateLimit + "foo." + label.SuffixRateLimitAverage: "12",
						label.Prefix + "sauternes." + label.BaseFrontendRateLimit + "foo." + label.SuffixRateLimitBurst:   "18",
						label.Prefix + "sauternes." + label.BaseFrontendRateLimit + "bar." + label.SuffixRateLimitPeriod:  "3",
						label.Prefix + "sauternes." + label.BaseFrontendRateLimit + "bar." + label.SuffixRateLimitAverage: "6",
						label.Prefix + "sauternes." + label.BaseFrontendRateLimit + "bar." + label.SuffixRateLimitBurst:   "9",
					}),
					iMachine(
						mState(ec2.InstanceStateNameRunning),
						mPrivateIP("127.0.0.1"),
						mPorts(
							mPort(80, 666),
						),
					),
				),
			},
			expectedFrontends: map[string]*types.Frontend{
				"frontend-sauternes-foo-sauternes": {
					Backend: "backend-foo-sauternes",
					EntryPoints: []string{
						"http",
						"https",
					},
					PassHostHeader: true,
					PassTLSCert:    true,
					Priority:       666,
					PassTLSClientCert: &types.TLSClientHeaders{
						PEM: true,
						Infos: &types.TLSClientCertificateInfos{
							NotBefore: true,
							Sans:      true,
							NotAfter:  true,
							Subject: &types.TLSCLientCertificateDNInfos{
								CommonName:      true,
								Country:         true,
								DomainComponent: true,
								Locality:        true,
								Organization:    true,
								Province:        true,
								SerialNumber:    true,
							},
							Issuer: &types.TLSCLientCertificateDNInfos{
								CommonName:      true,
								Country:         true,
								DomainComponent: true,
								Locality:        true,
								Organization:    true,
								Province:        true,
								SerialNumber:    true,
							},
						},
					},
					Auth: &types.Auth{
						HeaderField: "X-WebAuth-User",
						Basic: &types.Basic{
							RemoveHeader: true,
							Users: []string{"test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/",
								"test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"},
							UsersFile: ".htpasswd",
						},
					},
					WhiteList: &types.WhiteList{
						SourceRange: []string{"10.10.10.10"},
						IPStrategy: &types.IPStrategy{
							Depth:       5,
							ExcludedIPs: []string{"10.10.10.10", "10.10.10.11"},
						},
					},
					Headers: &types.Headers{
						CustomRequestHeaders: map[string]string{
							"Access-Control-Allow-Methods": "POST,GET,OPTIONS",
							"Content-Type":                 "application/json; charset=utf-8",
						},
						CustomResponseHeaders: map[string]string{
							"Access-Control-Allow-Methods": "POST,GET,OPTIONS",
							"Content-Type":                 "application/json; charset=utf-8",
						},
						AllowedHosts: []string{
							"foo",
							"bar",
							"bor",
						},
						HostsProxyHeaders: []string{
							"foo",
							"bar",
							"bor",
						},
						SSLRedirect:          true,
						SSLTemporaryRedirect: true,
						SSLForceHost:         true,
						SSLHost:              "foo",
						SSLProxyHeaders: map[string]string{
							"Access-Control-Allow-Methods": "POST,GET,OPTIONS",
							"Content-Type":                 "application/json; charset=utf-8",
						},
						STSSeconds:              666,
						STSIncludeSubdomains:    true,
						STSPreload:              true,
						ForceSTSHeader:          true,
						FrameDeny:               true,
						CustomFrameOptionsValue: "foo",
						ContentTypeNosniff:      true,
						BrowserXSSFilter:        true,
						CustomBrowserXSSValue:   "foo",
						ContentSecurityPolicy:   "foo",
						PublicKey:               "foo",
						ReferrerPolicy:          "foo",
						IsDevelopment:           true,
					},
					Errors: map[string]*types.ErrorPage{
						"foo": {
							Status:  []string{"404"},
							Query:   "foo_query",
							Backend: "backend-foobar",
						},
						"bar": {
							Status:  []string{"500", "600"},
							Query:   "bar_query",
							Backend: "backend-foobar",
						},
					},
					RateLimit: &types.RateLimit{
						ExtractorFunc: "client.ip",
						RateSet: map[string]*types.Rate{
							"foo": {
								Period:  parse.Duration(6 * time.Second),
								Average: 12,
								Burst:   18,
							},
							"bar": {
								Period:  parse.Duration(3 * time.Second),
								Average: 6,
								Burst:   9,
							},
						},
					},
					Redirect: &types.Redirect{
						EntryPoint:  "https",
						Regex:       "",
						Replacement: "",
						Permanent:   true,
					},

					Routes: map[string]types.Route{
						"route-frontend-sauternes-foo-sauternes": {
							Rule: "Host:foo.ecs.localhost",
						},
					},
				},
			},
			expectedBackends: map[string]*types.Backend{
				"backend-foo-sauternes": {
					Servers: map[string]types.Server{
						"server-foo-123456789abc-7f6444e0dff3330c8b0ad2bbbd383b0f": {
							URL:    "https://127.0.0.1:666",
							Weight: 12,
						},
					},
					CircuitBreaker: nil,
				},
			},
		},
		{
			desc: "several containers",
			instanceInfo: []ecsInstance{
				instance(
					ID("123456789abc"),
					name("test1"),
					labels(map[string]string{
						"traefik.sauternes.port":                         "2503",
						"traefik.sauternes.protocol":                     "https",
						"traefik.sauternes.weight":                       "80",
						"traefik.sauternes.backend":                      "foobar",
						"traefik.sauternes.frontend.passHostHeader":      "false",
						"traefik.sauternes.frontend.rule":                "Path:/mypath",
						"traefik.sauternes.frontend.priority":            "5000",
						"traefik.sauternes.frontend.entryPoints":         "http,https,ws",
						"traefik.sauternes.frontend.auth.basic":          "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/,test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0",
						"traefik.sauternes.frontend.redirect.entryPoint": "https",
					}),
					iMachine(
						mState(ec2.InstanceStateNameRunning),
						mPrivateIP("127.0.0.1"),
						mPorts(
							mPort(80, 2503),
						),
					),
				),
				instance(
					ID("abc987654321"),
					name("test2"),
					labels(map[string]string{
						"traefik.anothersauternes.port":          "8079",
						"traefik.anothersauternes.weight":        "33",
						"traefik.anothersauternes.frontend.rule": "Path:/anotherpath",
					}),
					iMachine(
						mState(ec2.InstanceStateNameRunning),
						mPrivateIP("127.0.0.2"),
						mPorts(
							mPort(80, 8079),
						),
					),
				),
			},
			expectedFrontends: map[string]*types.Frontend{
				"frontend-sauternes-test1-foobar": {
					Backend:        "backend-test1-foobar",
					PassHostHeader: false,
					Priority:       5000,
					EntryPoints:    []string{"http", "https", "ws"},
					Auth: &types.Auth{
						Basic: &types.Basic{
							Users: []string{"test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/",
								"test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"},
						},
					},
					Redirect: &types.Redirect{
						EntryPoint: "https",
					},
					Routes: map[string]types.Route{
						"route-frontend-sauternes-test1-foobar": {
							Rule: "Path:/mypath",
						},
					},
				},
				"frontend-anothersauternes-test2-anothersauternes": {
					Backend:        "backend-test2-anothersauternes",
					PassHostHeader: true,
					EntryPoints:    []string{},
					Routes: map[string]types.Route{
						"route-frontend-anothersauternes-test2-anothersauternes": {
							Rule: "Path:/anotherpath",
						},
					},
				},
			},
			expectedBackends: map[string]*types.Backend{
				"backend-test1-foobar": {
					Servers: map[string]types.Server{
						"server-test1-123456789abc-79533a101142718f0fdf84c42593c41e": {
							URL:    "https://127.0.0.1:2503",
							Weight: 80,
						},
					},
					CircuitBreaker: nil,
				},
				"backend-test2-anothersauternes": {
					Servers: map[string]types.Server{
						"server-test2-abc987654321-045e3e4aa5a744a325c099b803700a93": {
							URL:    "http://127.0.0.2:8079",
							Weight: 33,
						},
					},
					CircuitBreaker: nil,
				},
			},
		},
		{
			desc: "several segments with the same backend name and same port",
			instanceInfo: []ecsInstance{
				instance(
					ID("123456789abc"),
					name("test1"),
					labels(map[string]string{
						"traefik.port":                         "2503",
						"traefik.protocol":                     "https",
						"traefik.weight":                       "80",
						"traefik.frontend.entryPoints":         "http,https",
						"traefik.frontend.redirect.entryPoint": "https",

						"traefik.sauternes.backend":           "foobar",
						"traefik.sauternes.frontend.rule":     "Path:/sauternes",
						"traefik.sauternes.frontend.priority": "5000",

						"traefik.arbois.backend":           "foobar",
						"traefik.arbois.frontend.rule":     "Path:/arbois",
						"traefik.arbois.frontend.priority": "3000",
					}),

					iMachine(
						mState(ec2.InstanceStateNameRunning),
						mPrivateIP("127.0.0.1"),
						mPorts(
							mPort(80, 2503),
						),
					),
				),
			},
			expectedFrontends: map[string]*types.Frontend{
				"frontend-sauternes-test1-foobar": {
					Backend:        "backend-test1-foobar",
					PassHostHeader: true,
					Priority:       5000,
					EntryPoints:    []string{"http", "https"},
					Redirect: &types.Redirect{
						EntryPoint: "https",
					},
					Routes: map[string]types.Route{
						"route-frontend-sauternes-test1-foobar": {
							Rule: "Path:/sauternes",
						},
					},
				},
				"frontend-arbois-test1-foobar": {
					Backend:        "backend-test1-foobar",
					PassHostHeader: true,
					Priority:       3000,
					EntryPoints:    []string{"http", "https"},
					Redirect: &types.Redirect{
						EntryPoint: "https",
					},
					Routes: map[string]types.Route{
						"route-frontend-arbois-test1-foobar": {
							Rule: "Path:/arbois",
						},
					},
				},
			},
			expectedBackends: map[string]*types.Backend{
				"backend-test1-foobar": {
					Servers: map[string]types.Server{
						"server-test1-123456789abc-79533a101142718f0fdf84c42593c41e": {
							URL:    "https://127.0.0.1:2503",
							Weight: 80,
						},
					},
					CircuitBreaker: nil,
				},
			},
		},
		{
			desc: "several segments with the same backend name and different port (wrong behavior)",
			instanceInfo: []ecsInstance{
				instance(
					ID("123456789abc"),
					name("test1"),
					labels(map[string]string{
						"traefik.protocol":                     "https",
						"traefik.frontend.entryPoints":         "http,https",
						"traefik.frontend.redirect.entryPoint": "https",

						"traefik.sauternes.port":              "2503",
						"traefik.sauternes.weight":            "80",
						"traefik.sauternes.backend":           "foobar",
						"traefik.sauternes.frontend.rule":     "Path:/sauternes",
						"traefik.sauternes.frontend.priority": "5000",

						"traefik.arbois.port":              "2504",
						"traefik.arbois.weight":            "90",
						"traefik.arbois.backend":           "foobar",
						"traefik.arbois.frontend.rule":     "Path:/arbois",
						"traefik.arbois.frontend.priority": "3000",
					}),
					iMachine(
						mState(ec2.InstanceStateNameRunning),
						mPrivateIP("127.0.0.1"),
						mPorts(
							mPort(80, 2503),
							mPort(80, 2504),
						),
					),
				),
			},
			expectedFrontends: map[string]*types.Frontend{
				"frontend-sauternes-test1-foobar": {
					Backend:        "backend-test1-foobar",
					PassHostHeader: true,
					Priority:       5000,
					EntryPoints:    []string{"http", "https"},
					Redirect: &types.Redirect{
						EntryPoint: "https",
					},
					Routes: map[string]types.Route{
						"route-frontend-sauternes-test1-foobar": {
							Rule: "Path:/sauternes",
						},
					},
				},
				"frontend-arbois-test1-foobar": {
					Backend:        "backend-test1-foobar",
					PassHostHeader: true,
					Priority:       3000,
					EntryPoints:    []string{"http", "https"},
					Redirect: &types.Redirect{
						EntryPoint: "https",
					},
					Routes: map[string]types.Route{
						"route-frontend-arbois-test1-foobar": {
							Rule: "Path:/arbois",
						},
					},
				},
			},
			expectedBackends: map[string]*types.Backend{
				"backend-test1-foobar": {
					Servers: map[string]types.Server{
						"server-test1-123456789abc-79533a101142718f0fdf84c42593c41e": {
							URL:    "https://127.0.0.1:2503",
							Weight: 80,
						},
						"server-test1-123456789abc-315a41140f1bd825b066e39686c18482": {
							URL:    "https://127.0.0.1:2504",
							Weight: 90,
						},
					},
					CircuitBreaker: nil,
				},
			},
		},
		{
			desc: "several segments with the same backend name and different port binding",
			instanceInfo: []ecsInstance{
				instance(
					ID("123456789abc"),
					name("test1"),
					labels(map[string]string{
						"traefik.protocol":                     "https",
						"traefik.frontend.entryPoints":         "http,https",
						"traefik.frontend.redirect.entryPoint": "https",

						"traefik.sauternes.port":              "2503",
						"traefik.sauternes.weight":            "80",
						"traefik.sauternes.backend":           "foobar",
						"traefik.sauternes.frontend.rule":     "Path:/sauternes",
						"traefik.sauternes.frontend.priority": "5000",

						"traefik.arbois.port":              "8080",
						"traefik.arbois.weight":            "90",
						"traefik.arbois.backend":           "foobar",
						"traefik.arbois.frontend.rule":     "Path:/arbois",
						"traefik.arbois.frontend.priority": "3000",
					}),
					iMachine(
						mState(ec2.InstanceStateNameRunning),
						mPrivateIP("127.0.0.1"),
						mPorts(
							mPort(80, 2503),
							mPort(8080, 2504),
						),
					),
				),
			},
			expectedFrontends: map[string]*types.Frontend{
				"frontend-sauternes-test1-foobar": {
					Backend:        "backend-test1-foobar",
					PassHostHeader: true,
					Priority:       5000,
					EntryPoints:    []string{"http", "https"},
					Redirect: &types.Redirect{
						EntryPoint: "https",
					},
					Routes: map[string]types.Route{
						"route-frontend-sauternes-test1-foobar": {
							Rule: "Path:/sauternes",
						},
					},
				},
				"frontend-arbois-test1-foobar": {
					Backend:        "backend-test1-foobar",
					PassHostHeader: true,
					Priority:       3000,
					EntryPoints:    []string{"http", "https"},
					Redirect: &types.Redirect{
						EntryPoint: "https",
					},
					Routes: map[string]types.Route{
						"route-frontend-arbois-test1-foobar": {
							Rule: "Path:/arbois",
						},
					},
				},
			},
			expectedBackends: map[string]*types.Backend{
				"backend-test1-foobar": {
					Servers: map[string]types.Server{
						"server-test1-123456789abc-79533a101142718f0fdf84c42593c41e": {
							URL:    "https://127.0.0.1:2503",
							Weight: 80,
						},
						"server-test1-123456789abc-315a41140f1bd825b066e39686c18482": {
							URL:    "https://127.0.0.1:2504",
							Weight: 90,
						},
					},
					CircuitBreaker: nil,
				},
			},
		},
	}

	provider := &Provider{
		Domain:           "ecs.localhost",
		ExposedByDefault: true,
	}

	for _, test := range testCases {
		test := test
		t.Run(test.desc, func(t *testing.T) {
			t.Parallel()

			actualConfig, err := provider.buildConfiguration(test.instanceInfo)

			assert.NoError(t, err)
			require.NotNil(t, actualConfig, "actualConfig")

			assert.EqualValues(t, test.expectedBackends, actualConfig.Backends)
			assert.EqualValues(t, test.expectedFrontends, actualConfig.Frontends)
		})
	}
}


text:
namespace stan {
namespace math {

class op_vector_vari : public vari {
 protected:
  const size_t size_;
  vari** vis_;

 public:
  template <typename Arith, typename VecVar,
            require_arithmetic_t<Arith>* = nullptr,
            require_vector_like_vt<is_var, VecVar>* = nullptr>
  op_vector_vari(Arith f, VecVar&& vs) : vari(f), size_(vs.size()) {
    vis_ = reinterpret_cast<vari**>(operator new(sizeof(vari*) * vs.size()));
    for (size_t i = 0; i < vs.size(); ++i) {
      vis_[i] = vs[i].vi_;
    }
  }
  vari* operator[](size_t n) const { return vis_[n]; }
  size_t size() { return size_; }
};

}  // namespace math
}  // namespace stan
#endif


text:
## port to python by Li Jun
## http://groups.google.com/group/pythoncia

import os, sys

from ctypes import *
up=2
def setlibpath(up):
    import sys
    path=os.path.normpath(os.path.split(os.path.realpath(__file__))[0]+'\..'*up)
    if path not in sys.path:
        sys.path.append(path)

setlibpath(up)

from haru import *
from haru.c_func import *

from math import *

global pdf

@HPDF_Error_Handler(None, HPDF_UINT, HPDF_UINT, c_void_p)
def error_handler (error_no, detail_no, user_data):
    global pdf
    printf ("ERROR: error_no=%04X, detail_no=%u\n", error_no,
                detail_no)
    HPDF_Free (pdf)
    sys.exit(1)

font_list=[
    "Courier",
    "Courier-Bold",
    "Courier-Oblique",
    "Courier-BoldOblique",
    "Helvetica",
    "Helvetica-Bold",
    "Helvetica-Oblique",
    "Helvetica-BoldOblique",
    "Times-Roman",
    "Times-Bold",
    "Times-Italic",
    "Times-BoldItalic",
    "Symbol",
    "ZapfDingbats",
]

def main ():
    global pdf

    page_title = "Font Demo"

    fname=os.path.realpath(sys.argv[0])
    fname=fname[:fname.rfind('.')]+'.pdf'

    pdf = HPDF_New (error_handler, NULL)
    if (not pdf):
        printf ("error: cannot create PdfDoc object\n")
        return 1

    # Add a new page object.
    page = HPDF_AddPage (pdf)

    height = HPDF_Page_GetHeight (page)
    width = HPDF_Page_GetWidth (page)

    # Print the lines of the page.
    HPDF_Page_SetLineWidth (page, 1)
    HPDF_Page_Rectangle (page, 50, 50, width - 100, height - 110)
    HPDF_Page_Stroke (page)

    # Print the title of the page (with positioning center).
    def_font = HPDF_GetFont (pdf, "Helvetica", NULL)
    HPDF_Page_SetFontAndSize (page, def_font, 24)

    tw = HPDF_Page_TextWidth (page, page_title)
    HPDF_Page_BeginText (page)
    HPDF_Page_TextOut (page, (width - tw) / 2, height - 50, page_title)
    HPDF_Page_EndText (page)

    # output subtitle.
    HPDF_Page_BeginText (page)
    HPDF_Page_SetFontAndSize (page, def_font, 16)
    HPDF_Page_TextOut (page, 60, height - 80, "<Standerd Type1 fonts samples>")
    HPDF_Page_EndText (page)

    HPDF_Page_BeginText (page)
    HPDF_Page_MoveTextPos (page, 60, height - 105)

    for i in font_list:
        samp_text = "abcdefgABCDEFG12345!#$%&+-@?"

        #font_name = HPDF_LoadTTFontFromFile (pdf, "c:/winnt/fonts/arial.ttf", HPDF_TRUE);

        #font_name='arial.ttf'
        #font = HPDF_GetFont (pdf, font_name, "CP1250");

        #font = HPDF_GetFont (pdf, "Helvetica", NULL)

        font = HPDF_GetFont (pdf, i, NULL)

        # print a label of text
        HPDF_Page_SetFontAndSize (page, def_font, 9)
        HPDF_Page_ShowText (page, i)
        HPDF_Page_MoveTextPos (page, 0, -18)

        # print a sample text.
        HPDF_Page_SetFontAndSize (page, font, 20)
        HPDF_Page_ShowText (page, samp_text)
        HPDF_Page_MoveTextPos (page, 0, -20)

    HPDF_Page_EndText (page)

    HPDF_SaveToFile (pdf, fname)

    # clean up
    HPDF_Free (pdf)

    return 0

main()