text:
class GenerationFitnessCSV: public GenerationalCSVInstrument {
	private:

	protected:
	std::vector<double> buckets;
	double resolution;

	double bucket(Fitness actual);
	void report();

	public:
	GenerationFitnessCSV(
		PopulationNode* target,
		std::string outFile,
		double bottomFitness,
		double topFitness,
		double resolution = 1
	);
};

#endif


text:
static const int HEIGHT = 20;
static const int WIDTH = 40;
static const int MAXSIZE = 50;

// The arrays are define like this because array[MAXSIZE] wasn't allowed
typedef struct Snake{
	int alive;
	int bodx[50];
	int body[50];
	int digest[50];

	int score;
} Snake;

void initBoard(char board[][WIDTH]);
void printBoard(char board[][WIDTH]);
void placeApple(char board[][WIDTH]);

void initSnake(struct Snake* snake, int headx, int heady, int tailx, int taily);
void printSnake(struct Snake snake);
void moveSnake(char board[][WIDTH], struct Snake* snake, char dir);

redpajama_set_name: RedPajamaGithub


text:
package com.google.android.gms.drive.sample.demo;

import android.os.Bundle;
import android.widget.ListView;

import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.drive.Drive;
import com.google.android.gms.drive.DriveApi;
import com.google.android.gms.drive.query.Filters;
import com.google.android.gms.drive.query.Query;
import com.google.android.gms.drive.query.SearchableField;

/**
 * An activity to illustrate how to query files with title containing "a".
 */
public class QueryFilesWithAInTitleActivity extends BaseDemoActivity {

    private ListView mResultsListView;
    private ResultsAdapter mResultsAdapter;

    @Override
    protected void onCreate(Bundle b) {
        super.onCreate(b);
        setContentView(R.layout.activity_listfiles);
        mResultsListView = (ListView) findViewById(R.id.listViewResults);
        mResultsAdapter = new ResultsAdapter(this);
        mResultsListView.setAdapter(mResultsAdapter);
    }

    /**
     * Clears the result buffer to avoid memory leaks as soon as the activity is no longer
     * visible by the user.
     */
    @Override
    protected void onStop() {
        super.onStop();
        mResultsAdapter.clear();
    }

    @Override
    public void onConnected(Bundle connectionHint) {
        super.onConnected(connectionHint);
        Query query = new Query.Builder()
                .addFilter(Filters.contains(SearchableField.TITLE, "a"))
                .build();
        Drive.DriveApi.query(getGoogleApiClient(), query)
                .setResultCallback(metadataCallback);
    }

    final private ResultCallback<DriveApi.MetadataBufferResult> metadataCallback =
            new ResultCallback<DriveApi.MetadataBufferResult>() {
                @Override
                public void onResult(DriveApi.MetadataBufferResult result) {
                    if (!result.getStatus().isSuccess()) {
                        showMessage("Problem while retrieving results");
                        return;
                    }
                    mResultsAdapter.clear();
                    mResultsAdapter.append(result.getMetadataBuffer());
                }
            };

}


text:
// [VexFlow](http://vexflow.com) - Copyright (c) Mohit Muthanna 2010.

/**
 * ## Description
 *
 * Create a new tuplet from the specified notes. The notes must
 * be part of the same voice. If they are of different rhythmic
 * values, then options.num_notes must be set.
 *
 * @constructor
 * @param {Array.<Vex.Flow.StaveNote>} A set of notes: staveNotes,
 *   notes, etc... any class that inherits stemmableNote at some
 *   point in its prototype chain.
 * @param options: object {
 *
 *   num_notes: fit this many notes into...
 *   notes_occupied: ...the space of this many notes
 *
 *       Together, these two properties make up the tuplet ratio
 *     in the form of num_notes : notes_occupied.
 *       num_notes defaults to the number of notes passed in, so
 *     it is important that if you omit this property, all of
 *     the notes passed should be of the same note value.
 *       notes_occupied defaults to 2 -- so you should almost
 *     certainly pass this parameter for anything other than
 *     a basic triplet.
 *
 *   location:
 *     default 1, which is above the notes: ┌─── 3 ───┐
 *      -1 is below the notes └─── 3 ───┘
 *
 *   bracketed: boolean, draw a bracket around the tuplet number
 *     when true: ┌─── 3 ───┐   when false: 3
 *     defaults to true if notes are not beamed, false otherwise
 *
 *   ratioed: boolean
 *     when true: ┌─── 7:8 ───┐, when false: ┌─── 7 ───┐
 *     defaults to true if the difference between num_notes and
 *     notes_occupied is greater than 1.
 *
 *   y_offset: int, default 0
 *     manually offset a tuplet, for instance to avoid collisions
 *     with articulations, etc...
 * }
 */

import { RuntimeError, check } from './util';
import { Element } from './element';
import { Formatter } from './formatter';
import { Glyph } from './glyph';
import { Stem } from './stem';
import { Note } from './note';
import { StemmableNote } from './stemmablenote';

export interface TupletOptions {
  beats_occupied?: number;
  bracketed?: boolean;
  location?: number;
  notes_occupied?: number;
  num_notes?: number;
  ratioed?: boolean;
  y_offset?: number;
}

export class Tuplet extends Element {
  notes: Note[];

  protected options: TupletOptions;
  protected num_notes: number;
  protected point: number;

  protected bracketed: boolean;
  protected y_pos: number;
  protected x_pos: number;
  protected width: number;

  // location is initialized by the constructor via setTupletLocation(...).
  protected location!: number;

  protected notes_occupied: number;
  protected ratioed: boolean;
  protected numerator_glyphs: Glyph[] = [];
  protected denom_glyphs: Glyph[] = [];

  static get LOCATION_TOP(): number {
    return 1;
  }
  static get LOCATION_BOTTOM(): number {
    return -1;
  }
  static get NESTING_OFFSET(): number {
    return 15;
  }

  constructor(notes: Note[], options?: TupletOptions) {
    super();
    this.setAttribute('type', 'Tuplet');
    if (!notes || !notes.length) {
      throw new RuntimeError('BadArguments', 'No notes provided for tuplet.');
    }

    this.options = { ...options };
    this.notes = notes;
    this.num_notes = this.options.num_notes != undefined ? this.options.num_notes : notes.length;

    // We accept beats_occupied, but warn that it's deprecated:
    // the preferred property name is now notes_occupied.
    if (this.options.beats_occupied) {
      this.beatsOccupiedDeprecationWarning();
    }
    this.notes_occupied = this.options.notes_occupied || this.options.beats_occupied || 2;
    if (this.options.bracketed != undefined) {
      this.bracketed = this.options.bracketed;
    } else {
      this.bracketed = notes.some((note) => !note.hasBeam());
    }

    this.ratioed =
      this.options.ratioed != undefined ? this.options.ratioed : Math.abs(this.notes_occupied - this.num_notes) > 1;
    this.point = this.musicFont.lookupMetric('digits.tupletPoint');
    this.y_pos = 16;
    this.x_pos = 100;
    this.width = 200;

    this.setTupletLocation(this.options.location || Tuplet.LOCATION_TOP);

    Formatter.AlignRestsToNotes(notes, true, true);
    this.resolveGlyphs();
    this.attach();
  }

  attach(): void {
    for (let i = 0; i < this.notes.length; i++) {
      const note = this.notes[i];
      note.setTuplet(this);
    }
  }

  detach(): void {
    for (let i = 0; i < this.notes.length; i++) {
      const note = this.notes[i];
      note.resetTuplet(this);
    }
  }

  /**
   * Set whether or not the bracket is drawn.
   */
  setBracketed(bracketed: boolean): this {
    this.bracketed = !!bracketed;
    return this;
  }

  /**
   * Set whether or not the ratio is shown.
   */
  setRatioed(ratioed: boolean): this {
    this.ratioed = !!ratioed;
    return this;
  }

  /**
   * Set the tuplet indicator to be displayed either on the top or bottom of the stave.
   */
  setTupletLocation(location: number): this {
    if (location !== Tuplet.LOCATION_TOP && location !== Tuplet.LOCATION_BOTTOM) {
      // eslint-disable-next-line
      console.warn(`Invalid tuplet location [${location}]. Using Tuplet.LOCATION_TOP.`);
      location = Tuplet.LOCATION_TOP;
    }

    this.location = location;
    return this;
  }

  getNotes(): Note[] {
    return this.notes;
  }

  getNoteCount(): number {
    return this.num_notes;
  }

  beatsOccupiedDeprecationWarning(): void {
    // eslint-disable-next-line
    console.warn(
      'beats_occupied has been deprecated as an option for tuplets. Please use notes_occupied instead.',
      'Calls to getBeatsOccupied / setBeatsOccupied should now be routed to getNotesOccupied / setNotesOccupied.'
    );
  }

  getBeatsOccupied(): number {
    this.beatsOccupiedDeprecationWarning();
    return this.getNotesOccupied();
  }

  setBeatsOccupied(beats: number): void {
    this.beatsOccupiedDeprecationWarning();
    return this.setNotesOccupied(beats);
  }

  getNotesOccupied(): number {
    return this.notes_occupied;
  }

  setNotesOccupied(notes: number): void {
    this.detach();
    this.notes_occupied = notes;
    this.resolveGlyphs();
    this.attach();
  }

  resolveGlyphs(): void {
    this.numerator_glyphs = [];
    let n = this.num_notes;
    while (n >= 1) {
      this.numerator_glyphs.unshift(new Glyph('timeSig' + (n % 10), this.point));
      n = parseInt((n / 10).toString(), 10);
    }

    this.denom_glyphs = [];
    n = this.notes_occupied;
    while (n >= 1) {
      this.denom_glyphs.unshift(new Glyph('timeSig' + (n % 10), this.point));
      n = parseInt((n / 10).toString(), 10);
    }
  }

  // determine how many tuplets are nested within this tuplet
  // on the same side (above/below), to calculate a y
  // offset for this tuplet:
  getNestedTupletCount(): number {
    const location = this.location;
    const first_note = this.notes[0];
    let maxTupletCount = countTuplets(first_note, location);
    let minTupletCount = countTuplets(first_note, location);

    // Count the tuplets that are on the same side (above/below)
    // as this tuplet:
    function countTuplets(note: Note, location: number) {
      return note.tupletStack.filter((tuplet) => tuplet.location === location).length;
    }

    this.notes.forEach((note) => {
      const tupletCount = countTuplets(note, location);
      maxTupletCount = tupletCount > maxTupletCount ? tupletCount : maxTupletCount;
      minTupletCount = tupletCount < minTupletCount ? tupletCount : minTupletCount;
    });

    return maxTupletCount - minTupletCount;
  }

  // determine the y position of the tuplet:
  getYPosition(): number {
    // offset the tuplet for any nested tuplets between
    // it and the notes:
    const nested_tuplet_y_offset = this.getNestedTupletCount() * Tuplet.NESTING_OFFSET * -this.location;

    // offset the tuplet for any manual y_offset:
    const y_offset = this.options.y_offset || 0;

    // now iterate through the notes and find our highest
    // or lowest locations, to form a base y_pos
    const first_note = this.notes[0];
    let y_pos;
    if (this.location === Tuplet.LOCATION_TOP) {
      y_pos = first_note.checkStave().getYForLine(0) - 15;
      // y_pos = first_note.getStemExtents().topY - 10;

      for (let i = 0; i < this.notes.length; ++i) {
        const top_y =
          this.notes[i].getStemDirection() === Stem.UP
            ? this.notes[i].getStemExtents().topY - 10
            : this.notes[i].getStemExtents().baseY - 20;

        if (top_y < y_pos) {
          y_pos = top_y;
        }
      }
    } else {
      y_pos = first_note.checkStave().getYForLine(4) + 20;

      for (let i = 0; i < this.notes.length; ++i) {
        const bottom_y =
          this.notes[i].getStemDirection() === Stem.UP
            ? this.notes[i].getStemExtents().baseY + 20
            : this.notes[i].getStemExtents().topY + 10;
        if (bottom_y > y_pos) {
          y_pos = bottom_y;
        }
      }
    }

    return y_pos + nested_tuplet_y_offset + y_offset;
  }

  draw(): void {
    const ctx = this.checkContext();
    this.setRendered();

    // determine x value of left bound of tuplet
    const first_note = this.notes[0] as StemmableNote;
    const last_note = this.notes[this.notes.length - 1] as StemmableNote;

    if (!this.bracketed) {
      this.x_pos = first_note.getStemX();
      this.width = last_note.getStemX() - this.x_pos;
    } else {
      this.x_pos = first_note.getTieLeftX() - 5;
      this.width = last_note.getTieRightX() - this.x_pos + 5;
    }

    // determine y value for tuplet
    this.y_pos = this.getYPosition();

    const addGlyphWidth = (width: number, glyph: Glyph) => width + check<number>(glyph.getMetrics().width);

    // calculate total width of tuplet notation
    let width = this.numerator_glyphs.reduce(addGlyphWidth, 0);
    if (this.ratioed) {
      width = this.denom_glyphs.reduce(addGlyphWidth, width);
      width += this.point * 0.32;
    }

    const notation_center_x = this.x_pos + this.width / 2;
    const notation_start_x = notation_center_x - width / 2;

    // draw bracket if the tuplet is not beamed
    if (this.bracketed) {
      const line_width = this.width / 2 - width / 2 - 5;

      // only draw the bracket if it has positive length
      if (line_width > 0) {
        ctx.fillRect(this.x_pos, this.y_pos, line_width, 1);
        ctx.fillRect(this.x_pos + this.width / 2 + width / 2 + 5, this.y_pos, line_width, 1);
        ctx.fillRect(
          this.x_pos,
          this.y_pos + (this.location === Tuplet.LOCATION_BOTTOM ? 1 : 0),
          1,
          this.location * 10
        );
        ctx.fillRect(
          this.x_pos + this.width,
          this.y_pos + (this.location === Tuplet.LOCATION_BOTTOM ? 1 : 0),
          1,
          this.location * 10
        );
      }
    }

    // draw numerator glyphs
    const shiftY = this.musicFont.lookupMetric('digits.shiftY', 0);

    let x_offset = 0;
    this.numerator_glyphs.forEach((glyph) => {
      glyph.render(ctx, notation_start_x + x_offset, this.y_pos + this.point / 3 - 2 + shiftY);
      x_offset += check<number>(glyph.getMetrics().width);
    });

    // display colon and denominator if the ratio is to be shown
    if (this.ratioed) {
      const colon_x = notation_start_x + x_offset + this.point * 0.16;
      const colon_radius = this.point * 0.06;
      ctx.beginPath();
      ctx.arc(colon_x, this.y_pos - this.point * 0.08, colon_radius, 0, Math.PI * 2, true);
      ctx.closePath();
      ctx.fill();
      ctx.beginPath();
      ctx.arc(colon_x, this.y_pos + this.point * 0.12, colon_radius, 0, Math.PI * 2, true);
      ctx.closePath();
      ctx.fill();
      x_offset += this.point * 0.32;
      this.denom_glyphs.forEach((glyph) => {
        glyph.render(ctx, notation_start_x + x_offset, this.y_pos + this.point / 3 - 2 + shiftY);
        x_offset += check<number>(glyph.getMetrics().width);
      });
    }
  }
}


text:
package tldrio

import (
	"fmt"
	"testing"
)

func TestLatest(t *testing.T) {
	var tldrio *TldrIo
	tldrio = NewTldrIo()

	latest, err := tldrio.Latest(1, "world-news")
	if err != nil {
		t.Error(err)
	}
	if len((*latest)) != 1 {
		t.Error("didn't get a tl;dr")
	}
}

func ExampleTldrIo_Latest() {
	var tldrio *TldrIo
	tldrio = NewTldrIo()

	latest, err := tldrio.Latest(3, "world-news")
	if err != nil {
		fmt.Printf("couldn't get the three latest World News tl;drs: %s\n", err)
	} else {
		fmt.Printf("got three of the latest World News tl;drs: %t\n", len(*latest) == 3)
	}
	// Output:
	// got three of the latest World News tl;drs: true

}

func TestSearch(t *testing.T) {
	var tldrio *TldrIo
	tldrio = NewTldrIo()

	latest, err := tldrio.Latest(1, "world-news")
	if err != nil {
		t.Error(err)
	} else {
		url := (*latest)[0].OriginalUrl
		result, err := tldrio.Search(url)
		if err != nil {
			t.Error(err)
		} else {
			if (*latest)[0].CreatedAt != result.CreatedAt {
				t.Error("tl;drs don't match!")
			}
		}
	}
}

func ExampleTldrIo_Search() {
	var tldrio *TldrIo
	tldrio = NewTldrIo()

	result, err := tldrio.Search("http://jsonapi.org")
	if err != nil {
		fmt.Println("search didn't return any results")
	} else {
		fmt.Printf("search returned a tl;dr with the title '%s'\n", result.Title)
	}
	// Output:
	// search returned a tl;dr with the title 'JSON API'

}

func TestSearchNotThere(t *testing.T) {
	var tldrio *TldrIo
	tldrio = NewTldrIo()

	_, err := tldrio.Search("http://not.there.com")
	if err == nil {
		t.Error("expected no results but got one ...")
	}
}

func TestSearchBatch(t *testing.T) {
	var tldrio *TldrIo
	tldrio = NewTldrIo()

	results, err := tldrio.SearchBatch("http://42floors.com/blog/yc-without-being-in-yc",
		"http://jsonapi.org")
	if err != nil {
		t.Error(err)
	} else {
		if len(*results) == 0 {
			t.Error("batch search didn't return expected results")
		}
	}
}

func ExampleTldrIo_SearchBatch() {
	var tldrio *TldrIo
	tldrio = NewTldrIo()

	results, err := tldrio.SearchBatch("http://42floors.com/blog/yc-without-being-in-yc",
		"http://jsonapi.org")
	if err != nil {
		fmt.Println("search batch didn't return any results")
	} else {
		fmt.Printf("search batch found 2 results: %t\n", len(*results) == 2)
	}
	// Output:
	// search batch found 2 results: true
}


text:
<?php
namespace Neos\Flow\Tests\Functional\Configuration;

use Neos\Flow\Annotations as Flow;
use Neos\Flow\Core\Bootstrap;
use Neos\Flow\Tests\FunctionalTestCase;
use Neos\Flow\Package\PackageManagerInterface;
use Neos\Utility\SchemaValidator;
use Neos\Utility\Files;
use Symfony\Component\Yaml\Yaml;

/**
 * Testcase for the Flow Validation Framework
 *
 */
class SchemaValidationTest extends FunctionalTestCase
{

    /**
     * @var array<string>
     */
    protected $schemaPackageKeys = ['Neos.Flow', 'Neos.FluidAdaptor', 'Neos.Eel', 'Neos.Kickstart'];

    /**
     * The schema-schema yaml
     *
     * @var string
     */
    protected $schemaSchemaResource = 'resource://Neos.Flow/Private/Schema/Schema.schema.yaml';

    /**
     * The parsed schema-schema
     *
     * @var array
     */
    protected $schemaSchema;

    /**
     * @var SchemaValidator
     */
    protected $schemaValidator;

    public function setUp()
    {
        parent::setUp();
        $this->schemaValidator = new SchemaValidator();
        $this->schemaSchema = Yaml::parseFile($this->schemaSchemaResource);
    }

    /**
     * @return array
     */
    public function schemaFilesAreValidDataProvider()
    {
        $bootstrap = Bootstrap::$staticObjectManager->get(Bootstrap::class);
        $objectManager = $bootstrap->getObjectManager();
        $packageManager = $objectManager->get(PackageManagerInterface::class);

        $activePackages = $packageManager->getAvailablePackages();
        foreach ($activePackages as $package) {
            $packageKey = $package->getPackageKey();
            if (in_array($packageKey, $this->schemaPackageKeys)) {
                $schemaPackages[] = $package;
            }
        }

        $schemaFiles = [];

        foreach ($schemaPackages as $package) {
            $packageSchemaPath = Files::concatenatePaths(array($package->getResourcesPath(), 'Private/Schema'));
            if (is_dir($packageSchemaPath)) {
                foreach (Files::getRecursiveDirectoryGenerator($packageSchemaPath, '.schema.yaml') as $schemaFile) {
                    $schemaFiles[] = [$schemaFile];
                }
            }
        }
        return $schemaFiles;
    }

    /**
     * Validate that all the given files are valid schemas
     *
     * @test
     * @dataProvider schemaFilesAreValidDataProvider
     */
    public function schemaFilesAreValid($schemaFile)
    {
        $schema = Yaml::parseFile($schemaFile);
        $result = $this->schemaValidator->validate($schema, $this->schemaSchema);
        $hasErrors = $result->hasErrors();

        $message = sprintf('Schema-file "%s" is not valid: %s', $schemaFile, $result->getFirstError());
        $this->assertFalse($hasErrors, $message);
    }
}


text:
const Autoloader = require('./src/Autoloader');

const autoloader = new Autoloader();
autoloader.register();

module.exports = autoloader;

require('./src/Exception/ReflectionException');
require('./src/Reflection/ReflectionClass');
require('./src/Metadata/MetadataStorage');


text:
Compiled with Visual Studio 2022 Version 17.3.1 and Boost 1.80.

No new classes or functions.

# Version 4.2.4

Compiled with Visual Studio 2019 Version 16.11.4 and Boost 1.77.

No new classes or functions.

# Version 4.2.4

Compiled with Visual Studio 2019 Version 16.9.1 and Boost 1.72.

No new classes or functions.

# Version 4.2.3

Compiled with Visual Studio 2019 Version 16.8.2 and Boost 1.72.

This version fixes error C1047 and LNK1257 that appears when trying to link to
a project that is compiled with 16.8.0 or later. Also suppresses more warnings
when including WTL headers.

No new classes or functions.

# Version 4.2.2

Compiled with Visual Studio 2019 Version 16.7.7 and Boost 1.72.

This version suppresses more warnings when including Boost and WTL headers.

New classes: SystemImageList

# Version 4.2.1

Compiled with Visual Studio 2019 Version 16.5.0 and Boost 1.71.

- Fixed crash in Win32::Taskbar class when internal ITaskbarList3 COM object
 couldn't be accessed

# Version 4.2.0

Compiled with Visual Studio 2019 Version 16.4.3 and Boost 1.71.

No new classes. Some classes were changed to include move ctors and move
assignment operators.

- Path contains a mixture of object methods and static methods; the object
  methods are now marked deprecated, to be removed in version 4.3.0.
  Warning C4996 will show what calls have to be adjusted to the equivalent
  static methods.
- Method Clipboard::SetHtml() was deprecated, as it was never implemented
- Fixed some edge cases when parsing program options in ProgramOptions
- Stream::FileStream now caches the file length when calling Length()
- Added TimeSpan::Format() and marked FormatISO8601() obsolete

# Version 4.1.7

Compiled with Visual Studio 2019 Version 16.4.1 and Boost 1.70.

No new classes or functions.

# Version 4.1.6

Compiled with Visual Studio 2019 Version 16.1.4 and Boost 1.70.

No new classes or functions.

# Version 4.1.5

Compiled with Visual Studio 2017 Version 15.9.5 and Boost 1.68.

This version suppresses more warnings when including Boost and WTL headers. Also:

- made MutexLock, MutexTryLock and MutexUnLocker movable
- fixed including Singleton.hpp when compiling for C++17

# Version 4.1.4

Compiled with Visual Studio 2017 Version 15.8.9 and Boost 1.68.

This version suppresses warning 4996 about deprecated features when compiling
with C++17 and including `ulib\config\BoostAsio.hpp`.

# Version 4.1.3

Compiled with Visual Studio 2017 Version 15.8.7 and Boost 1.68. Use this
package together with the WTL 10.0.8280 or later package.

# Version 4.1.2

Compiled with Visual Studio 2017 Version 15.8.3 and Boost 1.68.

New classes: VersionInfoResource

New methods: sizeof_array, Win32::ErrorMessage::LastError()

# Version 4.1.1

Compiled with Visual Studio 2017 Version 15.5.2 and Boost 1.66.

New methods: Path::ModuleFilename()

Updated atlribbon.h for VS 2017 that is automatically included in config/Atl.hpp

# Version 4.1.0

Compiled with Visual Studio 2017 Update 3 and Boost 1.65.1.

New classes: Clipboard, MemoryReadStream, NullStream, HighResolutionTimer, Win7Taskbar, TraceOutputStopwatch, Singleton

New methods in Path, FileFinder and ProgramOptions

Bug fixes and more unit tests for existing classes.

# Version 4.0.1

Compatibility changes, bug fixes and changes to remove SonarQube and Coverity Scan warnings.

# Version 4.0.0

Compiled with Visual Studio 2017 Update 3 and Boost 1.65.0.

This is the initial release of the library.


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1, user-scalable=0">
    <title>demos</title>


text:
ECHO OFF
REM Usage: Call "$(MSBuildProjectDirectory)\PostBuild.$(ConfigurationName).bat" "$(MSBuildProjectDirectory)\$(OutDir)" "$(ConfigurationName)" "$(ProjectName)"
REM Vars:  $(ProjectName) = MyCo.Framework. Models, $(TargetPath) = output file, $(TargetDir) = full bin path , $(OutDir) = bin\debug, $(ConfigurationName) = "Debug"

ECHO Starting PostBuild.bat

REM Locals
SET FullPath=%1
SET FullPath=%FullPath:"=%
ECHO FullPath: %FullPath%
SET Configuration=%2
ECHO Configuration: %Configuration%
SET ProjectName=%3
ECHO ProjectName: %ProjectName%
SET LibFolder="\lib\%ProjectName%\"
ECHO LibFolder: %LibFolder%

REM Publish Output
MD %LibFolder%
%WINDIR%\system32\attrib.exe %LibFolder%*.* -r /s
%WINDIR%\system32\xcopy.exe "%FullPath%\*.*" "%LibFolder%*.*" /d/f/s/e/r/c/y

Exit 0


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;

namespace aspnetapp.Pages
{
    public class IndexModel : PageModel
    {
        private readonly ILogger<IndexModel> _logger;

        public IndexModel(ILogger<IndexModel> logger)
        {
            _logger = logger;
        }

        public void OnGet()
        {

        }
    }
}


text:
<?php
/* $Id: Add_SerialItemsOut.php 5768 2012-12-20 08:38:22Z daintree $*/
/*ProcessSerialItems.php takes the posted variables and adds to the SerialItems array
 in either the cartclass->LineItems->SerialItems or the POClass->LineItems->SerialItems */

if (isset($_POST['AddBatches'])){

	if (isset($_POST['TotalBundles'])){
		$loop_max = $_POST['TotalBundles'];
	} else {
		$loop_max = 10;
	}
	for ($i=0;$i < $loop_max;$i++){
	if(isset($_POST['SerialNo' . $i]) and mb_strlen($_POST['SerialNo' . $i])>0){
			$ExistingBundleQty = ValidBundleRef($StockID, $LocationOut, $_POST['SerialNo' . $i]);
			if ($ExistingBundleQty >0){
				$AddThisBundle = true;
				/*If the user enters a duplicate serial number the later one over-writes
				the first entered one - no warning given though ? */
				if (filter_number_format($_POST['Qty' . $i]) > $ExistingBundleQty){
					if ($LineItem->Serialised ==1){
						echo '
' . $_POST['SerialNo' . $i] . " " . _('has already been sold');
						$AddThisBundle = false;
					} elseif ($ExistingBundleQty==0) { /* and its a batch */
						echo '
' . _('There is none of') . ' ' . $_POST['SerialNo' . $i] . ' ' . _('left');
						$AddThisBundle = false;
					} else {
					 	echo '
' . _('There is only') . ' ' . $ExistingBundleQty . ' ' . _('of') . ' ' . $_POST['SerialNo' . $i] . ' ' . _('remaining') . '. ' . _('The entered quantity will be reduced to the remaining amount left of this batch/bundle/roll');
						$_POST['Qty' . $i] = $ExistingBundleQty;
						$AddThisBundle = true;
					}
				}
				if ($AddThisBundle==true
					AND filter_number_format($_POST['Qty' . $i])>0){

					$LineItem->SerialItems[$_POST['SerialNo' . $i]] = new SerialItem ($_POST['SerialNo' . $i],
																					filter_number_format($_POST['Qty' . $i]),
																					$_POST['ExpiryDate' . $i]);
				}
			} /*end if ExistingBundleQty >0 */
		} /* end if posted Serialno . i is not blank */

	} /* end of the loop aroung the form input fields */

//	for ($i=0;$i < count($_POST['Bundles']);$i++){ /*there is an entry in the multi select list box */
//		if ($LineItem->Serialised==1){	/*only if the item is serialised */
//			$LineItem->SerialItems[$_POST['Bundles'][$i]] = new SerialItem ($_POST['Bundles'][$i], 1);
//		}
//	}

} /*end if the user hit the enter button */

if (isset($_GET['Delete'])){
	unset($LineItem->SerialItems[$_GET['Delete']]);
}

if (isset($_GET['DELETEALL'])){
	$LineItem->SerialItems=array();
}

?>


text:
GeneratedCreditCardView::GeneratedCreditCardView(
    LocationBarView::Delegate* delegate)
    : delegate_(delegate) {
  Update();
}

GeneratedCreditCardView::~GeneratedCreditCardView() {}

void GeneratedCreditCardView::Update() {
  autofill::GeneratedCreditCardBubbleController* controller = GetController();
  if (controller && !controller->AnchorIcon().IsEmpty()) {
    SetVisible(true);
    SetImage(controller->AnchorIcon().AsImageSkia());
  } else {
    SetVisible(false);
    SetImage(NULL);
  }
}

// TODO(dbeam): figure out what to do for a tooltip and accessibility.

bool GeneratedCreditCardView::CanHandleClick() const {
  autofill::GeneratedCreditCardBubbleController* controller = GetController();
  return controller && !controller->IsHiding();
}

void GeneratedCreditCardView::OnClick() {
  autofill::GeneratedCreditCardBubbleController* controller = GetController();
  if (controller)
    controller->OnAnchorClicked();
}

autofill::GeneratedCreditCardBubbleController* GeneratedCreditCardView::
    GetController() const {
  content::WebContents* wc = delegate_->GetWebContents();
  if (!wc || delegate_->GetToolbarModel()->input_in_progress())
    return NULL;

  return autofill::GeneratedCreditCardBubbleController::FromWebContents(wc);
}


text:
/* Created by Jochen Neubeck 05/25/2017 */

#include <intrin.h>

#define InterlockedCompareExchange64 _InterlockedCompareExchange64 /* for XP */

DECLSPEC_IMPORT ULONG DbgPrint(PCSTR, ...); /* from ntdll.lib */

#ifdef _UNICODE
#define TF "l"
#else
#define TF "h"
#endif

#ifdef _DEBUG
#define trace (void)DbgPrint
#define enter(fmt, ...) \
	eh_enum = \
	( \
		DbgPrint("[%08X] -> " fmt "\n", \
			GetCurrentThreadId(), __VA_ARGS__), \
		succeeded \
	); char const *eh_text = "succeeded"; int eh_diag = 0
#define leave(fmt, ...) \
	( \
		DbgPrint("[%08X] <- %d = %s(%d) = " fmt "\n", \
			GetCurrentThreadId(), eh_enum, eh_text, eh_diag, __VA_ARGS__), \
		eh_enum \
	)
#define goto(label) \
	{ eh_enum = label; eh_text = #label; eh_diag = GetLastError(); goto label; }
#else
#define trace (void)sizeof
#define enter(fmt, ...) eh_enum = succeeded
#define leave(fmt, ...) eh_enum
#define goto(label) { eh_enum = label; goto label; }
#endif

/* A const_cast for C */
#define const_cast(type, expr) (sizeof((type)(expr) - (expr)), (type)(expr))

/* A syntax for automatic nested block scopes in switch statements, like so:
 *
 *     switch (uMsg)
 *     {{
 *     case(:WM_INITDIALOG:)
 *         HICON hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(101));
 *         SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
 *         SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
 *         ShowWindow(hDlg, SW_SHOW);
 *         return TRUE;
 *
 *     case(:WM_COMMAND:)
 *         switch (wParam)
 *         {
 *         case IDCANCEL:
 *         case ~~((3 + 1) * 2):
 *             DestroyWindow(hwnd);
 *             break;
 *         }
 *         return TRUE;
 *
 *     case(:WM_DESTROY:)
 *         PostQuitMessage(0);
 *         break;
 *
 *     default(:)
 *         break;
 *     }}
 *
 * Note how ~~() fixes the keyword vs. macro confusion that can arise with
 * computed case labels inside a conventional switch statement.
 */
#define case(x) } case 0 ? 0 x {
#define default(x) } default x {


text:
package edu.nyu.vida.data_polygamy.scalar_function;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import edu.nyu.vida.data_polygamy.utils.FrameworkUtils.Function;

public abstract class Aggregation {

    protected Function id = Function.NONE;

    public Aggregation() {}

    abstract public void addValue(float value, int time);
    abstract public void reset();
    abstract public int getCount();
    abstract public float getResult();
    abstract public void add(Aggregation agg);

    abstract public void readFields(DataInput in) throws IOException;
    abstract public void write(DataOutput out) throws IOException;
    abstract public int compareTo(Aggregation arg0);
    abstract public boolean equals(Object o);

    public Function getId() {
        return id;
    }
}


text:
package org.apache.reef.driver.evaluator;

import org.apache.reef.runtime.common.launch.DotNetLaunchCommandBuilder;

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

/**
 * DotNet evaluator process.
 */
public final class DotNetProcess implements EvaluatorProcess {
  private final DotNetLaunchCommandBuilder commandBuilder = new DotNetLaunchCommandBuilder();
  private boolean optionSet = false;

  /**
   * Instantiated via DotNetProcessFactory.
   */
  DotNetProcess() {
  }

  @Override
  public List<String> getCommandLine() {
    return commandBuilder
        .build();
  }

  @Override
  public EvaluatorType getType() {
    return EvaluatorType.DOTNET;
  }

  @Override
  public DotNetProcess setMemory(final int megaBytes) {
    commandBuilder.setMemory(megaBytes);
    optionSet = true;
    return this;
  }

  @Override
  public boolean isOptionSet() {
    return optionSet;
  }

  @Override
  public DotNetProcess setConfigurationFileName(final String configurationFileName) {
    commandBuilder.setConfigurationFilePaths(Collections.singletonList(configurationFileName));
    return this;
  }

  @Override
  public DotNetProcess setStandardOut(final String standardOut) {
    commandBuilder.setStandardOut(standardOut);
    return this;
  }

  @Override
  public DotNetProcess setStandardErr(final String standardErr) {
    commandBuilder.setStandardErr(standardErr);
    return this;
  }
}


text:
#if !NOESIS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
#if NOESIS
using Noesis;
#else
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
#endif
using System.Windows.Input;
//using LionFire.Processes;
//using LionFire.Services;
using LionFire.Collections;
using System.Collections;
using System.Collections.Specialized;

namespace LionFire.Avalon
{
    /// <summary>
    /// Interaction logic for LocalProcessMonitorPanel.xaml
    /// </summary>
    public partial class CollectionPropertiesView : UserControl
    {
        public Func<object, object> GetDetailObject = null;
        public Func<object, object> GetDisplayName = null;

#region DetailObject

        /// <summary>
        /// DetailObject Dependency Property
        /// </summary>
        public static readonly DependencyProperty DetailObjectProperty =
            DependencyProperty.Register("DetailObject", typeof(object), typeof(CollectionPropertiesView),
                new FrameworkPropertyMetadata((object)null));

        /// <summary>
        /// Gets or sets the DetailObject property. This dependency property
        /// indicates ....
        /// </summary>
        public object DetailObject
        {
            get { return (object)GetValue(DetailObjectProperty); }
            set { SetValue(DetailObjectProperty, value); }
        }

#endregion

#region ListLocation

        /// <summary>
        /// ListLocation Dependency Property
        /// </summary>
        public static readonly DependencyProperty ListLocationProperty =
            DependencyProperty.Register("ListLocation", typeof(Dock), typeof(CollectionPropertiesView),
                new FrameworkPropertyMetadata((Dock)Dock.Left));

        /// <summary>
        /// Gets or sets the ListLocation property. This dependency property
        /// indicates ....
        /// </summary>
        public Dock ListLocation
        {
            get { return (Dock)GetValue(ListLocationProperty); }
            set { SetValue(ListLocationProperty, value); }
        }

#endregion

        public CollectionPropertiesView()
        {
            InitializeComponent();

            itemsColumnWidth = ItemsColumn.Width;
            this.DataContextChanged += new DependencyPropertyChangedEventHandler(CollectionPropertiesView_DataContextChanged);
            ListView.SelectionChanged += new SelectionChangedEventHandler(ListView_SelectionChanged);
        }

        void CollectionPropertiesView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            this.ListView.ItemsSource = this.DataContext as IEnumerable;

            INotifyCollectionChanged ncc = this.ListView.ItemsSource as INotifyCollectionChanged;
            if(ncc != null)
            {
                ncc.CollectionChanged += new NotifyCollectionChangedEventHandler(ncc_CollectionChanged);
            }
            OnItemsChanged();

        }

        private void OnItemsChanged()
        {
            ItemsColumn.Width = this.ListView.ItemsSource.OfType<object>().Count() > 1 ? itemsColumnWidth : new GridLength(0);
            if (ListView.SelectedItem == null || !this.ListView.ItemsSource.OfType<object>().Contains(ListView.SelectedItem))
            {
                ListView.SelectedItem = this.ListView.ItemsSource.OfType<object>().FirstOrDefault();
            }
        }

        GridLength itemsColumnWidth;
        void ncc_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {

            OnItemsChanged();
        }

        void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //this.PropertyGrid.SelectedObject
            if (GetDetailObject != null)
            {
                DetailObject = GetDetailObject(ListView.SelectedItem);
            }
            else
            {
                DetailObject = ListView.SelectedItem;
            }

            this.ObjectView.DataContext = DetailObject;
        }

        //#region ListItemDisplayConverter

        ///// <summary>
        ///// ListItemDisplayConverter Dependency Property
        ///// </summary>
        //public static readonly DependencyProperty ListItemDisplayConverterProperty =
        //    DependencyProperty.Register("ListItemDisplayConverter", typeof(IValueConverter), typeof(CollectionPropertiesView),
        //        new FrameworkPropertyMetadata((IValueConverter)null));

        ///// <summary>
        ///// Gets or sets the ListItemDisplayConverter property. This dependency property
        ///// indicates ....
        ///// </summary>
        //public IValueConverter ListItemDisplayConverter
        //{
        //    get { return (IValueConverter)GetValue(ListItemDisplayConverterProperty); }
        //    set { SetValue(ListItemDisplayConverterProperty, value); }
        //}

        //#endregion

    }
}
#endif


text:
// ============================================================================
//
// Copyright (c) 2005-2012, Talend Inc.
//
// This source code has been automatically generated by_Talend Open Studio for Data Integration
// CodeGenerator version 5.2.1.r95165
// You can find more information about Talend products at www.talend.com.
// You may distribute this code under the terms of the GNU LGPL license
// http://www.gnu.org/licenses/lgpl.html).
//
// ============================================================================
package routines;

public class DataOperation {

    /**
     * CHAR() Converts a numeric value to its ASCII character string equivalent.
     *
     * {talendTypes} char | Character
     *
     * {Category} DataOperation
     *
     * {param} int(1) i: numeric value
     *
     * {example} CHAR(1):int
     *
     */
    public static char CHAR(int i) {
        return Character.forDigit(i, 10);
    }

    /**
     * DTX( ) Converts a decimal integer into its hexadecimal equivalent.
     *
     * {talendTypes} String
     *
     * {Category} DataOperation
     *
     * {param} int(1) i:decimal integer
     *
     * {example} DTX(1)
     *
     */
    public static String DTX(int i) {
        return Integer.toHexString(i);
    }

    /**
     * FIX(double) Rounds a number of type Double to a number of type Long with the precision specified in the PRECISION
     * statement.
     *
     * {talendTypes} long | Long
     *
     * {Category} DataOperation
     *
     * {param} double (0.0) d:double number
     *
     * {example} FIX(3.14)
     *
     */
    public static long FIX(double d) {
        return Math.round(d);
    }

    /**
     * XTD( ) Converts a hexadecimal string into its decimal equivalent.
     *
     * {talendTypes} int | Integer
     *
     * {Category} DataOperation
     *
     * {param} string ("0") text: hexadecimal string
     *
     * {example} XTD(\"1\")
     *
     */
    public static int XTD(String text) {
        return Integer.valueOf(text, 16);
    }
}


text:
FaceLandmarkInfo::FaceLandmarkInfo() {
  // TODO(widl-nan): init your members
}

FaceLandmarkInfo::FaceLandmarkInfo(const FaceLandmarkInfo& rhs) {
  // TODO(widl-nan): copy from rhs if you want this behavior
  // Or mark ctor = delete in face_landmark_info.h
}

FaceLandmarkInfo::~FaceLandmarkInfo() {
  landmarks_.FreeArray();
}

FaceLandmarkInfo& FaceLandmarkInfo::operator = (const FaceLandmarkInfo& rhs) {
  if (&rhs != this) {
    // TODO(widl-nan): copy members from rhs
  }

  return *this;
}


text:
import Cache from './cache';

class AjaxCache extends Cache {
  constructor() {
    super();
    this.pendingRequests = { };
  }

  retrieve(endpoint, forceRetrieve) {
    if (this.hasData(endpoint) && !forceRetrieve) {
      return Promise.resolve(this.get(endpoint));
    }

    let pendingRequest = this.pendingRequests[endpoint];

    if (!pendingRequest) {
      pendingRequest = new Promise((resolve, reject) => {
        // jQuery 2 is not Promises/A+ compatible (missing catch)
        $.ajax(endpoint) // eslint-disable-line promise/catch-or-return
        .then(data => resolve(data),
          (jqXHR, textStatus, errorThrown) => {
            const error = new Error(`${endpoint}: ${errorThrown}`);
            error.textStatus = textStatus;
            reject(error);
          },
        );
      })
      .then((data) => {
        this.internalStorage[endpoint] = data;
        delete this.pendingRequests[endpoint];
      })
      .catch((error) => {
        delete this.pendingRequests[endpoint];
        throw error;
      });

      this.pendingRequests[endpoint] = pendingRequest;
    }

    return pendingRequest.then(() => this.get(endpoint));
  }
}

export default new AjaxCache();


text:
package com.creasylai.yt_app.consts;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by laicreasy on 15/11/25.
 */
public class AppPreferenceCache {

	private static AppPreferenceCache mInstance;
	private Context mCtx;
	private SharedPreferences sharedPreferences;
	private SharedPreferences.Editor editor;

	private AppPreferenceCache(Context context) {
		// getApplicationContext() is key, it keeps you from leaking the
		// Activity or BroadcastReceiver if someone passes one in.
		mCtx = context.getApplicationContext();
		sharedPreferences = mCtx.getSharedPreferences(AppConst.STATIC_STRING_KEY.APP_SHARE_PREFERENCE, Context.MODE_PRIVATE);
		editor = sharedPreferences.edit();
	}

	public static synchronized AppPreferenceCache getInstance(Context context) {
		if (mInstance == null) {
			mInstance = new AppPreferenceCache(context);
		}
		return mInstance;
	}

}


text:
import { Connector } from '../src/connector'
import { config } from './connection-params'
import { expect } from 'chai'
import * as rethinkdb from 'rethinkdb'

describe('it  distributes  records  between  multiple  tables',  () => {
  let storageConnector: Connector
  let conn: rethinkdb.Connection

  before(async () => {
    storageConnector = new Connector(config, { logger: { getNameSpace: () => ({
      fatal: (e: any, m: any) => {
        console.error('Fatal exception', e, m)
      }
    })
    }})
    await storageConnector.whenReady()

    conn = (storageConnector as any).connection

    try {
      await rethinkdb.db(config.db).tableDrop(  'dsTestA'  ).run(conn)
      await rethinkdb.db(config.db).tableDrop(  'dsTestB'  ).run(conn)
      await rethinkdb.db(config.db).tableDrop(  'dsTestDefault'  ).run(conn)
    } catch (e) {

    }
    await (storageConnector as any).tableManager.refreshTables()
  })

  // tslint:disable-next-line: no-unused-expression
  const tableNames = ['dsTestA', 'dsTestB']
  for (let i = 0; i < tableNames.length; i++) {
    const tableName = tableNames[i]

    it(`sets  a  value  for  ${tableName}`,  (done) =>   {
      storageConnector.set(`${tableName}/valueA`, 12, { isIn:  tableName },  () => { done() }  )
    })

    it(`has  created  ${tableName}`,  async () =>   {
      const tableList = await rethinkdb.db(config.db).tableList().run(conn)
      expect(  tableList.indexOf( tableName )  ).not.to.equal(  -1  )
    })

    it(`has  written  the  record  to  ${tableName}`,  async () =>   {
      const record = await rethinkdb
        .table(tableName)
        .get('valueA')
        .run(conn)
      expect(record).to.deep.equal({ __ds: { _v: 12 }, own_primary_key: 'valueA', isIn: tableName  })
    })

    it(`creates  and  immediatly  updates  a  value  for  ${tableName}`,  (  done  ) => {
      let  firstInsertionComplete  =  false

      storageConnector.set(`${tableName}/someTest`, 2, { state:  'A' },  (  error  ) => {
        expect(  firstInsertionComplete  ).to.equal(  false  )
        expect(  error  ).to.equal(  null  )
        firstInsertionComplete  = true
      })

      storageConnector.set(`${tableName}/someTest`, 3, { state:  'B' },  (  error  ) => {
        expect(  firstInsertionComplete  ).to.equal(  true  )
        expect(  error  ).to.equal(  null  )

        storageConnector.get(`${tableName}/someTest`,  ( e, version, value  ) => {
          expect(  e  ).to.equal(  null  )
          expect(  value  ).to.deep.equal({  state:  'B'  })
          done()
        })
      })
    })
  }
})


text:
<?php

declare(strict_types = 1);

namespace Saber\Data\IRatio {

	use \Saber\Core;
	use \Saber\Data;
	use \Saber\Data\IFractional;
	use \Saber\Data\IInt32;
	use \Saber\Data\IRatio;
	use \Saber\Data\IString;
	use \Saber\Throwable;

	final class Type extends Data\Type implements IFractional\Type {

		#region Traits

		use Core\Dispatcher;

		#endregion

		#region Properties

		/**
		 * This variable stores the class path to this class' module.
		 *
		 * @access protected
		 * @static
		 * @var string
		 */
		protected static $module = '\\Saber\\Data\\IRatio\\Module';

		/**
		 * This variable stores references to commonly used singletons.
		 *
		 * @access protected
		 * @static
		 * @var array
		 */
		protected static $singletons = array();

		#endregion

		#region Methods -> Initialization

		/**
		 * This method enforces that the specified class is a covariant.
		 *
		 * @access public
		 * @static
		 * @param IRatio\Type $x                                    the class to be evaluated
		 * @return IRatio\Type                                      the class
		 */
		public static function covariant(IRatio\Type $x) : IRatio\Type {
			return $x;
		}

		/**
		 * This method returns a value as a boxed object.  A value is typically a PHP typed
		 * primitive or object.  It is considered "not" type-safe.
		 *
		 * @access public
		 * @static
		 * @param mixed $value                                      the value(s) to be boxed
		 * @return IRatio\Type                                      the boxed object
		 */
		public static function box($value/*...*/) : IRatio\Type {
			$values = (is_array($value)) ? $value : func_get_args();
			$values = array_map(function($value) {
				return ($value instanceof IInt32\Type) ? $value : IInt32\Type::box($value);
			}, $values);
			return new IRatio\Type($values[0], $values[1]);
		}

		/**
		 * This method returns a value as a boxed object.  A value is typically a PHP typed
		 * primitive or object.  It is considered type-safe.
		 *
		 * @access public
		 * @static
		 * @param mixed $value                                      the value(s) to be boxed
		 * @return IRatio\Type                                      the boxed object
		 */
		public static function make($value/*...*/) : IRatio\Type {
			$values = (is_array($value)) ? $value : func_get_args();
			$values = array_map(function($value) {
				return ($value instanceof IInt32\Type) ? $value : IInt32\Type::make($value);
			}, $values);

			$denominator = $values[1];

			$signum = IInt32\Module::signum($denominator)->unbox();
			if ($signum == 0) {
				throw new Throwable\InvalidArgument\Exception('Unable to create ratio. Denominator must not be zero.');
			}

			$numerator = $values[0];

			if (IInt32\Module::signum($numerator)->unbox() == 0) {
				return IRatio\Type::zero();
			}

			if ($signum < 0) {
				$numerator = IInt32\Module::negate($numerator);
				$denominator = IInt32\Module::negate($denominator);
			}

			$gcd = IInt32\Module::gcd($numerator, $denominator);
			if (!IInt32\Module::eq($gcd, IInt32\Type::one())->unbox()) {
				$numerator = IInt32\Module::divide($numerator, $gcd);
				$denominator = IInt32\Module::divide($denominator, $gcd);
			}

			return new IRatio\Type($numerator, $denominator);
		}

		/**
		 * This method returns an object with a "-1" value.
		 *
		 * @access public
		 * @static
		 * @return IRatio\Type                                      the object
		 */
		public static function negative() : IRatio\Type {
			if (!isset(static::$singletons[-1])) {
				static::$singletons[-1] = new IRatio\Type(IInt32\Type::negative(), IInt32\Type::one());
			}
			return static::$singletons[-1];
		}

		/**
		 * This method returns an object with a "1" value.
		 *
		 * @access public
		 * @static
		 * @return IRatio\Type                                      the object
		 */
		public static function one() {
			if (!isset(static::$singletons[1])) {
				static::$singletons[1] = new IRatio\Type(IInt32\Type::one(), IInt32\Type::one());
			}
			return static::$singletons[1];
		}

		/**
		 * This method returns an object with a "0" value.
		 *
		 * @access public
		 * @static
		 * @return IRatio\Type                                      the object
		 */
		public static function zero() {
			if (!isset(static::$singletons[0])) {
				static::$singletons[0] = new IRatio\Type(IInt32\Type::zero(), IInt32\Type::one());
			}
			return static::$singletons[0];
		}

		#endregion

		#region Methods -> Native Oriented

		/**
		 * This constructor initializes the class with the specified value.
		 *
		 * @access public
		 * @final
		 * @param IInt32\Type $numerator                            the numerator
		 * @param IInt32\Type $denominator                          the denominator
		 */
		public final function __construct(IInt32\Type $numerator, IInt32\Type $denominator) {
			$this->value = array($numerator, $denominator);
		}

		/**
		 * This method returns the denominator.
		 *
		 * @access public
		 * @final
		 * @return int                                              the denominator
		 */
		public final function __denominator() : int {
			return $this->denominator()->unbox();
		}

		/**
		 * This method returns the object's hash code.
		 *
		 * @access public
		 * @final
		 * @return string                                           the object's hash code
		 */
		public final function __hashCode() : string {
			return $this->__toString();
		}

		/**
		 * This method returns the numerator.
		 *
		 * @access public
		 * @final
		 * @return int                                              the numerator
		 */
		public final function __numerator() : int {
			return $this->numerator()->unbox();
		}

		/**
		 * This method returns the object as a string.
		 *
		 * @access public
		 * @final
		 * @return string                                           the object as a string
		 */
		public final function __toString() {
			return sprintf('%d / %d', $this->__numerator(), $this->__denominator());
		}

		#endregion

		#region Methods -> Object Oriented

		/**
		 * This method returns the denominator.
		 *
		 * @access public
		 * @final
		 * @return IInt32\Type                                      the denominator
		 */
		public final function denominator() : IInt32\Type {
			return $this->value[1];
		}

		/**
		 * This method returns the numerator.
		 *
		 * @access public
		 * @final
		 * @return IInt32\Type                                      the numerator
		 */
		public final function numerator() : IInt32\Type {
			return $this->value[0];
		}

		/**
		 * This method returns the values contained within the boxed object.
		 *
		 * @access public
		 * @final
		 * @param int $depth                                        how many levels to unbox
		 * @return array                                            the un-boxed values
		 */
		public final function unbox(int $depth = 0) {
			if ($depth > 0) {
				return array($this->__numerator(), $this->__denominator());
			}
			return $this->value;
		}

		#endregion

	}

}