text:
import {Component, OnInit, Input} from '@angular/core';
import {TestDetail, TestResult} from "../../../model/tests";
import {Alert} from "../../../model/alert";
import {AlertService} from "../../../service/alert.service";
import {Subscription} from "rxjs";
import {LoggingService} from "../../../service/logging.service";
import {TestService} from "../../../service/test.service";
import {SocketEvent} from "../../../model/socket.event";

@Component({
    selector: "test-detail",
    templateUrl: 'test-detail.html'
})
export class TestDetailComponent implements OnInit {

    @Input() detail: TestDetail;

    constructor(private _alertService: AlertService,
                private _testService: TestService,
                private loggingService: LoggingService) {}

    private loggingOutputSubscription: Subscription;
    private loggingEventSubscription: Subscription;

    completed = 0;
    failed = false;

    finishedActions = 0;

    logs = "";
    loggingFrame = "";

    ngOnInit() {
        this.loggingOutputSubscription = this.loggingService.logOutput
            .subscribe((e: SocketEvent) => {
                jQuery('pre.logger').scrollTop(jQuery('pre.logger')[0].scrollHeight);
                this.logs += e.msg;
                this.loggingFrame = e.msg;
                this.handle(e);
            });

        this.loggingEventSubscription = this.loggingService.testEvents
            .subscribe(this.handle);
    }

    ngOnDestroy(): void {
        if(this.loggingOutputSubscription) {
            this.loggingOutputSubscription.unsubscribe();
        }

        if(this.loggingEventSubscription) {
            this.loggingEventSubscription.unsubscribe();
        }
    }

    execute() {
        this.logs = "";
        this.loggingFrame = "";
        this.failed = false;
        this.completed = 0;
        this.finishedActions = 0;
        this.detail.messages = [];
        this.detail.running = true;
        this.detail.result = undefined;
        this._testService.execute(this.detail)
            .subscribe(
                processId => {
                    this.detail.result = new TestResult();
                    this.detail.result.test = this.detail;
                    this.detail.result.processId = processId;
                },
                error => this.notifyError(<any>error));
    }

    handle(event: SocketEvent) {
        console.log('Handle', event);
        if ("PROCESS_START" == event.type) {
            this.completed = 1;
        } else if ("TEST_START" == event.type) {
            this.completed = 1;
        } else if ("TEST_ACTION_FINISH" == event.type) {
            this.finishedActions++;

            if (this.detail.actions.length) {
                this.completed = Math.round((this.finishedActions / this.detail.actions.length) * 100);
            } else if (this.completed < 90) {
                this.completed += 2;
            }
        } else if ("TEST_FAILED" == event.type || "PROCESS_FAILED" == event.type) {
            this.failed = true;
            if (this.detail.result) {
                this.detail.result.status = 'FAIL';
            }
        } else if ("TEST_SUCCESS" == event.type || "PROCESS_SUCCESS" == event.type) {
            this.failed = false;
            if (this.detail.result) {
                this.detail.result.status = 'PASS';
            }
        } else if ("TEST_SKIP" == event.type) {
            this.failed = false;
            if (this.detail.result) {
                this.detail.result.status = 'SKIP';
            }
        } else {
            if (this.completed < 11) {
                this.completed++;
            }
        }

        if ("PROCESS_FAILED" == event.type || "PROCESS_SUCCESS" == event.type) {
            this.completed = 100;
            this.detail.running = false;
            this.loggingFrame = this.logs;
            jQuery('pre.logger').scrollTop(jQuery('pre.logger')[0].scrollHeight);
        }
    }

    hasResult() {
      return this.detail.result != undefined;
    }

    notifyError(error: any) {
        this._alertService.add(new Alert("danger", JSON.stringify(error), false));
    }
}


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<meta http-equiv="x-ua-compatible" content="ie=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui" />

			<form id="form">
				<input
					id="123"
					name="123"
					type="text"
					cf-questions="Hello, please tell me your name?"
				/>

				<fieldset cf-questions="Choose your favourite color, blue, red or yellow">
					<input type="radio" cf-label="blue" value="blue" id="1" />
					<input type="radio" cf-label="red" value="red" id="2" />
					<input type="radio" cf-label="yellow" value="yellow" id="3" />
				</fieldset>
			</form>

		<link type="text/css" rel="stylesheet" href="../build/conversational-form.css"/>

redpajama_set_name: RedPajamaGithub


text:
package operations

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"
	"net/http"
	"strings"

	"github.com/go-swagger/go-swagger/httpkit"
	"github.com/go-swagger/go-swagger/httpkit/middleware"
	"github.com/go-swagger/go-swagger/httpkit/security"
	"github.com/go-swagger/go-swagger/spec"
	"github.com/go-swagger/go-swagger/strfmt"

	"github.com/go-swagger/go-swagger/examples/generated/restapi/operations/pet"
	"github.com/go-swagger/go-swagger/examples/generated/restapi/operations/store"
	"github.com/go-swagger/go-swagger/examples/generated/restapi/operations/user"
)

// NewPetstoreAPI creates a new Petstore instance
func NewPetstoreAPI(spec *spec.Document) *PetstoreAPI {
	o := &PetstoreAPI{
		spec:            spec,
		handlers:        make(map[string]map[string]http.Handler),
		formats:         strfmt.Default,
		defaultConsumes: "application/json",
		defaultProduces: "application/json",
	}

	return o
}

/*PetstoreAPI This is a sample server Petstore server.

[Learn about Swagger](http://swagger.wordnik.com) or join the IRC channel `#swagger` on irc.freenode.net.

For this sample, you can use the api key `special-key` to test the authorization filters
*/
type PetstoreAPI struct {
	spec            *spec.Document
	context         *middleware.Context
	handlers        map[string]map[string]http.Handler
	formats         strfmt.Registry
	defaultConsumes string
	defaultProduces string
	// JSONConsumer registers a consumer for a "application/json" mime type
	JSONConsumer httpkit.Consumer
	// XMLConsumer registers a consumer for a "application/xml" mime type
	XMLConsumer httpkit.Consumer

	// JSONProducer registers a producer for a "application/json" mime type
	JSONProducer httpkit.Producer
	// XMLProducer registers a producer for a "application/xml" mime type
	XMLProducer httpkit.Producer

	// APIKeyAuth registers a function that takes a token and returns a principal
	// it performs authentication based on an api key api_key provided in the header
	APIKeyAuth func(string) (interface{}, error)

	// PetAddPetHandler sets the operation handler for the add pet operation
	PetAddPetHandler pet.AddPetHandler
	// UserCreateUserHandler sets the operation handler for the create user operation
	UserCreateUserHandler user.CreateUserHandler
	// UserCreateUsersWithArrayInputHandler sets the operation handler for the create users with array input operation
	UserCreateUsersWithArrayInputHandler user.CreateUsersWithArrayInputHandler
	// UserCreateUsersWithListInputHandler sets the operation handler for the create users with list input operation
	UserCreateUsersWithListInputHandler user.CreateUsersWithListInputHandler
	// StoreDeleteOrderHandler sets the operation handler for the delete order operation
	StoreDeleteOrderHandler store.DeleteOrderHandler
	// PetDeletePetHandler sets the operation handler for the delete pet operation
	PetDeletePetHandler pet.DeletePetHandler
	// UserDeleteUserHandler sets the operation handler for the delete user operation
	UserDeleteUserHandler user.DeleteUserHandler
	// PetFindPetsByStatusHandler sets the operation handler for the find pets by status operation
	PetFindPetsByStatusHandler pet.FindPetsByStatusHandler
	// PetFindPetsByTagsHandler sets the operation handler for the find pets by tags operation
	PetFindPetsByTagsHandler pet.FindPetsByTagsHandler
	// StoreGetOrderByIDHandler sets the operation handler for the get order by id operation
	StoreGetOrderByIDHandler store.GetOrderByIDHandler
	// PetGetPetByIDHandler sets the operation handler for the get pet by id operation
	PetGetPetByIDHandler pet.GetPetByIDHandler
	// UserGetUserByNameHandler sets the operation handler for the get user by name operation
	UserGetUserByNameHandler user.GetUserByNameHandler
	// UserLoginUserHandler sets the operation handler for the login user operation
	UserLoginUserHandler user.LoginUserHandler
	// UserLogoutUserHandler sets the operation handler for the logout user operation
	UserLogoutUserHandler user.LogoutUserHandler
	// StorePlaceOrderHandler sets the operation handler for the place order operation
	StorePlaceOrderHandler store.PlaceOrderHandler
	// PetUpdatePetHandler sets the operation handler for the update pet operation
	PetUpdatePetHandler pet.UpdatePetHandler
	// PetUpdatePetWithFormHandler sets the operation handler for the update pet with form operation
	PetUpdatePetWithFormHandler pet.UpdatePetWithFormHandler
	// UserUpdateUserHandler sets the operation handler for the update user operation
	UserUpdateUserHandler user.UpdateUserHandler

	// ServeError is called when an error is received, there is a default handler
	// but you can set your own with this
	ServeError func(http.ResponseWriter, *http.Request, error)
}

// SetDefaultProduces sets the default produces media type
func (o *PetstoreAPI) SetDefaultProduces(mediaType string) {
	o.defaultProduces = mediaType
}

// SetDefaultConsumes returns the default consumes media type
func (o *PetstoreAPI) SetDefaultConsumes(mediaType string) {
	o.defaultConsumes = mediaType
}

// DefaultProduces returns the default produces media type
func (o *PetstoreAPI) DefaultProduces() string {
	return o.defaultProduces
}

// DefaultConsumes returns the default consumes media type
func (o *PetstoreAPI) DefaultConsumes() string {
	return o.defaultConsumes
}

// Formats returns the registered string formats
func (o *PetstoreAPI) Formats() strfmt.Registry {
	return o.formats
}

// RegisterFormat registers a custom format validator
func (o *PetstoreAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) {
	o.formats.Add(name, format, validator)
}

// Validate validates the registrations in the PetstoreAPI
func (o *PetstoreAPI) Validate() error {
	var unregistered []string

	if o.JSONConsumer == nil {
		unregistered = append(unregistered, "JSONConsumer")
	}

	if o.XMLConsumer == nil {
		unregistered = append(unregistered, "XMLConsumer")
	}

	if o.JSONProducer == nil {
		unregistered = append(unregistered, "JSONProducer")
	}

	if o.XMLProducer == nil {
		unregistered = append(unregistered, "XMLProducer")
	}

	if o.APIKeyAuth == nil {
		unregistered = append(unregistered, "APIKeyAuth")
	}

	if o.PetAddPetHandler == nil {
		unregistered = append(unregistered, "pet.AddPetHandler")
	}

	if o.UserCreateUserHandler == nil {
		unregistered = append(unregistered, "user.CreateUserHandler")
	}

	if o.UserCreateUsersWithArrayInputHandler == nil {
		unregistered = append(unregistered, "user.CreateUsersWithArrayInputHandler")
	}

	if o.UserCreateUsersWithListInputHandler == nil {
		unregistered = append(unregistered, "user.CreateUsersWithListInputHandler")
	}

	if o.StoreDeleteOrderHandler == nil {
		unregistered = append(unregistered, "store.DeleteOrderHandler")
	}

	if o.PetDeletePetHandler == nil {
		unregistered = append(unregistered, "pet.DeletePetHandler")
	}

	if o.UserDeleteUserHandler == nil {
		unregistered = append(unregistered, "user.DeleteUserHandler")
	}

	if o.PetFindPetsByStatusHandler == nil {
		unregistered = append(unregistered, "pet.FindPetsByStatusHandler")
	}

	if o.PetFindPetsByTagsHandler == nil {
		unregistered = append(unregistered, "pet.FindPetsByTagsHandler")
	}

	if o.StoreGetOrderByIDHandler == nil {
		unregistered = append(unregistered, "store.GetOrderByIDHandler")
	}

	if o.PetGetPetByIDHandler == nil {
		unregistered = append(unregistered, "pet.GetPetByIDHandler")
	}

	if o.UserGetUserByNameHandler == nil {
		unregistered = append(unregistered, "user.GetUserByNameHandler")
	}

	if o.UserLoginUserHandler == nil {
		unregistered = append(unregistered, "user.LoginUserHandler")
	}

	if o.UserLogoutUserHandler == nil {
		unregistered = append(unregistered, "user.LogoutUserHandler")
	}

	if o.StorePlaceOrderHandler == nil {
		unregistered = append(unregistered, "store.PlaceOrderHandler")
	}

	if o.PetUpdatePetHandler == nil {
		unregistered = append(unregistered, "pet.UpdatePetHandler")
	}

	if o.PetUpdatePetWithFormHandler == nil {
		unregistered = append(unregistered, "pet.UpdatePetWithFormHandler")
	}

	if o.UserUpdateUserHandler == nil {
		unregistered = append(unregistered, "user.UpdateUserHandler")
	}

	if len(unregistered) > 0 {
		return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", "))
	}

	return nil
}

// ServeErrorFor gets a error handler for a given operation id
func (o *PetstoreAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) {
	return o.ServeError
}

// AuthenticatorsFor gets the authenticators for the specified security schemes
func (o *PetstoreAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]httpkit.Authenticator {

	result := make(map[string]httpkit.Authenticator)
	for name, scheme := range schemes {
		switch name {

		case "api_key":

			result[name] = security.APIKeyAuth(scheme.Name, scheme.In, func(tok string) (interface{}, error) { return o.APIKeyAuth(tok) })

		}
	}
	return result

}

// ConsumersFor gets the consumers for the specified media types
func (o *PetstoreAPI) ConsumersFor(mediaTypes []string) map[string]httpkit.Consumer {

	result := make(map[string]httpkit.Consumer)
	for _, mt := range mediaTypes {
		switch mt {

		case "application/json":
			result["application/json"] = o.JSONConsumer

		case "application/xml":
			result["application/xml"] = o.XMLConsumer

		}
	}
	return result

}

// ProducersFor gets the producers for the specified media types
func (o *PetstoreAPI) ProducersFor(mediaTypes []string) map[string]httpkit.Producer {

	result := make(map[string]httpkit.Producer)
	for _, mt := range mediaTypes {
		switch mt {

		case "application/json":
			result["application/json"] = o.JSONProducer

		case "application/xml":
			result["application/xml"] = o.XMLProducer

		}
	}
	return result

}

// HandlerFor gets a http.Handler for the provided operation method and path
func (o *PetstoreAPI) HandlerFor(method, path string) (http.Handler, bool) {
	if o.handlers == nil {
		return nil, false
	}
	um := strings.ToUpper(method)
	if _, ok := o.handlers[um]; !ok {
		return nil, false
	}
	h, ok := o.handlers[um][path]
	return h, ok
}

func (o *PetstoreAPI) initHandlerCache() {
	if o.context == nil {
		o.context = middleware.NewRoutableContext(o.spec, o, nil)
	}

	if o.handlers == nil {
		o.handlers = make(map[string]map[string]http.Handler)
	}

	if o.handlers["POST"] == nil {
		o.handlers[strings.ToUpper("POST")] = make(map[string]http.Handler)
	}
	o.handlers["POST"]["/pets"] = pet.NewAddPet(o.context, o.PetAddPetHandler)

	if o.handlers["POST"] == nil {
		o.handlers[strings.ToUpper("POST")] = make(map[string]http.Handler)
	}
	o.handlers["POST"]["/users"] = user.NewCreateUser(o.context, o.UserCreateUserHandler)

	if o.handlers["POST"] == nil {
		o.handlers[strings.ToUpper("POST")] = make(map[string]http.Handler)
	}
	o.handlers["POST"]["/users/createWithArray"] = user.NewCreateUsersWithArrayInput(o.context, o.UserCreateUsersWithArrayInputHandler)

	if o.handlers["POST"] == nil {
		o.handlers[strings.ToUpper("POST")] = make(map[string]http.Handler)
	}
	o.handlers["POST"]["/users/createWithList"] = user.NewCreateUsersWithListInput(o.context, o.UserCreateUsersWithListInputHandler)

	if o.handlers["DELETE"] == nil {
		o.handlers[strings.ToUpper("DELETE")] = make(map[string]http.Handler)
	}
	o.handlers["DELETE"]["/stores/order/{orderId}"] = store.NewDeleteOrder(o.context, o.StoreDeleteOrderHandler)

	if o.handlers["DELETE"] == nil {
		o.handlers[strings.ToUpper("DELETE")] = make(map[string]http.Handler)
	}
	o.handlers["DELETE"]["/pets/{petId}"] = pet.NewDeletePet(o.context, o.PetDeletePetHandler)

	if o.handlers["DELETE"] == nil {
		o.handlers[strings.ToUpper("DELETE")] = make(map[string]http.Handler)
	}
	o.handlers["DELETE"]["/users/{username}"] = user.NewDeleteUser(o.context, o.UserDeleteUserHandler)

	if o.handlers["GET"] == nil {
		o.handlers[strings.ToUpper("GET")] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/pets/findByStatus"] = pet.NewFindPetsByStatus(o.context, o.PetFindPetsByStatusHandler)

	if o.handlers["GET"] == nil {
		o.handlers[strings.ToUpper("GET")] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/pets/findByTags"] = pet.NewFindPetsByTags(o.context, o.PetFindPetsByTagsHandler)

	if o.handlers["GET"] == nil {
		o.handlers[strings.ToUpper("GET")] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/stores/order/{orderId}"] = store.NewGetOrderByID(o.context, o.StoreGetOrderByIDHandler)

	if o.handlers["GET"] == nil {
		o.handlers[strings.ToUpper("GET")] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/pets/{petId}"] = pet.NewGetPetByID(o.context, o.PetGetPetByIDHandler)

	if o.handlers["GET"] == nil {
		o.handlers[strings.ToUpper("GET")] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/users/{username}"] = user.NewGetUserByName(o.context, o.UserGetUserByNameHandler)

	if o.handlers["GET"] == nil {
		o.handlers[strings.ToUpper("GET")] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/users/login"] = user.NewLoginUser(o.context, o.UserLoginUserHandler)

	if o.handlers["GET"] == nil {
		o.handlers[strings.ToUpper("GET")] = make(map[string]http.Handler)
	}
	o.handlers["GET"]["/users/logout"] = user.NewLogoutUser(o.context, o.UserLogoutUserHandler)

	if o.handlers["POST"] == nil {
		o.handlers[strings.ToUpper("POST")] = make(map[string]http.Handler)
	}
	o.handlers["POST"]["/stores/order"] = store.NewPlaceOrder(o.context, o.StorePlaceOrderHandler)

	if o.handlers["PUT"] == nil {
		o.handlers[strings.ToUpper("PUT")] = make(map[string]http.Handler)
	}
	o.handlers["PUT"]["/pets"] = pet.NewUpdatePet(o.context, o.PetUpdatePetHandler)

	if o.handlers["POST"] == nil {
		o.handlers[strings.ToUpper("POST")] = make(map[string]http.Handler)
	}
	o.handlers["POST"]["/pets/{petId}"] = pet.NewUpdatePetWithForm(o.context, o.PetUpdatePetWithFormHandler)

	if o.handlers["PUT"] == nil {
		o.handlers[strings.ToUpper("PUT")] = make(map[string]http.Handler)
	}
	o.handlers["PUT"]["/users/{username}"] = user.NewUpdateUser(o.context, o.UserUpdateUserHandler)

}

// Serve creates a http handler to serve the API over HTTP
// can be used directly in http.ListenAndServe(":8000", api.Serve(nil))
func (o *PetstoreAPI) Serve(builder middleware.Builder) http.Handler {
	if len(o.handlers) == 0 {
		o.initHandlerCache()
	}

	return o.context.APIHandler(builder)
}


text:
module Basil
  class QuoteDb
    KEY ||= :quotedb_grabs

    def self.quote(name, random = false)
      ret = nil

      Storage.with_storage do |store|
        store[KEY] ||= []

        grabs = store[KEY].select { |msg| msg[:who] =~ /#{name}/i }

        unless grabs.empty?
          msg = if random && grabs.length > 1
                  grabs.shuffle.first
                else
                  grabs.last
                end

          ret = "<#{msg[:who]}> #{msg[:what]}"
        end
      end

      ret
    end
  end
end

# grabs the last thing the named person said and stores it
Basil.respond_to(/^grab (.+)/) do

  if msg = chat_history(:from => @match_data[1]).first
    Basil::Storage.with_storage do |store|
      quote = { :who => msg.from_name, :what => msg.text }

      store[Basil::QuoteDb::KEY] ||= []
      store[Basil::QuoteDb::KEY] << quote
    end

    says 'Ta-da!'
  end

end

# replies with the last quote grabbed for the named person
Basil.respond_to(/^q(uote)? (.+)/) do
  quote = Basil::QuoteDb.quote(@match_data[2])
  quote ? says(quote) : nil
end

# replies with a random quote grabbed for the named person
Basil.respond_to(/^rq(uote)? (.+)/) do
  quote = Basil::QuoteDb.quote(@match_data[2], true)
  quote ? says(quote) : nil
end


text:
@interface LogMessage : NSObject <K9LogMessage>

@property (nonatomic, nonnull) NSString          *text;
@property (nonatomic)          K9LogMessageLevel  level;
@property (nonatomic, nonnull) NSDate            *timestamp;
@property (nonatomic, nonnull) NSString          *filePath;
@property (nonatomic)          NSUInteger         lineNumber;
@property (nonatomic, nonnull) NSString          *methodName;

@end


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

  <string name="acc_label_card_number">Número do cartão</string>
  <string name="acc_label_card_number_node">%s, número do cartão</string>
  <string name="acc_label_cvc_node">%s, CVC</string>
  <string name="acc_label_expiry_date">Data de validade</string>
  <string name="acc_label_expiry_date_node">%s, data de validade</string>

  <string name="acc_label_zip">Código postal</string>

  <string name="acc_label_zip_short">CEP</string>

  <string name="added">Adicionou %s</string>

  <string name="address_city_required">Informe sua cidade</string>

  <string name="address_country_invalid">País inválido</string>

  <string name="address_county_required">Informe seu condado</string>

  <string name="address_label_address">Endereço</string>

  <string name="address_label_address_line1_optional">Endereço – Linha 1 (opcional)</string>

  <string name="address_label_address_line2_optional">Endereço – Linha 2 (opcional)</string>

  <string name="address_label_address_optional">Endereço (opcional)</string>

  <string name="address_label_apt_optional">Apt. (opcional)</string>

  <string name="address_label_city_optional">Cidade (opcional)</string>

  <string name="address_label_county_optional">Condado (opcional)</string>

  <string name="address_label_phone_number">Telefone</string>

  <string name="address_label_phone_number_optional">Telefone (opcional)</string>

  <string name="address_label_postal_code_optional">Código postal (opcional)</string>

  <string name="address_label_postcode">Código postal</string>

  <string name="address_label_postcode_optional">Código postal (opcional)</string>

  <string name="address_label_province_optional">Província (opcional)</string>

  <string name="address_label_region_generic">Estado/Província/Região</string>

  <string name="address_label_region_generic_optional">Estado/Província/Região (opcional)</string>

  <string name="address_label_state_optional">Estado (opcional)</string>

  <string name="address_label_zip_code_optional">Código postal (opcional)</string>

  <string name="address_label_zip_postal_code">Código postal</string>

  <string name="address_label_zip_postal_code_optional">Código postal (opcional)</string>

  <string name="address_name_required">Informe seu nome</string>

  <string name="address_phone_number_required">Informe seu telefone</string>

  <string name="address_postal_code_invalid">Código postal inválido.</string>

  <string name="address_postcode_invalid">Código postal inválido</string>

  <string name="address_province_required">Informe sua província</string>

  <string name="address_region_generic_required">Informe seu estado/província/região</string>

  <string name="address_required">Informe seu endereço</string>

  <string name="address_state_required">Informe seu estado</string>

  <string name="address_zip_invalid">Código postal inválido.</string>

  <string name="address_zip_postal_invalid">Código postal inválido.</string>

  <string name="affirm_buy_now_pay_later">Pagar depois com .</string>

  <string name="au_becs_account_name">Nome na conta</string>

  <string name="au_becs_bsb_number">Número BSB</string>

  <string name="au_becs_mandate">Ao informar os dados da sua conta bancária e confirmar este pagamento, você aceita esta Solicitação de Débito Automático e o contrato de serviço de Solicitação de Débito Automático e autoriza a Stripe Payments Australia Pty Ltd ACN 160 180 343 com número de Usuário para Débito Direto 507156 (a "Stripe") a debitar de sua conta pelo Bulk Electronic Clearing System (BECS) em nome de %s (o \"Comerciante\") quaisquer quantias comunicadas separadamente a você pelo Comerciante. Você confirma que é titular da conta ou signatário autorizado da conta indicada acima.</string>

  <string name="becs_mandate_acceptance">\n    Ao informar os dados da sua conta bancária e confirmar este pagamento, você aceita esta\n    Solicitação de Débito Direto e o contrato de serviço da Solicitação de Débito Direto, bem como autoriza a\n    Stripe Payments Australia Pty Ltd ACN 160 180 343 com número de Usuário para Débito Direto 507156\n    (a "Stripe") a debitar de sua conta pelo Bulk Electronic Clearing System (BECS) em\n    nome de %1$s (o \"Comerciante\") quaisquer quantias comunicadas separadamente a você\n    pelo Comerciante. Você confirma que é títular da conta ou signatário\n    autorizado da conta listada acima.\n    </string>

  <string name="becs_widget_account_number">Número da conta</string>

  <string name="becs_widget_account_number_incomplete">O número da conta está incompleto.</string>

  <string name="becs_widget_account_number_required">É obrigatório informar seu número da conta.</string>

  <string name="becs_widget_bsb">BSB</string>

  <string name="becs_widget_bsb_incomplete">O BSB inserido está incompleto.</string>

  <string name="becs_widget_bsb_invalid">O BSB inserido é inválido.</string>

  <string name="becs_widget_email">Endereço de e-mail</string>

  <string name="becs_widget_email_invalid">Endereço de e-mail inválido.</string>

  <string name="becs_widget_email_required">É obrigatório informar seu e-mail.</string>

  <string name="becs_widget_name">Nome</string>

  <string name="becs_widget_name_required">É obrigatório informar seu nome.</string>

  <string name="cancel">Cancelar</string>

  <string name="card_declined">O cartão foi recusado</string>

  <string name="card_ending_in">%1$s com final %2$s</string>

  <string name="close">Fechar</string>

  <string name="delete_payment_method">Excluir forma de pagamento</string>
  <string name="delete_payment_method_prompt_title">Excluir forma de pagamento?</string>

  <string name="done">Concluído</string>

  <string name="edit">Editar</string>

  <string name="expired_card">O cartão expirou</string>

  <string name="expiry_date_hint">MM/AA</string>
  <string name="expiry_label_short">Validade</string>

  <string name="fpx_bank_offline">%s – Offline</string>

  <string name="generic_decline">A forma de pagamento foi recusada.</string>

  <string name="incomplete_expiry_date">Data de validade incompleta.</string>

  <string name="invalid_bank_account_iban">O IBAN inserido é inválido.</string>
  <string name="invalid_card_number">Número do cartão inválido.</string>

  <string name="invalid_cvc">Código de segurança inválido.</string>

  <string name="invalid_expiry_month">O mês de validade do cartão é inválido.</string>

  <string name="invalid_expiry_year">Ano de validade inválido.</string>

  <string name="invalid_owner_name">Nome inválido.</string>

  <string name="invalid_shipping_information">Endereço de envio inválido</string>

  <string name="invalid_zip">Código postal incompleto.</string>
  <string name="payment_method_add_new_card">Adicionar novo cartão…</string>
  <string name="payment_method_add_new_fpx">Selecionar conta bancária (FPX)…</string>

  <string name="price_free">Grátis</string>

  <string name="processing_error">Erro ao processar o cartão – tente novamente em alguns segundos</string>

  <string name="remove">Remover</string>

  <string name="removed">Removeu %s</string>
  <string name="secure_checkout">Secure Checkout</string>

  <string name="stripe_failure_connection_error">Estamos passando por problemas de conexão com nosso provedor de pagamentos. Verifique sua conexão com a Internet e tente novamente.</string>

  <string name="stripe_failure_reason_authentication">Não é possível autenticar sua forma de pagamento. Escolha outra forma de pagamento e tente de novo.</string>

  <string name="stripe_failure_reason_timed_out">Tempo limite esgotado para autenticar sua forma de pagamento – tente novamente</string>

  <string name="stripe_internal_error">Ocorreu um erro interno.</string>

  <string name="stripe_paymentsheet_expiration_date_hint">MM / AA</string>

  <string name="stripe_verify_your_payment">Verifique seu pagamento</string>
  <string name="title_add_a_card">Adicionar um cartão</string>

  <string name="title_add_an_address">Definir endereço</string>

  <string name="title_bank_account">Conta bancária</string>

  <string name="title_payment_method">Forma de pagamento</string>

  <string name="title_select_shipping_method">Selecionar forma de envio</string>
</resources>


text:
/**
*
* MessageInput
*
*/
'use strict'

import React, { PropTypes, Component } from 'react'
import { connect } from 'react-redux'

import { addMessageRequest } from '../actions/chat'

class MessageInput extends Component {
  static propTypes = {
    dispatch: PropTypes.func.isRequired
  };

  render () {
    return (
      <div>
        <input type="text" onKeyUp={this._handleKeyUp} />
      </div>
    )
  }

  _handleKeyUp = (event) => {
    if (event.keyCode === 13) {
      this.props.dispatch(addMessageRequest({
        text: event.target.value,
        datetime: new Date()
      }))
      event.target.value = ''
    }
  }
}

export default connect()(MessageInput)


text:
#import "RCTActivityIndicatorView.h"

@implementation RCTActivityIndicatorView {
}

- (void)setHidden:(BOOL)hidden
{
  if ([self hidesWhenStopped] && ![self isAnimating]) {
    [super setHidden: YES];
  } else {
    [super setHidden: hidden];
  }
}

@end


text:
// This file is a part of the IncludeOS unikernel - www.includeos.org
//
// Copyright 2017 Oslo and Akershus University College of Applied Sciences
// and Alfred Bratterud
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once
#ifndef NET_VIF_HPP
#define NET_VIF_HPP

#include "link_layer.hpp"
#include <map>

namespace net {
/**
 * @brief      Virtual Network Interface (kinda)
 */
template <typename Protocol>
class Vif : public Link_layer<Protocol> {
public:
  using Linklayer  = Link_layer<Protocol>;

  Vif(hw::Nic& link, const int id)
    : Linklayer(Protocol{{this, &Vif<Protocol>::transmit}, link.mac(), id}, link.bufstore()),
      link_{link}, id_{id}, phys_down_{link_.create_physical_downstream()}
  {}

  int id() const noexcept
  { return id_; }

  void set_physical_downstream(net::downstream phys_down)
  { phys_down_ = phys_down; }

  void transmit(Packet_ptr pkt)
  {
    //printf("<Vif> Transmitting to physical\n");
    Expects(phys_down_);
    phys_down_(std::move(pkt));
  }

  void receive(Packet_ptr pkt)
  { Linklayer::receive(std::move(pkt)); }

  net::downstream create_physical_downstream() override
  { return phys_down_; }

  const char* driver_name() const override
  { return "Virtual Interface"; }

  std::string device_name() const override
  { return link_.device_name() + "." + std::to_string(id_); }

  const MAC::Addr& mac() const noexcept override
  { return link_.mac(); }

  uint16_t MTU() const noexcept override
  { return link_.MTU(); }

  net::Packet_ptr create_packet(int layer_begin) override
  { return link_.create_packet(layer_begin); }

  void on_transmit_queue_available(net::transmit_avail_delg del) override
  { link_.on_transmit_queue_available(del); }

  size_t transmit_queue_available() override
  { return link_.transmit_queue_available(); }

  void deactivate() override
  { }

  void move_to_this_cpu() override
  { link_.move_to_this_cpu(); }

  void flush() override
  { link_.flush(); }

  void poll() override
  { link_.poll(); }

private:
  hw::Nic& link_;
  const int id_;
  net::downstream phys_down_ = nullptr;

};

} // < namespace net

#endif


text:
package org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations;

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

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Feature {

    String code();

    String name();

    String description();

}


text:
<?php

namespace NZTA\SiteBanner\Tests;

use NZTA\SiteBanner\Models\SiteBanner;
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\ORM\FieldType\DBDatetime;

class SiteBannerTest extends SapphireTest
{

    public function testIsActiveWithoutEmbargoWithEmptyContent()
    {
        Config::inst()->update(SiteBanner::class, 'embargo_enabled', false);
        $banner = new SiteBanner();
        $banner->Content = null;
        $this->assertFalse($banner->isActive());
    }

    public function testIsActiveWithoutEmbargoWithContent()
    {
        Config::inst()->update('SiteBanner', 'embargo_enabled', false);
        $banner = new SiteBanner();
        $banner->Content = 'test';
        $this->assertTrue($banner->isActive());
    }

    public function testIsActiveWithEmbargoStartDate()
    {
        Config::inst()->update('SiteBanner', 'embargo_enabled', true);
        $banner = new SiteBanner();
        $banner->Content = 'test';
        $banner->StartDate = '2017-01-01 12:00:00';

        DBDatetime::set_mock_now('2017-01-01 11:00:00');
        $this->assertFalse($banner->isActive());

        DBDatetime::set_mock_now('2017-01-01 13:00:00');
        $this->assertTrue($banner->isActive());
    }

    public function testIsActiveWithEmbargoEndDate()
    {
        Config::inst()->update('SiteBanner', 'embargo_enabled', true);
        $banner = new SiteBanner();
        $banner->Content = 'test';
        $banner->EndDate = '2017-01-01 12:00:00';

        DBDatetime::set_mock_now('2017-01-01 11:00:00');
        $this->assertTrue($banner->isActive());

        DBDatetime::set_mock_now('2017-01-01 13:00:00');
        $this->assertFalse($banner->isActive());
    }
}


text:
package id.arief.sirmi.master.karyawan;

import id.arief.sirmi.database.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author arief-asus
 */
public class KaryawanController {

    public List<Karyawan> getData() {
        String sqlSelect = "SELECT * FROM m_karyawan";
        Statement statement;
        ResultSet resultSet;

        try {
            statement = Connection.getConnection().createStatement();
            resultSet = statement.executeQuery(sqlSelect);

            List<Karyawan> list = new ArrayList<>();

            while (resultSet.next()) {
                Karyawan karyawan = new Karyawan();
                karyawan.setKodeKaryawan(resultSet.getString("kode_karyawan"));
                karyawan.setNamaKaryawan(resultSet.getString("nama_karyawan"));
                karyawan.setTanggalLahirKaryawan(resultSet.getDate("tanggal_lahir"));
                karyawan.setKontakKaryawan(resultSet.getString("kontak_karyawan"));

                list.add(karyawan);
            }
            resultSet.close();
            return list;
        } catch (SQLException exception) {
            System.out.println("Terjadi kesalahan : " + exception);
            return null;
        }

    }

    public List<Karyawan> getKaryawanByParameter(String sqlParameter, String searchParameter) {
        String sqlSelect = "SELECT * FROM m_karyawan WHERE " + sqlParameter + " LIKE '%" + searchParameter + "%'";
        Statement statement = null;
        ResultSet resultSet;
        try {
            statement = Connection.getConnection().createStatement();
            resultSet = statement.executeQuery(sqlSelect);

            List<Karyawan> list = new ArrayList<>();

            while (resultSet.next()) {

                Karyawan karyawan = new Karyawan();
                karyawan.setKodeKaryawan(resultSet.getString("kode_karyawan"));
                karyawan.setNamaKaryawan(resultSet.getString("nama_karyawan"));
                karyawan.setTanggalLahirKaryawan(resultSet.getDate("tanggal_lahir"));
                karyawan.setKontakKaryawan(resultSet.getString("kontak_karyawan"));

                list.add(karyawan);
            }
            resultSet.close();
            return list;
        } catch (SQLException exception) {
            System.out.println("Terjadi kesalahan : " + exception);
            return null;
        }
    }

    public void tambahData(Karyawan karyawan) {
        try {
            String sqlTambah = "INSERT INTO m_karyawan VALUES (?,?,?,?,?)";
            PreparedStatement ps;
            ps = Connection.getConnection().prepareStatement(sqlTambah);
            ps.setString(1, null);
            ps.setString(2, karyawan.getKodeKaryawan());
            ps.setString(3, karyawan.getNamaKaryawan());
            ps.setString(4, karyawan.getTanggalLahirKaryawan().toString());
            ps.setString(5, karyawan.getKontakKaryawan());
            ps.executeUpdate();
        } catch (SQLException ex) {
            Logger.getLogger(KaryawanController.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void ubahData(Karyawan karyawan) {
        try {
            String sqlTambah = "UPDATE m_karyawan set nama_karyawan = ?, tanggal_lahir = ?, kontak_karyawan = ? WHERE kode_karyawan = ?";
            PreparedStatement ps;
            ps = Connection.getConnection().prepareStatement(sqlTambah);
            ps.setString(4, karyawan.getKodeKaryawan());
            ps.setString(1, karyawan.getNamaKaryawan());
            ps.setString(2, karyawan.getTanggalLahirKaryawan().toString());
            ps.setString(3, karyawan.getKontakKaryawan());
            ps.executeUpdate();
        } catch (SQLException ex) {
            Logger.getLogger(KaryawanController.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void deleteKaryawan(String kodeKaryawan) {
        try {
            String sql = "DELETE from m_karyawan WHERE kode_karyawan = ?";
            PreparedStatement ps;
            ps = Connection.getConnection().prepareStatement(sql);
            ps.setString(1, kodeKaryawan);
            ps.executeUpdate();
        } catch (SQLException ex) {
            Logger.getLogger(KaryawanController.class.getName()).log(Level.SEVERE, null, ex);
        }

    }

    public boolean cekKaryawan(String kodeKaryawan, String tanggalLahir, String namaKaryawan) {
        boolean adaKaryawan = false;
        String sql_cek = "SELECT * FROM m_karyawan WHERE kode_karyawan = '" + kodeKaryawan + "' OR tanggal_lahir = '" + tanggalLahir + "' AND  nama_karyawan= '" + namaKaryawan + "'";
        Statement statement;
        ResultSet resultSet;

        try {
            statement = Connection.getConnection().createStatement();
            resultSet = statement.executeQuery(sql_cek);
            if (resultSet.first()) {
                adaKaryawan = true;
            } else {
                adaKaryawan = false;
            }

        } catch (SQLException ex) {
            adaKaryawan = false;
            Logger.getLogger(KaryawanController.class.getName()).log(Level.SEVERE, null, ex);
        }

        return adaKaryawan;
    }

}


text:
describe('DSBinaryHeap.push(node)', function () {
  it('should push items to the front of the DSBinaryHeap.', function () {
    var heap = new TestDSBinaryHeap();
    var objHeap = new TestDSBinaryHeap(function (x) {
      return x.value;
    });
    var items = [20, 4, 33, 1, 0, 34, 22, 31, 32, 5, 6, 7],
      objItems = [];
    for (var i = 0; i < items.length; i++) {
      objItems.push({
        value: items[i]
      });
    }

    heap.push(items[0]);
    objHeap.push(objItems[0]);
    assert.deepEqual(heap.size(), 1);
    assert.deepEqual(objHeap.size(), 1);
    assert.deepEqual(heap.peek(), items[0]);
    assert.deepEqual(objHeap.peek(), objItems[0]);

    heap.push(items[1]);
    objHeap.push(objItems[1]);
    assert.deepEqual(heap.size(), 2);
    assert.deepEqual(objHeap.size(), 2);
    assert.deepEqual(heap.peek(), items[1]);
    assert.deepEqual(objHeap.peek(), objItems[1]);

    heap.push(items[2]);
    objHeap.push(objItems[2]);
    assert.deepEqual(heap.size(), 3);
    assert.deepEqual(objHeap.size(), 3);
    assert.deepEqual(heap.peek(), items[1]);
    assert.deepEqual(objHeap.peek(), objItems[1]);

    heap.push(items[3]);
    objHeap.push(objItems[3]);
    assert.deepEqual(heap.size(), 4);
    assert.deepEqual(objHeap.size(), 4);
    assert.deepEqual(heap.peek(), items[3]);
    assert.deepEqual(objHeap.peek(), objItems[3]);

    heap.push(items[4]);
    objHeap.push(objItems[4]);
    assert.deepEqual(heap.size(), 5);
    assert.deepEqual(objHeap.size(), 5);
    assert.deepEqual(heap.peek(), items[4]);
    assert.deepEqual(objHeap.peek(), objItems[4]);

    heap.push(items[5]);
    objHeap.push(objItems[5]);
    assert.deepEqual(heap.size(), 6);
    assert.deepEqual(objHeap.size(), 6);
    assert.deepEqual(heap.peek(), items[4]);
    assert.deepEqual(objHeap.peek(), objItems[4]);

    heap.push(items[6]);
    objHeap.push(objItems[6]);
    assert.deepEqual(heap.size(), 7);
    assert.deepEqual(objHeap.size(), 7);
    assert.deepEqual(heap.peek(), items[4]);
    assert.deepEqual(objHeap.peek(), objItems[4]);

    heap.push(items[7]);
    objHeap.push(objItems[7]);
    assert.deepEqual(heap.size(), 8);
    assert.deepEqual(objHeap.size(), 8);
    assert.deepEqual(heap.peek(), items[4]);
    assert.deepEqual(objHeap.peek(), objItems[4]);

    heap.push(items[8]);
    objHeap.push(objItems[8]);
    assert.deepEqual(heap.size(), 9);
    assert.deepEqual(objHeap.size(), 9);
    assert.deepEqual(heap.peek(), items[4]);
    assert.deepEqual(objHeap.peek(), objItems[4]);

    heap.push(items[9]);
    objHeap.push(objItems[9]);
    assert.deepEqual(heap.size(), 10);
    assert.deepEqual(objHeap.size(), 10);
    assert.deepEqual(heap.peek(), items[4]);
    assert.deepEqual(objHeap.peek(), objItems[4]);

    heap.push(items[10]);
    objHeap.push(objItems[10]);
    assert.deepEqual(heap.size(), 11);
    assert.deepEqual(objHeap.size(), 11);
    assert.deepEqual(heap.peek(), items[4]);
    assert.deepEqual(objHeap.peek(), objItems[4]);

    heap.push(items[11]);
    objHeap.push(objItems[11]);
    assert.deepEqual(heap.size(), 12);
    assert.deepEqual(objHeap.size(), 12);
    assert.deepEqual(heap.peek(), items[4]);
    assert.deepEqual(objHeap.peek(), objItems[4]);
  });
});


text:
var cubeHeight = 1;
var cubeWidth = 16;
var cubeDepth = 40;
var instruments = [];
var allcubesinOneFFT = [];
var allobjects = [];
var allFFTs = [];
var allRows = [];
var fftSpectrums = [];
var effects = [];
var instruments = [synth0, synth1, synth2, synth3, synth4, synth5, synth6, synth7, synth8, synth9, synth10, synth11, synth12, synth13];

var switches = []; //Tone switches boolian 0/1
effects[0] = new Tone.Freeverb();
effects[1] = new Tone.BitCrusher(1);
var row1on = false;
var thisRowsVolume = [];
var AreRowsOn = [];
var framesPerSecond = 24;

// InstantiateEverything();

// function InstantiateEverything(){
//   $(".stem0").hide();
//   $("#video0").prop('muted', true);
// }

//make an fft analyzer for each instrument
for (var i in instruments) {
    fft = new Tone.Analyser(32, "fft");
    allFFTs.push(fft);
}

for (var i = 0; i < effects.length; i++) {
    for (j in instruments) {
        instruments[j].connect(effects[i]);
    }
}

for (var i in instruments) {
    switches[i] = new Tone.Switch(false);
    switches[i].gate.value = 0;

    instruments[i].fan(switches[i], allFFTs[i]).toMaster();
    for (var j = 0; j < effects.length; j++) {
        instruments[i].connect(effects[j]);
    }
    for (var m = 0; m < effects.length; m++) {
        effects[m].connect(switches[i])
    }

}

//start everything, this can moved to a button press
Tone.Transport.start();
Tone.Transport.bpm.value = 124;

//////THREE JS/////////////////
// ///
//  /__  ___/ //    / / //   ) )  //   / /  //   / /             / / //   ) )
//    / /    //___ / / //___/ /  //____    //____               / / ((
//   / /    / ___   / / ___ (   / ____    / ____               / /    \\
//  / /    //    / / //   | |  //        //                   / /       ) )
// / /    //    / / //    | | //____/ / //____/ /       ((___/ / ((___ / /
// /////////////////////////////////////////////////////////////////////////
var container;
var camera, controls, scene, renderer;
var raycaster;

var mouse = new THREE.Vector2(),
    offset = new THREE.Vector3(),
    INTERSECTED, SELECTED;
var plane;

init();
loop();
// animate();

function init() {
    container = document.createElement('div');
    container.id = "threeJS";
    container.backgroundColor = "red";
    container.style.zIndex = "-30"
    container.style.position = "absolute"

    document.body.appendChild(container);
    camera = new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight,1, 9000);

    scene = new THREE.Scene();
    scene.add(new THREE.AmbientLight(0x505050));

  // camera.position.z = 1000;
    camera.rotateX(40);
    camera.rotateY(40);
    // camera.rotateZ(40);

    // mouse = new THREE.Vector2();
    var light2 = new THREE.DirectionalLight(0xffffff, 1);
    light2.position.set(1, 1, 1).normalize();
    scene.add(light2);
    var geometry = new THREE.BoxGeometry(20, 20, 20);
    raycaster = new THREE.Raycaster();

    var light = new THREE.SpotLight(0xffffff, 1.5);
    light.position.set(0, 500, 2000);
    light.castShadow = true;

    light.shadowCameraNear = 200;
    light.shadowCameraFar = camera.far;
    light.shadowCameraFov = 50;

    light.shadowBias = -0.00022;

    light.shadowMapWidth = 2048;
    light.shadowMapHeight = 2048;

    scene.add(light);

    for (var j = 0; j < instruments.length; j++) {
        var rotateX = Math.cos(Rune.radians(j*spacing))*radius
            var rotateY = Math.sin(Rune.radians(j*spacing))*radius

        allcubesinOneFFT[j] = [];

        for (var i = 0; i < 32; i++) {
            var color = new THREE.Color(((r * .032 * i) % 1).toFixed(2), ((g * .032 * i) % 1).toFixed(2), ((b * .032 * j) % 1).toFixed(2));

            var object = new THREE.Mesh(geometry, new THREE.MeshBasicMaterial({
                color: color
            }));
            var radius = 700;
            var spacing = 360/ (instruments.length-1)

            object.position.x = -100 + rotateX;
            object.position.y = rotateY;
            object.position.z = 80-(i*cubeDepth*20)

            // object.position.z = 500 - (cubeWidth * 20 * i);

            object.rotation.x = 0;
            object.rotation.y = 0;
            object.rotation.z = (j*5);

            object.scale.x = cubeWidth;
            object.scale.y = cubeHeight;
            object.scale.z = cubeDepth;

            scene.add(object);
            allobjects.push(object)

            allcubesinOneFFT[j].push(object);
            // console.log(allcubesinOneFFT[j].length)
            // allcubesinOneFFT[j].rotate.x=30

        }
        allRows.push(allcubesinOneFFT[j]);
        // console.log('allrows' + allRows.length)
    }

    renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
    renderer.setClearColor(0xab33a0, 0);
    renderer.setPixelRatio(window.devicePixelRatio);
    renderer.setSize(window.innerWidth, window.innerHeight);
    renderer.sortObjects = false;
    renderer.shadowMap.enabled = true;
    renderer.shadowMap.type = THREE.PCFShadowMap;
    container.appendChild(renderer.domElement);

    controls = new THREE.TrackballControls(camera);
    controls.rotateSpeed = 1.0;
    controls.zoomSpeed = 1.2;
    controls.panSpeed = 0.8;
    controls.noZoom = false;
    controls.noPan = false;
    controls.staticMoving = true;
    controls.dynamicDampingFactor = 0.3;

    renderer.domElement.addEventListener('mousemove', onDocumentMouseMove, false);
    renderer.domElement.addEventListener('mousedown', onDocumentMouseDown, false);
    renderer.domElement.addEventListener('mouseup', onDocumentMouseUp, false);

    // stats = new Stats();
    // stats.domElement.style.position = 'absolute';
    // stats.domElement.style.top = '100px';
    // container.appendChild(stats.domElement);

    //resize
    window.addEventListener('resize', onWindowResize, false);

} //INIT ENDS

function onWindowResize() {
    camera.aspect = window.innerWidth / window.innerHeight;
    camera.updateProjectionMatrix();

    renderer.setSize(window.innerWidth, window.innerHeight);
}

function onDocumentMouseMove(event) {

    // event.preventDefault();

    mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
    mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;

    // raycaster.setFromCamera(mouse, camera);

    // if (SELECTED) {
    //     if (SELECTED == allRows[0][0]) {
    //         console.log("DRAGGING ONE")
    //     } else if (SELECTED == allRows[1][0]) {
    //         console.log("DRAGGING ZERO")
    //     } else if (SELECTED == allRows[2][0]) {
    //         console.log("DRAGGING TWO")
    //     }

    //     return;

    // }

    // var intersects = raycaster.intersectObjects(allcubesinOneFFT[0]);

    // if (intersects.length > 0) {

    //     if (INTERSECTED != intersects[0].object) {

    //         if (INTERSECTED) INTERSECTED.material.color.setHex(INTERSECTED.currentHex);

    //         INTERSECTED = intersects[0].object;
    //         INTERSECTED.currentHex = INTERSECTED.material.color.getHex();

    //     }

    //     container.style.cursor = 'pointer';

    // } else {

    //     if (INTERSECTED) INTERSECTED.material.color.setHex(INTERSECTED.currentHex);

    //     INTERSECTED = null;

    //     container.style.cursor = 'auto';

    // }

}

function onDocumentMouseDown(event) {

    event.preventDefault();

    raycaster.setFromCamera(mouse, camera);

    var intersects = raycaster.intersectObjects(allobjects);

    if (intersects.length > 0) {

        controls.enabled = false;

        SELECTED = intersects[0].object;

        if (SELECTED == allobjects[0]) {

            console.log("TOGGLE ZERO bc I clicked it")
        } else if (SELECTED == allobjects[32]) {
            if (row1on == false) {
                row1on = true;
                ToggleRow1();
            } else {
                row1on = false;
                ToggleRow1();

            }

            console.log("TOGGLE ONE bc I clicked it")
        } else if (SELECTED == allobjects[64]) {
            console.log("TOGGLE TWO bc I clicked it")
        }

        container.style.cursor = 'move';

    }

}

function onDocumentMouseUp(event) {
    event.preventDefault();
    controls.enabled = true;
    if (INTERSECTED) {
        SELECTED = null;
    }
    container.style.cursor = 'auto';

}

function render() {
    renderer.render(scene, camera);
    controls.update();
}

function update(allFFTspectrums) {
    var thisRowsTotalFFT = 0;
    var thisFFTTotal = [];
camera.position.z = camera.position.z+.5

    for (var j = 0; j < instruments.length; j++) {
        for (var i = 0, len = 32; i < len; i++) {
            allRows[j][i].scale.y = cubeHeight + 20 * (allFFTspectrums[j][i] / 255);
            //add the row0 , cube0, row0, cube1
            //make an FFTarray for the row.
            thisRowsTotalFFT = thisRowsTotalFFT + allFFTspectrums[j][i]
                // thisFFTTotal.push(thisRowsTotalFFT)
                //add this number an array and add them all up
                // if (allFFTspectrums[j][0])

        }

        //switch case goes here
        //
        // thisRowsVolume[4] = thisRowsTotalFFT / 32;
        // // console.log("this rows' volume is " + thisRowsVolume[1]);
        // if (thisRowsVolume[4] <= 40) {
        //     // console.log('row4 vol < 40 ')
        // //     // console.log(thisRowsVolume[j])
        //     AreRowsOn[4] = false;
        // } else {
        //     // console.log('row4 vol is ON')
        //     AreRowsOn[4] = true;
        // //     // console.log(AreRowsOn[j])
        // }
        // checkAllVolumes(j)

    }
}

function loop() { //this is where we put all animation
    requestAnimationFrame(loop);

    for (i in instruments) {
        fftValues = allFFTs[i].analyse();
        fftSpectrums.push(fftValues)
    }

    controls.update();
    // stats.update();
    update(fftSpectrums);
    render();

}

function ToggleRow1() {
    // console.log(row1on)
    if (row1on == true) {
        // console.log(allcubesinOneFFT[0][0])
        instruments[1].volume.exponentialRampToValue(-100, 2);

        // allcubesinOneFFT[0][0].material.color.('rgb')
        //turn row 1 off
        for (var i = 0; i < allFFTs[0].length; i++) {
            // console.log(allcubesinOneFFT[0][i])

            // allcubesinOneFFT[0][i].material.color.setHex(#ffffff)
        }

    } else {
        //turn row 1 on
        // allcubesinOneFFT[0][i].material.color.setHex(#ef53e4)
        instruments[1].volume.exponentialRampToValue(0, 2);
    }
}

function bpmFaster() {
    Tone.Transport.bpm.value = Tone.Transport.bpm.value + 10
        // console.log("changed bpm to: " + Tone.Transport.bpm.value)
}

function bpmSlower() {
    Tone.Transport.bpm.value = Tone.Transport.bpm.value - 10
}

function toggleGlobalEffects(index) {
    switches[index].gate.value = 1 - switches[index].gate.value
        // console.log(switches[index].gate.value)
}

/////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
//////////////MAKE THIS ART IN EACH STEM /////////////////////
/////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
///

if (AreRowsOn[0] == true) {
    Stem0On();
} else {
    Stem0Off();
}

if (AreRowsOn[1] == true) {
    console.log('one is on')
    Stem1On();
} else {
    Stem1Off();
}

if (AreRowsOn[4] == true) {
    console.log('one is on')
    Stem4On();
} else {
    Stem4Off();
}


text:
try:
    import json
except ImportError:
    import simplejson as json

try:
    from cStringIO import StringIO
except ImportError:
    from StringIO import StringIO

import hashlib
import zipfile
import decimal

from M2Crypto import SMIME
from M2Crypto import X509
from M2Crypto.X509 import X509_Stack

class Alignment:
    LEFT = 'PKTextAlignmentLeft'
    CENTER = 'PKTextAlignmentCenter'
    RIGHT = 'PKTextAlignmentRight'
    JUSTIFIED = 'PKTextAlignmentJustified'
    NATURAL = 'PKTextAlignmentNatural'

class BarcodeFormat:
    PDF417 = 'PKBarcodeFormatPDF417'
    QR = 'PKBarcodeFormatQR'
    AZTEC = 'PKBarcodeFormatAztec'
    CODE128 = 'PKBarcodeFormatCode128'

class TransitType:
    AIR = 'PKTransitTypeAir'
    TRAIN = 'PKTransitTypeTrain'
    BUS = 'PKTransitTypeBus'
    BOAT = 'PKTransitTypeBoat'
    GENERIC = 'PKTransitTypeGeneric'

class DateStyle:
    NONE = 'PKDateStyleNone'
    SHORT = 'PKDateStyleShort'
    MEDIUM = 'PKDateStyleMedium'
    LONG = 'PKDateStyleLong'
    FULL = 'PKDateStyleFull'

class NumberStyle:
    DECIMAL = 'PKNumberStyleDecimal'
    PERCENT = 'PKNumberStylePercent'
    SCIENTIFIC = 'PKNumberStyleScientific'
    SPELLOUT = 'PKNumberStyleSpellOut'

class Field(object):

    def __init__(self, key, value, label=''):

        self.key = key  # Required. The key must be unique within the scope
        self.value = value  # Required. Value of the field. For example, 42
        self.label = label  # Optional. Label text for the field.
        self.changeMessage = ''  # Optional. Format string for the alert text that is displayed when the pass is updated
        self.textAlignment = Alignment.LEFT

    def json_dict(self):
        return self.__dict__

class DateField(Field):

    def __init__(self, key, value, label='', dateStyle=DateStyle.SHORT,
                 timeStyle=DateStyle.SHORT, ignoresTimeZone=False):
        super(DateField, self).__init__(key, value, label)
        self.dateStyle = dateStyle  # Style of date to display
        self.timeStyle = timeStyle  # Style of time to display
        self.isRelative = False  # If true, the labels value is displayed as a relative date
        if ignoresTimeZone:
            self.ignoresTimeZone = ignoresTimeZone

    def json_dict(self):
        return self.__dict__

class NumberField(Field):

    def __init__(self, key, value, label=''):
        super(NumberField, self).__init__(key, value, label)
        self.numberStyle = NumberStyle.DECIMAL  # Style of date to display

    def json_dict(self):
        return self.__dict__

class CurrencyField(NumberField):

    def __init__(self, key, value, label='', currencyCode=''):
        super(CurrencyField, self).__init__(key, value, label)
        self.currencyCode = currencyCode  # ISO 4217 currency code

    def json_dict(self):
        return self.__dict__

class Barcode(object):

    def __init__(self, message, format=BarcodeFormat.PDF417, altText='', messageEncoding='iso-8859-1'):
        self.format = format
        self.message = message  # Required. Message or payload to be displayed as a barcode
        self.messageEncoding = messageEncoding  # Required. Text encoding that is used to convert the message
        if altText:
            self.altText = altText  # Optional. Text displayed near the barcode

    def json_dict(self):
        return self.__dict__

class Location(object):

    def __init__(self, latitude, longitude, altitude=0.0):
        # Required. Latitude, in degrees, of the location.
        try:
            self.latitude = float(latitude)
        except (ValueError, TypeError):
            self.latitude = 0.0
        # Required. Longitude, in degrees, of the location.
        try:
            self.longitude = float(longitude)
        except (ValueError, TypeError):
            self.longitude = 0.0
        # Optional. Altitude, in meters, of the location.
        try:
            self.altitude = float(altitude)
        except (ValueError, TypeError):
            self.altitude = 0.0
        # Optional. Notification distance
        self.distance = None
        # Optional. Text displayed on the lock screen when
        # the pass is currently near the location
        self.relevantText = ''

    def json_dict(self):
        return self.__dict__

class IBeacon(object):
    def __init__(self, proximityuuid, major, minor):
        # IBeacon data
        self.proximityUUID = proximityuuid
        self.major = major
        self.minor = minor

        # Optional. Text message where near the ibeacon
        self.relevantText = ''

    def json_dict(self):
        return self.__dict__

class PassInformation(object):

    def __init__(self):
        self.headerFields = []
        self.primaryFields = []
        self.secondaryFields = []
        self.backFields = []
        self.auxiliaryFields = []

    def addHeaderField(self, key, value, label):
        self.headerFields.append(Field(key, value, label))

    def addPrimaryField(self, key, value, label):
        self.primaryFields.append(Field(key, value, label))

    def addSecondaryField(self, key, value, label):
        self.secondaryFields.append(Field(key, value, label))

    def addBackField(self, key, value, label):
        self.backFields.append(Field(key, value, label))

    def addAuxiliaryField(self, key, value, label):
        self.auxiliaryFields.append(Field(key, value, label))

    def json_dict(self):
        d = {}
        if self.headerFields:
            d.update({'headerFields': [f.json_dict() for f in self.headerFields]})
        if self.primaryFields:
            d.update({'primaryFields': [f.json_dict() for f in self.primaryFields]})
        if self.secondaryFields:
            d.update({'secondaryFields': [f.json_dict() for f in self.secondaryFields]})
        if self.backFields:
            d.update({'backFields': [f.json_dict() for f in self.backFields]})
        if self.auxiliaryFields:
            d.update({'auxiliaryFields': [f.json_dict() for f in self.auxiliaryFields]})
        return d

class BoardingPass(PassInformation):

    def __init__(self, transitType=TransitType.AIR):
        super(BoardingPass, self).__init__()
        self.transitType = transitType
        self.jsonname = 'boardingPass'

    def json_dict(self):
        d = super(BoardingPass, self).json_dict()
        d.update({'transitType': self.transitType})
        return d

class Coupon(PassInformation):

    def __init__(self):
        super(Coupon, self).__init__()
        self.jsonname = 'coupon'

class EventTicket(PassInformation):

    def __init__(self):
        super(EventTicket, self).__init__()
        self.jsonname = 'eventTicket'

class Generic(PassInformation):

    def __init__(self):
        super(Generic, self).__init__()
        self.jsonname = 'generic'

class StoreCard(PassInformation):

    def __init__(self):
        super(StoreCard, self).__init__()
        self.jsonname = 'storeCard'

class Pass(object):

    def __init__(self, passInformation, json='', passTypeIdentifier='',
                 organizationName='', teamIdentifier=''):

        self._files = {}  # Holds the files to include in the .pkpass
        self._hashes = {}  # Holds the SHAs of the files array

        # Standard Keys

        # Required. Team identifier of the organization that originated and
        # signed the pass, as issued by Apple.
        self.teamIdentifier = teamIdentifier
        # Required. Pass type identifier, as issued by Apple. The value must
        # correspond with your signing certificate. Used for grouping.
        self.passTypeIdentifier = passTypeIdentifier
        # Required. Display name of the organization that originated and
        # signed the pass.
        self.organizationName = organizationName
        # Required. Serial number that uniquely identifies the pass.
        self.serialNumber = ''
        # Required. Brief description of the pass, used by the iOS
        # accessibility technologies.
        self.description = ''
        # Required. Version of the file format. The value must be 1.
        self.formatVersion = 1

        # Visual Appearance Keys
        self.backgroundColor = None  # Optional. Background color of the pass
        self.foregroundColor = None  # Optional. Foreground color of the pass,
        self.labelColor = None  # Optional. Color of the label text
        self.logoText = None  # Optional. Text displayed next to the logo
        self.barcode = None  # Optional. Information specific to barcodes.  This is deprecated and can only be set to original barcode formats.
        self.barcodes = None #Optional.  All supported barcodes
        # Optional. If true, the strip image is displayed
        self.suppressStripShine = False

        # Web Service Keys

        # Optional. If present, authenticationToken must be supplied
        self.webServiceURL = None
        # The authentication token to use with the web service
        self.authenticationToken = None

        # Relevance Keys

        # Optional. Locations where the pass is relevant.
        # For example, the location of your store.
        self.locations = None
        # Optional. IBeacons data
        self.ibeacons = None
        # Optional. Date and time when the pass becomes relevant
        self.relevantDate = None

        # Optional. A list of iTunes Store item identifiers for
        # the associated apps.
        self.associatedStoreIdentifiers = None
        self.appLaunchURL = None
        # Optional. Additional hidden data in json for the passbook
        self.userInfo = None

        self.expirationDate = None
        self.voided = None

        self.passInformation = passInformation

    # Adds file to the file array
    def addFile(self, name, fd):
        self._files[name] = fd.read()

    # Creates the actual .pkpass file
    def create(self, certificate, key, wwdr_certificate, password, zip_file=None):
        pass_json = self._createPassJson()
        manifest = self._createManifest(pass_json)
        signature = self._createSignature(manifest, certificate, key, wwdr_certificate, password)
        if not zip_file:
            zip_file = StringIO()
        self._createZip(pass_json, manifest, signature, zip_file=zip_file)
        return zip_file

    def _createPassJson(self):
        return json.dumps(self, default=PassHandler)

    # creates the hashes for the files and adds them into a json string.
    def _createManifest(self, pass_json):
        # Creates SHA hashes for all files in package
        self._hashes['pass.json'] = hashlib.sha1(pass_json).hexdigest()
        for filename, filedata in self._files.items():
            self._hashes[filename] = hashlib.sha1(filedata).hexdigest()
        return json.dumps(self._hashes)

    # Creates a signature and saves it
    def _createSignature(self, manifest, certificate, key,
                         wwdr_certificate, password):
        def passwordCallback(*args, **kwds):
            return password

        smime = SMIME.SMIME()
        # we need to attach wwdr cert as X509
        wwdrcert = X509.load_cert(wwdr_certificate)
        stack = X509_Stack()
        stack.push(wwdrcert)
        smime.set_x509_stack(stack)

        # need to cast to string since load_key doesnt work with unicode paths
        smime.load_key(str(key), certificate, callback=passwordCallback)
        pk7 = smime.sign(SMIME.BIO.MemoryBuffer(manifest), flags=SMIME.PKCS7_DETACHED | SMIME.PKCS7_BINARY)

        pem = SMIME.BIO.MemoryBuffer()
        pk7.write(pem)
        # convert pem to der
        der = ''.join(l.strip() for l in pem.read().split('-----')[2].splitlines()).decode('base64')

        return der

    # Creates .pkpass (zip archive)
    def _createZip(self, pass_json, manifest, signature, zip_file=None):
        zf = zipfile.ZipFile(zip_file or 'pass.pkpass', 'w')
        zf.writestr('signature', signature)
        zf.writestr('manifest.json', manifest)
        zf.writestr('pass.json', pass_json)
        for filename, filedata in self._files.items():
            zf.writestr(filename, filedata)
        zf.close()

    def json_dict(self):
        d = {
            'description': self.description,
            'formatVersion': self.formatVersion,
            'organizationName': self.organizationName,
            'passTypeIdentifier': self.passTypeIdentifier,
            'serialNumber': self.serialNumber,
            'teamIdentifier': self.teamIdentifier,
            'suppressStripShine': self.suppressStripShine,
            self.passInformation.jsonname: self.passInformation.json_dict()
        }
        #barcodes have 2 fields, 'barcode' is legacy so limit it to the legacy formats, 'barcodes' supports all
        if self.barcode:
            original_formats = [BarcodeFormat.PDF417, BarcodeFormat.QR, BarcodeFormat.AZTEC]
            legacyBarcode = self.barcode
            newBarcodes = [self.barcode.json_dict()]
            if self.barcode.format not in original_formats:
                legacyBarcode = Barcode(self.barcode.message, BarcodeFormat.PDF417, self.barcode.altText)
            d.update({'barcodes': newBarcodes})
            d.update({'barcode': legacyBarcode})

        if self.relevantDate:
            d.update({'relevantDate': self.relevantDate})
        if self.backgroundColor:
            d.update({'backgroundColor': self.backgroundColor})
        if self.foregroundColor:
            d.update({'foregroundColor': self.foregroundColor})
        if self.labelColor:
            d.update({'labelColor': self.labelColor})
        if self.logoText:
            d.update({'logoText': self.logoText})
        if self.locations:
            d.update({'locations': self.locations})
        if self.ibeacons:
            d.update({'beacons': self.ibeacons})
        if self.userInfo:
            d.update({'userInfo': self.userInfo})
        if self.associatedStoreIdentifiers:
            d.update(
                {'associatedStoreIdentifiers': self.associatedStoreIdentifiers}
            )
        if self.appLaunchURL:
            d.update({'appLaunchURL': self.appLaunchURL})
        if self.expirationDate:
            d.update({'expirationDate': self.expirationDate})
        if self.voided:
            d.update({'voided': True})
        if self.webServiceURL:
            d.update({'webServiceURL': self.webServiceURL,
                      'authenticationToken': self.authenticationToken})
        return d

def PassHandler(obj):
    if hasattr(obj, 'json_dict'):
        return obj.json_dict()
    else:
        # For Decimal latitude and logitude etc.
        if isinstance(obj, decimal.Decimal):
            return str(obj)
        else:
            return obj


text:
from . import Arduino
from . import ARDUINO_GROVE_I2C

__author__ = "Marco Rabozzi, Luca Cerina, Giuseppe Natale"
__copyright__ = "Copyright 2016, NECST Laboratory, Politecnico di Milano"

ARDUINO_GROVE_HAPTIC_MOTOR_PROGRAM = "arduino_grove_haptic_motor.bin"
CONFIG_IOP_SWITCH = 0x1
START_WAVEFORM = 0x2
STOP_WAVEFORM = 0x3
READ_IS_PLAYING = 0x4

class Grove_HapticMotor(object):
    """This class controls the Grove Haptic Motor based on the DRV2605L.
    Hardware version v0.9.

    Attributes
    ----------
    microblaze : Arduino
        Microblaze processor instance used by this module.

    """
    def __init__(self, mb_info, gr_pin):
        """Return a new instance of an Grove_Haptic_Motor object.

        Parameters
        ----------
        mb_info : dict
            A dictionary storing Microblaze information, such as the
            IP name and the reset name.
        gr_pin: list
            A group of pins on arduino-grove shield.

        """
        if gr_pin not in [ARDUINO_GROVE_I2C]:
            raise ValueError("Group number can only be I2C.")

        self.microblaze = Arduino(mb_info, ARDUINO_GROVE_HAPTIC_MOTOR_PROGRAM)
        self.microblaze.write_blocking_command(CONFIG_IOP_SWITCH)

    def play(self, effect):
        """Play a vibration effect on the Grove Haptic Motor peripheral.

        Valid effect identifiers are in the range [1, 127].

        Parameters
        ----------
        effect : int
            An integer that specifies the effect.

        Returns
        -------
        None

        """
        if (effect < 1) or (effect > 127):
            raise ValueError("Valid effect identifiers are within 1 and 127.")
        self.microblaze.write_mailbox(0, [effect, 0])
        self.microblaze.write_blocking_command(START_WAVEFORM)

    def play_sequence(self, sequence):
        """Play a sequence of effects possibly separated by pauses.

        At most 8 effects or pauses can be specified at a time.
        Pauses are defined using negative integer values in the
        range [-1, -127] that correspond to a pause length in the
        range [10, 1270] ms

        Valid effect identifiers are in the range [1, 127]

        As an example, in the following sequence example: [4,-20,5]
        effect 4 is played and after a pause of 200 ms effect 5 is played

        Parameters
        ----------
        sequence : list
            At most 8 values specifying effects and pauses.

        Returns
        -------
        None

        """
        length = len(sequence)
        if length < 1:
            raise ValueError("The sequence must contain at least one value.")
        if length > 8:
            raise ValueError("The sequence cannot contain more than 8 values.")
        for i in range(length):
            if sequence[i] < 0:
                if sequence[i] < -127:
                    raise ValueError("Pause value must be smaller than -127")
                sequence[i] = -sequence[i] + 128
            else:
                if (sequence[i] < 1) or (sequence[i] > 127):
                    raise ValueError("Valid effect identifiers are within " +
                                     "1 and 127.")
        sequence += [0] * (8 - length)

        self.microblaze.write_mailbox(0, sequence)
        self.microblaze.write_blocking_command(START_WAVEFORM)

    def stop(self):
        """Stop an effect or a sequence on the motor peripheral.

        Returns
        -------
        None

        """
        self.microblaze.write_blocking_command(STOP_WAVEFORM)

    def is_playing(self):
        """Check if a vibration effect is running on the motor.

        Returns
        -------
        bool
            True if a vibration effect is playing, false otherwise

        """
        self.microblaze.write_blocking_command(READ_IS_PLAYING)
        flag = self.microblaze.read_mailbox(0)
        return flag == 1


text:
using System;
using OpenADK.Library;

namespace OpenADK.Library.au.Student
{
	///
	/// Defines the set of values that can be specified whenever a TermInfoSessionType
	/// is used as a parameter to a method or constructor.
	///
	/// <remarks>
	/// Alternatively, the static
	///  <see cref="Wrap"/> method can be called to encapsulate any string value in
	///  a TermInfoSessionType object.
	/// <para>Author: Generated by adkgen</para>
	/// <para>Version: 2.6</para>
	/// <para>Since: 2.3</para>
	/// </remarks>
	[Serializable]
	public class TermInfoSessionType : SifEnum
	{
	/// Semester ("0828")
	public static readonly TermInfoSessionType C0828_SEMESTER = new TermInfoSessionType("0828");

	/// Full school year ("0827")
	public static readonly TermInfoSessionType C0827_FULL_SCHOOL_YEAR = new TermInfoSessionType("0827");

	/// Twelve month ("0837")
	public static readonly TermInfoSessionType C0837_TWELVE_MONTH = new TermInfoSessionType("0837");

	/// Quarter ("0830")
	public static readonly TermInfoSessionType C0830_QUARTER = new TermInfoSessionType("0830");

	/// Mini-term ("0832")
	public static readonly TermInfoSessionType C0832_MINITERM = new TermInfoSessionType("0832");

	/// Trimester ("0829")
	public static readonly TermInfoSessionType C0829_TRIMESTER = new TermInfoSessionType("0829");

	/// Other ("9999")
	public static readonly TermInfoSessionType C9999_OTHER = new TermInfoSessionType("9999");

	/// Summer term ("0833")
	public static readonly TermInfoSessionType C0833_SUMMER_TERM = new TermInfoSessionType("0833");

	///Wrap an arbitrary string value in a TermInfoSessionType object.
	///<param name="wrappedValue">The element/attribute value.</param>
	///<remarks>This method does not verify
	///that the value is valid according to the SIF Specification</remarks>
	public static TermInfoSessionType Wrap( String wrappedValue ) {
		return new TermInfoSessionType( wrappedValue );
	}

	private TermInfoSessionType( string enumDefValue ) : base( enumDefValue ) {}
	}
}


text:
package org.tp23.antinstaller.runtime.exe;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.BuildListener;
import org.apache.tools.ant.DefaultLogger;
import org.apache.tools.ant.Diagnostics;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.ProjectHelper;
import org.apache.tools.ant.input.DefaultInputHandler;
import org.apache.tools.ant.launch.Locator;
import org.tp23.antinstaller.InstallException;
import org.tp23.antinstaller.InstallerContext;
import org.tp23.antinstaller.antmod.ProjectHelper3;
import org.tp23.antinstaller.selfextract.NonExtractor;
import org.tp23.antinstaller.selfextract.SelfExtractor;
/**
 *
 *
This AntRunner runs Ant builds directly from a Jar without having to extract
 * the build.xml to temporary space.

 *

 *
Copyright: Copyright (c) 2004

 *
Company: tp23

 * @author Paul Hinds
 * @version $Id: AntProjectFilter.java,v 1.10 2007/01/28 08:44:39 teknopaul Exp $
 */
public class AntProjectFilter implements ExecuteFilter{

    //TODO certain jars are added from Ant default directories that are probably not needed

	private static String antVersion = null;

	/** The Ant Home property - from default Launcher  */
	public static final String ANTHOME_PROPERTY = "ant.home";

	/** The location of a per-user library directory - from default Launcher */
	public static final String USER_LIBDIR = ".ant/lib";

	public AntProjectFilter() {
	}

	/**
	 * run Ant
	 *
	 * @param ctx InstallerContext
	 * @throws InstallException
	 * @todo Implement this org.tp23.antinstaller.runtime.AntRunner method
	 */
	public void exec(InstallerContext ctx) throws InstallException {
		if(ctx.getInstaller().isVerbose()) {
            ctx.log("Starting Ant Project");
        }

		try {

			Project project = new Project();
			appendClassPath();
			setAntHome(ctx);
			project.setCoreLoader(this.getClass().getClassLoader());

			DefaultLogger antLogger = new DefaultLogger();
			antLogger.setOutputPrintStream(ctx.getAntOutputRenderer().getOut());
			antLogger.setErrorPrintStream(ctx.getAntOutputRenderer().getErr());
			antLogger.setMessageOutputLevel(Project.MSG_INFO);
			BuildListener bl = ctx.getBuildListener();
			if(bl != null){
				project.addBuildListener(bl);
			}
			project.addBuildListener(antLogger);

            /*
             * Log useful ant task output to the log file to help debugging
             * and for customer support
             */
            final String logFileName = ctx.getLogger().getFileName();
            if( logFileName != null && logFileName.length() > 0 )
            {
                PrintStream stream = new PrintStream( new FileOutputStream(logFileName, true), true);
                DefaultLogger antFileLogger = new DefaultLogger();
                antFileLogger.setOutputPrintStream( stream );
                antFileLogger.setErrorPrintStream( stream );
                int logLevel = (ctx.getInstaller().isVerbose())
                                    ? Project.MSG_VERBOSE
                                    : Project.MSG_INFO;
                antFileLogger.setMessageOutputLevel( logLevel );

                project.addBuildListener( antFileLogger );
            }

            // irrelevant really but might help someone on a command line
			project.setInputHandler(new DefaultInputHandler());
			project.fireBuildStarted();

			project.init();
			project.setUserProperty("ant.version", getAntVersion());

			// add properties
			// N.B. properties are not loaded from the file it exists for debugging installers
			String arg;
			String value;
			Map properties = ctx.getInstaller().getResultContainer().getAllProperties();
			Iterator iter = properties.keySet().iterator();
			while (iter.hasNext()) {
				arg = (String) iter.next();
				value = (String) properties.get(arg);
				project.setUserProperty(arg, value);
			}

			// From here we immitate Main
			try {
			    Diagnostics.validateVersion();
			} catch (Throwable exc) {
				// minimal messages for the benefit of the command line install
				System.err.println("Version error:" + exc.getClass() + "," + exc.getMessage());
			    return;
			}

			ProjectHelper helper = new ProjectHelper3();
			project.addReference("ant.projectHelper", helper);

			File buildXml = new File(ctx.getFileRoot(), ctx.getAntBuildFile());
			if(buildXml.exists()){
				helper.parse(project, buildXml);
				project.setUserProperty("ant.file",buildXml.getAbsolutePath());
			} else {
				URL buildIS = this.getClass().getResource("/" + ctx.getAntBuildFile());
				helper.parse(project, buildIS);
				project.setUserProperty("ant.file", buildIS.toExternalForm());
			}

			File enclosingJar = SelfExtractor.getEnclosingJar(this);
			project.setUserProperty(NonExtractor.ANTINSTALLER_JAR_PROPERTY , enclosingJar.getAbsolutePath());
			System.out.println(NonExtractor.ANTINSTALLER_JAR_PROPERTY + enclosingJar.getAbsolutePath());

			//what is this !?! project.setKeepGoingMode(keepGoingMode);

			project.setBaseDir(ctx.getFileRoot());

			project.executeTargets(ctx.getInstaller().getTargets(ctx));
			project.fireBuildFinished(null);
			ctx.setInstallSucceded(true);
			ctx.log("Ant finished");
		}
		catch (Throwable e) {
			throw new InstallException("Error running the install, " + e.getMessage(), e);
		}
        finally {
			ctx.getRunner().antFinished();
		}
	}

	public static synchronized String getAntVersion() throws BuildException {
		 if (antVersion == null) {
			 try {
				 Properties props = new Properties();
				 InputStream in =
					 AntProjectFilter.class.getResourceAsStream("/org/apache/tools/ant/version.txt");
				 props.load(in);
				 in.close();

				 StringBuffer msg = new StringBuffer();
				 msg.append("Apache Ant version ");
				 msg.append(props.getProperty("VERSION"));
				 msg.append(" compiled on ");
				 msg.append(props.getProperty("DATE"));
				 antVersion = msg.toString();
			 } catch (IOException ioe) {
				 throw new BuildException("Could not load the version information:"
										  + ioe.getMessage());
			 } catch (NullPointerException npe) {
				 throw new BuildException("Could not load the version information.");
			 }
		 }
		 return antVersion;
	 }

	/**
	 * Append extra Ant jars to the classpath the original classpath
	 * is not removed incase the installer is launched from a script
	 *
	 */
	private static void appendClassPath(){
		try {
			// now update the class.path property
			StringBuffer baseClassPath
				= new StringBuffer(System.getProperty("java.class.path"));
			if (baseClassPath.charAt(baseClassPath.length() - 1)
				== File.pathSeparatorChar) {
				baseClassPath.setLength(baseClassPath.length() - 1);
			}
			URL[] jars = getLibPaths();
			for (int i = 0; i < jars.length; ++i) {
				baseClassPath.append(File.pathSeparatorChar);
				baseClassPath.append(Locator.fromURI(jars[i].toString()));
			}

			System.setProperty("java.class.path", baseClassPath.toString());

			URLClassLoader loader = new URLClassLoader(jars);
			Thread.currentThread().setContextClassLoader(loader);
		}
		catch (MalformedURLException e) {
			// swallow exception, normally all resources are already loaded
			System.err.println("Invalid Jar path");
		}
	}

	/**
	 * Ant home is not a requirement but can exist prior to loading
	 * the default Ant mechanism of using the current Jars parent
	 * is consipicuously absent, do not rely on ANT_HOME out side of a
	 * controlled environment (e.g. a normal install)
	 */
	private static void setAntHome(InstallerContext ctx){
		String antHomeProperty = System.getProperty(ANTHOME_PROPERTY);
		if(antHomeProperty==null){
			System.setProperty(ANTHOME_PROPERTY, ctx.getFileRoot().getAbsolutePath());
		}
	}

	/**
	 * To maintain compatability with previous verisons currently the only
	 * Ant command line argument supported is the -lib parameter with the value
	 * "antlib"
     * @TODO this should probably be removed
	 * @throws MalformedURLException
	 */
	private static URL[] getLibPaths() throws MalformedURLException{

		// add all Jars from the ./antlib directory at the time of the build
		// this is NOT based on ANT_HOME
		URL[] libJars = Locator.getLocationURLs(new File("antlib"));

		// add all the Jars from ~/.ant/lib
		// this is probably irrelevant for a normal install
		URL[] userJars = Locator.getLocationURLs(new File(USER_LIBDIR));

		// Now try and find JAVA_HOME
		File toolsJar = Locator.getToolsJar();

		int jarsLength = libJars.length + userJars.length + (toolsJar!=null?1:0);
		URL[] allJars = new URL[jarsLength];
		int i = 0;
		if(toolsJar != null){
			allJars[i++] = toolsJar.toURL();
		}
		if(libJars.length != 0){
			System.arraycopy(libJars, 0, allJars, i, libJars.length);
			i += libJars.length;
		}
		if(userJars.length != 0){
			System.arraycopy(userJars, 0, allJars, i, userJars.length);
			//i+=userJars.length;
			//assert(allJars.length=i-1);
		}
		return libJars;
	}

}


text:
require_dependency 'user'

module RedminePusherNotifications
  module Patches
    module UserPatch

      def self.included(base)
        base.send(:include, InstanceMethods)
        base.class_eval do
          unloadable
        end
      end

      module InstanceMethods

        def receive_pusher_notifications?
          self.custom_field_values.each do |custom|
            if custom.custom_field.name == 'Receive Pusher Notifications'
              return custom.value
            end
          end
          return false
        end

      end

    end
  end
end

unless User.included_modules.include?(RedminePusherNotifications::Patches::UserPatch)
  User.send(:include, RedminePusherNotifications::Patches::UserPatch)
end


text:
package org.artifactory.ui.rest.resource.admin.configuration.repositories;

/**
 * @author Dan Feldman
 */
public interface RepoResourceConstants {

    String PATH_REPOSITORIES = "admin/repositories";
    String PATH_REPLICATION = PATH_REPOSITORIES + "/replication";
}


text:
<?php

namespace Energine\apps\components;

use Energine\share\components\DataSet;
use Energine\share\gears\ComponentProxyBuilder;

/**
 * Similar news.
 *
 * @code
class SimilarNews;
 * @endcode
 */
class SimilarNews extends DataSet {
    /**
     * Default component name for binding.
     */
    const DEFAULT_LINK_TO = 'news';
    /**
     * Separator of tag names.
     */
    const TAG_SEPARATOR = ',';

    /**
     * News ID.
     * @var int $newsID
     */
    private $newsID;

    /**
     * Component to which "Similar news" will be bounded.
     * @var NewsFeed $cp
     */
    private $cp;

    /**
     * @copydoc DBDataSet::__construct
     */
    public function __construct($name, array $params = NULL) {
        parent::__construct($name, $params);
        $bindComponentName = ($this->getParam('bind')) ? $this->getParam('bind') : self::DEFAULT_LINK_TO;
        $this->cp =
            E()->getDocument()->componentManager->getBlockByName($bindComponentName);
        if (!$this->cp || ($this->cp && $this->cp->getState() != 'view')) {
            $this->disable();
        }
        $this->setParam('recordsPerPage', false);
    }

    /**
     * @copydoc DBDataSet::defineParams
     */
    // Определяет допустимые параметры компонента и их значения по-умолчанию в виде массива array(paramName => defaultValue).
    protected function defineParams() {
        $result = array_merge(parent::defineParams(),
            [
                'limit' => 5,
                'bind' => ''
            ]);
        return $result;
    }

    /**
     * @copydoc DBDataSet::main
     */
    protected function main() {
        $ap = $this->cp->getStateParams(true);
        /**
         * @var $tag Array of tag ids
         */
        $tags = $this->dbh->getColumn($this->dbh->getTagsTablename($this->cp->getTableName()), 'tag_id', ['news_id' => (int)$ap['id']]);

        $this->setType(self::COMPONENT_TYPE_LIST);
        $this->setBuilder($b = new ComponentProxyBuilder());
        $params = [
            'active' => false,
            'state' => 'main',
            'tags' => $tags,
            'tableName' => $this->cp->getTableName(),
            'exclude' => (int)$ap['id'],
            'limit' => $this->getParam('limit')
        ];
        $b->setComponent(
            'simNews',
            'Energine\\apps\\components\\NewsFeed',
            $params
        );
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Untitled Document: Traversing a Hash Table</title>

<meta name="description" content="Untitled Document: Traversing a Hash Table">
<meta name="keywords" content="Untitled Document: Traversing a Hash Table">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="BFD-Index.html#BFD-Index" rel="index" title="BFD Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Hash-Tables.html#Hash-Tables" rel="up" title="Hash Tables">
<link href="Deriving-a-New-Hash-Table-Type.html#Deriving-a-New-Hash-Table-Type" rel="next" title="Deriving a New Hash Table Type">
<link href="Looking-Up-or-Entering-a-String.html#Looking-Up-or-Entering-a-String" rel="prev" title="Looking Up or Entering a String">

Next: Deriving a New Hash Table Type, Previous: Looking Up or Entering a String, Up: Hash Tables   [Contents][Index]

2.18.3 Traversing a hash table

The function bfd_hash_traverse may be used to traverse a
hash table, calling a function on each element.  The traversal
is done in a random order.

bfd_hash_traverse takes as arguments a function and a
generic void * pointer.  The function is called with a
hash table entry (a struct bfd_hash_entry *) and the
generic pointer passed to bfd_hash_traverse.  The function
must return a boolean value, which indicates whether to
continue traversing the hash table.  If the function returns
FALSE, bfd_hash_traverse will stop the traversal and
return immediately.


text:
<?php

namespace ZendTest\Cache\Storage\Adapter;

use Zend\Cache;

/**
 * @group      Zend_Cache
 */
class ApcTest extends CommonAdapterTest
{

    /**
     * Restore 'apc.use_request_time'
     *
     * @var mixed
     */
    protected $iniUseRequestTime;

    public function setUp()
    {
        if (!defined('TESTS_ZEND_CACHE_APC_ENABLED') || !TESTS_ZEND_CACHE_APC_ENABLED) {
            $this->markTestSkipped("Skipped by TestConfiguration (TESTS_ZEND_CACHE_APC_ENABLED)");
        }

        if (version_compare('3.1.6', phpversion('apc')) > 0) {
            try {
                new Cache\Storage\Adapter\Apc();
                $this->fail("Expected exception Zend\Cache\Exception\ExtensionNotLoadedException");
            } catch (Cache\Exception\ExtensionNotLoadedException $e) {
                $this->markTestSkipped("Missing ext/apc >= 3.1.6");
            }
        }

        $enabled = (bool) ini_get('apc.enabled');
        if (PHP_SAPI == 'cli') {
            $enabled = $enabled && (bool) ini_get('apc.enable_cli');
        }

        if (!$enabled) {
            try {
                new Cache\Storage\Adapter\Apc();
                $this->fail("Expected exception Zend\Cache\Exception\ExtensionNotLoadedException");
            } catch (Cache\Exception\ExtensionNotLoadedException $e) {
                $this->markTestSkipped("ext/apc is disabled - see 'apc.enabled' and 'apc.enable_cli'");
            }
        }

        // needed on test expirations
        $this->iniUseRequestTime = ini_get('apc.use_request_time');
        ini_set('apc.use_request_time', 0);

        $this->_options = new Cache\Storage\Adapter\ApcOptions();
        $this->_storage = new Cache\Storage\Adapter\Apc();
        $this->_storage->setOptions($this->_options);

        parent::setUp();
    }

    public function tearDown()
    {
        if (function_exists('apc_clear_cache')) {
            apc_clear_cache('user');
        }

        // reset ini configurations
        ini_set('apc.use_request_time', $this->iniUseRequestTime);

        parent::tearDown();
    }
}


text:
namespace ash {

namespace {

AccessibilityControllerImpl* GetController() {
  return Shell::Get()->accessibility_controller();
}

}  // namespace

AccessibilityControllerTestApiImpl::AccessibilityControllerTestApiImpl() =
    default;

AccessibilityControllerTestApiImpl::~AccessibilityControllerTestApiImpl() =
    default;

void AccessibilityControllerTestApiImpl::SetLargeCursorEnabled(bool enabled) {
  GetController()->large_cursor().SetEnabled(enabled);
}

bool AccessibilityControllerTestApiImpl::IsLargeCursorEnabled() const {
  return GetController()->large_cursor().enabled();
}

int AccessibilityControllerTestApiImpl::GetDictationSodaDownloadProgress()
    const {
  return GetController()->dictation_soda_download_progress();
}

// static
std::unique_ptr<AccessibilityControllerTestApi>
AccessibilityControllerTestApi::Create() {
  return std::make_unique<AccessibilityControllerTestApiImpl>();
}

}  // namespace ash


text:
package com.flowpowered.commons;

/**
 * Stores the size that spans a fixed amount of bits<br> For example: 1, 2, 4, 8, 16 and 32 sizes match this description
 */
public class BitSize {
    public final int SIZE;
    public final int HALF_SIZE;
    public final int DOUBLE_SIZE;
    public final int MASK;
    public final int BITS;
    public final int DOUBLE_BITS;
    public final int AREA;
    public final int HALF_AREA;
    public final int DOUBLE_AREA;
    public final int VOLUME;
    public final int HALF_VOLUME;
    public final int DOUBLE_VOLUME;

    public BitSize(int bitCount) {
        this.BITS = bitCount;
        this.SIZE = 1 << bitCount;
        this.AREA = this.SIZE * this.SIZE;
        this.VOLUME = this.AREA * this.SIZE;
        this.HALF_SIZE = this.SIZE >> 1;
        this.HALF_AREA = this.AREA >> 1;
        this.HALF_VOLUME = this.VOLUME >> 1;
        this.DOUBLE_SIZE = this.SIZE << 1;
        this.DOUBLE_AREA = this.AREA << 1;
        this.DOUBLE_VOLUME = this.VOLUME << 1;
        this.DOUBLE_BITS = this.BITS << 1;
        this.MASK = this.SIZE - 1;
    }
}


text:
#!/usr/bin/env ruby

#
# utility to copy libraries (some installed via Aptfile) which are referenced by the R packages
# built during execution of init.R/packrat/renv, which need to be "packaged" into the slug since
# the chroot isn't included at runtime.
#
# this script uses ldd to inspect each .so file in the given directory to get the referenced .so
# files to copy them to /app/R/lib/R/lib so that they can be found at runtime.
#
# any dynamic dependencies, such as a command line utilities, scripts or any other files, won't be
# included in this process, as there is no definitive way to know what is needed, so YMMV.
#

require 'open3'

def find_depend_libs(binary)
  cmd = "/usr/bin/ldd #{binary} | /usr/bin/awk '{print $3}' | /usr/bin/sort -u"

  output = ""
  res = nil
  Open3.popen2e(cmd, :chdir=>"/") do |stdin, stdout_stderr, wait_thr|
    output = stdout_stderr.read.chomp
    res = wait_thr.value
  end

  raise StandardError.new("Failed to find dependent libraries for '#{binary}'. #{output}") if res&.exitstatus != 0

  output.split("\n")
      .reject {|s| s == "" }
      .reject {|s| s =~ /^\/app/ }
      .select {|s| File.exists?(s) }
      .collect {|f| [f, File.basename(f)] }
end

def copy_depend_libs(path, binary)
  find_depend_libs(binary).each do |src, dest|
    target = File.join(path, dest)
    next if File.exists?(target)
    print "⦁ #{src} → #{target} "
    copy_binary_file src, target
    if target =~ /\.so/ && target !~ /\.so$/
      Dir.chdir(File.dirname(target)) do
        basename = File.basename(target)
        symlinkname = basename.sub(/\.so.*/, ".so")
        File.symlink(basename, symlinkname) unless File.exists?(symlinkname)
      end
    end
    print "[OK]\n"
    copy_depend_libs path, src
  end
end

def copy_binary_file(src, target)
  File.open(src, 'rb') do |f|
    File.open(target, 'wb') do |g|
      g.chmod(0777) # executable
      g.write(f.read)
    end
  end
end

# where to search
#  e.g. /app/R/site-library/**/*.so
search=ARGV[0]

puts "Searching in #{search}"

# destination for copied libs
dest_path = "/app/R/lib/R/lib"

# all related SO files
Dir.glob(search).each do |binary|
  copy_depend_libs(dest_path, binary)
end


text:
package org.apache.kylin.common.threadlocal;

/**
 * InternalThread
 */
public class InternalThread extends Thread {

    private InternalThreadLocalMap threadLocalMap;

    public InternalThread() {
    }

    public InternalThread(Runnable target) {
        super(target);
    }

    public InternalThread(ThreadGroup group, Runnable target) {
        super(group, target);
    }

    public InternalThread(String name) {
        super(name);
    }

    public InternalThread(ThreadGroup group, String name) {
        super(group, name);
    }

    public InternalThread(Runnable target, String name) {
        super(target, name);
    }

    public InternalThread(ThreadGroup group, Runnable target, String name) {
        super(group, target, name);
    }

    public InternalThread(ThreadGroup group, Runnable target, String name, long stackSize) {
        super(group, target, name, stackSize);
    }

    /**
     * Returns the internal data structure that keeps the threadLocal variables bound to this thread.
     * Note that this method is for internal use only, and thus is subject to change at any time.
     */
    public final InternalThreadLocalMap threadLocalMap() {
        return threadLocalMap;
    }

    /**
     * Sets the internal data structure that keeps the threadLocal variables bound to this thread.
     * Note that this method is for internal use only, and thus is subject to change at any time.
     */
    public final void setThreadLocalMap(InternalThreadLocalMap threadLocalMap) {
        this.threadLocalMap = threadLocalMap;
    }
}