text:
'use strict';

/* jshint ignore:start */
/**
 * This code was generated by
 * \ / _    _  _|   _  _
 *  | (_)\/(_)(_|\/| |(/_  v1.0.0
 *       /       /
 */
/* jshint ignore:end */

var Holodeck = require('../../../../../holodeck');  /* jshint ignore:line */
var Request = require(
    '../../../../../../../lib/http/request');  /* jshint ignore:line */
var Response = require(
    '../../../../../../../lib/http/response');  /* jshint ignore:line */
var RestException = require(
    '../../../../../../../lib/base/RestException');  /* jshint ignore:line */
var Twilio = require('../../../../../../../lib');  /* jshint ignore:line */

var client;
var holodeck;

describe('Event', function() {
  beforeEach(function() {
    holodeck = new Holodeck();
    client = new Twilio('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'AUTHTOKEN', {
      httpClient: holodeck
    });
  });
  it('should treat the first each arg as a callback',
    function(done) {
      var body = {
          'events': [
              {
                  'request': {
                      'method': 'POST',
                      'url': 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json',
                      'parameters': {
                          'status_callback_method': 'POST',
                          'twiml': '<Response><Say>Hi!</Say></Response>',
                          'trim': 'trim-silence',
                          'timeout': '55',
                          'method': 'POST',
                          'from': '+987654321',
                          'to': '+123456789',
                          'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
                          'machine_detection_timeout': '0'
                      }
                  },
                  'response': {
                      'response_code': 201,
                      'request_duration': 50,
                      'content_type': 'application/json',
                      'response_body': '{\'sid\': \'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\'}',
                      'date_created': 'Tue, 11 Aug 2020 17:44:08 +0000'
                  }
              }
          ],
          'end': 0,
          'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0',
          'next_page_uri': null,
          'page': 0,
          'page_size': 50,
          'previous_page_uri': null,
          'start': 0,
          'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0'
      };
      holodeck.mock(new Response(200, body));
      client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                      .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                      .events.each(() => done());
    }
  );
  it('should treat the second arg as a callback',
    function(done) {
      var body = {
          'events': [
              {
                  'request': {
                      'method': 'POST',
                      'url': 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json',
                      'parameters': {
                          'status_callback_method': 'POST',
                          'twiml': '<Response><Say>Hi!</Say></Response>',
                          'trim': 'trim-silence',
                          'timeout': '55',
                          'method': 'POST',
                          'from': '+987654321',
                          'to': '+123456789',
                          'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
                          'machine_detection_timeout': '0'
                      }
                  },
                  'response': {
                      'response_code': 201,
                      'request_duration': 50,
                      'content_type': 'application/json',
                      'response_body': '{\'sid\': \'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\'}',
                      'date_created': 'Tue, 11 Aug 2020 17:44:08 +0000'
                  }
              }
          ],
          'end': 0,
          'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0',
          'next_page_uri': null,
          'page': 0,
          'page_size': 50,
          'previous_page_uri': null,
          'start': 0,
          'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0'
      };
      holodeck.mock(new Response(200, body));
      client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                      .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                      .events.each({pageSize: 20}, () => done());
      holodeck.assertHasRequest(new Request({
          method: 'GET',
          url: 'https://api.twilio.com/2010-04-01/Accounts/${accountSid}/Calls/${callSid}/Events.json',
          params: {PageSize: 20},
      }));
    }
  );
  it('should find the callback in the opts object',
    function(done) {
      var body = {
          'events': [
              {
                  'request': {
                      'method': 'POST',
                      'url': 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json',
                      'parameters': {
                          'status_callback_method': 'POST',
                          'twiml': '<Response><Say>Hi!</Say></Response>',
                          'trim': 'trim-silence',
                          'timeout': '55',
                          'method': 'POST',
                          'from': '+987654321',
                          'to': '+123456789',
                          'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
                          'machine_detection_timeout': '0'
                      }
                  },
                  'response': {
                      'response_code': 201,
                      'request_duration': 50,
                      'content_type': 'application/json',
                      'response_body': '{\'sid\': \'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\'}',
                      'date_created': 'Tue, 11 Aug 2020 17:44:08 +0000'
                  }
              }
          ],
          'end': 0,
          'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0',
          'next_page_uri': null,
          'page': 0,
          'page_size': 50,
          'previous_page_uri': null,
          'start': 0,
          'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0'
      };
      holodeck.mock(new Response(200, body));
      client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                      .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                      .events.each({callback: () => done()}, () => fail('wrong callback!'));
    }
  );
  it('should generate valid list request',
    function(done) {
      holodeck.mock(new Response(500, {}));

      var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                                    .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                                    .events.list();
      promise.then(function() {
        throw new Error('failed');
      }, function(error) {
        expect(error.constructor).toBe(RestException.prototype.constructor);
        done();
      }).done();

      var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
      var callSid = 'CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
      var url = `https://api.twilio.com/2010-04-01/Accounts/${accountSid}/Calls/${callSid}/Events.json`;

      holodeck.assertHasRequest(new Request({
        method: 'GET',
        url: url
      }));
    }
  );
  it('should generate valid read_full response',
    function(done) {
      var body = {
          'events': [
              {
                  'request': {
                      'method': 'POST',
                      'url': 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json',
                      'parameters': {
                          'status_callback_method': 'POST',
                          'twiml': '<Response><Say>Hi!</Say></Response>',
                          'trim': 'trim-silence',
                          'timeout': '55',
                          'method': 'POST',
                          'from': '+987654321',
                          'to': '+123456789',
                          'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
                          'machine_detection_timeout': '0'
                      }
                  },
                  'response': {
                      'response_code': 201,
                      'request_duration': 50,
                      'content_type': 'application/json',
                      'response_body': '{\'sid\': \'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\'}',
                      'date_created': 'Tue, 11 Aug 2020 17:44:08 +0000'
                  }
              }
          ],
          'end': 0,
          'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0',
          'next_page_uri': null,
          'page': 0,
          'page_size': 50,
          'previous_page_uri': null,
          'start': 0,
          'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0'
      };

      holodeck.mock(new Response(200, body));

      var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                                    .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                                    .events.list();
      promise.then(function(response) {
        expect(response).toBeDefined();
        done();
      }, function() {
        throw new Error('failed');
      }).done();
    }
  );
  it('should generate valid read_empty response',
    function(done) {
      var body = {
          'events': [],
          'end': 0,
          'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0',
          'next_page_uri': null,
          'page': 0,
          'page_size': 50,
          'previous_page_uri': null,
          'start': 0,
          'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0'
      };

      holodeck.mock(new Response(200, body));

      var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                                    .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                                    .events.list();
      promise.then(function(response) {
        expect(response).toBeDefined();
        done();
      }, function() {
        throw new Error('failed');
      }).done();
    }
  );
});


text:
class HomeController < ApplicationController
  before_action :authenticate_user!, except: [:index]

  def index
    redirect_to customer_path if user_signed_in? && current_user.customer?
    redirect_to agent_path if user_signed_in? && current_user.agent?
    redirect_to admin_path if user_signed_in? && current_user.admin?
  end
end

redpajama_set_name: RedPajamaGithub


text:
+++
Talk_date = ""
Talk_start_time = ""
Talk_end_time = ""
Title = "Arrancada, o que este esporte pode nos ensinar sobre agilidade e performance?"
Type = "talk"
Speakers = ["tatiane-paya"]
+++

Já viu uma prova de arrancada? Como uma equipe se organiza? O que existe por trás do conjunto carro-piloto, para arrancar em uma pista de 201-402m em menos de 5s. O que este esporte nos ensina, sobre agilidade e performance em TI?


text:
package objectvisitor_test

import (
	"context"
	"testing"

	"github.com/golang/mock/gomock"
	"github.com/stretchr/testify/assert"
	corev1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

	"github.com/vmware-tanzu/octant/internal/objectvisitor"
	"github.com/vmware-tanzu/octant/internal/objectvisitor/fake"
	queryerFake "github.com/vmware-tanzu/octant/internal/queryer/fake"
	"github.com/vmware-tanzu/octant/internal/testutil"
)

func TestPod_Visit(t *testing.T) {
	controller := gomock.NewController(t)
	defer controller.Finish()

	serviceAccount := testutil.CreateServiceAccount("service-account")
	configMap := testutil.CreateConfigMap("configmap")
	secret := testutil.CreateSecret("secret")
	pvc := testutil.CreatePersistentVolumeClaim("pvc")

	object := testutil.CreatePod("pod")
	object.Spec.ServiceAccountName = serviceAccount.Name
	u := testutil.ToUnstructured(t, object)

	q := queryerFake.NewMockQueryer(controller)
	service := testutil.CreateService("service")
	q.EXPECT().
		ServicesForPod(gomock.Any(), object).
		Return([]*corev1.Service{service}, nil)
	q.EXPECT().
		ServiceAccountForPod(gomock.Any(), object).
		Return(serviceAccount, nil)
	q.EXPECT().
		ConfigMapsForPod(gomock.Any(), object).
		Return([]*corev1.ConfigMap{configMap}, nil)
	q.EXPECT().
		SecretsForPod(gomock.Any(), object).
		Return([]*corev1.Secret{secret}, nil)
	q.EXPECT().
		PersistentVolumeClaimsForPod(gomock.Any(), object).
		Return([]*corev1.PersistentVolumeClaim{pvc}, nil)

	handler := fake.NewMockObjectHandler(controller)
	handler.EXPECT().SetLevel(gomock.Any(), 1).Return(2)
	handler.EXPECT().
		AddEdge(gomock.Any(), u, testutil.ToUnstructured(t, service), gomock.Any()).
		Return(nil)
	handler.EXPECT().
		AddEdge(gomock.Any(), u, testutil.ToUnstructured(t, serviceAccount), gomock.Any()).
		Return(nil)
	handler.EXPECT().
		AddEdge(gomock.Any(), u, testutil.ToUnstructured(t, configMap), gomock.Any()).
		Return(nil)
	handler.EXPECT().AddEdge(gomock.Any(), u, testutil.ToUnstructured(t, secret), gomock.Any()).
		Return(nil)
	handler.EXPECT().AddEdge(gomock.Any(), u, testutil.ToUnstructured(t, pvc), gomock.Any()).
		Return(nil)

	var visited []unstructured.Unstructured
	visitor := fake.NewMockVisitor(controller)
	visitor.EXPECT().
		Visit(gomock.Any(), gomock.Any(), handler, true, gomock.Any()).
		DoAndReturn(func(ctx context.Context, object *unstructured.Unstructured, handler objectvisitor.ObjectHandler, _ bool, _ int) error {
			visited = append(visited, *object)
			return nil
		}).AnyTimes()

	pod := objectvisitor.NewPod(q)

	ctx := context.Background()
	err := pod.Visit(ctx, u, handler, visitor, true, 1)

	sortObjectsByName(t, visited)

	expected := testutil.ToUnstructuredList(t, service, serviceAccount)
	assert.Equal(t, expected.Items, visited)
	assert.NoError(t, err)
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Ask.Bootstrap</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Ask Bootstrap: a compilation of frameworks with handy scripts and styles, ready for cooking a new project or web app immediately.">
    <meta name="author" content="Compiled and maintained by Cengiz Ulusoy. Refer to 'copyrights' section for licences of the components used in this project.">

    <link href="/src/css/bootstrap.css" rel="stylesheet">
    <link href="/src/css/responsive.css" rel="stylesheet">

    <link href="/docs/js/google/prettify/prettify.css" rel="stylesheet">

    <link href="/docs/css/docs.css" rel="stylesheet">

    <link rel="shortcut icon" href="/src/img/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/src/img/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/src/img/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/src/img/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="/src/img/ico/apple-touch-icon-57-precomposed.png">

          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">

          </button>
          Ask.Bootstrap

                Home

                Scaffolding

                Base CSS

                Components

                JavaScript

JavaScript

Bring Bootstrap's components to life—now with 13 custom jQuery plugins.

 Overview

 Transitions

 Modal

 Dropdown

 Scrollspy

 Tab

 Tooltip

 Popover

 Alert

 Button

 Collapse

 Carousel

 Typeahead

 Affix

 Tables

 Date Range

 Chosen

Togglable tabs bootstrap-tab.js

Example tabs

Add quick, dynamic tab functionality to transiton through panes of local content, even via dropdown menus.

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.

Usage

Enable tabbable tabs via JavaScript (each tab needs to be activated individually):

$('#myTab a').click(function (e) {
  e.preventDefault();
  $(this).tab('show');
})

You can activate individual tabs in several ways:

$('#myTab a[href="#profile"]').tab('show'); // Select tab by name
$('#myTab a:first').tab('show'); // Select first tab
$('#myTab a:last').tab('show'); // Select last tab
$('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)

Markup

You can activate a tab or pill navigation without writing any JavaScript by simply specifying data-toggle="tab" or data-toggle="pill" on an element. Adding the nav and nav-tabs classes to the tab ul will apply the Bootstrap tab styling.

<ul class="nav nav-tabs">
  <li><a href="#home" data-toggle="tab">Home</a></li>
  <li><a href="#profile" data-toggle="tab">Profile</a></li>
  <li><a href="#messages" data-toggle="tab">Messages</a></li>
  <li><a href="#settings" data-toggle="tab">Settings</a></li>
</ul>

Methods

$().tab

            Activates a tab element and content container. Tab should have either a data-target or an href targeting a container node in the DOM.

<ul class="nav nav-tabs" id="myTab">
  <li class="active"><a href="#home">Home</a></li>
  <li><a href="#profile">Profile</a></li>
  <li><a href="#messages">Messages</a></li>
  <li><a href="#settings">Settings</a></li>
</ul>

<div class="tab-content">
  <div class="tab-pane active" id="home">...</div>
  <div class="tab-pane" id="profile">...</div>
  <div class="tab-pane" id="messages">...</div>
  <div class="tab-pane" id="settings">...</div>
</div>

<script>
  $(function () {
    $('#myTab a:last').tab('show');
  })
</script>

Events

               Event
               Description

               show
               This event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.

               shown
               This event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.

$('a[data-toggle="tab"]').on('shown', function (e) {
  e.target // activated tab
  e.relatedTarget // previous tab
})

Back to top

Ask.Bootstrap (v 0.1.0) is a front-end framework combinations of mainly HTML5 Boilerplate, Twitter Bootstrap with other additional handy libraries.

        Project is maintained by Cengiz Ulusoy at Ask Community Systems, Rotterdam.

        Please read copyrights section for more information about the creators of the frameworks and components used in this project.

            Home

            Scaffolding

            Base CSS

            Components

            JavaScript


text:
body {
    background: #F06292;
    background-image: url("background.jpg");
    font-family: 'Helvetica', 'Arial', sans-serif;
    overflow: hidden;
}

img {
    padding-top: 170px;
    vertical-align: center;
    max-width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

a {color: #ffffff; text-decoration: underline}

.Title {
    color: #ffffff;
    font-size: 5vmax;
    font-style: normal;
    font-variant: normal;
    font-weight: bold;
    margin-bottom: 2px;
    margin-left: 2px;
    margin-right: 2px;
    margin-top: 2px;
    opacity: 1.00;
    padding-bottom: 0px;
    padding-top: 0px;
    text-align: left;
    text-decoration: none;
    text-indent: 0px;
    text-transform: uppercase;
    text-align: left;
}

.List, li, p {
    color: #ffffff;
    font-family: 'Helvetica', 'Arial', sans-serif;
    font-size: 30px;
    font-style: normal;
    font-variant: normal;
    font-weight: bold;
    letter-spacing: 1;
    margin-bottom: 2px;
    margin-left: 2px;
    margin-right: 2px;
    margin-top: 2px;
    opacity: 1.00;
    padding-bottom: 50px;
    padding-top: 20px;
    text-align: left;
    text-decoration: none;
    text-indent: 0px;
    text-transform: uppercase;
    text-align: center;

}

}

.Disclaimer {
    color: #ffffff;
    font-family: 'Helvetica', 'Arial', sans-serif;
	font-size: x-small;
    font-style: normal;
    font-variant: normal;
    font-weight: bold;
    letter-spacing: 1;
    margin-bottom: 2px;
    margin-left: 2px;
    margin-right: 2px;
    margin-top: 2px;
    opacity: 1.00;
    padding-bottom: 0px;
    padding-top: 20px;
    text-align: left;
    text-decoration: none;
    text-indent: 0px;
    text-transform: lowercase;
}

.About {
    font-size: x-small;
    font-family: 'helvetica';
    text-transform: uppercase;

}

@media screen and (max-width: 767px) {
    .List, .title {
        text-align: left;
    }
}

#preloader {
    position:fixed;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background-color:#fff; /* change if the mask should have another color then white */
    z-index:99; /* makes sure it stays on top */
}

#status {
    width:200px;
    height:200px;
    position:absolute;
    left:50%; /* centers the loading animation horizontally one the screen */
    top:50%; /* centers the loading animation vertically one the screen */
    background-image:url(../img/status.gif); /* path to your loading animation */
    background-repeat:no-repeat;
    background-position:center;
    margin:-100px 0 0 -100px; /* is width and height divided by two */
}


text:
<?php
$servername = "localhost";
$db_name="forumlp2";
$db_user = "root";
$db_pass = "";

// Create connection
//function GetConnection () {
$conn = mysql_connect($servername, $db_user, $db_pass);
mysql_select_db($db_name,$conn) or die('Could not select database.')
//Check connection
//if (!$conn) {
  //  die("Connection failed: " . mysqli_connect_error());
//}
//return $conn;
//}

 ?>


text:
require 'yell'

require 'traject/util'
require 'traject/qualified_const_get'
require 'traject/thread_pool'

require 'json'
require 'httpclient'

require 'uri'
require 'thread'     # for Mutex/Queue
require 'concurrent' # for atomic_fixnum

# Write to Solr using the JSON interface; only works for Solr >= 3.2
#
# This should work under both MRI and JRuby, with JRuby getting much
# better performance due to the threading model.
#
# Solr updates are by default sent with no commit params. This will definitely
# maximize your performance, and *especially* for bulk/batch indexing is recommended --
# use Solr auto commit in your Solr configuration instead, possibly with `commit_on_close`
# setting here.
#
# However, if you want the writer to send `commitWithin=true`, `commit=true`,
# `softCommit=true`, or any other URL parameters valid for Solr update handlers,
# you can configure this with `solr_writer.solr_update_args` setting. See:
# https://lucene.apache.org/solr/guide/7_0/near-real-time-searching.html#passing-commit-and-commitwithin-parameters-as-part-of-the-url
# Eg:
#
#     settings do
#       provide "solr_writer.solr_update_args", { commitWithin: 1000 }
#     end
#
#  (That it's a hash makes it infeasible to set/override on command line, if this is
#  annoying for you let us know)
#
#  `solr_update_args` will apply to batch and individual update requests, but
#  not to commit sent if `commit_on_close`. You can also instead set
#   `solr_writer.solr_commit_args` for that (or pass in an arg to #commit if calling
#   manually)
#
# ## Relevant settings
#
# * solr.url (optional if solr.update_url is set) The URL to the solr core to index into.
#   (Can include embedded HTTP basic auth as eg `http://user:pass@host/solr`)
#
# * solr.update_url: The actual update url. If unset, we'll first see if
#   "#{solr.url}/update/json" exists, and if not use "#{solr.url}/update". (Can include
#   embedded HTTP basic auth as eg `http://user:pass@host/solr)
#
# * solr_writer.batch_size: How big a batch to send to solr. Default is 100.
#   My tests indicate that this setting doesn't change overall index speed by a ton.
#
# * solr_writer.thread_pool: How many threads to use for the writer. Default is 1.
#   Likely useful even under MRI since thread will be waiting on Solr for some time.
#
# * solr_writer.max_skipped: How many records skipped due to errors before we
#   bail out with a fatal error? Set to -1 for unlimited skips. Default 0,
#   raise and abort on a single record that could not be added to Solr.
#
# * solr_writer.skippable_exceptions: List of classes that will be rescued internal to
#   SolrJsonWriter, and handled with max_skipped logic. Defaults to
#   `[HTTPClient::TimeoutError, SocketError, Errno::ECONNREFUSED, Traject::SolrJsonWriter::BadHttpResponse]`
#
# * solr_writer.solr_update_args: A _hash_ of query params to send to solr update url.
#   Will be sent with every update request. Eg `{ softCommit: true }` or `{ commitWithin: 1000 }`.
#   See also `solr_writer.solr_commit_args`
#
# * solr_writer.commit_on_close: Set to true (or "true") if you want to commit at the
#   end of the indexing run. (Old "solrj_writer.commit_on_close" supported for backwards
#   compat only.)
#
# * solr_writer.commit_solr_update_args: A hash of query params to send when committing.
#   Will be used for automatic `close_on_commit`, as well as any manual calls to #commit.
#   If set, must include {"commit" => "true"} or { "softCommit" => "true" } if you actually
#   want commits to happen when SolrJsonWriter tries to commit! But can be used to switch to softCommits
#   (hard commits default), or specify additional params like optimize etc.
#
# * solr_writer.http_timeout: Value in seconds, will be set on the httpclient as connect/receive/send
#   timeout. No way to set them individually at present. Default nil, use HTTPClient defaults
#   (60 for connect/recieve, 120 for send).
#
# * solr_writer.commit_timeout: If commit_on_close, how long to wait for Solr before
#   giving up as a timeout (http client receive_timeout). Default 10 minutes. Solr can be slow at commits. Overrides solr_writer.timeout
#
# * solr_json_writer.http_client Mainly intended for testing, set your own HTTPClient
#   or mock object to be used for HTTP.
#
class Traject::SolrJsonWriter
  include Traject::QualifiedConstGet

  URI_REGEXP = URI::Parser.new.make_regexp.freeze

  DEFAULT_MAX_SKIPPED = 0
  DEFAULT_BATCH_SIZE  = 100

  # The passed-in settings
  attr_reader :settings, :thread_pool_size

  # A queue to hold documents before sending to solr
  attr_reader :batched_queue

  def initialize(argSettings)
    @settings = Traject::Indexer::Settings.new(argSettings)

    # Set max errors
    @max_skipped = (@settings['solr_writer.max_skipped'] || DEFAULT_MAX_SKIPPED).to_i
    if @max_skipped < 0
      @max_skipped = nil
    end

    # Figure out where to send updates, and if with basic auth
    @solr_update_url, basic_auth_user, basic_auth_password = self.determine_solr_update_url

    @http_client = if @settings["solr_json_writer.http_client"]
      @settings["solr_json_writer.http_client"]
    else
      client = HTTPClient.new
      if @settings["solr_writer.http_timeout"]
        client.connect_timeout = client.receive_timeout = client.send_timeout = @settings["solr_writer.http_timeout"]
      end

      if basic_auth_user || basic_auth_password
        client.set_auth(@solr_update_url, basic_auth_user, basic_auth_password)
      end

      client
    end

    @batch_size = (settings["solr_writer.batch_size"] || DEFAULT_BATCH_SIZE).to_i
    @batch_size = 1 if @batch_size < 1

    # Store error count in an AtomicInteger, so multi threads can increment
    # it safely, if we're threaded.
    @skipped_record_incrementer = Concurrent::AtomicFixnum.new(0)

    # How many threads to use for the writer?
    # if our thread pool settings are 0, it'll just create a null threadpool that
    # executes in calling context.
    @thread_pool_size = (@settings["solr_writer.thread_pool"] || 1).to_i

    @batched_queue         = Queue.new
    @thread_pool = Traject::ThreadPool.new(@thread_pool_size)

    # old setting solrj_writer supported for backwards compat, as we make
    # this the new default writer.
    @commit_on_close = (settings["solr_writer.commit_on_close"] || settings["solrj_writer.commit_on_close"]).to_s == "true"

    @solr_update_args = settings["solr_writer.solr_update_args"]
    @commit_solr_update_args = settings["solr_writer.commit_solr_update_args"]

    logger.info("   #{self.class.name} writing to '#{@solr_update_url}' #{"(with HTTP basic auth)" if basic_auth_user || basic_auth_password}in batches of #{@batch_size} with #{@thread_pool_size} bg threads")
  end

  # Add a single context to the queue, ready to be sent to solr
  def put(context)
    @thread_pool.raise_collected_exception!

    @batched_queue << context
    if @batched_queue.size >= @batch_size
      batch = Traject::Util.drain_queue(@batched_queue)
      @thread_pool.maybe_in_thread_pool(batch) {|batch_arg| send_batch(batch_arg) }
    end
  end

  # Not part of standard writer API.
  #
  # If we are batching adds, and have some not-yet-written ones queued up --
  # flush em all to solr.
  #
  # This should be thread-safe to call, but the write does take place in
  # the caller's thread, no threading is done for you here, regardless of setting
  # of solr_writer.thread_pool
  def flush
    send_batch( Traject::Util.drain_queue(@batched_queue) )
  end

  # configured update url, with either settings @solr_update_args or passed in
  # query_params added to it
  def solr_update_url_with_query(query_params)
    if query_params
      @solr_update_url + '?' + URI.encode_www_form(query_params)
    else
      @solr_update_url
    end
  end

  # Send the given batch of contexts. If something goes wrong, send
  # them one at a time.
  # @param [Array<Traject::Indexer::Context>] an array of contexts
  def send_batch(batch)
    return if batch.empty?

    logger.debug("#{self.class.name}: sending batch of #{batch.size} to Solr")

    json_package = JSON.generate(batch.map { |c| c.output_hash })

    begin
      resp = @http_client.post solr_update_url_with_query(@solr_update_args), json_package, "Content-type" => "application/json"
    rescue StandardError => exception
    end

    if exception || resp.status != 200
      error_message = exception ?
        Traject::Util.exception_to_log_message(exception) :
        "Solr response: #{resp.status}: #{resp.body}"

      logger.error "Error in Solr batch add. Will retry documents individually at performance penalty: #{error_message}"

      batch.each do |c|
        send_single(c)
      end
    end
  end

  # Send a single context to Solr, logging an error if need be
  # @param [Traject::Indexer::Context] c The context whose document you want to send
  def send_single(c)
    logger.debug("#{self.class.name}: sending single record to Solr: #{c.output_hash}")

    json_package = JSON.generate([c.output_hash])
    begin
      post_url = solr_update_url_with_query(@solr_update_args)
      resp = @http_client.post post_url, json_package, "Content-type" => "application/json"

      unless resp.status == 200
        raise BadHttpResponse.new("Unexpected HTTP response status #{resp.status} from POST #{post_url}", resp)
      end

      # Catch Timeouts and network errors -- as well as non-200 http responses --
      # as skipped records, but otherwise allow unexpected errors to propagate up.
    rescue *skippable_exceptions => exception
      msg = if exception.kind_of?(BadHttpResponse)
        "Solr error response: #{exception.response.status}: #{exception.response.body}"
      else
        Traject::Util.exception_to_log_message(exception)
      end

      logger.error "Could not add record #{c.record_inspect}: #{msg}"
      logger.debug("\t" + exception.backtrace.join("\n\t")) if exception
      logger.debug(c.source_record.to_s) if c.source_record

      @skipped_record_incrementer.increment
      if @max_skipped and skipped_record_count > @max_skipped
        # re-raising in rescue means the last encountered error will be available as #cause
        # on raised exception, a feature in ruby 2.1+.
        raise MaxSkippedRecordsExceeded.new("#{self.class.name}: Exceeded maximum number of skipped records (#{@max_skipped}): aborting: #{exception.message}")
      end
    end
  end

  # Very beginning of a delete implementation. POSTs a delete request to solr
  # for id in arg (value of Solr UniqueID field, usually `id` field).
  #
  # Right now, does it inline and immediately, no use of background threads or batching.
  # This could change.
  #
  # Right now, if unsuccesful for any reason, will raise immediately out of here.
  # Could raise any of the `skippable_exceptions` (timeouts, network errors), an
  # exception will be raised right out of here.
  #
  # Will use `solr_writer.solr_update_args` settings.
  #
  # There is no built-in way to direct a record to be deleted from an indexing config
  # file at the moment, this is just a loose method on the writer.
  def delete(id)
    logger.debug("#{self.class.name}: Sending delete to Solr for #{id}")

    json_package = {delete: id}
    resp = @http_client.post solr_update_url_with_query(@solr_update_args), JSON.generate(json_package), "Content-type" => "application/json"
    if resp.status != 200
      raise RuntimeError.new("Could not delete #{id.inspect}, http response #{resp.status}: #{resp.body}")
    end
  end

  # Send a delete all query.
  #
  # This method takes no params and will not automatically commit the deletes.
  # @example @writer.delete_all!
  def delete_all!
    delete(query: "*:*")
  end

  # Get the logger from the settings, or default to an effectively null logger
  def logger
    settings["logger"] ||= Yell.new(STDERR, :level => "gt.fatal") # null logger
  end

  # On close, we need to (a) raise any exceptions we might have, (b) send off
  # the last (possibly empty) batch, and (c) commit if instructed to do so
  # via the solr_writer.commit_on_close setting.
  def close
    @thread_pool.raise_collected_exception!

    # Finish off whatever's left. Do it in the thread pool for
    # consistency, and to ensure expected order of operations, so
    # it goes to the end of the queue behind any other work.
    batch = Traject::Util.drain_queue(@batched_queue)
    if batch.length > 0
      @thread_pool.maybe_in_thread_pool { send_batch(batch) }
    end

    if @thread_pool_size && @thread_pool_size > 0
      # Wait for shutdown, and time it.
      logger.debug "#{self.class.name}: Shutting down thread pool, waiting if needed..."
      elapsed = @thread_pool.shutdown_and_wait
      if elapsed > 60
        logger.warn "Waited #{elapsed} seconds for all threads, you may want to increase solr_writer.thread_pool (currently #{@settings["solr_writer.thread_pool"]})"
      end
      logger.debug "#{self.class.name}: Thread pool shutdown complete"
      logger.warn "#{self.class.name}: #{skipped_record_count} skipped records" if skipped_record_count > 0
    end

    # check again now that we've waited, there could still be some
    # that didn't show up before.
    @thread_pool.raise_collected_exception!

    # Commit if we're supposed to
    if @commit_on_close
      commit
    end
  end

  # Send a commit
  #
  # Called automatially by `close_on_commit` setting, but also can be called manually.
  #
  # If settings `solr_writer.commit_solr_update_args` is set, will be used by default.
  # That setting needs `{ commit: true }` or  `{softCommit: true}` if you want it to
  # actually do a commit!
  #
  # Optional query_params argument is the actual args to send, you must be sure
  # to make it include "commit: true" or "softCommit: true" for it to actually commit!
  # But you may want to include other params too, like optimize etc. query_param
  # argument replaces setting `solr_writer.commit_solr_update_args`, they are not merged.
  #
  # @param [Hash] query_params optional query params to send to solr update. Default {"commit" => "true"}
  #
  # @example @writer.commit
  # @example @writer.commit(softCommit: true)
  # @example @writer.commit(commit: true, optimize: true, waitFlush: false)
  def commit(query_params = nil)
    query_params ||= @commit_solr_update_args || {"commit" => "true"}
    logger.info "#{self.class.name} sending commit to solr at url #{@solr_update_url}..."

    original_timeout = @http_client.receive_timeout

    @http_client.receive_timeout = (settings["commit_timeout"] || (10 * 60)).to_i

    resp = @http_client.get(solr_update_url_with_query(query_params))
    unless resp.status == 200
      raise RuntimeError.new("Could not commit to Solr: #{resp.status} #{resp.body}")
    end

    @http_client.receive_timeout = original_timeout
  end

  # Return count of encountered skipped records. Most accurate to call
  # it after #close, in which case it should include full count, even
  # under async thread_pool.
  def skipped_record_count
    @skipped_record_incrementer.value
  end

  # Relatively complex logic to determine if we have a valid URL and what it is,
  # and if we have basic_auth info
  #
  # Empties out user and password embedded in URI returned, to help avoid logging it.
  #
  # @returns [update_url, basic_auth_user, basic_auth_password]
  def determine_solr_update_url
    url = if settings['solr.update_url']
      check_solr_update_url(settings['solr.update_url'])
    else
      derive_solr_update_url_from_solr_url(settings['solr.url'])
    end

    parsed_uri                            = URI.parse(url)
    user_from_uri, password_from_uri      = parsed_uri.user, parsed_uri.password
    parsed_uri.user, parsed_uri.password  = nil, nil

    basic_auth_user     = @settings["solr_writer.basic_auth_user"] || user_from_uri
    basic_auth_password = @settings["solr_writer.basic_auth_password"] || password_from_uri

    return [parsed_uri.to_s, basic_auth_user, basic_auth_password]
  end

  # If we've got a solr.update_url, make sure it's ok
  def check_solr_update_url(url)
    unless /^#{URI_REGEXP}$/.match(url)
      raise ArgumentError.new("#{self.class.name} setting `solr.update_url` doesn't look like a URL: `#{url}`")
    end
    url
  end

  def derive_solr_update_url_from_solr_url(url)
    # Nil? Then we bail
    if url.nil?
      raise ArgumentError.new("#{self.class.name}: Neither solr.update_url nor solr.url set; need at least one")
    end

    # Not a URL? Bail
    unless  /^#{URI_REGEXP}$/.match(url)
      raise ArgumentError.new("#{self.class.name} setting `solr.url` doesn't look like a URL: `#{url}`")
    end

    # Assume the /update/json handler
    return [url.chomp('/'), 'update', 'json'].join('/')
  end

  class MaxSkippedRecordsExceeded < RuntimeError ; end

  # Adapted from HTTPClient::BadResponseError.
  # It's got a #response accessor that will give you the HTTPClient
  # Response object that had a bad status, although relying on that
  # would tie you to our HTTPClient implementation that maybe should
  # be considered an implementation detail, so I dunno.
  class BadHttpResponse < RuntimeError
    # HTTP::Message:: a response
    attr_reader :response

    def initialize(msg, response = nil) # :nodoc:
      solr_error = find_solr_error(response)
      msg += ": #{solr_error}" if solr_error

      super(msg)

      @response = response
    end

    private

    # If we can get the error out of a JSON response, please do,
    # to include in error message.
    def find_solr_error(response)
      return nil unless response && response.body && response.content_type&.start_with?("application/json")

      parsed = JSON.parse(response.body)

      parsed && parsed.dig("error", "msg")
    rescue JSON::ParserError
      return nil
    end
  end

  private

  def skippable_exceptions
    @skippable_exceptions ||= (settings["solr_writer.skippable_exceptions"] || [HTTPClient::TimeoutError, SocketError, Errno::ECONNREFUSED, Traject::SolrJsonWriter::BadHttpResponse])
  end
end


text:
using System;
using System.ComponentModel.Composition;
using System.Linq;
using System.Waf.Applications;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Media;
using Waf.Writer.Presentation.Services;
using Waf.Writer.Presentation.Views;

namespace Waf.Writer.Presentation.ViewModels
{
    [Export]
    public class ConsoleViewModel : ViewModel<IConsoleView>
    {
        private readonly Brush _defaultColor = new SolidColorBrush(Colors.White);
        private readonly Brush _errorColor = new SolidColorBrush(Colors.Red);
        private readonly IPowerShellService _powerShellService;
        private readonly SolidColorBrush _verboseColor = new SolidColorBrush(Colors.Gray);
        private readonly SolidColorBrush _warningColor = new SolidColorBrush(Colors.Yellow);

        [ImportingConstructor]
        public ConsoleViewModel(IConsoleView view, IPowerShellService powerShellService) : base(view)
        {
            _powerShellService = powerShellService;

            _powerShellService.ErrorOutputted += (sender, e) => WriteError(e.Text);
            _powerShellService.WarningOutputted += (sender, e) => WriteWarning(e.Text);
            _powerShellService.VerboseOutputted += (sender, e) => WriteVerbose(e.Text);

            var style = (Style) Application.Current.FindResource("ConsoleWindowDocument");
            Document.Style = style;

            style = (Style) Application.Current.FindResource("ConsoleWindowParagraph");
            Document.Resources.Add(typeof(Paragraph), style);
        }

        public FlowDocument Document { get; } = new FlowDocument();

        public IPowerShellService PowerShellService
        {
            get { return _powerShellService; }
        }

        public void Write(string text, Brush color)
        {
            if (string.IsNullOrEmpty(text))
            {
                return;
            }

            var textLines = text.Split(new[] {Environment.NewLine}, StringSplitOptions.None);
            var p = new Paragraph();

            for (var i = 0; i < textLines.Length - 1; i++)
            {
                p.Inlines.Add(new Run(textLines[i]) {Foreground = color});
                p.Inlines.Add(new LineBreak());
            }

            p.Inlines.Add(new Run(textLines.Last()) {Foreground = color});

            Document.Blocks.Add(p);

            ViewCore.ScrollToEnd();
        }

        public void Write(string text)
        {
            Write(text, _defaultColor);
        }

        public void WriteWarning(string text)
        {
            Write(text, _warningColor);
        }

        public void WriteError(string text)
        {
            Write(text, _errorColor);
        }

        public void WriteVerbose(string text)
        {
            Write(text, _verboseColor);
        }

        public void Clear()
        {
        }

        public void Invoke(string command)
        {
            Write($"PS> {command}");

            foreach (var r in _powerShellService.Invoke(command))
            {
                Write(r.ToString());
            }
        }
    }
}


text:
require 'spec_helper'

RSpec.describe BusStopsRoute do
  describe 'validations' do
    context 'when two bus stops have the same route and direction' do
      let(:route) { create :route }
      let(:stop1) { create :bus_stop }
      let :valid_bsr do
        create :bus_stops_route, route: route, bus_stop: stop1
      end

      context 'when they have the same sequence' do
        let :invalid_bsr do
          build :bus_stops_route, route: valid_bsr.route,
                                  direction: valid_bsr.direction,
                                  sequence: valid_bsr.sequence
        end

        it 'is not valid' do
          expect(invalid_bsr).not_to be_valid
        end
      end

      context 'when they have the same bus stop' do
        let :invalid_bsr do
          build :bus_stops_route, route: valid_bsr.route,
                                  direction: valid_bsr.direction,
                                  bus_stop: valid_bsr.bus_stop
        end

        it 'is not valid' do
          expect(invalid_bsr).not_to be_valid
        end
      end
    end
  end

  describe 'establish_sequences' do
    let(:main_variant) { %w[A B C D E] }
    let(:other_variant) { %w[A] }
    let(:stop_hash) { { route_dir: { key1: main_variant, key2: other_variant } } }

    before { described_class.establish_sequences(stop_hash) }

    context 'when all stops in other variant are in longest variant' do
      it 'preserves sequence of longest variant' do
        expect(stop_hash[:route_dir]).to eql %w[A B C D E]
      end
    end

    context 'when a stop (but not the 1st stop) in another variant is not in the longest variant' do
      context 'when one stop is in the other variant' do
        let(:other_variant) { %w[A F E] }

        it 'inserts that stop into longest variant after common stop' do
          expect(stop_hash[:route_dir]).to eql %w[A F B C D E]
        end
      end

      context 'when multiple stops are in the other variant' do
        let(:other_variant) { %w[A F G H E] }

        it 'inserts those stops into longest variant after common stop' do
          expect(stop_hash[:route_dir]).to eql %w[A F G H B C D E]
        end
      end
    end

    context 'when the first stop in another variant is not in the longest variant' do
      context 'when one stop is in the other variant' do
        let(:other_variant) { %w[F D E] }

        it 'inserts that stop into longest variant before common stop' do
          expect(stop_hash[:route_dir]).to eql %w[A B C F D E]
        end
      end

      context 'when multiple stops are in the other variant' do
        let(:other_variant) { %w[F G H D E] }

        it 'inserts those stops into longest variant before common stop' do
          expect(stop_hash[:route_dir]).to eql %w[A B C F G H D E]
        end
      end
    end

    context 'when no stop in the other variant is in the longest variant' do
      let(:other_variant) { %w[F G H I] }

      it 'appends the other variant to the end of the longest variant' do
        expect(stop_hash[:route_dir]).to eql %w[A B C D E F G H I]
      end
    end
  end
end


text:
import React from "react";

import { useRovingTabIndex } from "../RovingTabIndex";
import StyledRadioButton from "../../components/views/elements/StyledRadioButton";
import { KeyBindingAction } from "../KeyboardShortcuts";
import { getKeyBindingsManager } from "../../KeyBindingsManager";

interface IProps extends React.ComponentProps<typeof StyledRadioButton> {
    label?: string;
    onChange(); // we handle keyup/down ourselves so lose the ChangeEvent
    onClose(): void; // gets called after onChange on KeyBindingAction.Enter
}

// Semantic component for representing a styled role=menuitemradio
export const StyledMenuItemRadio: React.FC<IProps> = ({ children, label, onChange, onClose, ...props }) => {
    const [onFocus, isActive, ref] = useRovingTabIndex<HTMLInputElement>();

    const onKeyDown = (e: React.KeyboardEvent) => {
        let handled = true;
        const action = getKeyBindingsManager().getAccessibilityAction(e);

        switch (action) {
            case KeyBindingAction.Space:
                onChange();
                break;
            case KeyBindingAction.Enter:
                onChange();
                // Implements https://www.w3.org/TR/wai-aria-practices/#keyboard-interaction-12
                onClose();
                break;
            default:
                handled = false;
        }

        if (handled) {
            e.stopPropagation();
            e.preventDefault();
        }
    };
    const onKeyUp = (e: React.KeyboardEvent) => {
        const action = getKeyBindingsManager().getAccessibilityAction(e);
        switch (action) {
            case KeyBindingAction.Enter:
            case KeyBindingAction.Space:
                // prevent the input default handler as we handle it on keydown to match
                // https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-2/menubar-2.html
                e.stopPropagation();
                e.preventDefault();
                break;
        }
    };
    return (
        <StyledRadioButton
            {...props}
            role="menuitemradio"
            aria-label={label}
            onChange={onChange}
            onKeyDown={onKeyDown}
            onKeyUp={onKeyUp}
            onFocus={onFocus}
            inputRef={ref}
            tabIndex={isActive ? 0 : -1}
        >
            { children }
        </StyledRadioButton>
    );
};


text:
using System.IO;
using OpenMetaverse;

namespace OpenSim.Region.Framework.Interfaces
{
    public interface ITerrainModule
    {
        void LoadFromFile(string filename);
        void SaveToFile(string filename);
        void ModifyTerrain(UUID user, Vector3 pos, byte size, byte action, UUID agentId);
        bool SetTerrain(UUID user, int x1, int y1, int x2, int y2, float height);   // returns false for invalid args

        /// <summary>
        /// Taint the terrain. This will lead to sending the terrain data to the clients again.
        /// Use this if you change terrain data outside of the terrain module (e.g. in osTerrainSetHeight)
        /// </summary>
        void TaintTerrain();

        /// <summary>
        /// Load a terrain from a stream.
        /// </summary>
        /// <param name="filename">
        /// Only required here to identify the image type.  Not otherwise used in the loading itself.
        /// </param>
        /// <param name="stream"></param>
        void LoadFromStream(string filename, Stream stream);

        /// <summary>
        /// Save a terrain to a stream.
        /// </summary>
        /// <param name="filename">
        /// Only required here to identify the image type.  Not otherwise used in the saving itself.
        /// </param>
        /// <param name="stream"></param>
        void SaveToStream(string filename, Stream stream);

        void InstallPlugin(string name, ITerrainEffect plug);
    }
}


text:
package org.osrse.slave.handler;

import org.osrse.game.logic.player.PlayerCommunication;
import org.osrse.network.Packet;
import org.osrse.network.PacketHandler;
import org.osrse.slave.LoginSession;
import org.osrse.slave.ReferencedPerson;

/**
 * Created by Jonathan on 8/25/2016.
 */
public class FSPrivacy extends PacketHandler<LoginSession> {
	@Override
	public void handle(LoginSession session, Packet packet) {
		int playerStaticIndex = packet.getShort();
		int basicMatterId = packet.get();
		if (basicMatterId != 3) {
			ReferencedPerson p = session.getPlayer(playerStaticIndex);
			p.setStatus(basicMatterId);
			PlayerCommunication.appendInteraction(p);
		} else {
			session.releasePerson(playerStaticIndex);
		}
	}
}


text:
layout: page
title: Jimenez Air Party
date: 2016-05-24
author: Carolyn Cooper
tags: weekly links, java
status: published
summary: Etiam suscipit dictum quam eu suscipit. Cras egestas, magna at.
banner: images/banner/leisure-04.jpg
booking:
  startDate: 05/08/2018
  endDate: 05/09/2018
  ctyhocn: CHIGUHX
  groupCode: JAP
published: true
---
Praesent ut sem venenatis, feugiat arcu sit amet, viverra metus. Sed sit amet velit mollis, scelerisque lacus vel, pellentesque augue. Mauris quis nunc vitae arcu sollicitudin hendrerit ullamcorper nec mauris. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce tellus massa, sagittis in pharetra id, euismod eu sem. Ut quis neque porttitor, scelerisque dolor eu, dapibus lectus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras feugiat odio in elit malesuada varius. Cras ullamcorper nibh eu felis finibus, ac fringilla elit feugiat. Aliquam semper luctus elit a tincidunt.

* In ornare nunc ac metus finibus, id vehicula nisl feugiat
* Nam ullamcorper felis eget ipsum bibendum, mollis laoreet libero maximus
* Donec eget sapien vitae nibh pulvinar euismod
* Suspendisse vitae ex ac sapien sodales volutpat nec id est.

Donec metus nunc, porttitor fringilla est iaculis, faucibus tristique magna. Donec a nibh libero. Sed mattis volutpat tortor, interdum rutrum mauris hendrerit vitae. Etiam sed tortor in mi iaculis tincidunt ac vitae quam. Nulla porta facilisis sapien, eget tempus erat ullamcorper ultricies. In at elementum nunc, sit amet egestas magna. Etiam eget dolor eu elit dapibus congue ac at odio. Curabitur lacinia nunc eleifend bibendum ornare.
Morbi cursus nibh orci, nec suscipit urna dictum ac. Donec sodales pellentesque urna, sed auctor quam scelerisque at. Donec lobortis nunc velit, eget sodales ex luctus sed. Vivamus scelerisque massa in dui consequat condimentum. Maecenas mi mi, molestie vel nunc sed, cursus lacinia sem. Mauris eros dolor, mollis ut dui vel, condimentum consequat nulla. Ut varius, risus at egestas rutrum, risus lectus facilisis ante, vel suscipit turpis felis nec augue. Curabitur feugiat tempus ante, non porta eros pulvinar ut. Phasellus bibendum dolor eros, ut pellentesque ipsum euismod id.


text:
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;

namespace OpenRiaServices.DomainControllers.Server.Metadata
{
    /// <summary>
    /// Custom TypeDescriptor for Types exposed by a <see cref="DomainController"/>.
    /// </summary>
    internal class DomainControllerTypeDescriptor : CustomTypeDescriptor
    {
        private readonly HashSet<string> _foreignKeyMembers;
        private readonly bool _keyIsEditable;
        private PropertyDescriptorCollection _properties;

        public DomainControllerTypeDescriptor(ICustomTypeDescriptor parent, bool keyIsEditable, HashSet<string> foreignKeyMembers)
            : base(parent)
        {
            _keyIsEditable = keyIsEditable;
            _foreignKeyMembers = foreignKeyMembers;
        }

        public override PropertyDescriptorCollection GetProperties()
        {
            if (_properties == null)
            {
                // Get properties from our parent
                PropertyDescriptorCollection originalCollection = base.GetProperties();

                // Set _properties to avoid a stack overflow when CreateProjectionProperties
                // ends up recursively calling TypeDescriptor.GetProperties on a type.
                _properties = originalCollection;

                bool customDescriptorsCreated = false;
                List<PropertyDescriptor> tempPropertyDescriptors = new List<PropertyDescriptor>();

                // for every property exposed by our parent, see if we have additional metadata to add,
                // and if we do we need to add a wrapper PropertyDescriptor to add the new attributes
                foreach (PropertyDescriptor propDescriptor in _properties)
                {
                    Attribute[] newMetadata = GetAdditionalAttributes(propDescriptor);
                    if (newMetadata.Length > 0)
                    {
                        tempPropertyDescriptors.Add(new DomainControllerPropertyDescriptor(propDescriptor, newMetadata));
                        customDescriptorsCreated = true;
                    }
                    else
                    {
                        tempPropertyDescriptors.Add(propDescriptor);
                    }
                }

                if (customDescriptorsCreated)
                {
                    _properties = new PropertyDescriptorCollection(tempPropertyDescriptors.ToArray(), true);
                }
            }

            return _properties;
        }

        /// <summary>
        /// Return an array of new attributes for the specified PropertyDescriptor. If no
        /// attributes need to be added, return an empty array.
        /// </summary>
        /// <param name="pd">The property to add attributes for.</param>
        /// <returns>The collection of new attributes.</returns>
        private Attribute[] GetAdditionalAttributes(PropertyDescriptor pd)
        {
            List<Attribute> additionalAttributes = new List<Attribute>();

            if (ShouldAddRoundTripAttribute(pd, _foreignKeyMembers.Contains(pd.Name)))
            {
                additionalAttributes.Add(new RoundtripOriginalAttribute());
            }

            bool allowInitialValue;
            if (ShouldAddEditableFalseAttribute(pd, _keyIsEditable, out allowInitialValue))
            {
                additionalAttributes.Add(new EditableAttribute(false) { AllowInitialValue = allowInitialValue });
            }

            return additionalAttributes.ToArray();
        }

        /// <summary>
        /// Determines whether a type uses any features requiring the
        /// <see cref="DomainControllerTypeDescriptor"/> to be registered. We do this
        /// check as an optimization so we're not adding additional TDPs to the
        /// chain when they're not necessary.
        /// </summary>
        /// <param name="descriptor">The descriptor for the type to check.</param>
        /// <param name="keyIsEditable">Indicates whether the key for this Type is editable.</param>
        /// <param name="foreignKeyMembers">The set of foreign key members for the Type.</param>
        /// <returns>Returns <c>true</c> if the type uses any features requiring the
        /// <see cref="DomainControllerTypeDescriptionProvider"/> to be registered.</returns>
        internal static bool ShouldRegister(ICustomTypeDescriptor descriptor, bool keyIsEditable, HashSet<string> foreignKeyMembers)
        {
            foreach (PropertyDescriptor pd in descriptor.GetProperties())
            {
                // If there are any attributes that should be inferred for this member, then
                // we will register the descriptor
                if (ShouldInferAttributes(pd, keyIsEditable, foreignKeyMembers))
                {
                    return true;
                }
            }

            return false;
        }

        /// <summary>
        /// Returns true if the specified member requires a RoundTripOriginalAttribute
        /// and one isn't already present.
        /// </summary>
        /// <param name="pd">The member to check.</param>
        /// <param name="isFkMember">True if the member is a foreign key, false otherwise.</param>
        /// <returns>True if RoundTripOriginalAttribute should be added, false otherwise.</returns>
        private static bool ShouldAddRoundTripAttribute(PropertyDescriptor pd, bool isFkMember)
        {
            if (pd.Attributes[typeof(RoundtripOriginalAttribute)] != null || pd.Attributes[typeof(AssociationAttribute)] != null)
            {
                // already has the attribute or is an association
                return false;
            }

            if (isFkMember || pd.Attributes[typeof(ConcurrencyCheckAttribute)] != null ||
                pd.Attributes[typeof(TimestampAttribute)] != null || pd.Attributes[typeof(KeyAttribute)] != null)
            {
                return true;
            }

            return false;
        }

        /// <summary>
        /// Returns <c>true</c> if the specified member requires an <see cref="EditableAttribute"/>
        /// to make the member read-only and one isn't already present.
        /// </summary>
        /// <param name="pd">The member to check.</param>
        /// <param name="keyIsEditable">Indicates whether the key for this Type is editable.</param>
        /// <param name="allowInitialValue">
        /// The default that should be used for <see cref="EditableAttribute.AllowInitialValue"/> if the attribute
        /// should be added to the member.
        /// </param>
        /// <returns><c>true</c> if <see cref="EditableAttribute"/> should be added, <c>false</c> otherwise.</returns>
        private static bool ShouldAddEditableFalseAttribute(PropertyDescriptor pd, bool keyIsEditable, out bool allowInitialValue)
        {
            allowInitialValue = false;

            if (pd.Attributes[typeof(EditableAttribute)] != null)
            {
                // already has the attribute
                return false;
            }

            bool hasKeyAttribute = (pd.Attributes[typeof(KeyAttribute)] != null);
            if (hasKeyAttribute && keyIsEditable)
            {
                return false;
            }

            if (hasKeyAttribute || pd.Attributes[typeof(TimestampAttribute)] != null)
            {
                // If we're inferring EditableAttribute because of a KeyAttribute
                // we want to allow initial value for the member.
                allowInitialValue = hasKeyAttribute;
                return true;
            }

            return false;
        }

        /// <summary>
        /// Determines if there are any attributes that can be inferred for the specified member.
        /// </summary>
        /// <param name="pd">The member to check.</param>
        /// <param name="keyIsEditable">Indicates whether the key for this Type is editable.</param>
        /// <param name="foreignKeyMembers">Collection of foreign key members for the Type.</param>
        /// <returns><c>true</c> if there are attributes to be inferred, <c>false</c> otherwise.</returns>
        private static bool ShouldInferAttributes(PropertyDescriptor pd, bool keyIsEditable, IEnumerable<string> foreignKeyMembers)
        {
            bool allowInitialValue;

            return ShouldAddEditableFalseAttribute(pd, keyIsEditable, out allowInitialValue) ||
                   ShouldAddRoundTripAttribute(pd, foreignKeyMembers.Contains(pd.Name));
        }
    }

    /// <summary>
    /// PropertyDescriptor wrapper.
    /// </summary>
    internal class DomainControllerPropertyDescriptor : PropertyDescriptor
    {
        private readonly PropertyDescriptor _base;

        public DomainControllerPropertyDescriptor(PropertyDescriptor pd, Attribute[] attribs)
            : base(pd, attribs)
        {
            _base = pd;
        }

        public override Type ComponentType
        {
            get { return _base.ComponentType; }
        }

        public override bool IsReadOnly
        {
            get { return _base.IsReadOnly; }
        }

        public override Type PropertyType
        {
            get { return _base.PropertyType; }
        }

        public override object GetValue(object component)
        {
            return _base.GetValue(component);
        }

        public override void SetValue(object component, object value)
        {
            _base.SetValue(component, value);
        }

        public override bool ShouldSerializeValue(object component)
        {
            return _base.ShouldSerializeValue(component);
        }

        public override bool CanResetValue(object component)
        {
            return _base.CanResetValue(component);
        }

        public override void ResetValue(object component)
        {
            _base.ResetValue(component);
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--This Adobe Flex compiler configuration file was generated by a tool.-->
<!--Any modifications you make may be lost.-->
<flex-config>
  <target-player>11.0</target-player>
  <benchmark>false</benchmark>
  <static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
  <compiler>
    <define append="true">
      <name>CONFIG::debug</name>
      <value>true</value>
    </define>
    <define append="true">
      <name>CONFIG::release</name>
      <value>false</value>
    </define>
    <define append="true">
      <name>CONFIG::timeStamp</name>
      <value>'4/14/2014'</value>
    </define>
    <define append="true">
      <name>CONFIG::air</name>
      <value>false</value>
    </define>
    <define append="true">
      <name>CONFIG::mobile</name>
      <value>false</value>
    </define>
    <define append="true">
      <name>CONFIG::desktop</name>
      <value>false</value>
    </define>
    <verbose-stacktraces>true</verbose-stacktraces>
    <source-path append="true">
      <path-element>C:\Users\Andrew\Documents\GitHub\llfe\src</path-element>
      <path-element>C:\Program Files (x86)\FlashDevelop\Library\AS3\classes</path-element>
    </source-path>
  </compiler>
  <file-specs>
    <path-element>C:\Users\Andrew\Documents\GitHub\llfe\src\test\Main.as</path-element>
  </file-specs>
  <default-background-color>#FFFFFF</default-background-color>
  <default-frame-rate>30</default-frame-rate>
  <default-size>
    <width>800</width>
    <height>600</height>
  </default-size>
</flex-config>


text:
package org.gradle.integtests.tooling.r32;

import org.gradle.tooling.BuildAction;
import org.gradle.tooling.BuildController;

import java.util.Collections;
import java.util.List;

public class Action2 implements BuildAction<List<String>> {
    @Override
    public List<String> execute(BuildController controller) {
        return Collections.singletonList(controller.getBuildModel().getRootProject().getName() + " " + (++SharedActionStaticState.counter));
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OOPadv
{
    public interface ICustomList<T>
    {
        List<T> Items { get; }

        void Add(T element);

        T Remove(int index);

        bool Contains(T element);

        void Swap(int index1, int index2);

        int CountGreaterThan(T element);

        T Max();

        T Min();

        void Print();
    }
}


text:
@class SJRegion;

@interface SJLocation : NSObject

@property(nonatomic, weak) SJRegion *region;

@property(nonatomic, strong, readonly) NSString *street;
@property(nonatomic, strong, readonly) NSString *number;
@property(nonatomic, strong, readonly) NSString *suffix;

+ (void)setStreetNames:(NSArray *)streets;

+ (SJLocation *)location;
+ (SJLocation *)location:(SJRegion *)region;

- (NSString *)full; // number street, city, state zip(+addon)
- (NSString *)address; // number street

@end