text:
package flushwriter

import (
	"fmt"
	"testing"
)

type writerWithFlush struct {
	writeCount, flushCount int
	err                    error
}

func (w *writerWithFlush) Flush() {
	w.flushCount++
}

func (w *writerWithFlush) Write(p []byte) (n int, err error) {
	w.writeCount++
	return len(p), w.err
}

type writerWithNoFlush struct {
	writeCount int
}

func (w *writerWithNoFlush) Write(p []byte) (n int, err error) {
	w.writeCount++
	return len(p), nil
}

func TestWriteWithFlush(t *testing.T) {
	w := &writerWithFlush{}
	fw := Wrap(w)
	for i := 0; i < 10; i++ {
		_, err := fw.Write([]byte("Test write"))
		if err != nil {
			t.Errorf("Unexpected error while writing with flush writer: %v", err)
		}
	}
	if w.flushCount != 10 {
		t.Errorf("Flush not called the expected number of times. Actual: %d", w.flushCount)
	}
	if w.writeCount != 10 {
		t.Errorf("Write not called the expected number of times. Actual: %d", w.writeCount)
	}
}

func TestWriteWithoutFlush(t *testing.T) {
	w := &writerWithNoFlush{}
	fw := Wrap(w)
	for i := 0; i < 10; i++ {
		_, err := fw.Write([]byte("Test write"))
		if err != nil {
			t.Errorf("Unexpected error while writing with flush writer: %v", err)
		}
	}
	if w.writeCount != 10 {
		t.Errorf("Write not called the expected number of times. Actual: %d", w.writeCount)
	}
}

func TestWriteError(t *testing.T) {
	e := fmt.Errorf("Error")
	w := &writerWithFlush{err: e}
	fw := Wrap(w)
	_, err := fw.Write([]byte("Test write"))
	if err != e {
		t.Errorf("Did not get expected error. Got: %#v", err)
	}
}


text:
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2005, 2006, 2007, 2008, 2009
// University of Rochester
// Department of Computer Science
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//    * Redistributions of source code must retain the above copyright notice,
//      this list of conditions and the following disclaimer.
//
//    * Redistributions in binary form must reproduce the above copyright
//      notice, this list of conditions and the following disclaimer in the
//      documentation and/or other materials provided with the distribution.
//
//    * Neither the name of the University of Rochester nor the names of its
//      contributors may be used to endorse or promote products derived from
//      this software without specific prior written permission.
//
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

#ifndef __CONTENTIONMANAGER_H__
#define __CONTENTIONMANAGER_H__

#include <string>
#include "../support/atomic_ops.h"
#include "../support/hrtime.h"
/*********************************** SH-START ******************************************/
#include <chronos/chronos.h>
#include <chronos/chronos_utils.h>
#include <iostream>
#include <vector>
#include <time.h>
#include <rstm_hlp.hpp>
#include <pthread.h>
#include <string>
#include <sstream>
using namespace std;
/*********************************** SH-END ******************************************/

namespace stm
{
  enum ConflictResolutions { AbortSelf, AbortOther, Wait };
  enum tx_state {released,retrying,executing};	//Different states for transaction
  extern volatile unsigned long long new_tx_released;	//Holds address of a released transaction to be used in pnf_helper
  extern volatile unsigned int new_tx_checking;	//If 1, then pnf_main should check Txs in n_set
  extern volatile unsigned long long new_tx_committed;	//Holds address of a committed transaction to be used in pnf_helper
  extern volatile unsigned long long m_set_bits;	//Holds bit representation of all objects held in m_set in PNF
  										//Due to current implementation, m_set_bits cannot exceed 64 objects
  extern pthread_t pnf_main_th;				//pnf_main service thread
  extern pthread_attr_t pnf_th_attr;			//Attributes for pnf_main service thread
  extern struct sched_param pnf_main_param;	//scheduling parameters for pnf_main service

  extern bool compTimeSpec(struct timespec* f_ts,struct timespec* s_ts);	//"true" if f_ts timespec is smaller than s_ts. "false" otherwise
  extern int nSetPos(void* cm_ptr);	//Returns position of cm_ptr within n_set
  extern void addTxNset(void* cm_th);	//Add cm_th to n_set according to its priority
  extern void pnf_main_start();	//Starts pnf_main service. This function must be called before initiating PNF CM for any task
  extern void pnf_main_stop();	//Stops pnf_main service
  extern void* pnf_main(void* arg);	//Main (centralized) service of PNF. It continues execution until all tasks finish. It is invoked by Txs to execute some tasks

  class ContentionManager
  {
    protected:
      int priority;
    public:
      	struct timespec time_param;			//input parameter for ECM which should be cast to deadline
                                       		//In case of RCM, it holds the period
		unsigned long length;				//specific for LCM
		double psy;							//specific for LCM
		struct timespec stamp, tra_abort;		//stamp records the beginning of the transaction, while tra_abort records when the transaction is aborted
		unsigned long long total_abort_duration;	//Holds the total abort time of all instances of the thread during the whole run time of experimennt
		vector<double> acc_obj;                         //list of accessed objects by current tx
		int th;				//ptr to current thread
		vector<string> rec;	//Holds intermediate records for logging
		stringstream rec_in;
		struct timespec rec_time;
		struct sched_param param;
		struct sched_param param_tmp;
		int policy;
		int task_run_prio;
		int task_end_prio;
		int task_util;
		struct timespec* task_deadline;
		struct timespec* task_period;
		unsigned long task_unlocked;
		unsigned long task_locked;
		int eta;            //Defines maximum number of times each transaction can be aborted
							//Used in FBLT
		bool new_tx;	//if true, it is first time to begin transaction. Otherwise, tx has already begun and it is just
						//an abort and retry
		unsigned long long curr_objs_bits;	//Indices of accessed objects by current Tx. If bit at position X=1, then
											//current Tx accesses object number X. It should be identified at Tx_begin.
											//As curr_objs is represented with unsigned long long, than maximum
											//number of accessed objects cannot exceed 64
		unsigned long long cur_m_set_bits;	//current version of m_set_bits. It is used with lock-free conflict checking in some CMs like PNF
		unsigned long long new_m_set_bits;	//New m_set_bits from the perspective of cur_m_set_bits and current Tx
		bool go_on;	//If true, pnf_main tells current Tx to complete execution. It is used to
					//synchronize execution between pnf_main and current Tx
		tx_state cur_state;			//Holds state of current transaction
		struct sched_param orig_param;	//records original sched_param for current thread when a Tx starts
		bool m_set;				//if "true", tx is an executing tx. Otherwise, tx is a retrying one.

		vector<string> getRec(){
            return rec;
        }

        void newInst(){
            //Declares a new instance of the current thread
            //Define things that need to be renewed in the new instance
            rec=vector<string> ();
        }

        struct timespec* getTimeParam(){
          return &time_param;
        }

	/******************** LCM functions start ********************/

	void setLength(unsigned long in_length){
		length=in_length;
	}

	unsigned long getLength(){
		return length;
	}

	void setPsy(double in_psy){
		psy=in_psy;
	}

	double getPsy(){
		return psy;
	}
	/******************** LCM functions end ********************/

	/******************** SH-START *******************/
        void setAccObj(vector<double> in_acc_obj){
	//Set list of accessed objects by current transaction
		acc_obj=in_acc_obj;
	}

	vector<double> getAccObj(){
	//get list of accessed objects by current transaction
		return acc_obj;
	}

        void setCurThr(int in_th){
	//set value to thread inititing current transaction
		th=in_th;
	}

	int getCurThr(){
	//get value of thread initiating current transaction
		return th;
	}

      ContentionManager() : priority(0),total_abort_duration(0){
	/******************************* SH-START **********************************/
	tra_abort.tv_sec=0;
	tra_abort.tv_nsec=0;
	new_tx=true;
	go_on=false;
	/******************************* SH-END **********************************/
      }
      int getPriority() { return priority; }

      ////////////////////////////////////////
      // Transaction-level events
      virtual void onBeginTransaction() {
	  try{
		clock_gettime(CLOCK_REALTIME, &stamp);
		/********************************* Debug 5 start ********************************/
		//tra_start.push_back(stamp);
		/********************************* Debug 5 end ********************************/
	    }catch(exception e){
		cout<<"onBeginTransaction exception: "<<e.what()<<endl;
	    }
     }
	virtual void onTryCommitTransaction() { }
	virtual void onTransactionCommitted() {
		priority = 0;	//This step is not part of PNF. It comes from original CM
		new_tx=true;
	}
      virtual void onTransactionAborted() {
	  try{
		clock_gettime(CLOCK_REALTIME, &tra_abort);
		total_abort_duration+=subtract_ts_mod(&stamp,&tra_abort);
	    }catch(exception e){
		cout<<"onTransactionAborted exception: "<<e.what()<<endl;
	    }

      }

      ////////////////////////////////////////
      // Object-level events
      virtual void onContention() { }
      virtual void onOpenRead() { }
      virtual void onOpenWrite() { }
      virtual void onReOpen() { }

      ////////////////////////////////////////
      // Conflict Event methods
      virtual ConflictResolutions onRAW(ContentionManager* enemy) = 0;
      virtual ConflictResolutions onWAR(ContentionManager* enemy) = 0;
      virtual ConflictResolutions onWAW(ContentionManager* enemy) = 0;

      virtual ~ContentionManager() { }
  };

  // create a contention manager
  ContentionManager* Factory(std::string cm_type);

/************************* SH-START **********************************/
	// Redefine factory to pass real-time arguments to the real-time CM
  ContentionManager* Factory(std::string cm_type, void* t_args);
/************************* SH-END **********************************/

  // wait by executing a bunch of nops in a loop (not preemption
  // tolerant)
  inline void nano_sleep(unsigned long nops)
  {
      for (unsigned i = 0; i < nops; i++)
          nop();
  }
} // namespace stm

#endif  // __CONTENTIONMANAGER_H__

redpajama_set_name: RedPajamaGithub


text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Tipoestadoinvestigacion
 *
 * @author cristhian
 */
class Tipoestadoinvestigacion extends ActiveRecord{
    //put your code here
}


text:
package org.apache.carbondata.spark.testsuite.dataload

import java.io.File

import org.apache.spark.sql.common.util.CarbonHiveContext._
import org.apache.spark.sql.common.util.QueryTest
import org.apache.spark.sql.Row

import org.apache.carbondata.core.util.CarbonProperties
import org.apache.carbondata.core.constants.CarbonCommonConstants
import org.scalatest.BeforeAndAfterAll

/**
  * Test Class for no inverted index load and query
  *
  */

class TestNoInvertedIndexLoadAndQuery extends QueryTest with BeforeAndAfterAll{

  def currentPath: String = new File(this.getClass.getResource("/").getPath + "/../../")
    .getCanonicalPath
  val testData1 = new File(currentPath + "/../../examples/src/main/resources/dimSample.csv")
    .getCanonicalPath
  val testData2 = new File(currentPath + "/../../examples/src/main/resources/data.csv")
    .getCanonicalPath

  override def beforeAll {
    sql("DROP TABLE IF EXISTS index1")
    sql("DROP TABLE IF EXISTS index2")
  }

  test("no inverted index load and point query") {

    sql("""
           CREATE TABLE IF NOT EXISTS index1
           (id Int, name String, city String)
           STORED BY 'org.apache.carbondata.format'
           TBLPROPERTIES('NO_INVERTED_INDEX'='name,city')
        """)
    sql(s"""
           LOAD DATA LOCAL INPATH '$testData1' into table index1
           """)
    checkAnswer(
      sql("""
           SELECT * FROM index1 WHERE city = "Bangalore"
          """),
      Seq(Row("Emily", "Bangalore", 19.0)))

  }

  test("no inverted index load and agg query") {

    sql(
      """
        CREATE TABLE IF NOT EXISTS index2
        (ID Int, date Timestamp, country String,
        name String, phonetype String, serialname String, salary Int)
        STORED BY 'org.apache.carbondata.format'
        TBLPROPERTIES('NO_INVERTED_INDEX'='country,name,phonetype')
      """)

    CarbonProperties.getInstance()
      .addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, "yyyy/MM/dd")

    sql(s"""
           LOAD DATA LOCAL INPATH '$testData2' into table index2
           """)

    checkAnswer(
      sql("""
           SELECT country, count(salary) AS amount
           FROM index2
           WHERE country IN ('china','france')
           GROUP BY country
          """),
      Seq(Row("china", 849), Row("france", 101))
    )

  }

  override def afterAll {
    sql("drop table index1")
    sql("drop table index2")
  }

}


text:
import {
    ChangeDetectionStrategy,
    ChangeDetectorRef,
    Component,
    EventEmitter,
    Input,
    OnChanges,
    OnInit,
    Output,
    SimpleChanges,
    ViewEncapsulation
} from "@angular/core";
import {FormBuilder, FormGroup} from "@angular/forms";
import {Workflow} from "cwl-svg";
import {WorkflowInputParameterModel, WorkflowModel, WorkflowOutputParameterModel} from "cwlts/models";
import {DirectiveBase} from "../../../util/directive-base/directive-base";
import {debounceTime} from "rxjs/operators";

@Component({
    encapsulation: ViewEncapsulation.None,
    changeDetection: ChangeDetectionStrategy.OnPush,
    selector: "ct-workflow-io-inspector",
    styleUrls: ["./workflow-io-inspector.components.scss"],
    template: `

            Required

                        <ct-toggle-slider data-test="required-toggle"
                                          [formControl]="form.controls['isRequired']"
                                          [off]="'No'"
                                          [on]="'Yes'">
                        </ct-toggle-slider>

            ID
            <input type="text"
                   class="form-control"
                   data-test="id-field"
                   [formControl]="form.controls['id']">

                {{form.controls['id'].errors['error']}}

                     This port is not connected

 0" class="text-muted small">
                Connections: {{ port['source'].join(", ") }}

            Label
            <input type="text"
                   class="form-control"
                   data-test="label-field"
                   (blur)="labelUpdate($event)"
                   [formControl]="form.controls['label']">

        <ct-type-select [formControl]="form.controls['typeForm']"></ct-type-select>

            Symbols
            <ct-auto-complete data-test="symbols-field"
                              [create]="true"
                              [formControl]="form.controls['symbols']"></ct-auto-complete>

            File types
            <ct-auto-complete data-test="file-types-field"
                              [formControl]="form.controls['fileTypes']"
                              [create]="true"></ct-auto-complete>

            Create batch group

                <ct-tooltip-content #ctt>

                        This workflow has a batch criteria which has been set via the API. If you change it,
                        you won't be able to restore the custom batch criteria afterwards.

                </ct-tooltip-content>

            <select class="form-control"
                    data-test="batch-select"
                    *ngIf="!workflowModel.batchInput || workflowModel.batchInput === port.id"
                    [formControl]="form.controls['batchType']">
                <option *ngFor="let propertyType of batchByList"
                        [disabled]="readonly"
                        [ngValue]="propertyType.value">
                    {{propertyType.label}}
                </option>
            </select>

                Only one input per workflow can be configured as batch. Grouping criteria has already been set on
                #{{workflowModel['batchInput']}}.

            Description
            <textarea class="form-control"
                      rows="4"
                      data-test="desc-field"
                      [formControl]="form.controls['description']"></textarea>

        <ct-secondary-file
            *ngIf="isFileType()"
            [formControl]="form.controls['secondaryFiles']"
            [readonly]="readonly"
            [port]="port">
        </ct-secondary-file>
    `

})
export class WorkflowIOInspectorComponent extends DirectiveBase implements OnInit, OnChanges {

    batchByList: { label: string, value: string | string [] } [] =
        [
            {
                label: "None",
                value: "none"
            },
            {
                label: "File",
                value: "item"
            },
            {
                label: "Sample",
                value: ["metadata.sample_id"]
            },
            {
                label: "Case",
                value: ["metadata.case_id"]
            },
            {
                label: "Library (Sample + Library)",
                value: ["metadata.sample_id", "metadata.library_id"]
            },
            {
                label: "Platform unit (Sample + Library + Platform unit)",
                value: ["metadata.sample_id", "metadata.library_id", "metadata.platform_unit_id"]
            },
            {
                label: "File segment (Sample + Library + Platform unit + File segment)",
                value: ["metadata.sample_id", "metadata.library_id", "metadata.platform_unit_id", "metadata.file_segment_number"]
            }
        ];

    // Initial batchByList length (to know if there is a custom value by comparing this value and current list length)
    private batchByListInitialLength = this.batchByList.length;

    // Value in batchByList that should be selected in DOM. This is added in order to solve the problem when we have
    // a custom value for batch by (when you type it manually in Code mode). We need this because of array values
    // (other way it will not preselect the value in DOM select input)
    private selectedBatchByOption;

    @Input()
    port: WorkflowInputParameterModel | WorkflowOutputParameterModel;

    @Input()
    workflowModel: WorkflowModel;

    disabled = false;

    get readonly(): boolean {
        return this.disabled;
    }

    @Input("readonly")
    set readonly(value: boolean) {
        this.disabled = value;
        if (this.form) {
            this.setDisabledState(value);
        }
    }

    @Input()
    graph: Workflow;

    @Output()
    change = new EventEmitter<any>();

    form: FormGroup;

    private initSymbolsList: string[] = [];

    constructor(private formBuilder: FormBuilder, private cdr: ChangeDetectorRef) {
        super();
    }

    ngOnChanges(changes: SimpleChanges): void {

        if (this.form) {

            if (changes["port"]) {
                const newIO = changes["port"].currentValue;
                if (!newIO) { // Happens when you go through wf history to the beginning
                    return;
                }

                this.form.patchValue({
                        isRequired: !newIO.type.isNullable,
                        id: newIO.id,
                        label: newIO.label,
                        typeForm: newIO.type,
                        symbols: newIO.type.symbols || this.initSymbolsList,
                        description: newIO.description,
                        fileTypes: newIO.fileTypes,
                        secondaryFiles: newIO.secondaryFiles
                    },
                    {
                        emitEvent: false,
                        onlySelf: true
                    }
                );
            }

            if (changes["workflow"]) {
                // If there was a custom value in batchByList and model is changed (Undo/Redo...) we have to remove that
                // custom value from batchByList
                if (this.batchByListInitialLength > this.batchByList.length) {
                    this.batchByList.pop();
                }
                this.selectedBatchByOption = this.findBatchValueInTheList(this.workflowModel["batchByValue"]);
                this.form.controls["batchType"].setValue(this.selectedBatchByOption);
            }
        }
    }

    /**
     * Return value of an option in batchByList that should be selected
     */
    findBatchValueInTheList(batchTypeValue: string | string []): string | string [] {

        if (!batchTypeValue) {
            // None value
            return this.batchByList.find((item) => item.value === "none").value;
        }

        // Find if batchTypeValue is in batchByList
        const criteriaInList = this.batchByList.find((batchBy) => {
            if (Array.isArray(batchBy.value) && Array.isArray(batchTypeValue)) {
                return batchBy.value.slice().sort().toString() === batchTypeValue.slice().sort().toString();
            } else {
                return batchBy.value === batchTypeValue;
            }
        });

        if (criteriaInList) {
            return criteriaInList.value;
        } else {
            // If its a custom value, should be added to a list
            this.batchByList.push({
                label: "Api: " + batchTypeValue,
                value: batchTypeValue
            });
            return batchTypeValue;
        }
    }

    ngOnInit() {

        this.selectedBatchByOption = this.findBatchValueInTheList(this.workflowModel["batchByValue"]);

        this.form = this.formBuilder.group({
            isRequired: [{value: !this.port.type.isNullable, disabled: this.readonly}],
            id: [{value: this.port.id, disabled: this.readonly}],
            label: [{value: this.port.label, disabled: this.readonly}],
            typeForm: [{value: this.port.type, disabled: this.readonly}],
            symbols: [{value: this.port.type.symbols || this.initSymbolsList, disabled: this.readonly}],
            description: [{value: this.port.description, disabled: this.readonly}],
            fileTypes: [{value: this.port.fileTypes, disabled: this.readonly}],
            batchType: [this.selectedBatchByOption],
            secondaryFiles: [{value: this.port.secondaryFiles || [], disabled: this.readonly}]
        });

        this.form.valueChanges.pipe(
            debounceTime(500)
        ).subscribeTracked(this, () => {
            this.change.emit();
        });

        this.form.controls["isRequired"].valueChanges.subscribeTracked(this, (value) => {
            this.port.type.isNullable = !value;
        });

        this.form.controls["id"].valueChanges.pipe(
            debounceTime(1000)
        ).subscribeTracked(this, (value) => {
            try {
                if (this.port.id === value) {
                    return;
                }

                // Change id on workflow model so canvas can interact with it
                this.workflowModel.changeIONodeId(this.port, value);
                this.graph.draw();

                if (this.isEnumType()) {
                    this.port.type.name = value;
                }
            } catch (e) {
                this.form.controls["id"].setErrors({error: e.message});
                // Because this comes outside of Angular (workflow model)
                this.cdr.markForCheck();
            }
        });

        this.form.controls["symbols"].valueChanges.subscribeTracked(this, (value) => {
            if (value.length > 0 && this.isEnumType()) {
                this.port.type.symbols = value;
            }
        });

        this.form.controls["typeForm"].valueChanges.subscribeTracked(this, (value) => {

            if (!this.isFileType()) {
                this.form.controls["secondaryFiles"].setValue([], {onlySelf: true, emitEvent: false});
                this.form.controls["secondaryFiles"].disable({onlySelf: true, emitEvent: false});
            } else {
                this.form.controls["secondaryFiles"].enable({onlySelf: true, emitEvent: false});
            }

            this.workflowModel.validateConnectionsForIOPort(this.port);
        });

        this.form.controls["fileTypes"].valueChanges.subscribeTracked(this, (value) => {
            this.port.fileTypes = value || [];
            this.workflowModel.validateConnectionsForIOPort(this.port);
        });

        this.form.controls["description"].valueChanges.subscribeTracked(this, (description) => {
            this.port.description = description;
        });

        this.form.controls["secondaryFiles"].valueChanges.subscribeTracked(this, (files) => {
            this.port.secondaryFiles = files;
        });

        this.form.controls["batchType"].valueChanges.subscribeTracked(this, (batchType) => {
            this.selectedBatchByOption = batchType;
            this.workflowModel.setBatch(this.port.id, batchType);
        });
    }

    labelUpdate(ev: FocusEvent) {
        const val = (<HTMLInputElement>ev.srcElement).value;

        if (val === this.port.label) {
            return;
        }

        this.port.label = val ? val : undefined;
        this.graph.draw();
    }

    /**
     * Return true if there is a custom value in batchByList and that value is not selected
     */
    customValueIsNotSelected() {
        return (this.batchByList.length > this.batchByListInitialLength)
            && (this.selectedBatchByOption !== this.batchByList[this.batchByList.length - 1].value);
    }

    isInputPort() {
        return this.port instanceof WorkflowInputParameterModel;
    }

    isEnumType() {
        return this.port.type.type === "enum" || (this.port.type.type === "array" && this.port.type.items === "enum");
    }

    isFileType() {
        return this.port.type.type === "File" || (this.port.type.type === "array" && this.port.type.items === "File");
    }

    setDisabledState(isDisabled: boolean) {
        const excludedControls = ["batchType"];
        Object.keys(this.form.controls).filter(c => excludedControls.indexOf(c) === -1).forEach((item) => {
            const control = this.form.controls[item];
            isDisabled ? control.disable({emitEvent: false}) : control.enable({emitEvent: false});
        });
    }
}


text:
package org.web3scala.http

import dispatch._
import Defaults._
import org.json4s.JValue

class DispatchHttpClient(host: String = "127.0.0.1", port: Int = 8545, secure: Boolean = false) extends JValueHttpClient {
  override def async(request: Array[Byte]): Future[JValue] = {
    val req = DispatchHttpClient.httpRequest(host, port, secure, request)
    DispatchHttpClient.http(req OK as.json4s.Json)
  }
  override def sync(request: Array[Byte]): JValue = {
    async(request).apply()
  }
}
object DispatchHttpClient {
  private val httpInstance: Http = Http.default
  private def http: Http = httpInstance
  private def httpRequest(host: String, port: Int, secure: Boolean, request: Array[Byte]): Req = {
    val req = dispatch.host(host, port)
      .setBody(request)
      .setHeader("Content-Type", "application/json")
    if (secure) req.secure else req
  }
}


text:
#import "_SPLUITableViewUpdate.h"
#import "_SPLTableViewUpdateState.h"

@interface _SPLUITableViewUpdate ()

@property (nonatomic, assign) NSInteger updateLevel;
@property (nonatomic, strong) _SPLTableViewUpdateState *state;

@end

@implementation _SPLUITableViewUpdate

- (instancetype)init
{
    return [super init];
}

- (instancetype)initWithTableView:(UITableView *)tableView
{
    if (self = [super init]) {
        _tableView = tableView;
    }
    return self;
}

- (void)tableViewBehaviorBeginUpdates:(id<SPLTableViewBehavior>)tableViewBehavior
{
    self.updateLevel++;

    if (self.updateLevel == 1) {
        self.state = [[_SPLTableViewUpdateState alloc] init];
    }
}

- (void)tableViewBehaviorEndUpdates:(id<SPLTableViewBehavior>)tableViewBehavior
{
    self.updateLevel--;

    if (self.updateLevel == 0) {
        [self _applyUpdateFromState:self.state];
        self.state = nil;
    }
}

- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation fromTableViewBehavior:(id<SPLTableViewBehavior>)tableViewBehavior
{
    if (self.updateLevel == 0) {
        [self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:animation];
    } else {
        [self.state insertRowsAtIndexPaths:indexPaths withRowAnimation:animation fromTableViewBehavior:tableViewBehavior];
    }
}

- (void)deleteRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation fromTableViewBehavior:(id<SPLTableViewBehavior>)tableViewBehavior
{
    if (self.updateLevel == 0) {
        [self.tableView deleteRowsAtIndexPaths:indexPaths withRowAnimation:animation];
    } else {
        [self.state deleteRowsAtIndexPaths:indexPaths withRowAnimation:animation fromTableViewBehavior:tableViewBehavior];
    }
}

- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation fromTableViewBehavior:(id<SPLTableViewBehavior>)tableViewBehavior;
{
    if (self.updateLevel == 0) {
        [self.tableView reloadRowsAtIndexPaths:indexPaths withRowAnimation:animation];
    } else {
        [self.state reloadRowsAtIndexPaths:indexPaths withRowAnimation:animation fromTableViewBehavior:tableViewBehavior];
    }
}

- (void)insertSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation fromTableViewBehavior:(id<SPLTableViewBehavior>)tableViewBehavior
{
    if (self.updateLevel == 0) {
        [self.tableView insertSections:sections withRowAnimation:animation];
    } else {
        [self.state insertSections:sections withRowAnimation:animation fromTableViewBehavior:tableViewBehavior];
    }
}

- (void)deleteSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation fromTableViewBehavior:(id<SPLTableViewBehavior>)tableViewBehavior
{
    if (self.updateLevel == 0) {
        [self.tableView deleteSections:sections withRowAnimation:animation];
    } else {
        [self.state deleteSections:sections withRowAnimation:animation fromTableViewBehavior:tableViewBehavior];
    }
}

- (void)reloadSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation fromTableViewBehavior:(id<SPLTableViewBehavior>)tableViewBehavior
{
    if (self.updateLevel == 0) {
        [self.tableView reloadSections:sections withRowAnimation:animation];
    } else {
        [self.state reloadSections:sections withRowAnimation:animation fromTableViewBehavior:tableViewBehavior];
    }
}

- (NSIndexPath *)convertIndexPath:(NSIndexPath *)indexPath fromChildBehavior:(id<SPLTableViewBehavior>)childBehavior
{
    return indexPath;
}

- (void)_applyUpdateFromState:(_SPLTableViewUpdateState *)state
{
    if (state.updateCount <= 0) {
        return;
    }

    if (state.updateCount > 50 || !self.tableView.window) {
        return [self.tableView reloadData];
    }

    NSIndexPath *(^transform)(NSIndexPath *indexPath) = ^NSIndexPath *(NSIndexPath *indexPath) {
        NSIndexPath *result = indexPath;

        for (_SPLSectionUpdate *update in state.insertedSections) {
            if (update.section <= result.section) {
                result = [NSIndexPath indexPathForRow:result.row inSection:result.section + 1];
            }
        }

        return result;
    };

    [self.tableView beginUpdates];

    for (_SPLSectionUpdate *update in state.updatedSections) {
        [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:update.section] withRowAnimation:update.animation];
    }

    for (_SPLSectionUpdate *update in state.deletedSections) {
        [self.tableView deleteSections:[NSIndexSet indexSetWithIndex:update.section] withRowAnimation:update.animation];
    }

    for (_SPLSectionUpdate *update in state.insertedSections) {
        [self.tableView insertSections:[NSIndexSet indexSetWithIndex:update.section] withRowAnimation:update.animation];
    }

    for (_SPLIndexPathUpdate *update in state.deletedIndexPaths) {
        [self.tableView deleteRowsAtIndexPaths:@[ transform(update.indexPath) ] withRowAnimation:update.animation];
    }

    for (_SPLIndexPathUpdate *update in state.insertedIndexPaths) {
        [self.tableView insertRowsAtIndexPaths:@[ transform(update.indexPath) ] withRowAnimation:update.animation];
    }

    for (_SPLIndexPathUpdate *update in state.updatedIndexPaths) {
        [self.tableView reloadRowsAtIndexPaths:@[ transform(update.indexPath) ] withRowAnimation:update.animation];
    }

    [self.tableView endUpdates];
}

@end


text:
using Medallion.Threading.Oracle;
using NUnit.Framework;
using System.Data;

namespace Medallion.Threading.Tests.Oracle;

public class OracleDistributedLockTest
{
    [Test]
    public void TestValidatesConstructorArguments()
    {
        Assert.Catch<ArgumentNullException>(() => new OracleDistributedLock(null!, TestingOracleDb.DefaultConnectionString));
        Assert.Catch<ArgumentNullException>(() => new OracleDistributedLock(null!, TestingOracleDb.DefaultConnectionString, exactName: true));
        Assert.Catch<ArgumentNullException>(() => new OracleDistributedLock("a", default(string)!));
        Assert.Catch<ArgumentNullException>(() => new OracleDistributedLock("a", default(IDbConnection)!));
        Assert.Catch<FormatException>(() => new OracleDistributedLock(new string('a', OracleDistributedLock.MaxNameLength + 1), TestingOracleDb.DefaultConnectionString, exactName: true));
        Assert.DoesNotThrow(() => new OracleDistributedLock(new string('a', OracleDistributedLock.MaxNameLength), TestingOracleDb.DefaultConnectionString, exactName: true));
    }

    [Test]
    public void TestGetSafeLockNameCompat()
    {
        GetSafeName(string.Empty).ShouldEqual("EMPTYz4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==");
        GetSafeName("abc").ShouldEqual("abc");
        GetSafeName("ABC").ShouldEqual("ABC");
        GetSafeName("\\").ShouldEqual("\\");
        GetSafeName(new string('a', OracleDistributedLock.MaxNameLength)).ShouldEqual(new string('a', OracleDistributedLock.MaxNameLength));
        GetSafeName(new string('\\', OracleDistributedLock.MaxNameLength)).ShouldEqual(new string('\\', OracleDistributedLock.MaxNameLength));
        GetSafeName(new string('x', OracleDistributedLock.MaxNameLength + 1)).ShouldEqual("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxGQFUg+qZ+nRyj9exOtumtynPpKt8OIVz76JkHSrwV38k3VGsuu7EGnoR0Q9sTmijuQ57I0jGeEhqQ2XJ2RAc3Q==");

        static string GetSafeName(string name) => new OracleDistributedLock(name, TestingOracleDb.DefaultConnectionString).Name;
    }
}


text:
package com.google.errorprone.bugpatterns;

import org.junit.*;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/**
 * @author eaftan@google.com (Eddie Aftandilian)
 */
@RunWith(JUnit4.class)
public class JUnit4TestNotRunNegativeCase3 {
  // Doesn't begin with "test".
  public void thisIsATest() {}

  // Isn't public.
  void testTest1() {}

  // Have checked annotation.
  @Test
  public void testTest2() {}

  @Before
  public void testBefore() {}

  @After
  public void testAfter() {}

  @BeforeClass
  public void testBeforeClass() {}

  @AfterClass
  public void testAfterClass() {}

  // Has parameters.
  public void testTest3(int foo) {}

  // Doesn't return void
  public int testSomething() { return 42; }
}


text:
(function(root, factory) {
    if (typeof define === 'function' && define.amd) {
        define('three.RollerCoaster', ['three'], factory);
    }
    else if ('undefined' !== typeof exports && 'undefined' !== typeof module) {
        module.exports = factory(require('three'));
    }
    else {
        factory(root.THREE);
    }
}(this, function(THREE) {

/**
 * @author mrdoob / http://mrdoob.com/
 */

var RollerCoasterGeometry = function ( curve, size ) {

	THREE.BufferGeometry.call( this );

	var vertices = [];
	var normals = [];
	var colors = [];

	var color1 = [ 1, 1, 1 ];
	var color2 = [ 1, 1, 0 ];

	var up = new THREE.Vector3( 0, 1, 0 );
	var forward = new THREE.Vector3();
	var right = new THREE.Vector3();

	var quaternion = new THREE.Quaternion();
	var prevQuaternion = new THREE.Quaternion();
	prevQuaternion.setFromAxisAngle( up , Math.PI / 2 );

	var point = new THREE.Vector3();
	var prevPoint = new THREE.Vector3();
	prevPoint.copy( curve.getPointAt( 0 ) );

	// shapes

	var step = [
		new THREE.Vector3( -2.25,  0, 0 ),
		new THREE.Vector3(  0,  -0.5, 0 ),
		new THREE.Vector3(  0, -1.75, 0 ),

		new THREE.Vector3(  0,  -0.5, 0 ),
		new THREE.Vector3(  2.25,  0, 0 ),
		new THREE.Vector3(  0, -1.75, 0 )
	];

	var PI2 = Math.PI * 2;

	var sides = 5;
	var tube1 = [];

	for ( var i = 0; i < sides; i ++ ) {

		var angle = ( i / sides ) * PI2;
		tube1.push( new THREE.Vector3( Math.sin( angle ) * 0.6, Math.cos( angle ) * 0.6, 0 ) );

	}

	var sides = 6;
	var tube2 = [];

	for ( var i = 0; i < sides; i ++ ) {

		var angle = ( i / sides ) * PI2;
		tube2.push( new THREE.Vector3( Math.sin( angle ) * 0.25, Math.cos( angle ) * 0.25, 0 ) );

	}

	var vector = new THREE.Vector3();
	var normal = new THREE.Vector3();

	var drawShape = function ( shape, color ) {

		normal.set( 0, 0, -1 ).applyQuaternion( quaternion );

		for ( var j = 0; j < shape.length; j ++ ) {

			vector.copy( shape[ j ] );
			vector.applyQuaternion( quaternion );
			vector.add( point );

			vertices.push( vector.x, vector.y, vector.z );
			normals.push( normal.x, normal.y, normal.z );
			colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );

		}

		normal.set( 0, 0, 1 ).applyQuaternion( quaternion );

		for ( var j = shape.length - 1; j >= 0; j -- ) {

			vector.copy( shape[ j ] );
			vector.applyQuaternion( quaternion );
			vector.add( point );

			vertices.push( vector.x, vector.y, vector.z );
			normals.push( normal.x, normal.y, normal.z );
			colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );

		}

	};

	var vector1 = new THREE.Vector3();
	var vector2 = new THREE.Vector3();
	var vector3 = new THREE.Vector3();
	var vector4 = new THREE.Vector3();

	var normal1 = new THREE.Vector3();
	var normal2 = new THREE.Vector3();
	var normal3 = new THREE.Vector3();
	var normal4 = new THREE.Vector3();

	var extrudeShape = function ( shape, offset, color ) {

		for ( var j = 0, jl = shape.length; j < jl; j ++ ) {

			var point1 = shape[ j ];
			var point2 = shape[ ( j + 1 ) % jl ];

			vector1.copy( point1 ).add( offset );
			vector1.applyQuaternion( quaternion );
			vector1.add( point );

			vector2.copy( point2 ).add( offset );
			vector2.applyQuaternion( quaternion );
			vector2.add( point );

			vector3.copy( point2 ).add( offset );
			vector3.applyQuaternion( prevQuaternion );
			vector3.add( prevPoint );

			vector4.copy( point1 ).add( offset );
			vector4.applyQuaternion( prevQuaternion );
			vector4.add( prevPoint );

			vertices.push( vector1.x, vector1.y, vector1.z );
			vertices.push( vector2.x, vector2.y, vector2.z );
			vertices.push( vector4.x, vector4.y, vector4.z );

			vertices.push( vector2.x, vector2.y, vector2.z );
			vertices.push( vector3.x, vector3.y, vector3.z );
			vertices.push( vector4.x, vector4.y, vector4.z );

			//

			normal1.copy( point1 );
			normal1.applyQuaternion( quaternion );
			normal1.normalize();

			normal2.copy( point2 );
			normal2.applyQuaternion( quaternion );
			normal2.normalize();

			normal3.copy( point2 );
			normal3.applyQuaternion( prevQuaternion );
			normal3.normalize();

			normal4.copy( point1 );
			normal4.applyQuaternion( prevQuaternion );
			normal4.normalize();

			normals.push( normal1.x, normal1.y, normal1.z );
			normals.push( normal2.x, normal2.y, normal2.z );
			normals.push( normal4.x, normal4.y, normal4.z );

			normals.push( normal2.x, normal2.y, normal2.z );
			normals.push( normal3.x, normal3.y, normal3.z );
			normals.push( normal4.x, normal4.y, normal4.z );

			colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );
			colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );
			colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );

			colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );
			colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );
			colors.push( color[ 0 ], color[ 1 ], color[ 2 ] );

		}

	};

	var offset = new THREE.Vector3();

	for ( var i = 1; i <= size; i ++ ) {

		point.copy( curve.getPointAt( i / size ) );

		up.set( 0, 1, 0 );

		forward.subVectors( point, prevPoint ).normalize();
		right.crossVectors( up, forward ).normalize();
		up.crossVectors( forward, right );

		var angle = Math.atan2( forward.x, forward.z );

		quaternion.setFromAxisAngle( up, angle );

		if ( i % 2 === 0 ) {

			drawShape( step, color2 );

		}

		extrudeShape( tube1, offset.set( 0, -1.25, 0 ), color2 );
		extrudeShape( tube2, offset.set( 2, 0, 0 ), color1 );
		extrudeShape( tube2, offset.set( -2, 0, 0 ), color1 );

		prevPoint.copy( point );
		prevQuaternion.copy( quaternion );

	}

	// console.log( vertices.length );

	this.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( vertices ), 3 ) );
	this.addAttribute( 'normal', new THREE.BufferAttribute( new Float32Array( normals ), 3 ) );
	this.addAttribute( 'color', new THREE.BufferAttribute( new Float32Array( colors ), 3 ) );

};

RollerCoasterGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );

var RollerCoasterLiftersGeometry = function ( curve, size ) {

	THREE.BufferGeometry.call( this );

	var vertices = [];
	var normals = [];

	var quaternion = new THREE.Quaternion();

	var up = new THREE.Vector3( 0, 1, 0 );

	var point = new THREE.Vector3();
	var tangent = new THREE.Vector3();

	// shapes

	var tube1 = [
		new THREE.Vector3(  0,  0.5, -0.5 ),
		new THREE.Vector3(  0,  0.5,  0.5 ),
		new THREE.Vector3(  0, -0.5,  0 )
	];

	var tube2 = [
		new THREE.Vector3( -0.5, 0,  0.5 ),
		new THREE.Vector3( -0.5, 0, -0.5 ),
		new THREE.Vector3(  0.5, 0,  0 )
	];

	var tube3 = [
		new THREE.Vector3(  0.5, 0, -0.5 ),
		new THREE.Vector3(  0.5, 0,  0.5 ),
		new THREE.Vector3( -0.5, 0,  0 )
	];

	var vector1 = new THREE.Vector3();
	var vector2 = new THREE.Vector3();
	var vector3 = new THREE.Vector3();
	var vector4 = new THREE.Vector3();

	var normal1 = new THREE.Vector3();
	var normal2 = new THREE.Vector3();
	var normal3 = new THREE.Vector3();
	var normal4 = new THREE.Vector3();

	var extrudeShape = function ( shape, fromPoint, toPoint ) {

		for ( var j = 0, jl = shape.length; j < jl; j ++ ) {

			var point1 = shape[ j ];
			var point2 = shape[ ( j + 1 ) % jl ];

			vector1.copy( point1 );
			vector1.applyQuaternion( quaternion );
			vector1.add( fromPoint );

			vector2.copy( point2 );
			vector2.applyQuaternion( quaternion );
			vector2.add( fromPoint );

			vector3.copy( point2 );
			vector3.applyQuaternion( quaternion );
			vector3.add( toPoint );

			vector4.copy( point1 );
			vector4.applyQuaternion( quaternion );
			vector4.add( toPoint );

			vertices.push( vector1.x, vector1.y, vector1.z );
			vertices.push( vector2.x, vector2.y, vector2.z );
			vertices.push( vector4.x, vector4.y, vector4.z );

			vertices.push( vector2.x, vector2.y, vector2.z );
			vertices.push( vector3.x, vector3.y, vector3.z );
			vertices.push( vector4.x, vector4.y, vector4.z );

			//

			normal1.copy( point1 );
			normal1.applyQuaternion( quaternion );
			normal1.normalize();

			normal2.copy( point2 );
			normal2.applyQuaternion( quaternion );
			normal2.normalize();

			normal3.copy( point2 );
			normal3.applyQuaternion( quaternion );
			normal3.normalize();

			normal4.copy( point1 );
			normal4.applyQuaternion( quaternion );
			normal4.normalize();

			normals.push( normal1.x, normal1.y, normal1.z );
			normals.push( normal2.x, normal2.y, normal2.z );
			normals.push( normal4.x, normal4.y, normal4.z );

			normals.push( normal2.x, normal2.y, normal2.z );
			normals.push( normal3.x, normal3.y, normal3.z );
			normals.push( normal4.x, normal4.y, normal4.z );

		}

	};

	var fromPoint = new THREE.Vector3();
	var toPoint = new THREE.Vector3();

	for ( var i = 1; i <= size; i ++ ) {

		point.copy( curve.getPointAt( i / size ) );
		tangent.copy( curve.getTangentAt( i / size ) );

		var angle = Math.atan2( tangent.x, tangent.z );

		quaternion.setFromAxisAngle( up, angle );

		//

		if ( point.y > 100 ) {

			fromPoint.set( -7.5, -3.5, 0 );
			fromPoint.applyQuaternion( quaternion );
			fromPoint.add( point );

			toPoint.set( 7.5, -3.5, 0 );
			toPoint.applyQuaternion( quaternion );
			toPoint.add( point );

			extrudeShape( tube1, fromPoint, toPoint );

			fromPoint.set( -7, -3, 0 );
			fromPoint.applyQuaternion( quaternion );
			fromPoint.add( point );

			toPoint.set( -7, -point.y, 0 );
			toPoint.applyQuaternion( quaternion );
			toPoint.add( point );

			extrudeShape( tube2, fromPoint, toPoint );

			fromPoint.set( 7, -3, 0 );
			fromPoint.applyQuaternion( quaternion );
			fromPoint.add( point );

			toPoint.set( 7, -point.y, 0 );
			toPoint.applyQuaternion( quaternion );
			toPoint.add( point );

			extrudeShape( tube3, fromPoint, toPoint );

		} else {

			fromPoint.set( 0, -2, 0 );
			fromPoint.applyQuaternion( quaternion );
			fromPoint.add( point );

			toPoint.set( 0, -point.y, 0 );
			toPoint.applyQuaternion( quaternion );
			toPoint.add( point );

			extrudeShape( tube3, fromPoint, toPoint );

		}

	}

	this.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( vertices ), 3 ) );
	this.addAttribute( 'normal', new THREE.BufferAttribute( new Float32Array( normals ), 3 ) );

};

RollerCoasterLiftersGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );

var RollerCoasterShadowGeometry = function ( curve, size ) {

	THREE.BufferGeometry.call( this );

	var vertices = [];

	var up = new THREE.Vector3( 0, 1, 0 );
	var forward = new THREE.Vector3();

	var quaternion = new THREE.Quaternion();
	var prevQuaternion = new THREE.Quaternion();
	prevQuaternion.setFromAxisAngle( up , Math.PI / 2 );

	var point = new THREE.Vector3();

	var prevPoint = new THREE.Vector3();
	prevPoint.copy( curve.getPointAt( 0 ) );
	prevPoint.y = 0;

	var vector1 = new THREE.Vector3();
	var vector2 = new THREE.Vector3();
	var vector3 = new THREE.Vector3();
	var vector4 = new THREE.Vector3();

	for ( var i = 1; i <= size; i ++ ) {

		point.copy( curve.getPointAt( i / size ) );
		point.y = 0;

		forward.subVectors( point, prevPoint );

		var angle = Math.atan2( forward.x, forward.z );

		quaternion.setFromAxisAngle( up, angle );

		vector1.set( -3, 0, 0 );
		vector1.applyQuaternion( quaternion );
		vector1.add( point );

		vector2.set(  3, 0, 0 );
		vector2.applyQuaternion( quaternion );
		vector2.add( point );

		vector3.set(  3, 0, 0 );
		vector3.applyQuaternion( prevQuaternion );
		vector3.add( prevPoint );

		vector4.set( -3, 0, 0 );
		vector4.applyQuaternion( prevQuaternion );
		vector4.add( prevPoint );

		vertices.push( vector1.x, vector1.y, vector1.z );
		vertices.push( vector2.x, vector2.y, vector2.z );
		vertices.push( vector4.x, vector4.y, vector4.z );

		vertices.push( vector2.x, vector2.y, vector2.z );
		vertices.push( vector3.x, vector3.y, vector3.z );
		vertices.push( vector4.x, vector4.y, vector4.z );

		prevPoint.copy( point );
		prevQuaternion.copy( quaternion );

	}

	this.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( vertices ), 3 ) );

};

RollerCoasterShadowGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );

var SkyGeometry = function () {

	THREE.BufferGeometry.call( this );

	var vertices = [];

	for ( var i = 0; i < 100; i ++ ) {

		var x = Math.random() * 8000 - 4000;
		var y = Math.random() * 500 + 500;
		var z = Math.random() * 8000 - 4000;

		var size = Math.random() * 400 + 200;

		vertices.push( x - size, y, z - size );
		vertices.push( x + size, y, z - size );
		vertices.push( x - size, y, z + size );

		vertices.push( x + size, y, z - size );
		vertices.push( x + size, y, z + size );
		vertices.push( x - size, y, z + size );

	}

	this.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( vertices ), 3 ) );

};

SkyGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );

var TreesGeometry = function ( landscape ) {

	THREE.BufferGeometry.call( this );

	var vertices = [];
	var colors = [];

	var raycaster = new THREE.Raycaster();
	raycaster.ray.direction.set( 0, -1, 0 );

	for ( var i = 0; i < 2000; i ++ ) {

		var x = Math.random() * 5000 - 2500;
		var z = Math.random() * 5000 - 2500;

		raycaster.ray.origin.set( x, 500, z );

		var intersections = raycaster.intersectObject( landscape );

		if ( intersections.length === 0 ) continue;

		var y = intersections[ 0 ].point.y;

		var height = Math.random() * 50 + 5;

		var angle = Math.random() * Math.PI * 2;

		vertices.push( x + Math.sin( angle ) * 10, y, z + Math.cos( angle ) * 10 );
		vertices.push( x, y + height, z );
		vertices.push( x + Math.sin( angle + Math.PI ) * 10, y, z + Math.cos( angle + Math.PI ) * 10 );

		angle += Math.PI / 2;

		vertices.push( x + Math.sin( angle ) * 10, y, z + Math.cos( angle ) * 10 );
		vertices.push( x, y + height, z );
		vertices.push( x + Math.sin( angle + Math.PI ) * 10, y, z + Math.cos( angle + Math.PI ) * 10 );

		var random = Math.random() * 0.1;

		for ( var j = 0; j < 6; j ++ ) {

			colors.push( 0.2 + random, 0.4 + random, 0 );

		}

	}

	this.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( vertices ), 3 ) );
	this.addAttribute( 'color', new THREE.BufferAttribute( new Float32Array( colors ), 3 ) );

};

TreesGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
THREE.RollerCoasterGeometry = RollerCoasterGeometry;
THREE.RollerCoasterLiftersGeometry = RollerCoasterLiftersGeometry;
THREE.RollerCoasterShadowGeometry = RollerCoasterShadowGeometry;
THREE.SkyGeometry = SkyGeometry;
THREE.TreesGeometry = TreesGeometry;}));


text:
package apps::ericsson::enm::api::mode::nodes;

use base qw(centreon::plugins::templates::counter);

use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);

sub custom_fru_status_output {
    my ($self, %options) = @_;

    return sprintf(
        'operational state: %s, admin state: %s%s',
        $self->{result_values}->{operational_state},
        $self->{result_values}->{administrative_state},
        $self->{result_values}->{availability_status} ne 'null' ? ', availability status: ' . $self->{result_values}->{availability_status}: ''
    );
}

sub custom_celltdd_status_output {
    my ($self, %options) = @_;

    return sprintf(
        'operational state: %s, admin state: %s%s',
        $self->{result_values}->{operational_state},
        $self->{result_values}->{administrative_state},
        $self->{result_values}->{availability_status} ne 'null' ? ', availability status: ' . $self->{result_values}->{availability_status}: ''
    );
}

sub prefix_fru_output {
    my ($self, %options) = @_;

    return sprintf(
        "field replaceable unit '%s'%s ",
        $options{instance},
        $options{instance_value}->{label} ne '' ?  ' [label: ' . $options{instance_value}->{label} . ']' : ''
    );
}

sub prefix_celltdd_output {
    my ($self, %options) = @_;

    return sprintf(
        "tdd cell '%s'%s ",
        $options{instance},
        $options{instance_value}->{label} ne '' ?  ' [label: ' . $options{instance_value}->{label} . ']' : ''
    );
}

sub prefix_global_output {
    my ($self, %options) = @_;

    return 'nodes ';
}

sub node_long_output {
    my ($self, %options) = @_;

    return "checking node '" . $options{instance} . "'";
}

sub prefix_node_output {
    my ($self, %options) = @_;

    return "Node '" . $options{instance} . "' ";
}

sub set_counters {
    my ($self, %options) = @_;

    $self->{maps_counters_type} = [
        { name => 'global', type => 0, cb_prefix_output => 'prefix_global_output', skipped_code => { -10 => 1 } },
        { name => 'nodes', type => 3, cb_prefix_output => 'prefix_node_output', cb_long_output => 'node_long_output', indent_long_output => '    ', message_multiple => 'All nodes are ok',
            group => [
                { name => 'node_global', type => 0, skipped_code => { -10 => 1 } },
                { name => 'fru', display_long => 1, cb_prefix_output => 'prefix_fru_output', message_multiple => 'All field replaceable units are ok', type => 1, skipped_code => { -10 => 1 } },
                { name => 'celltdd', display_long => 1, cb_prefix_output => 'prefix_celltdd_output',  message_multiple => 'All tdd cells are ok', type => 1, skipped_code => { -10 => 1 } },
            ]
        }
    ];

    $self->{maps_counters}->{global} = [
        { label => 'nodes-total', nlabel => 'nodes.total.count', display_ok => 0, set => {
                key_values => [ { name => 'total' } ],
                output_template => 'total: %s',
                perfdatas => [
                    { template => '%s', min => 0 }
                ]
            }
        }
    ];

    $self->{maps_counters}->{node_global} = [
        { label => 'node-sync-status', type => 2, critical_default => '%{sync_status} =~ /unsynchronized/i', set => {
                key_values => [ { name => 'sync_status' }, { name => 'node_id' } ],
                output_template => 'synchronization status: %s',
                closure_custom_perfdata => sub { return 0; },
                closure_custom_threshold_check => \&catalog_status_threshold_ng
            }
        }
    ];

    $self->{maps_counters}->{fru} = [
        { label => 'fru-status',  type => 2, set => {
                key_values => [
                    { name => 'node_id' }, { name => 'fru_id' }, { name => 'label' },
                    { name => 'administrative_state' }, { name => 'availability_status' },
                    { name => 'operational_state' }
                ],
                closure_custom_output => $self->can('custom_fru_status_output'),
                closure_custom_perfdata => sub { return 0; },
                closure_custom_threshold_check => \&catalog_status_threshold_ng
            }
        }
    ];

    $self->{maps_counters}->{celltdd} = [
        { label => 'cell-tdd-status',  type => 2, set => {
                key_values => [
                    { name => 'node_id' }, { name => 'cell_tdd_id' }, { name => 'label' },
                    { name => 'administrative_state' }, { name => 'availability_status' },
                    { name => 'operational_state' }
                ],
                closure_custom_output => $self->can('custom_celltdd_status_output'),
                closure_custom_perfdata => sub { return 0; },
                closure_custom_threshold_check => \&catalog_status_threshold_ng
            }
        }
    ];
}

sub new {
    my ($class, %options) = @_;
    my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
    bless $self, $class;

    $options{options}->add_options(arguments => {
        'filter-node-id:s'      => { name => 'filter_node_id' },
        'exclude-node-id:s'     => { name => 'exclude_node_id' },
        'filter-fru-id:s'       => { name => 'filter_fru_id' },
        'exclude-fru-id:s'      => { name => 'exclude_fru_id' },
        'filter-cell-tdd-id:s'  => { name => 'filter_cell_tdd_id' },
        'exclude-cell-tdd-id:s' => { name => 'exclude_cell_tdd_id' }
    });

    return $self;
}

sub manage_selection {
    my ($self, %options) = @_;

    my $nodes = $options{custom}->get_nodeSyncState();

    $self->{global} = { total => 0 };
    $self->{nodes} = {};
    foreach my $node (@$nodes) {
        next if (defined($self->{option_results}->{filter_node_id}) && $self->{option_results}->{filter_node_id} ne '' &&
            $node->{NodeId} !~ /$self->{option_results}->{filter_node_id}/);
        next if (defined($self->{option_results}->{exclude_node_id}) && $self->{option_results}->{exclude_node_id} ne '' &&
            $node->{NodeId} =~ /$self->{option_results}->{exclude_node_id}/);

        $self->{global}->{total}++;
        $self->{nodes}->{ $node->{NodeId} } = {
            node_global => { node_id => $node->{NodeId}, sync_status => lc($node->{syncStatus}) },
            fru => {},
            celltdd => {}
        };
    }

    my $frus = $options{custom}->get_fruState();
    foreach my $fru (@$frus) {
        next if (defined($self->{option_results}->{filter_node_id}) && $self->{option_results}->{filter_node_id} ne '' &&
            $fru->{NodeId} !~ /$self->{option_results}->{filter_node_id}/);
        next if (defined($self->{option_results}->{exclude_node_id}) && $self->{option_results}->{exclude_node_id} ne '' &&
            $fru->{NodeId} =~ /$self->{option_results}->{exclude_node_id}/);
        next if (defined($self->{option_results}->{filter_fru_id}) && $self->{option_results}->{filter_fru_id} ne '' &&
            $fru->{FieldReplaceableUnitId} !~ /$self->{option_results}->{filter_fru_id}/);
        next if (defined($self->{option_results}->{exclude_fru_id}) && $self->{option_results}->{exclude_fru_id} ne '' &&
            $fru->{FieldReplaceableUnitId} =~ /$self->{option_results}->{exclude_fru_id}/);

        $self->{nodes}->{ $fru->{NodeId} }->{fru}->{ $fru->{FieldReplaceableUnitId} } = {
            node_id => $fru->{NodeId},
            fru_id => $fru->{FieldReplaceableUnitId},
            label => defined($fru->{userLabel}) && $fru->{userLabel} ne 'null' ? $fru->{userLabel} : '',
            administrative_state => lc($fru->{administrativeState}),
            availability_status => lc($fru->{availabilityStatus}),
            operational_state => lc($fru->{operationalState})
        };
    }

    my $cells = $options{custom}->get_EUtranCellTDD();
    foreach my $cell (@$cells) {
        next if (defined($self->{option_results}->{filter_node_id}) && $self->{option_results}->{filter_node_id} ne '' &&
            $cell->{NodeId} !~ /$self->{option_results}->{filter_node_id}/);
        next if (defined($self->{option_results}->{exclude_node_id}) && $self->{option_results}->{exclude_node_id} ne '' &&
            $cell->{NodeId} =~ /$self->{option_results}->{exclude_node_id}/);
        next if (defined($self->{option_results}->{filter_cell_tdd_id}) && $self->{option_results}->{filter_cell_tdd_id} ne '' &&
            $cell->{EUtranCellTDDId} !~ /$self->{option_results}->{filter_cell_tdd_id}/);
        next if (defined($self->{option_results}->{exclude_cell_tdd_id}) && $self->{option_results}->{exclude_cell_tdd_id} ne '' &&
            $cell->{EUtranCellTDDId} =~ /$self->{option_results}->{exclude_cell_tdd_id}/);

        $self->{nodes}->{ $cell->{NodeId} }->{celltdd}->{ $cell->{EUtranCellTDDId} } = {
            node_id => $cell->{NodeId},
            cell_tdd_id => $cell->{EUtranCellTDDId},
            label => defined($cell->{userLabel}) && $cell->{userLabel} ne 'null' ? $cell->{userLabel} : '',
            administrative_state => lc($cell->{administrativeState}),
            availability_status => lc($cell->{availabilityStatus}),
            operational_state => lc($cell->{operationalState})
        };
    }
}

1;

__END__

=head1 MODE

Check nodes.

=over 8

=item B<--filter-counters>

Only display some counters (regexp can be used).
Example: --filter-counters='total'

=item B<--filter-node-id>

Filter nodes by id (can be a regexp).

=item B<--filter-fru-id>

Filter field replaceable units by id (can be a regexp).

=item B<--filter-cell-tdd-id>

Filter tdd cells by id (can be a regexp).

=item B<--unknown-node-sync-status>

Set unknown threshold for synchronization status.
Can used special variables like: %{node_id}, %{sync_status}

=item B<--warning-node-sync-status>

Set warning threshold for synchronization status.
Can used special variables like: %{node_id}, %{sync_status}

=item B<--critical-node-sync-status>

Set critical threshold for synchronization status (Default: '%{sync_status} =~ /unsynchronized/i').
Can used special variables like: %{node_id}, %{sync_status}

=item B<--unknown-fru-status>

Set unknown threshold for field replaceable unit status.
Can used special variables like: %{node_id}, %{fru_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state}

=item B<--warning-fru-status>

Set warning threshold for field replaceable unit status.
Can used special variables like: %{node_id}, %{fru_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state}

=item B<--critical-fru-status>

Set critical threshold for field replaceable unit status.
Can used special variables like: %{node_id}, %{fru_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state}

=item B<--unknown-cell-tdd-status>

Set unknown threshold for cell tdd status.
Can used special variables like: %{node_id}, %{cell_tdd_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state}

=item B<--warning-cell-tdd-status>

Set warning threshold for cell tdd status.
Can used special variables like: %{node_id}, %{cell_tdd_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state}

=item B<--critical-cell-tdd-status>

Set critical threshold for cell tdd status.
Can used special variables like: %{node_id}, %{cell_tdd_id}, %{label}, %{administrative_state}, %{availability_status}, %{operational_state}

=item B<--warning-*> B<--critical-*>

Thresholds.
Can be: 'nodes-total'.

=back

=cut


text:
			<template let-col let-row="rowData" let-rowIndex="rowIndex" pTemplate="editor">
				{{rowIndex+1}}
			</template>

				<template let-col let-row="rowData" let-rowIndex="rowIndex" pTemplate="editor">
					<button type="button" (click)="EditItem(row)" class="btn btn-theme btn-sm btn-grid"></button>
				</template>


text:
/**
 * @test
 * @bug 6589834
 * @summary deoptimization problem with -XX:+DeoptimizeALot
 *
 * @run main Test_ia32
 */

/***************************************************************************************
NOTE: The bug shows up (with several "Bug!" message) even without the
      flag -XX:+DeoptimizeALot. In a debug build, you may want to try
      the flags -XX:+VerifyStack and -XX:+DeoptimizeALot to get more information.
****************************************************************************************/
import java.lang.reflect.Constructor;

public class Test_ia32 {

    public static int NUM_THREADS = 100;

    public static int CLONE_LENGTH = 1000;

    public static void main(String[] args) throws InterruptedException, ClassNotFoundException {

        Reflector[] threads = new Reflector[NUM_THREADS];
        for (int i = 0; i < threads.length; i++) {
            threads[i] = new Reflector();
            threads[i].start();
        }

        System.out.println("Give Reflector.run() some time to compile...");
        Thread.sleep(5000);

        System.out.println("Load RMISecurityException causing run() deoptimization");
        ClassLoader.getSystemClassLoader().loadClass("java.rmi.RMISecurityException");

        for (Reflector thread : threads)
            thread.requestStop();

        for (Reflector thread : threads)
            try {
                thread.join();
            } catch (InterruptedException e) {
                System.out.println(e);
            }

    }

}

class Reflector extends Thread {

    volatile boolean _doSpin = true;

    Test_ia32[] _tests;

    Reflector() {
        _tests = new Test_ia32[Test_ia32.CLONE_LENGTH];
        for (int i = 0; i < _tests.length; i++) {
            _tests[i] = new Test_ia32();
        }
    }

    static int g(int i1, int i2, Test_ia32[] arr, int i3, int i4) {

        if (!(i1==1 && i2==2 && i3==3 && i4==4)) {
            System.out.println("Bug!");
        }

        return arr.length;
    }

    static int f(Test_ia32[] arr) {
        return g(1, 2, arr.clone(), 3, 4);
    }

    @Override
    public void run() {
        Constructor[] ctrs = null;
        Class<Test_ia32> klass = Test_ia32.class;
        try {
            ctrs = klass.getConstructors();
        } catch (SecurityException e) {
            System.out.println(e);
        }

        try {
            while (_doSpin) {
                if (f(_tests) < 0)
                    System.out.println("return value usage");
            }
        } catch (NullPointerException e) {
            e.printStackTrace();
        }

        System.out.println(this + " - stopped.");
    }

    public void requestStop() {
        System.out.println(this + " - stop requested.");
        _doSpin = false;
    }

}


text:
#include "config.h"
#include "core/rendering/OrderIterator.h"

#include "core/rendering/RenderBox.h"

namespace WebCore {

OrderIterator::OrderIterator(const RenderBox* containerBox)
    : m_containerBox(containerBox)
    , m_currentChild(0)
    , m_isReset(false)
{
}

RenderBox* OrderIterator::first()
{
    reset();
    return next();
}

RenderBox* OrderIterator::next()
{
    do {
        if (!m_currentChild) {
            if (m_orderValuesIterator == m_orderValues.end())
                return 0;

            if (!m_isReset) {
                ++m_orderValuesIterator;
                if (m_orderValuesIterator == m_orderValues.end())
                    return 0;
            } else {
                m_isReset = false;
            }

            m_currentChild = firstChildBox();
        } else {
            m_currentChild = nextSiblingBox();
        }
    } while (!m_currentChild || m_currentChild->style()->order() != *m_orderValuesIterator);

    return m_currentChild;
}

void OrderIterator::reset()
{
    m_currentChild = 0;
    m_orderValuesIterator = m_orderValues.begin();
    m_isReset = true;
}

RenderBox* OrderIterator::firstChildBox()
{
    if (m_children.isEmpty())
        return m_containerBox->firstChildBox();

    m_childIndex = 0;
    return m_children[0];
}

RenderBox* OrderIterator::nextSiblingBox()
{
    if (m_children.isEmpty())
        return m_currentChild->nextSiblingBox();

    if (m_childIndex >= m_children.size() - 1)
        return 0;

    return m_children[++m_childIndex];
}

OrderIteratorPopulator::~OrderIteratorPopulator()
{
    m_iterator.reset();
}

void OrderIteratorPopulator::storeChild(RenderBox* child)
{
    m_iterator.m_children.append(child);

    collectChild(child);
}

void OrderIteratorPopulator::collectChild(const RenderBox* child)
{
    m_iterator.m_orderValues.insert(child->style()->order());
}

} // namespace WebCore


text:
package org.spongepowered.api.entity.ai;

import org.spongepowered.api.entity.living.Agent;
import org.spongepowered.api.util.generator.dummy.DummyObjectProvider;

public final class GoalTypes {

    // SORTFIELDS:ON

    /**
     * {@link Goal} that is the default set of tasks for most {@link Agent}s.
     */
    public static final GoalType NORMAL = DummyObjectProvider.createFor(GoalType.class, "NORMAL");

    /**
     * {@link Goal} that is the "target" set of tasks.
     *
     * In this goal, the objective is to formulate the target so that the
     * {@link Agent} can act on it. The best example is how monsters like
     * zombie and skeleton attack enemies: they seek out a target and if
     * a task in their normal goal sees that they have a target, they act
     * accordingly.
     */
    public static final GoalType TARGET = DummyObjectProvider.createFor(GoalType.class, "TARGET");

    // SORTFIELDS:OFF

    private GoalTypes() {
    }
}


text:
external help file: aOSComm-IndiaTour-help.xml
online version:
schema: 2.0.0
---

# Remove-xSPOListContentType

## SYNOPSIS
{{Fill in the Synopsis}}

## SYNTAX

```
Remove-xSPOListContentType [-Url] <Uri> [-Title] <String> [-Name] <String>
```

## DESCRIPTION
{{Fill in the Description}}

## EXAMPLES

### Example 1
```
PS C:\> {{ Add example code here }}
```

{{ Add example description here }}

## PARAMETERS

### -Name
{{Fill Name Description}}

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
```

### -Title
{{Fill Title Description}}

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
```

### -Url
{{Fill Url Description}}

```yaml
Type: Uri
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
```

## INPUTS

### System.Uri
System.String

## OUTPUTS

### System.Object

## NOTES

## RELATED LINKS


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FluentValidation;
using SOURCE.BackOffice.Web.ViewModels.Pages.Administration.Pool.Details;

namespace SOURCE.BackOffice.Web.ViewModels.Validators.Administration.Pool
{
    public class InfosGeneralesViewModelValidator : AbstractValidator<InfosGeneralesViewModel>
    {
        public InfosGeneralesViewModelValidator()
        {
            RuleFor(x => x.Pool).SetValidator(new PoolViewModelValidator());
            RuleFor(x => x.CompetencesPrestations).SetCollectionValidator(new CompetenceViewModelValidator());
            RuleFor(x => x.CompetencesSectorielles).SetCollectionValidator(new CompetenceViewModelValidator());
        }
    }
}


text:
require 'imgkit'
require 'mini_magick'
require 'enigma'

module Johannes

  class Base
    def initialize(attributes={})
      @text  = attributes['text'] || ''
      @width = attributes['width'] || nil
      @size  = attributes['size'] || '12px'
      @font  = attributes['font'] || 'Helvetica Neue'
      @align = attributes['align'] || 'left'
      @color = attributes['color'] || 'black'
      @line_height = attributes['line_height'] || '1.0em'
    end

    @stylesheets = []

    def self.stylesheets
      @stylesheets
    end

    def self.stylesheets=(val)
      @stylesheets = val
    end

    attr_reader :text, :width, :font

    def css_attributes
      {
        'display'     => 'inline',
        'font-family' => @font,
        'font-size'   => @size,
        'color'       => @color,
        'line-height' => @line_height,
        'width'       => @width || 'auto'
      }
    end

    def css
      rval = ''
      css_attributes.each do |key, value|
        rval << "#{key}: #{value};"
      end

      rval
    end

    def stylesheet_link_tags
      Johannes::Base.stylesheets.map do |url|
        %{<link rel="stylesheet" type="text/css" href="#{url}"/>}
      end.join('')
    end

    def to_html
      %{

            #{stylesheet_link_tags}

#{text}

      }
    end

    def to_image
      image = MiniMagick::Image.read(IMGKit.new(to_html, width: @width).to_img)
      image.trim
      image.format "png"
      image.depth '8'
      image.to_blob
    end
  end

end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Interactivity;
using Livet.Behaviors.Messaging;
using Livet.Messaging;

namespace TpiProgrammer.View
{
    public class ShowMessageBoxAction : InteractionMessageAction<FrameworkElement>
    {
        public static readonly DependencyProperty MessageProperty = DependencyProperty.Register(
            "Message", typeof (string), typeof (ShowMessageBoxAction), new PropertyMetadata(default(string)));

        public string Message
        {
            get { return (string) GetValue(MessageProperty); }
            set { SetValue(MessageProperty, value); }
        }

        public static readonly DependencyProperty CaptionProperty = DependencyProperty.Register(
            "Caption", typeof (string), typeof (ShowMessageBoxAction), new PropertyMetadata(default(string)));

        public string Caption
        {
            get { return (string) GetValue(CaptionProperty); }
            set { SetValue(CaptionProperty, value); }
        }

        public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
            "Icon", typeof (MessageBoxImage), typeof (ShowMessageBoxAction), new PropertyMetadata(default(MessageBoxImage)));

        public MessageBoxImage Icon
        {
            get { return (MessageBoxImage) GetValue(IconProperty); }
            set { SetValue(IconProperty, value); }
        }

        public static readonly DependencyProperty OwnerProperty = DependencyProperty.Register(
            "Owner", typeof (Window), typeof (ShowMessageBoxAction), new PropertyMetadata(default(Window)));

        public Window Owner
        {
            get { return (Window) GetValue(OwnerProperty); }
            set { SetValue(OwnerProperty, value); }
        }

        protected override void InvokeAction(InteractionMessage message)
        {
            var targetMessage = message as MessageBoxMessage;
            if( targetMessage != null)
            {
                var formattedMessage = String.Format(this.Message, targetMessage.Parameters);
                targetMessage.Response = MessageBox.Show(this.Owner, formattedMessage, this.Caption, targetMessage.Button, this.Icon);
            }
        }
    }

    public class MessageBoxMessage : InteractionMessage
    {
        public MessageBoxButton Button { get; private set; }
        public object[] Parameters { get; private set; }
        public MessageBoxResult Response { get; set; }

        protected override Freezable CreateInstanceCore()
        {
            return new MessageBoxMessage(this.MessageKey, this.Button, this.Parameters);
        }

        public MessageBoxMessage(string messageKey, MessageBoxButton button, params object[] parameters) : base(messageKey)
        {
            this.Button = button;
            this.Parameters = parameters;
            this.Response = MessageBoxResult.OK;
        }
        public MessageBoxMessage(string messageKey) : this(messageKey, MessageBoxButton.OK)
        {
        }
    }
}


text:
using System.IO;
using Aspose.Pdf;
using Aspose.Pdf.Annotations;
using System;

namespace Aspose.Pdf.Examples.CSharp.AsposePDF.Annotations
{
    public class GetParticularAnnotation
    {
        public static void Run()
        {
            // ExStart:GetParticularAnnotation
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdf_Annotations();

            // Open document
            Document pdfDocument = new Document(dataDir + "GetParticularAnnotation.pdf");

            // Get particular annotation
            TextAnnotation textAnnotation = (TextAnnotation)pdfDocument.Pages[1].Annotations[1];

            // Get annotation properties
            Console.WriteLine("Title : {0} ", textAnnotation.Title);
            Console.WriteLine("Subject : {0} ", textAnnotation.Subject);
            Console.WriteLine("Contents : {0} ", textAnnotation.Contents);
            // ExEnd:GetParticularAnnotation
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Aquarium
{
    /// <summary>
    /// Interaction logic for Key.xaml
    /// </summary>
    public partial class Key : Window
    {
        public Key()
        {
            InitializeComponent();
        }
    }
}


text:
from __future__ import absolute_import
from datetime import date, datetime  # noqa: F401

from typing import List, Dict  # noqa: F401

from openapi_server.models.base_model_ import Model
from openapi_server import util

class PipelineBranchesitemlatestRun(Model):
    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

    Do not edit the class manually.
    """

    def __init__(self, duration_in_millis=None, estimated_duration_in_millis=None, en_queue_time=None, end_time=None, id=None, organization=None, pipeline=None, result=None, run_summary=None, start_time=None, state=None, type=None, commit_id=None, _class=None):  # noqa: E501
        """PipelineBranchesitemlatestRun - a model defined in OpenAPI

        :param duration_in_millis: The duration_in_millis of this PipelineBranchesitemlatestRun.  # noqa: E501
        :type duration_in_millis: int
        :param estimated_duration_in_millis: The estimated_duration_in_millis of this PipelineBranchesitemlatestRun.  # noqa: E501
        :type estimated_duration_in_millis: int
        :param en_queue_time: The en_queue_time of this PipelineBranchesitemlatestRun.  # noqa: E501
        :type en_queue_time: str
        :param end_time: The end_time of this PipelineBranchesitemlatestRun.  # noqa: E501
        :type end_time: str
        :param id: The id of this PipelineBranchesitemlatestRun.  # noqa: E501
        :type id: str
        :param organization: The organization of this PipelineBranchesitemlatestRun.  # noqa: E501
        :type organization: str
        :param pipeline: The pipeline of this PipelineBranchesitemlatestRun.  # noqa: E501
        :type pipeline: str
        :param result: The result of this PipelineBranchesitemlatestRun.  # noqa: E501
        :type result: str
        :param run_summary: The run_summary of this PipelineBranchesitemlatestRun.  # noqa: E501
        :type run_summary: str
        :param start_time: The start_time of this PipelineBranchesitemlatestRun.  # noqa: E501
        :type start_time: str
        :param state: The state of this PipelineBranchesitemlatestRun.  # noqa: E501
        :type state: str
        :param type: The type of this PipelineBranchesitemlatestRun.  # noqa: E501
        :type type: str
        :param commit_id: The commit_id of this PipelineBranchesitemlatestRun.  # noqa: E501
        :type commit_id: str
        :param _class: The _class of this PipelineBranchesitemlatestRun.  # noqa: E501
        :type _class: str
        """
        self.openapi_types = {
            'duration_in_millis': int,
            'estimated_duration_in_millis': int,
            'en_queue_time': str,
            'end_time': str,
            'id': str,
            'organization': str,
            'pipeline': str,
            'result': str,
            'run_summary': str,
            'start_time': str,
            'state': str,
            'type': str,
            'commit_id': str,
            '_class': str
        }

        self.attribute_map = {
            'duration_in_millis': 'durationInMillis',
            'estimated_duration_in_millis': 'estimatedDurationInMillis',
            'en_queue_time': 'enQueueTime',
            'end_time': 'endTime',
            'id': 'id',
            'organization': 'organization',
            'pipeline': 'pipeline',
            'result': 'result',
            'run_summary': 'runSummary',
            'start_time': 'startTime',
            'state': 'state',
            'type': 'type',
            'commit_id': 'commitId',
            '_class': '_class'
        }

        self._duration_in_millis = duration_in_millis
        self._estimated_duration_in_millis = estimated_duration_in_millis
        self._en_queue_time = en_queue_time
        self._end_time = end_time
        self._id = id
        self._organization = organization
        self._pipeline = pipeline
        self._result = result
        self._run_summary = run_summary
        self._start_time = start_time
        self._state = state
        self._type = type
        self._commit_id = commit_id
        self.__class = _class

    @classmethod
    def from_dict(cls, dikt) -> 'PipelineBranchesitemlatestRun':
        """Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The PipelineBranchesitemlatestRun of this PipelineBranchesitemlatestRun.  # noqa: E501
        :rtype: PipelineBranchesitemlatestRun
        """
        return util.deserialize_model(dikt, cls)

    @property
    def duration_in_millis(self):
        """Gets the duration_in_millis of this PipelineBranchesitemlatestRun.

        :return: The duration_in_millis of this PipelineBranchesitemlatestRun.
        :rtype: int
        """
        return self._duration_in_millis

    @duration_in_millis.setter
    def duration_in_millis(self, duration_in_millis):
        """Sets the duration_in_millis of this PipelineBranchesitemlatestRun.

        :param duration_in_millis: The duration_in_millis of this PipelineBranchesitemlatestRun.
        :type duration_in_millis: int
        """

        self._duration_in_millis = duration_in_millis

    @property
    def estimated_duration_in_millis(self):
        """Gets the estimated_duration_in_millis of this PipelineBranchesitemlatestRun.

        :return: The estimated_duration_in_millis of this PipelineBranchesitemlatestRun.
        :rtype: int
        """
        return self._estimated_duration_in_millis

    @estimated_duration_in_millis.setter
    def estimated_duration_in_millis(self, estimated_duration_in_millis):
        """Sets the estimated_duration_in_millis of this PipelineBranchesitemlatestRun.

        :param estimated_duration_in_millis: The estimated_duration_in_millis of this PipelineBranchesitemlatestRun.
        :type estimated_duration_in_millis: int
        """

        self._estimated_duration_in_millis = estimated_duration_in_millis

    @property
    def en_queue_time(self):
        """Gets the en_queue_time of this PipelineBranchesitemlatestRun.

        :return: The en_queue_time of this PipelineBranchesitemlatestRun.
        :rtype: str
        """
        return self._en_queue_time

    @en_queue_time.setter
    def en_queue_time(self, en_queue_time):
        """Sets the en_queue_time of this PipelineBranchesitemlatestRun.

        :param en_queue_time: The en_queue_time of this PipelineBranchesitemlatestRun.
        :type en_queue_time: str
        """

        self._en_queue_time = en_queue_time

    @property
    def end_time(self):
        """Gets the end_time of this PipelineBranchesitemlatestRun.

        :return: The end_time of this PipelineBranchesitemlatestRun.
        :rtype: str
        """
        return self._end_time

    @end_time.setter
    def end_time(self, end_time):
        """Sets the end_time of this PipelineBranchesitemlatestRun.

        :param end_time: The end_time of this PipelineBranchesitemlatestRun.
        :type end_time: str
        """

        self._end_time = end_time

    @property
    def id(self):
        """Gets the id of this PipelineBranchesitemlatestRun.

        :return: The id of this PipelineBranchesitemlatestRun.
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this PipelineBranchesitemlatestRun.

        :param id: The id of this PipelineBranchesitemlatestRun.
        :type id: str
        """

        self._id = id

    @property
    def organization(self):
        """Gets the organization of this PipelineBranchesitemlatestRun.

        :return: The organization of this PipelineBranchesitemlatestRun.
        :rtype: str
        """
        return self._organization

    @organization.setter
    def organization(self, organization):
        """Sets the organization of this PipelineBranchesitemlatestRun.

        :param organization: The organization of this PipelineBranchesitemlatestRun.
        :type organization: str
        """

        self._organization = organization

    @property
    def pipeline(self):
        """Gets the pipeline of this PipelineBranchesitemlatestRun.

        :return: The pipeline of this PipelineBranchesitemlatestRun.
        :rtype: str
        """
        return self._pipeline

    @pipeline.setter
    def pipeline(self, pipeline):
        """Sets the pipeline of this PipelineBranchesitemlatestRun.

        :param pipeline: The pipeline of this PipelineBranchesitemlatestRun.
        :type pipeline: str
        """

        self._pipeline = pipeline

    @property
    def result(self):
        """Gets the result of this PipelineBranchesitemlatestRun.

        :return: The result of this PipelineBranchesitemlatestRun.
        :rtype: str
        """
        return self._result

    @result.setter
    def result(self, result):
        """Sets the result of this PipelineBranchesitemlatestRun.

        :param result: The result of this PipelineBranchesitemlatestRun.
        :type result: str
        """

        self._result = result

    @property
    def run_summary(self):
        """Gets the run_summary of this PipelineBranchesitemlatestRun.

        :return: The run_summary of this PipelineBranchesitemlatestRun.
        :rtype: str
        """
        return self._run_summary

    @run_summary.setter
    def run_summary(self, run_summary):
        """Sets the run_summary of this PipelineBranchesitemlatestRun.

        :param run_summary: The run_summary of this PipelineBranchesitemlatestRun.
        :type run_summary: str
        """

        self._run_summary = run_summary

    @property
    def start_time(self):
        """Gets the start_time of this PipelineBranchesitemlatestRun.

        :return: The start_time of this PipelineBranchesitemlatestRun.
        :rtype: str
        """
        return self._start_time

    @start_time.setter
    def start_time(self, start_time):
        """Sets the start_time of this PipelineBranchesitemlatestRun.

        :param start_time: The start_time of this PipelineBranchesitemlatestRun.
        :type start_time: str
        """

        self._start_time = start_time

    @property
    def state(self):
        """Gets the state of this PipelineBranchesitemlatestRun.

        :return: The state of this PipelineBranchesitemlatestRun.
        :rtype: str
        """
        return self._state

    @state.setter
    def state(self, state):
        """Sets the state of this PipelineBranchesitemlatestRun.

        :param state: The state of this PipelineBranchesitemlatestRun.
        :type state: str
        """

        self._state = state

    @property
    def type(self):
        """Gets the type of this PipelineBranchesitemlatestRun.

        :return: The type of this PipelineBranchesitemlatestRun.
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this PipelineBranchesitemlatestRun.

        :param type: The type of this PipelineBranchesitemlatestRun.
        :type type: str
        """

        self._type = type

    @property
    def commit_id(self):
        """Gets the commit_id of this PipelineBranchesitemlatestRun.

        :return: The commit_id of this PipelineBranchesitemlatestRun.
        :rtype: str
        """
        return self._commit_id

    @commit_id.setter
    def commit_id(self, commit_id):
        """Sets the commit_id of this PipelineBranchesitemlatestRun.

        :param commit_id: The commit_id of this PipelineBranchesitemlatestRun.
        :type commit_id: str
        """

        self._commit_id = commit_id

    @property
    def _class(self):
        """Gets the _class of this PipelineBranchesitemlatestRun.

        :return: The _class of this PipelineBranchesitemlatestRun.
        :rtype: str
        """
        return self.__class

    @_class.setter
    def _class(self, _class):
        """Sets the _class of this PipelineBranchesitemlatestRun.

        :param _class: The _class of this PipelineBranchesitemlatestRun.
        :type _class: str
        """

        self.__class = _class


text:
require 'pathname'
module JasmineRails::SpecHelper
  def javascript_spec_files
    spec_dir = File.join(Rails.root, 'spec', 'javascripts', 'spec')
    spec_files = Dir["#{spec_dir}/**/*Spec.js"]

    spec_base_path = Pathname.new(spec_dir)
    spec_files.map do |file|
      relative_path = Pathname.new(file).relative_path_from(spec_base_path)
      require_path = relative_path.sub('.js', '')
      "/assets/spec/#{require_path}"
    end
  end
end


text:
/*jshint node:true, indent:2, curly:false, eqeqeq:true, immed:true, latedef:true, newcap:true, noarg:true,
regexp:true, undef:true, strict:true, trailing:true, white:true */
/*global X:true */

(function () {
  "use strict";

  var _ = X._;

  /**
    We've stored report data in a temporary table with a key. Return the data to anyone who has the
    appropriate key.

    @extends X.Route
    @class
   */
  X.dataFromKeyRoute = X.Route.create({

    handle: function (xtr) {
      // this is all very temporary
      var that = this,
        querystring = require("querystring"),
        url = xtr.request.url,
        response = xtr.get("response"),
        params = url.substring(url.indexOf('?') + 1),
        dataKey = -1,
        tempDataModel;

      if (params) {
        dataKey = querystring.parse(params).dataKey;
      }

      //console.log(XT.session.schema.attributes);
      //tempDataModel = new XM.BiCache({key: dataKey});
      tempDataModel = XM.BiCache.findOrCreate(dataKey);
      if (tempDataModel === null) {
        // this bit should not be necessary by my understanding of findOrCreate. Go figure.
        tempDataModel = new XM.BiCache({key: dataKey});
      }

      tempDataModel.fetch({success: function (model, result) {
        response.writeHead(200, {"Content-Type": "application/json"});
        response.write(JSON.stringify({
          data: JSON.parse(model.get("data")),
          query: JSON.parse(model.get("query"))}));
        response.end();

        // this message will self-destruct in 1 second...
        // TODO: makes more sense to sweep out old records. We'll have
        // to do that anyway.
        //model.destroy({
        //  success: function () {
        //    console.log("destroy success")
        //  },
        //  error: function () {
        //    console.log("destroy error")
        //  }
        //});
      }, error: function (model, err) {
        console.log("error", model);
        if (err.code === 'xt1007') {
          xtr.error({isError: true, message: "Record not found"});
        } else {
          xtr.error({isError: true, message: "Error"});
        }
      }});
    },

    handles: "dataFromKey /dataFromKey".w()
  });
}());


text:
<!DOCTYPE html>

    <title>1. English digit</title>
    <link href="styles/StyleSheet.css" rel="stylesheet" />
    <link href="../Doncho's%20Console/styles/js-console.css" rel="stylesheet" />

        Enter value for A:
        <input type="text" id="a" />
        <button id="submit">Submit</button>


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/dataform/v1alpha2/dataform.proto

package com.google.cloud.dataform.v1alpha2;

public interface ReadFileResponseOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.cloud.dataform.v1alpha2.ReadFileResponse)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * The file's contents.
   *

   *
   * bytes file_contents = 1;
   *
   * @return The fileContents.
   */
  com.google.protobuf.ByteString getFileContents();
}