text:
<?php

namespace Oro\Bundle\TrackingBundle\Tests\Functional\Command;

use Symfony\Component\Filesystem\Filesystem;

use Oro\Bundle\ImportExportBundle\Processor\ProcessorRegistry;
use Oro\Bundle\TestFrameworkBundle\Test\WebTestCase;

/**
 * @dbIsolation
 */
class ImportLogsCommandTest extends WebTestCase
{
    /**
     * @var Filesystem
     */
    protected $fs;

    /**
     * @var string
     */
    protected $directory;

    /**
     * @var string
     */
    protected $logsDir;

    protected function setUp()
    {
        $this->initClient();

        $this->fs = new Filesystem();

        $this->directory = sys_get_temp_dir() . DIRECTORY_SEPARATOR . time();

        $this->getContainer()->get('akeneo_batch.job_repository')->getJobManager()->beginTransaction();
    }

    protected function tearDown()
    {
        // clear DB from separate connection, close to avoid connection limit and memory leak
        $manager = $this->getContainer()->get('akeneo_batch.job_repository')->getJobManager();
        $manager->rollback();
        $manager->getConnection()->close();

        $this->fs->remove($this->directory);
        parent::tearDown();
    }

    public function testDirectoryEmpty()
    {
        $this->assertFalse($this->fs->exists($this->directory));

        $result = $this->runCommand(
            'oro:cron:import-tracking',
            ['--directory' => $this->directory]
        );
        $this->assertTrue($this->fs->exists($this->directory));
        $this->assertContains('Logs not found', $result);
    }

    public function testFileProcessed()
    {
        $date = new \DateTime('now', new \DateTimeZone('UTC'));
        $file = $date->modify('-1 day')->format('Ymd-H') . '-60-1.log';

        $this->fs->dumpFile(
            $this->directory . DIRECTORY_SEPARATOR . $file,
            json_encode(['prop' => 'value'])
        );

        $result = $this->runCommand(
            'oro:cron:import-tracking',
            ['--directory' => $this->directory]
        );
        $this->assertFileNotExists($this->directory . DIRECTORY_SEPARATOR . $file);
        $this->assertContains(sprintf('Successful: "%s"', $file), $result);
    }

    public function testCurrentFileNotProcessed()
    {
        $date = new \DateTime('now', new \DateTimeZone('UTC'));
        $file = $date->format('Ymd-H') . '-60-1.log';

        $this->fs->dumpFile(
            $this->directory . DIRECTORY_SEPARATOR . $file,
            json_encode(['prop' => 'value'])
        );

        $result = $this->runCommand(
            'oro:cron:import-tracking',
            ['--directory' => $this->directory]
        );
        $this->assertFileExists($this->directory . DIRECTORY_SEPARATOR . $file);
        $this->assertNotContains(sprintf('Successful: "%s"', $file), $result);
    }

    public function testIsFileProcessed()
    {
        $date = new \DateTime('now', new \DateTimeZone('UTC'));
        $fileName = $date->modify('-1 day')->format('Ymd-H') . '-60-1.log';
        $file = $this->directory . DIRECTORY_SEPARATOR . $fileName;

        $this->fs->dumpFile($file, json_encode(['prop' => 'value']));

        $jobResult = $this->getContainer()->get('oro_importexport.job_executor')->executeJob(
            ProcessorRegistry::TYPE_IMPORT,
            'import_log_to_database',
            [
                ProcessorRegistry::TYPE_IMPORT => [
                    'entityName' => $this->getContainer()->getParameter('oro_tracking.tracking_data.class'),
                    'processorAlias' => 'oro_tracking.processor.data',
                    'file' => $file,
                ],
            ]
        );
        $this->assertTrue($jobResult->isSuccessful());

        $result = $this->runCommand(
            'oro:cron:import-tracking',
            ['--directory' => $this->directory]
        );
        $this->assertFileNotExists($this->directory . DIRECTORY_SEPARATOR . $file);
        $this->assertContains(sprintf('"%s" already processed', $fileName), $result);
    }
}


text:
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>

#include "defs.h"

static void __attribute__((noreturn))
usage(bool fail)
{
	fprintf(stdout,
	    "Usage: xbps-rindex [OPTIONS] MODE ARGUMENTS\n\n"
	    "OPTIONS\n"
	    " -d --debug                        Debug mode shown to stderr\n"
	    " -f --force                        Force mode to overwrite entry in add mode\n"
	    " -h --help                         Show help usage\n"
	    " -v --verbose                      Verbose messages\n"
	    " -V --version                      Show XBPS version\n"
	    "    --privkey <key>                Path to the private key for signing\n"
	    "    --signedby <string>            Signature details, i.e \"name <email>\"\n\n"
	    "MODE\n"
	    " -a --add <repodir/pkg> ...        Add package(s) to repository index\n"
	    " -c --clean <repodir>              Clean repository index\n"
	    " -r --remove-obsoletes <repodir>   Removes obsolete packages from repository\n"
	    " -s --sign <repodir>               Initialize repository metadata signature\n"
	    " -S --sign-pkg archive.xbps ...    Sign binary package archive\n\n");
	exit(fail ? EXIT_FAILURE : EXIT_SUCCESS);
}

int
main(int argc, char **argv)
{
	const char *shortopts = "acdfhrsSVv";
	struct option longopts[] = {
		{ "add", no_argument, NULL, 'a' },
		{ "clean", no_argument, NULL, 'c' },
		{ "debug", no_argument, NULL, 'd' },
		{ "force", no_argument, NULL, 'f' },
		{ "help", no_argument, NULL, 'h' },
		{ "remove-obsoletes", no_argument, NULL, 'r' },
		{ "version", no_argument, NULL, 'V' },
		{ "verbose", no_argument, NULL, 'v' },
		{ "privkey", required_argument, NULL, 0},
		{ "signedby", required_argument, NULL, 1},
		{ "sign", no_argument, NULL, 's'},
		{ "sign-pkg", no_argument, NULL, 'S'},
		{ NULL, 0, NULL, 0 }
	};
	struct xbps_handle xh;
	const char *privkey = NULL, *signedby = NULL;
	int rv, c, flags = 0;
	bool add_mode, clean_mode, rm_mode, sign_mode, sign_pkg_mode, force;

	add_mode = clean_mode = rm_mode = sign_mode = sign_pkg_mode = force = false;

	while ((c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) {
		switch (c) {
		case 0:
			privkey = optarg;
			break;
		case 1:
			signedby = optarg;
			break;
		case 'a':
			add_mode = true;
			break;
		case 'c':
			clean_mode = true;
			break;
		case 'd':
			flags |= XBPS_FLAG_DEBUG;
			break;
		case 'f':
			force = true;
			break;
		case 'h':
			usage(false);
			/* NOTREACHED */
		case 'r':
			rm_mode = true;
			break;
		case 's':
			sign_mode = true;
			break;
		case 'S':
			sign_pkg_mode = true;
			break;
		case 'v':
			flags |= XBPS_FLAG_VERBOSE;
			break;
		case 'V':
			printf("%s\n", XBPS_RELVER);
			exit(EXIT_SUCCESS);
		}
	}
	if ((argc == optind) ||
	    (!add_mode && !clean_mode && !rm_mode && !sign_mode && !sign_pkg_mode)) {
		usage(true);
	} else if ((add_mode && (clean_mode || rm_mode || sign_mode || sign_pkg_mode)) ||
		   (clean_mode && (add_mode || rm_mode || sign_mode || sign_pkg_mode)) ||
		   (rm_mode && (add_mode || clean_mode || sign_mode || sign_pkg_mode)) ||
		   (sign_mode && (add_mode || clean_mode || rm_mode || sign_pkg_mode)) ||
		   (sign_pkg_mode && (add_mode || clean_mode || rm_mode || sign_mode))) {
		fprintf(stderr, "Only one mode can be specified: add, clean, "
		    "remove-obsoletes, sign or sign-pkg.\n");
		exit(EXIT_FAILURE);
	}

	/* initialize libxbps */
	memset(&xh, 0, sizeof(xh));
	xh.flags = flags;
	if ((rv = xbps_init(&xh)) != 0) {
		fprintf(stderr, "failed to initialize libxbps: %s\n",
		    strerror(rv));
		exit(EXIT_FAILURE);
	}

	if (add_mode)
		rv = index_add(&xh, optind, argc, argv, force);
	else if (clean_mode)
		rv = index_clean(&xh, argv[optind]);
	else if (rm_mode)
		rv = remove_obsoletes(&xh, argv[optind]);
	else if (sign_mode)
		rv = sign_repo(&xh, argv[optind], privkey, signedby);
	else if (sign_pkg_mode)
		rv = sign_pkgs(&xh, optind, argc, argv, privkey, force);

	exit(rv ? EXIT_FAILURE : EXIT_SUCCESS);
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace KmeCnin\Bundle\FumbleManiaBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use FOS\UserBundle\Entity\User as BaseUser;

/**
 * User.
 *
 * @ORM\Entity
 * @ORM\Table(name="fos_user")
 */
class User extends BaseUser
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * First name.
     *
     * @ORM\Column(name="firstName", type="string", length=50)
     *
     * @Assert\NotBlank(
     *      message = "assert.not_blank.message"
     * )
     * @Assert\Length(
     *      max = "50",
     *      maxMessage = "assert.length.max_message (50)"
     * )
     */
    protected $firstName;

    /**
     * Last name.
     *
     * @ORM\Column(name="lastName", type="string", length=50)
     *
     * @Assert\NotBlank(
     *      message = "assert.not_blank.message"
     * )ert\Length(
     *      max = "50",
     *      maxMessage = "assert.length.max_message (50)"
     * )
     */
    protected $lastName;

    /**
     * Get firstName.
     *
     * @return string
     */
    public function getFirstName()
    {
        return $this->firstName;
    }

    /**
     * Get lastName.
     *
     * @return string
     */
    public function getLastName()
    {
        return $this->lastName;
    }

    /**
     * Set firstName.
     *
     * @param string
     *
     * @return User
     */
    public function setFirstName($firstName)
    {
        $this->firstName = $firstName;
        return $this;
    }

    /**
     * Set lastName.
     *
     * @param string
     *
     * @return User
     */
    public function setLastName($lastName)
    {
        $this->lastName = $lastName;
        return $this;
    }

    public function __toString()
    {
        return (string) $this->firstName;
    }
}


text:
describe('makeSelectCourseListDomain', () => {
  it('Expect to have unit tests specified', () => {
    expect(true).toEqual(false);
  });
});


text:
package chikurin

import (
	"fmt"
	"time"

	latest "github.com/tcnksm/go-latest"
)

const TIMEOUT_SEC = 1

func verCheck(version string) <-chan *latest.CheckResponse {
	verCheckCh := make(chan *latest.CheckResponse)

	go func() {
		fixFunc := latest.DeleteFrontV()
		githubTag := &latest.GithubTag{
			Owner:             "hico-horiuchi",
			Repository:        "chikurin",
			FixVersionStrFunc: fixFunc,
		}

		res, _ := latest.Check(githubTag, fixFunc(version))
		verCheckCh <- res
	}()

	return verCheckCh
}

func Version(version string) string {
	var print []byte
	print = append(print, fmt.Sprintf("chikurin version %s\n", version)...)
	verCheckCh := verCheck(version)

	for {
		select {
		case res := <-verCheckCh:
			if res != nil && res.Outdated {
				print = append(print, fmt.Sprintf("Latest version of chikurin is %s, please update it\n", res.Current)...)
			}
			return string(print)
		case <-time.After(TIMEOUT_SEC * time.Second):
			return string(print)
		}
	}
}


text:
'use strict';

exports.__esModule = true;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var ComposeMarkdownHint = function (_Component) {
  _inherits(ComposeMarkdownHint, _Component);

  function ComposeMarkdownHint() {
    _classCallCheck(this, ComposeMarkdownHint);

    return _possibleConstructorReturn(this, _Component.apply(this, arguments));
  }

  ComposeMarkdownHint.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
    return nextProps.isActive !== this.props.isActive;
  };

  ComposeMarkdownHint.prototype.render = function render() {
    var intl = this.context.intl;

    var className = (0, _classnames2.default)('compose__markdown-hint', {
      'compose__markdown-hint--active': this.props.isActive
    });

    return _react2.default.createElement(
      'div',
      { className: className },
      _react2.default.createElement(
        'b',
        null,
        '*',
        intl.messages['compose.markdown.bold'],
        '*'
      ),
      '\xA0\xA0',
      _react2.default.createElement(
        'i',
        null,
        '_',
        intl.messages['compose.markdown.italic'],
        '_'
      ),
      '\xA0\xA0',
      _react2.default.createElement(
        'code',
        null,
        '```',
        intl.messages['compose.markdown.preformatted'],
        '```'
      )
    );
  };

  return ComposeMarkdownHint;
}(_react.Component);

ComposeMarkdownHint.contextTypes = {
  intl: _react.PropTypes.object.isRequired
};
ComposeMarkdownHint.propTypes = {
  isActive: _react.PropTypes.bool.isRequired
};
exports.default = ComposeMarkdownHint;
//# sourceMappingURL=ComposeMarkdownHint.react.js.map


text:
namespace $.$$ {

	export class $mol_touch extends $.$mol_touch {

		auto() {
			this.pointer_events()
			this.start_pan()
			this.start_pos()
			this.start_distance()
			this.start_zoom()
			this.action_type()
			this.view_rect()
		}

		@ $mol_mem
		pointer_events( next = [] as readonly PointerEvent[] ) {
			return next
		}

		@ $mol_mem
		pointer_coords() {

			const events = this.pointer_events()
			const touches = events.filter( e => e.pointerType === 'touch' )
			const pens = events.filter( e => e.pointerType === 'pen' )
			const mouses = events.filter( e => !e.pointerType || e.pointerType === 'mouse' )
			const choosen = touches.length ? touches : pens.length ? pens : mouses

			return new $mol_vector(
				... choosen.map( event => this.event_coords( event ) )
			)

		}

		@ $mol_mem
		pointer_center() {
			const coords = this.pointer_coords()
			return coords.length ? coords.center() : new $mol_vector_2d( NaN , NaN )
		}

		event_coords( event: PointerEvent | WheelEvent ) {

			const { left, top } = this.view_rect()!

			return new $mol_vector_2d(
				Math.round( event.pageX - left ),
				Math.round( event.pageY - top ),
			)

		}

		@ $mol_mem
		action_point() {

			const coord = this.pointer_center()
			if( !coord ) return null!

			const zoom = this.zoom()
			const pan = this.pan()

			return new $mol_vector_2d(
				( coord.x - pan.x ) / zoom,
				( coord.y - pan.y ) / zoom,
			)

		}

		event_eat( event: PointerEvent | WheelEvent ) {

			if( event instanceof PointerEvent ) {

				const events = this.pointer_events()
					.filter( e => e instanceof PointerEvent )
					.filter( e => e.pointerId !== event.pointerId )
				if( event.type !== 'pointerup' && event.type !== 'pointerleave' ) events.push( event )
				this.pointer_events( events )

				const touch_count = events.filter( e => e.pointerType === 'touch' ).length

				if( this.allow_zoom() && touch_count === 2 ) {
					return this.action_type( 'zoom' )
				}

				if( this.action_type() === 'zoom' && touch_count === 1 ) {
					return this.action_type( 'zoom' )
				}

				enum button {
					left = 1,
					right = 2,
					middle = 4,
				}

				if( events.length > 0 ) {
					if( event.ctrlKey && this.allow_zoom() ) return this.action_type( 'zoom' )
					if( event.buttons === button.left && this.allow_draw() ) return this.action_type( 'draw' )
					if( event.buttons && this.allow_pan() ) return this.action_type( 'pan' )
				}

				return this.action_type( '' )

			}

			if( event instanceof WheelEvent ) {
				this.pointer_events([ event as any ])
				if( event.shiftKey ) return this.action_type( 'pan' )
				return this.action_type( 'zoom' )
			}

			return this.action_type( '' )
		}

		event_start( event : PointerEvent ) {
			if( event.defaultPrevented ) return

			this.start_pan( this.pan() )

			const action_type = this.event_eat( event )
			if( !action_type ) return

			const coords = this.pointer_coords()
			this.start_pos( coords.center() )

			if( action_type === 'draw' ) {
				this.draw_start( event )
				return
			}

			this.start_distance( coords.distance() )
			this.start_zoom( this.zoom() )

		}

		event_move( event : PointerEvent ) {
			if( event.defaultPrevented ) return

			const rect = this.view_rect()
			if( !rect ) return

			const start_pan = this.start_pan()

			const action_type = this.event_eat( event )

			const start_pos = this.start_pos()
			let pos = this.pointer_center()!

			if( !action_type ) return
			if( action_type === 'draw' ) {

				const distance = new $mol_vector( start_pos, pos ).distance()
				if( distance >= 4 ) {
					this.draw( event )
				}
				return
			}

			if( !start_pos ) return

			if( action_type === 'pan' ) {

				this.dom_node().setPointerCapture( event.pointerId )

				this.pan(
					new $mol_vector_2d(
						start_pan[0] + pos[0] - start_pos[0],
						start_pan[1] + pos[1] - start_pos[1],
					)
				)

			}

			const precision = this.swipe_precision()

			if(
				(
					this.swipe_right !== $mol_touch.prototype.swipe_right
					|| this.swipe_from_left !== $mol_touch.prototype.swipe_from_left
					|| this.swipe_to_right !== $mol_touch.prototype.swipe_to_right
				)
				&& pos[0] - start_pos[0] > precision * 2
				&& Math.abs( pos[1] - start_pos[1] ) < precision
			) {
				this.swipe_right( event )
			}

			if(
				(
					this.swipe_left !== $mol_touch.prototype.swipe_left
					|| this.swipe_from_right !== $mol_touch.prototype.swipe_from_right
					|| this.swipe_to_left !== $mol_touch.prototype.swipe_to_left
				)
				&& start_pos[0] - pos[0] > precision * 2
				&& Math.abs( pos[1] - start_pos[1] ) < precision
			) {
				this.swipe_left( event )
			}

			if(
				(
					this.swipe_bottom !== $mol_touch.prototype.swipe_bottom
					|| this.swipe_from_top !== $mol_touch.prototype.swipe_from_top
					|| this.swipe_to_bottom !== $mol_touch.prototype.swipe_to_bottom
				)
				&& pos[1] - start_pos[1] > precision * 2
				&& Math.abs( pos[0] - start_pos[0] ) < precision
			) {
				this.swipe_bottom( event )
			}

			if(
				(
					this.swipe_top !== $mol_touch.prototype.swipe_top
					|| this.swipe_from_bottom !== $mol_touch.prototype.swipe_from_bottom
					|| this.swipe_to_top !== $mol_touch.prototype.swipe_to_top
				)
				&& start_pos[1] - pos[1] > precision * 2
				&& Math.abs( pos[0] - start_pos[0] ) < precision
			) {
				this.swipe_top( event )
			}

			if( action_type === 'zoom' ) {

				const coords = this.pointer_coords()
				const distance = coords.distance()
				const start_distance = this.start_distance()
				const center = coords.center()

				const start_zoom = this.start_zoom()
				let mult = Math.abs( distance - start_distance ) < 32 ? 1 : distance / start_distance
				this.zoom( start_zoom * mult )

				const pan = new $mol_vector_2d(
					( start_pan[0] - center[0] + pos[0] - start_pos[0] ) * mult + center[0],
					( start_pan[1] - center[1] + pos[1] - start_pos[1] ) * mult + center[1],
				)

				this.pan( pan )

			}

		}

		event_end( event : PointerEvent ) {

			const action = this.action_type()
			if( action ==='draw' ) {
				this.draw_end( event )
			}

			this.event_leave( event )

		}

		event_leave( event : PointerEvent ) {

			this.event_eat( event )
			this.dom_node().releasePointerCapture( event.pointerId )
			this.start_pos( null )

		}

		swipe_left( event : PointerEvent ) {
			if( this.view_rect()!.right - this.start_pos()[0] < this.swipe_precision() * 2 ) this.swipe_from_right( event )
			else this.swipe_to_left( event )
			this.event_end( event )
		}

		swipe_right( event : PointerEvent ) {
			if( this.start_pos()[0] - this.view_rect()!.left < this.swipe_precision() * 2 ) this.swipe_from_left( event )
			else this.swipe_to_right( event )
			this.event_end( event )
		}

		swipe_top( event : PointerEvent ) {
			if( this.view_rect()!.bottom - this.start_pos()[1] < this.swipe_precision() * 2 ) this.swipe_from_bottom( event )
			else this.swipe_to_top( event )
			this.event_end( event )
		}

		swipe_bottom( event : PointerEvent ) {
			if( this.start_pos()[1] - this.view_rect()!.top < this.swipe_precision() * 2 ) this.swipe_from_top( event )
			else this.swipe_to_bottom( event )
			this.event_end( event )
		}

		event_wheel( event : WheelEvent ) {

			if( this.pan === $mol_touch.prototype.pan && this.zoom === $mol_touch.prototype.zoom ) return

			if( this.pan !== $mol_touch.prototype.pan ) {
				event.preventDefault()
			}

			const action_type = this.event_eat( event )

			if( action_type === 'zoom' ) {

				const zoom_prev = this.zoom() || 0.001
				const zoom_next = zoom_prev * ( 1 - .001 * event.deltaY )
				const mult = zoom_next / zoom_prev
				this.zoom( zoom_next )

				const pan_prev = this.pan()
				const center = this.pointer_center()!
				const pan_next = pan_prev.multed0( mult ).added1( center.multed0( 1 - mult ) )

				this.pan( pan_next )
			}

			if( action_type === 'pan' ) {

				const pan_prev = this.pan()
				const pan_next = new $mol_vector_2d(
					pan_prev.x - event.deltaX,
					pan_prev.y - event.deltaY,
				)

				this.pan( pan_next )
			}

		}

	}

}


text:
using System.Xml.Serialization;
using System.Xml.Schema;
using System.Collections.Generic;
using System;
using System.Xml;

namespace FlickrNet
{
    /// <summary>
    /// Contains a list of <see cref="Contact"/> items for a given user.
    /// </summary>
    public sealed class ContactCollection : System.Collections.ObjectModel.Collection<Contact>, IFlickrParsable
    {
        /// <summary>
        /// The total number of contacts that match the calling query.
        /// </summary>
        public int Total { get; set; }
        /// <summary>
        /// The page of the result set that has been returned.
        /// </summary>
        public int Page { get; set; }
        /// <summary>
        /// The number of contacts returned per page.
        /// </summary>
        public int PerPage { get; set; }
        /// <summary>
        /// The number of pages of contacts that are available.
        /// </summary>
        public int Pages { get; set; }

        void IFlickrParsable.Load(System.Xml.XmlReader reader)
        {
            if (reader.LocalName != "contacts")
                UtilityMethods.CheckParsingException(reader);

            while (reader.MoveToNextAttribute())
            {
                switch (reader.LocalName)
                {
                    case "page":
                        Page = int.Parse(reader.Value, System.Globalization.NumberFormatInfo.InvariantInfo);
                        break;
                    case "total":
                        Total = int.Parse(reader.Value, System.Globalization.NumberFormatInfo.InvariantInfo);
                        break;
                    case "pages":
                        Pages = int.Parse(reader.Value, System.Globalization.NumberFormatInfo.InvariantInfo);
                        break;
                    case "per_page":
                    case "perpage":
                        PerPage = int.Parse(reader.Value, System.Globalization.NumberFormatInfo.InvariantInfo);
                        break;
                    default:
                        UtilityMethods.CheckParsingException(reader);
                        break;
                }
            }

            reader.Read();

            while (reader.LocalName == "contact")
            {
                Contact contact = new Contact();
                ((IFlickrParsable)contact).Load(reader);
                Add(contact);
            }

            reader.Skip();
        }
    }

}


text:
var Emitter = require("events").EventEmitter;

function Mock(path) {
  this.isClosed = false;
}

Mock.prototype = Object.create(Emitter.prototype, {
  constructor: {
    value: Mock
  }
});

Mock.prototype.write = function (buffer) {
  // Tests are written to work with arrays not buffers
  // this shouldn"t impact the data, just the container
  // This also should be changed in future test rewrites
  if (Buffer.isBuffer(buffer)) {
    buffer = Array.prototype.slice.call(buffer, 0);
  }

  this.lastWrite = buffer;
  this.emit("write", buffer);
};

/* istanbul ignore next */
Mock.prototype.close = function () {
  this.isClosed = true;
};

var com;
var sp;
var stub = {
  SerialPort: Mock,
  list: function() {},
};

try {
  /* istanbul ignore if */
  if (process.browser || parseFloat(process.versions.nw) >= 0.13) {
    com = require("browser-serialport");
  } else {
    /* istanbul ignore else */
    if (process.env.IS_TEST_MODE) {
      com = stub;
    } else {
      sp = require("serialport");
      com = {
        SerialPort: sp,
        list: sp.list,
      };
    }
  }
} catch (err) {}

/* istanbul ignore if */
if (com == null) {
  if (process.env.IS_TEST_MODE) {
    com = stub;
  } else {
    console.log("It looks like serialport didn't compile properly. This is a common problem and its fix is well documented here https://github.com/voodootikigod/node-serialport#to-install");
    console.log("The result of requiring the package is: ", sp);
    throw "Missing serialport dependency";
  }
}

module.exports = com;


text:
import pandas as pd

### "load"
crimes = pd.read_csv("crimes_final.csv", header = None)

### "inspect-data"
crimes.head(5)

### "append-header"
 crimes.columns = [
     "id",
     "case_number",
     "date",
     "block",
     "iucr",
     "primary_type",
     "description",
     "location_descriptions",
     "arrest",
     "domestic",
     "beat",
     "district",
     "ward",
     "community_area",
     "fbi_code",
     "x_coordinate",
     "y_coordinate",
     "year",
     "updated_on",
     "latitude",
     "longitude"
 ]

### "lowercase-columns"
for column in crimes.columns:
    if crimes[column].dtypes == object:
        crimes[column] = crimes[column].str.lower()

### "whats-missing"
len(crimes.index)
crimes.isnull().sum()

### "remove-empty-cols"
del crimes["district"]
crimes.drop("ward", axis = 1, inplace = True)
crimes = crime.drop("community_area", axis = 1)

### "save-file"
cimes.to_csv("crimes_cleaned.csv")


text:
module StreetNames
  VERSION = "0.2.1"
end


text:
<?php

namespace Models;

class Attachment extends Post {
	protected static $post_type = 'attachment';
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycol. gén. struct. (Paris) 197 (1984)

#### Original name
Microclavaceae Locq.

### Remarks
null


text:
using System.Globalization;
using System.Runtime.InteropServices;
using Xunit;

namespace System.Numerics.Tests
{
    public class Vector2Tests
    {
        [Fact]
        public void Vector2MarshalSizeTest()
        {
            Assert.Equal(8, Marshal.SizeOf<Vector2>());
            Assert.Equal(8, Marshal.SizeOf<Vector2>(new Vector2()));
        }

        [Fact]
        public void Vector2CopyToTest()
        {
            Vector2 v1 = new Vector2(2.0f, 3.0f);

            float[] a = new float[3];
            float[] b = new float[2];

            Assert.Throws<NullReferenceException>(() => v1.CopyTo(null, 0));
            Assert.Throws<ArgumentOutOfRangeException>(() => v1.CopyTo(a, -1));
            Assert.Throws<ArgumentOutOfRangeException>(() => v1.CopyTo(a, a.Length));
            AssertExtensions.Throws<ArgumentException>(null, () => v1.CopyTo(a, 2));

            v1.CopyTo(a, 1);
            v1.CopyTo(b);
            Assert.Equal(0.0, a[0]);
            Assert.Equal(2.0, a[1]);
            Assert.Equal(3.0, a[2]);
            Assert.Equal(2.0, b[0]);
            Assert.Equal(3.0, b[1]);
        }

        [Fact]
        public void Vector2GetHashCodeTest()
        {
            Vector2 v1 = new Vector2(2.0f, 3.0f);
            Vector2 v2 = new Vector2(2.0f, 3.0f);
            Vector2 v3 = new Vector2(3.0f, 2.0f);
            Assert.Equal(v1.GetHashCode(), v1.GetHashCode());
            Assert.Equal(v1.GetHashCode(), v2.GetHashCode());
            Assert.NotEqual(v1.GetHashCode(), v3.GetHashCode());
            Vector2 v4 = new Vector2(0.0f, 0.0f);
            Vector2 v6 = new Vector2(1.0f, 0.0f);
            Vector2 v7 = new Vector2(0.0f, 1.0f);
            Vector2 v8 = new Vector2(1.0f, 1.0f);
            Assert.NotEqual(v4.GetHashCode(), v6.GetHashCode());
            Assert.NotEqual(v4.GetHashCode(), v7.GetHashCode());
            Assert.NotEqual(v4.GetHashCode(), v8.GetHashCode());
            Assert.NotEqual(v7.GetHashCode(), v6.GetHashCode());
            Assert.NotEqual(v8.GetHashCode(), v6.GetHashCode());
            Assert.NotEqual(v8.GetHashCode(), v7.GetHashCode());
        }

        [Fact]
        public void Vector2ToStringTest()
        {
            string separator = CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator;
            CultureInfo enUsCultureInfo = new CultureInfo("en-US");

            Vector2 v1 = new Vector2(2.0f, 3.0f);

            string v1str = v1.ToString();
            string expectedv1 = string.Format(CultureInfo.CurrentCulture
                , "<{1:G}{0} {2:G}>"
                , new object[] { separator, 2, 3 });
            Assert.Equal(expectedv1, v1str);

            string v1strformatted = v1.ToString("c", CultureInfo.CurrentCulture);
            string expectedv1formatted = string.Format(CultureInfo.CurrentCulture
                , "<{1:c}{0} {2:c}>"
                , new object[] { separator, 2, 3 });
            Assert.Equal(expectedv1formatted, v1strformatted);

            string v2strformatted = v1.ToString("c", enUsCultureInfo);
            string expectedv2formatted = string.Format(enUsCultureInfo
                , "<{1:c}{0} {2:c}>"
                , new object[] { enUsCultureInfo.NumberFormat.NumberGroupSeparator, 2, 3 });
            Assert.Equal(expectedv2formatted, v2strformatted);

            string v3strformatted = v1.ToString("c");
            string expectedv3formatted = string.Format(CultureInfo.CurrentCulture
                , "<{1:c}{0} {2:c}>"
                , new object[] { separator, 2, 3 });
            Assert.Equal(expectedv3formatted, v3strformatted);
        }

        // A test for Distance (Vector2f, Vector2f)
        [Fact]
        public void Vector2DistanceTest()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            Vector2 b = new Vector2(3.0f, 4.0f);

            float expected = (float)System.Math.Sqrt(8);
            float actual;

            actual = Vector2.Distance(a, b);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Distance did not return the expected value.");
        }

        // A test for Distance (Vector2f, Vector2f)
        // Distance from the same point
        [Fact]
        public void Vector2DistanceTest2()
        {
            Vector2 a = new Vector2(1.051f, 2.05f);
            Vector2 b = new Vector2(1.051f, 2.05f);

            float actual = Vector2.Distance(a, b);
            Assert.Equal(0.0f, actual);
        }

        // A test for DistanceSquared (Vector2f, Vector2f)
        [Fact]
        public void Vector2DistanceSquaredTest()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            Vector2 b = new Vector2(3.0f, 4.0f);

            float expected = 8.0f;
            float actual;

            actual = Vector2.DistanceSquared(a, b);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.DistanceSquared did not return the expected value.");
        }

        // A test for Dot (Vector2f, Vector2f)
        [Fact]
        public void Vector2DotTest()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            Vector2 b = new Vector2(3.0f, 4.0f);

            float expected = 11.0f;
            float actual;

            actual = Vector2.Dot(a, b);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Dot did not return the expected value.");
        }

        // A test for Dot (Vector2f, Vector2f)
        // Dot test for perpendicular vector
        [Fact]
        public void Vector2DotTest1()
        {
            Vector2 a = new Vector2(1.55f, 1.55f);
            Vector2 b = new Vector2(-1.55f, 1.55f);

            float expected = 0.0f;
            float actual = Vector2.Dot(a, b);
            Assert.Equal(expected, actual);
        }

        // A test for Dot (Vector2f, Vector2f)
        // Dot test with specail float values
        [Fact]
        public void Vector2DotTest2()
        {
            Vector2 a = new Vector2(float.MinValue, float.MinValue);
            Vector2 b = new Vector2(float.MaxValue, float.MaxValue);

            float actual = Vector2.Dot(a, b);
            Assert.True(float.IsNegativeInfinity(actual), "Vector2f.Dot did not return the expected value.");
        }

        // A test for Length ()
        [Fact]
        public void Vector2LengthTest()
        {
            Vector2 a = new Vector2(2.0f, 4.0f);

            Vector2 target = a;

            float expected = (float)System.Math.Sqrt(20);
            float actual;

            actual = target.Length();

            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Length did not return the expected value.");
        }

        // A test for Length ()
        // Length test where length is zero
        [Fact]
        public void Vector2LengthTest1()
        {
            Vector2 target = new Vector2();
            target.X = 0.0f;
            target.Y = 0.0f;

            float expected = 0.0f;
            float actual;

            actual = target.Length();

            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Length did not return the expected value.");
        }

        // A test for LengthSquared ()
        [Fact]
        public void Vector2LengthSquaredTest()
        {
            Vector2 a = new Vector2(2.0f, 4.0f);

            Vector2 target = a;

            float expected = 20.0f;
            float actual;

            actual = target.LengthSquared();

            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.LengthSquared did not return the expected value.");
        }

        // A test for LengthSquared ()
        // LengthSquared test where the result is zero
        [Fact]
        public void Vector2LengthSquaredTest1()
        {
            Vector2 a = new Vector2(0.0f, 0.0f);

            float expected = 0.0f;
            float actual = a.LengthSquared();

            Assert.Equal(expected, actual);
        }

        // A test for Min (Vector2f, Vector2f)
        [Fact]
        public void Vector2MinTest()
        {
            Vector2 a = new Vector2(-1.0f, 4.0f);
            Vector2 b = new Vector2(2.0f, 1.0f);

            Vector2 expected = new Vector2(-1.0f, 1.0f);
            Vector2 actual;
            actual = Vector2.Min(a, b);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Min did not return the expected value.");
        }

        [Fact]
        public void Vector2MinMaxCodeCoverageTest()
        {
            Vector2 min = new Vector2(0, 0);
            Vector2 max = new Vector2(1, 1);
            Vector2 actual;

            // Min.
            actual = Vector2.Min(min, max);
            Assert.Equal(actual, min);

            actual = Vector2.Min(max, min);
            Assert.Equal(actual, min);

            // Max.
            actual = Vector2.Max(min, max);
            Assert.Equal(actual, max);

            actual = Vector2.Max(max, min);
            Assert.Equal(actual, max);
        }

        // A test for Max (Vector2f, Vector2f)
        [Fact]
        public void Vector2MaxTest()
        {
            Vector2 a = new Vector2(-1.0f, 4.0f);
            Vector2 b = new Vector2(2.0f, 1.0f);

            Vector2 expected = new Vector2(2.0f, 4.0f);
            Vector2 actual;
            actual = Vector2.Max(a, b);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Max did not return the expected value.");
        }

        // A test for Clamp (Vector2f, Vector2f, Vector2f)
        [Fact]
        public void Vector2ClampTest()
        {
            Vector2 a = new Vector2(0.5f, 0.3f);
            Vector2 min = new Vector2(0.0f, 0.1f);
            Vector2 max = new Vector2(1.0f, 1.1f);

            // Normal case.
            // Case N1: specified value is in the range.
            Vector2 expected = new Vector2(0.5f, 0.3f);
            Vector2 actual = Vector2.Clamp(a, min, max);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Clamp did not return the expected value.");
            // Normal case.
            // Case N2: specified value is bigger than max value.
            a = new Vector2(2.0f, 3.0f);
            expected = max;
            actual = Vector2.Clamp(a, min, max);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Clamp did not return the expected value.");
            // Case N3: specified value is smaller than max value.
            a = new Vector2(-1.0f, -2.0f);
            expected = min;
            actual = Vector2.Clamp(a, min, max);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Clamp did not return the expected value.");
            // Case N4: combination case.
            a = new Vector2(-2.0f, 4.0f);
            expected = new Vector2(min.X, max.Y);
            actual = Vector2.Clamp(a, min, max);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Clamp did not return the expected value.");
            // User specified min value is bigger than max value.
            max = new Vector2(0.0f, 0.1f);
            min = new Vector2(1.0f, 1.1f);

            // Case W1: specified value is in the range.
            a = new Vector2(0.5f, 0.3f);
            expected = max;
            actual = Vector2.Clamp(a, min, max);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Clamp did not return the expected value.");

            // Normal case.
            // Case W2: specified value is bigger than max and min value.
            a = new Vector2(2.0f, 3.0f);
            expected = max;
            actual = Vector2.Clamp(a, min, max);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Clamp did not return the expected value.");

            // Case W3: specified value is smaller than min and max value.
            a = new Vector2(-1.0f, -2.0f);
            expected = max;
            actual = Vector2.Clamp(a, min, max);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Clamp did not return the expected value.");
        }

        // A test for Lerp (Vector2f, Vector2f, float)
        [Fact]
        public void Vector2LerpTest()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            Vector2 b = new Vector2(3.0f, 4.0f);

            float t = 0.5f;

            Vector2 expected = new Vector2(2.0f, 3.0f);
            Vector2 actual;
            actual = Vector2.Lerp(a, b, t);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Lerp did not return the expected value.");
        }

        // A test for Lerp (Vector2f, Vector2f, float)
        // Lerp test with factor zero
        [Fact]
        public void Vector2LerpTest1()
        {
            Vector2 a = new Vector2(0.0f, 0.0f);
            Vector2 b = new Vector2(3.18f, 4.25f);

            float t = 0.0f;
            Vector2 expected = Vector2.Zero;
            Vector2 actual = Vector2.Lerp(a, b, t);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Lerp did not return the expected value.");
        }

        // A test for Lerp (Vector2f, Vector2f, float)
        // Lerp test with factor one
        [Fact]
        public void Vector2LerpTest2()
        {
            Vector2 a = new Vector2(0.0f, 0.0f);
            Vector2 b = new Vector2(3.18f, 4.25f);

            float t = 1.0f;
            Vector2 expected = new Vector2(3.18f, 4.25f);
            Vector2 actual = Vector2.Lerp(a, b, t);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Lerp did not return the expected value.");
        }

        // A test for Lerp (Vector2f, Vector2f, float)
        // Lerp test with factor > 1
        [Fact]
        public void Vector2LerpTest3()
        {
            Vector2 a = new Vector2(0.0f, 0.0f);
            Vector2 b = new Vector2(3.18f, 4.25f);

            float t = 2.0f;
            Vector2 expected = b * 2.0f;
            Vector2 actual = Vector2.Lerp(a, b, t);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Lerp did not return the expected value.");
        }

        // A test for Lerp (Vector2f, Vector2f, float)
        // Lerp test with factor < 0
        [Fact]
        public void Vector2LerpTest4()
        {
            Vector2 a = new Vector2(0.0f, 0.0f);
            Vector2 b = new Vector2(3.18f, 4.25f);

            float t = -2.0f;
            Vector2 expected = -(b * 2.0f);
            Vector2 actual = Vector2.Lerp(a, b, t);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Lerp did not return the expected value.");
        }

        // A test for Lerp (Vector2f, Vector2f, float)
        // Lerp test with special float value
        [Fact]
        public void Vector2LerpTest5()
        {
            Vector2 a = new Vector2(45.67f, 90.0f);
            Vector2 b = new Vector2(float.PositiveInfinity, float.NegativeInfinity);

            float t = 0.408f;
            Vector2 actual = Vector2.Lerp(a, b, t);
            Assert.True(float.IsPositiveInfinity(actual.X), "Vector2f.Lerp did not return the expected value.");
            Assert.True(float.IsNegativeInfinity(actual.Y), "Vector2f.Lerp did not return the expected value.");
        }

        // A test for Lerp (Vector2f, Vector2f, float)
        // Lerp test from the same point
        [Fact]
        public void Vector2LerpTest6()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            Vector2 b = new Vector2(1.0f, 2.0f);

            float t = 0.5f;

            Vector2 expected = new Vector2(1.0f, 2.0f);
            Vector2 actual = Vector2.Lerp(a, b, t);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Lerp did not return the expected value.");
        }

        // A test for Transform(Vector2f, Matrix4x4)
        [Fact]
        public void Vector2TransformTest()
        {
            Vector2 v = new Vector2(1.0f, 2.0f);
            Matrix4x4 m =
                Matrix4x4.CreateRotationX(MathHelper.ToRadians(30.0f)) *
                Matrix4x4.CreateRotationY(MathHelper.ToRadians(30.0f)) *
                Matrix4x4.CreateRotationZ(MathHelper.ToRadians(30.0f));
            m.M41 = 10.0f;
            m.M42 = 20.0f;
            m.M43 = 30.0f;

            Vector2 expected = new Vector2(10.316987f, 22.183012f);
            Vector2 actual;

            actual = Vector2.Transform(v, m);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Transform did not return the expected value.");
        }

        // A test for Transform(Vector2f, Matrix3x2)
        [Fact]
        public void Vector2Transform3x2Test()
        {
            Vector2 v = new Vector2(1.0f, 2.0f);
            Matrix3x2 m = Matrix3x2.CreateRotation(MathHelper.ToRadians(30.0f));
            m.M31 = 10.0f;
            m.M32 = 20.0f;

            Vector2 expected = new Vector2(9.866025f, 22.23205f);
            Vector2 actual;

            actual = Vector2.Transform(v, m);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Transform did not return the expected value.");
        }

        // A test for TransformNormal (Vector2f, Matrix4x4)
        [Fact]
        public void Vector2TransformNormalTest()
        {
            Vector2 v = new Vector2(1.0f, 2.0f);
            Matrix4x4 m =
                Matrix4x4.CreateRotationX(MathHelper.ToRadians(30.0f)) *
                Matrix4x4.CreateRotationY(MathHelper.ToRadians(30.0f)) *
                Matrix4x4.CreateRotationZ(MathHelper.ToRadians(30.0f));
            m.M41 = 10.0f;
            m.M42 = 20.0f;
            m.M43 = 30.0f;

            Vector2 expected = new Vector2(0.3169873f, 2.18301272f);
            Vector2 actual;

            actual = Vector2.TransformNormal(v, m);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Tranform did not return the expected value.");
        }

        // A test for TransformNormal (Vector2f, Matrix3x2)
        [Fact]
        public void Vector2TransformNormal3x2Test()
        {
            Vector2 v = new Vector2(1.0f, 2.0f);
            Matrix3x2 m = Matrix3x2.CreateRotation(MathHelper.ToRadians(30.0f));
            m.M31 = 10.0f;
            m.M32 = 20.0f;

            Vector2 expected = new Vector2(-0.133974612f, 2.232051f);
            Vector2 actual;

            actual = Vector2.TransformNormal(v, m);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Transform did not return the expected value.");
        }

        // A test for Transform (Vector2f, Quaternion)
        [Fact]
        public void Vector2TransformByQuaternionTest()
        {
            Vector2 v = new Vector2(1.0f, 2.0f);

            Matrix4x4 m =
                Matrix4x4.CreateRotationX(MathHelper.ToRadians(30.0f)) *
                Matrix4x4.CreateRotationY(MathHelper.ToRadians(30.0f)) *
                Matrix4x4.CreateRotationZ(MathHelper.ToRadians(30.0f));
            Quaternion q = Quaternion.CreateFromRotationMatrix(m);

            Vector2 expected = Vector2.Transform(v, m);
            Vector2 actual = Vector2.Transform(v, q);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Transform did not return the expected value.");
        }

        // A test for Transform (Vector2f, Quaternion)
        // Transform Vector2f with zero quaternion
        [Fact]
        public void Vector2TransformByQuaternionTest1()
        {
            Vector2 v = new Vector2(1.0f, 2.0f);
            Quaternion q = new Quaternion();
            Vector2 expected = v;

            Vector2 actual = Vector2.Transform(v, q);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Transform did not return the expected value.");
        }

        // A test for Transform (Vector2f, Quaternion)
        // Transform Vector2f with identity quaternion
        [Fact]
        public void Vector2TransformByQuaternionTest2()
        {
            Vector2 v = new Vector2(1.0f, 2.0f);
            Quaternion q = Quaternion.Identity;
            Vector2 expected = v;

            Vector2 actual = Vector2.Transform(v, q);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Transform did not return the expected value.");
        }

        // A test for Normalize (Vector2f)
        [Fact]
        public void Vector2NormalizeTest()
        {
            Vector2 a = new Vector2(2.0f, 3.0f);
            Vector2 expected = new Vector2(0.554700196225229122018341733457f, 0.8320502943378436830275126001855f);
            Vector2 actual;

            actual = Vector2.Normalize(a);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Normalize did not return the expected value.");
        }

        // A test for Normalize (Vector2f)
        // Normalize zero length vector
        [Fact]
        public void Vector2NormalizeTest1()
        {
            Vector2 a = new Vector2(); // no parameter, default to 0.0f
            Vector2 actual = Vector2.Normalize(a);
            Assert.True(float.IsNaN(actual.X) && float.IsNaN(actual.Y), "Vector2f.Normalize did not return the expected value.");
        }

        // A test for Normalize (Vector2f)
        // Normalize infinite length vector
        [Fact]
        public void Vector2NormalizeTest2()
        {
            Vector2 a = new Vector2(float.MaxValue, float.MaxValue);
            Vector2 actual = Vector2.Normalize(a);
            Vector2 expected = new Vector2(0, 0);
            Assert.Equal(expected, actual);
        }

        // A test for operator - (Vector2f)
        [Fact]
        public void Vector2UnaryNegationTest()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);

            Vector2 expected = new Vector2(-1.0f, -2.0f);
            Vector2 actual;

            actual = -a;

            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.operator - did not return the expected value.");
        }

        // A test for operator - (Vector2f)
        // Negate test with special float value
        [Fact]
        public void Vector2UnaryNegationTest1()
        {
            Vector2 a = new Vector2(float.PositiveInfinity, float.NegativeInfinity);

            Vector2 actual = -a;

            Assert.True(float.IsNegativeInfinity(actual.X), "Vector2f.operator - did not return the expected value.");
            Assert.True(float.IsPositiveInfinity(actual.Y), "Vector2f.operator - did not return the expected value.");
        }

        // A test for operator - (Vector2f)
        // Negate test with special float value
        [Fact]
        public void Vector2UnaryNegationTest2()
        {
            Vector2 a = new Vector2(float.NaN, 0.0f);
            Vector2 actual = -a;

            Assert.True(float.IsNaN(actual.X), "Vector2f.operator - did not return the expected value.");
            Assert.True(float.Equals(0.0f, actual.Y), "Vector2f.operator - did not return the expected value.");
        }

        // A test for operator - (Vector2f, Vector2f)
        [Fact]
        public void Vector2SubtractionTest()
        {
            Vector2 a = new Vector2(1.0f, 3.0f);
            Vector2 b = new Vector2(2.0f, 1.5f);

            Vector2 expected = new Vector2(-1.0f, 1.5f);
            Vector2 actual;

            actual = a - b;

            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.operator - did not return the expected value.");
        }

        // A test for operator * (Vector2f, float)
        [Fact]
        public void Vector2MultiplyOperatorTest()
        {
            Vector2 a = new Vector2(2.0f, 3.0f);
            const float factor = 2.0f;

            Vector2 expected = new Vector2(4.0f, 6.0f);
            Vector2 actual;

            actual = a * factor;
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.operator * did not return the expected value.");
        }

        // A test for operator * (float, Vector2f)
        [Fact]
        public void Vector2MultiplyOperatorTest2()
        {
            Vector2 a = new Vector2(2.0f, 3.0f);
            const float factor = 2.0f;

            Vector2 expected = new Vector2(4.0f, 6.0f);
            Vector2 actual;

            actual = factor * a;
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.operator * did not return the expected value.");
        }

        // A test for operator * (Vector2f, Vector2f)
        [Fact]
        public void Vector2MultiplyOperatorTest3()
        {
            Vector2 a = new Vector2(2.0f, 3.0f);
            Vector2 b = new Vector2(4.0f, 5.0f);

            Vector2 expected = new Vector2(8.0f, 15.0f);
            Vector2 actual;

            actual = a * b;

            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.operator * did not return the expected value.");
        }

        // A test for operator / (Vector2f, float)
        [Fact]
        public void Vector2DivisionTest()
        {
            Vector2 a = new Vector2(2.0f, 3.0f);

            float div = 2.0f;

            Vector2 expected = new Vector2(1.0f, 1.5f);
            Vector2 actual;

            actual = a / div;

            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.operator / did not return the expected value.");
        }

        // A test for operator / (Vector2f, Vector2f)
        [Fact]
        public void Vector2DivisionTest1()
        {
            Vector2 a = new Vector2(2.0f, 3.0f);
            Vector2 b = new Vector2(4.0f, 5.0f);

            Vector2 expected = new Vector2(2.0f / 4.0f, 3.0f / 5.0f);
            Vector2 actual;

            actual = a / b;

            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.operator / did not return the expected value.");
        }

        // A test for operator / (Vector2f, float)
        // Divide by zero
        [Fact]
        public void Vector2DivisionTest2()
        {
            Vector2 a = new Vector2(-2.0f, 3.0f);

            float div = 0.0f;

            Vector2 actual = a / div;

            Assert.True(float.IsNegativeInfinity(actual.X), "Vector2f.operator / did not return the expected value.");
            Assert.True(float.IsPositiveInfinity(actual.Y), "Vector2f.operator / did not return the expected value.");
        }

        // A test for operator / (Vector2f, Vector2f)
        // Divide by zero
        [Fact]
        public void Vector2DivisionTest3()
        {
            Vector2 a = new Vector2(0.047f, -3.0f);
            Vector2 b = new Vector2();

            Vector2 actual = a / b;

            Assert.True(float.IsInfinity(actual.X), "Vector2f.operator / did not return the expected value.");
            Assert.True(float.IsInfinity(actual.Y), "Vector2f.operator / did not return the expected value.");
        }

        // A test for operator + (Vector2f, Vector2f)
        [Fact]
        public void Vector2AdditionTest()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            Vector2 b = new Vector2(3.0f, 4.0f);

            Vector2 expected = new Vector2(4.0f, 6.0f);
            Vector2 actual;

            actual = a + b;

            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.operator + did not return the expected value.");
        }

        // A test for Vector2f (float, float)
        [Fact]
        public void Vector2ConstructorTest()
        {
            float x = 1.0f;
            float y = 2.0f;

            Vector2 target = new Vector2(x, y);
            Assert.True(MathHelper.Equal(target.X, x) && MathHelper.Equal(target.Y, y), "Vector2f(x,y) constructor did not return the expected value.");
        }

        // A test for Vector2f ()
        // Constructor with no parameter
        [Fact]
        public void Vector2ConstructorTest2()
        {
            Vector2 target = new Vector2();
            Assert.Equal(0.0f, target.X);
            Assert.Equal(0.0f, target.Y);
        }

        // A test for Vector2f (float, float)
        // Constructor with special floating values
        [Fact]
        public void Vector2ConstructorTest3()
        {
            Vector2 target = new Vector2(float.NaN, float.MaxValue);
            Assert.Equal(target.X, float.NaN);
            Assert.Equal(target.Y, float.MaxValue);
        }

        // A test for Vector2f (float)
        [Fact]
        public void Vector2ConstructorTest4()
        {
            float value = 1.0f;
            Vector2 target = new Vector2(value);

            Vector2 expected = new Vector2(value, value);
            Assert.Equal(expected, target);

            value = 2.0f;
            target = new Vector2(value);
            expected = new Vector2(value, value);
            Assert.Equal(expected, target);
        }

        // A test for Add (Vector2f, Vector2f)
        [Fact]
        public void Vector2AddTest()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            Vector2 b = new Vector2(5.0f, 6.0f);

            Vector2 expected = new Vector2(6.0f, 8.0f);
            Vector2 actual;

            actual = Vector2.Add(a, b);
            Assert.Equal(expected, actual);
        }

        // A test for Divide (Vector2f, float)
        [Fact]
        public void Vector2DivideTest()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            float div = 2.0f;
            Vector2 expected = new Vector2(0.5f, 1.0f);
            Vector2 actual;
            actual = Vector2.Divide(a, div);
            Assert.Equal(expected, actual);
        }

        // A test for Divide (Vector2f, Vector2f)
        [Fact]
        public void Vector2DivideTest1()
        {
            Vector2 a = new Vector2(1.0f, 6.0f);
            Vector2 b = new Vector2(5.0f, 2.0f);

            Vector2 expected = new Vector2(1.0f / 5.0f, 6.0f / 2.0f);
            Vector2 actual;

            actual = Vector2.Divide(a, b);
            Assert.Equal(expected, actual);
        }

        // A test for Equals (object)
        [Fact]
        public void Vector2EqualsTest()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            Vector2 b = new Vector2(1.0f, 2.0f);

            // case 1: compare between same values
            object obj = b;

            bool expected = true;
            bool actual = a.Equals(obj);
            Assert.Equal(expected, actual);

            // case 2: compare between different values
            b.X = 10.0f;
            obj = b;
            expected = false;
            actual = a.Equals(obj);
            Assert.Equal(expected, actual);

            // case 3: compare between different types.
            obj = new Quaternion();
            expected = false;
            actual = a.Equals(obj);
            Assert.Equal(expected, actual);

            // case 3: compare against null.
            obj = null;
            expected = false;
            actual = a.Equals(obj);
            Assert.Equal(expected, actual);
        }

        // A test for Multiply (Vector2f, float)
        [Fact]
        public void Vector2MultiplyTest()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            const float factor = 2.0f;
            Vector2 expected = new Vector2(2.0f, 4.0f);
            Vector2 actual = Vector2.Multiply(a, factor);
            Assert.Equal(expected, actual);
        }

        // A test for Multiply (float, Vector2f)
        [Fact]
        public void Vector2MultiplyTest2()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            const float factor = 2.0f;
            Vector2 expected = new Vector2(2.0f, 4.0f);
            Vector2 actual = Vector2.Multiply(factor, a);
            Assert.Equal(expected, actual);
        }

        // A test for Multiply (Vector2f, Vector2f)
        [Fact]
        public void Vector2MultiplyTest3()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            Vector2 b = new Vector2(5.0f, 6.0f);

            Vector2 expected = new Vector2(5.0f, 12.0f);
            Vector2 actual;

            actual = Vector2.Multiply(a, b);
            Assert.Equal(expected, actual);
        }

        // A test for Negate (Vector2f)
        [Fact]
        public void Vector2NegateTest()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);

            Vector2 expected = new Vector2(-1.0f, -2.0f);
            Vector2 actual;

            actual = Vector2.Negate(a);
            Assert.Equal(expected, actual);
        }

        // A test for operator != (Vector2f, Vector2f)
        [Fact]
        public void Vector2InequalityTest()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            Vector2 b = new Vector2(1.0f, 2.0f);

            // case 1: compare between same values
            bool expected = false;
            bool actual = a != b;
            Assert.Equal(expected, actual);

            // case 2: compare between different values
            b.X = 10.0f;
            expected = true;
            actual = a != b;
            Assert.Equal(expected, actual);
        }

        // A test for operator == (Vector2f, Vector2f)
        [Fact]
        public void Vector2EqualityTest()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            Vector2 b = new Vector2(1.0f, 2.0f);

            // case 1: compare between same values
            bool expected = true;
            bool actual = a == b;
            Assert.Equal(expected, actual);

            // case 2: compare between different values
            b.X = 10.0f;
            expected = false;
            actual = a == b;
            Assert.Equal(expected, actual);
        }

        // A test for Subtract (Vector2f, Vector2f)
        [Fact]
        public void Vector2SubtractTest()
        {
            Vector2 a = new Vector2(1.0f, 6.0f);
            Vector2 b = new Vector2(5.0f, 2.0f);

            Vector2 expected = new Vector2(-4.0f, 4.0f);
            Vector2 actual;

            actual = Vector2.Subtract(a, b);
            Assert.Equal(expected, actual);
        }

        // A test for UnitX
        [Fact]
        public void Vector2UnitXTest()
        {
            Vector2 val = new Vector2(1.0f, 0.0f);
            Assert.Equal(val, Vector2.UnitX);
        }

        // A test for UnitY
        [Fact]
        public void Vector2UnitYTest()
        {
            Vector2 val = new Vector2(0.0f, 1.0f);
            Assert.Equal(val, Vector2.UnitY);
        }

        // A test for One
        [Fact]
        public void Vector2OneTest()
        {
            Vector2 val = new Vector2(1.0f, 1.0f);
            Assert.Equal(val, Vector2.One);
        }

        // A test for Zero
        [Fact]
        public void Vector2ZeroTest()
        {
            Vector2 val = new Vector2(0.0f, 0.0f);
            Assert.Equal(val, Vector2.Zero);
        }

        // A test for Equals (Vector2f)
        [Fact]
        public void Vector2EqualsTest1()
        {
            Vector2 a = new Vector2(1.0f, 2.0f);
            Vector2 b = new Vector2(1.0f, 2.0f);

            // case 1: compare between same values
            bool expected = true;
            bool actual = a.Equals(b);
            Assert.Equal(expected, actual);

            // case 2: compare between different values
            b.X = 10.0f;
            expected = false;
            actual = a.Equals(b);
            Assert.Equal(expected, actual);
        }

        // A test for Vector2f comparison involving NaN values
        [Fact]
        public void Vector2EqualsNanTest()
        {
            Vector2 a = new Vector2(float.NaN, 0);
            Vector2 b = new Vector2(0, float.NaN);

            Assert.False(a == Vector2.Zero);
            Assert.False(b == Vector2.Zero);

            Assert.True(a != Vector2.Zero);
            Assert.True(b != Vector2.Zero);

            Assert.False(a.Equals(Vector2.Zero));
            Assert.False(b.Equals(Vector2.Zero));

            // Counterintuitive result - IEEE rules for NaN comparison are weird!
            Assert.False(a.Equals(a));
            Assert.False(b.Equals(b));
        }

        // A test for Reflect (Vector2f, Vector2f)
        [Fact]
        public void Vector2ReflectTest()
        {
            Vector2 a = Vector2.Normalize(new Vector2(1.0f, 1.0f));

            // Reflect on XZ plane.
            Vector2 n = new Vector2(0.0f, 1.0f);
            Vector2 expected = new Vector2(a.X, -a.Y);
            Vector2 actual = Vector2.Reflect(a, n);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Reflect did not return the expected value.");

            // Reflect on XY plane.
            n = new Vector2(0.0f, 0.0f);
            expected = new Vector2(a.X, a.Y);
            actual = Vector2.Reflect(a, n);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Reflect did not return the expected value.");

            // Reflect on YZ plane.
            n = new Vector2(1.0f, 0.0f);
            expected = new Vector2(-a.X, a.Y);
            actual = Vector2.Reflect(a, n);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Reflect did not return the expected value.");
        }

        // A test for Reflect (Vector2f, Vector2f)
        // Reflection when normal and source are the same
        [Fact]
        public void Vector2ReflectTest1()
        {
            Vector2 n = new Vector2(0.45f, 1.28f);
            n = Vector2.Normalize(n);
            Vector2 a = n;

            Vector2 expected = -n;
            Vector2 actual = Vector2.Reflect(a, n);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Reflect did not return the expected value.");
        }

        // A test for Reflect (Vector2f, Vector2f)
        // Reflection when normal and source are negation
        [Fact]
        public void Vector2ReflectTest2()
        {
            Vector2 n = new Vector2(0.45f, 1.28f);
            n = Vector2.Normalize(n);
            Vector2 a = -n;

            Vector2 expected = n;
            Vector2 actual = Vector2.Reflect(a, n);
            Assert.True(MathHelper.Equal(expected, actual), "Vector2f.Reflect did not return the expected value.");
        }

        [Fact]
        public void Vector2AbsTest()
        {
            Vector2 v1 = new Vector2(-2.5f, 2.0f);
            Vector2 v3 = Vector2.Abs(new Vector2(0.0f, float.NegativeInfinity));
            Vector2 v = Vector2.Abs(v1);
            Assert.Equal(2.5f, v.X);
            Assert.Equal(2.0f, v.Y);
            Assert.Equal(0.0f, v3.X);
            Assert.Equal(float.PositiveInfinity, v3.Y);
        }

        [Fact]
        public void Vector2SqrtTest()
        {
            Vector2 v1 = new Vector2(-2.5f, 2.0f);
            Vector2 v2 = new Vector2(5.5f, 4.5f);
            Assert.Equal(2, (int)Vector2.SquareRoot(v2).X);
            Assert.Equal(2, (int)Vector2.SquareRoot(v2).Y);
            Assert.Equal(float.NaN, Vector2.SquareRoot(v1).X);
        }

        // A test to make sure these types are blittable directly into GPU buffer memory layouts
        [Fact]
        public unsafe void Vector2SizeofTest()
        {
            Assert.Equal(8, sizeof(Vector2));
            Assert.Equal(16, sizeof(Vector2_2x));
            Assert.Equal(12, sizeof(Vector2PlusFloat));
            Assert.Equal(24, sizeof(Vector2PlusFloat_2x));
        }

        [StructLayout(LayoutKind.Sequential)]
        struct Vector2_2x
        {
            private Vector2 _a;
            private Vector2 _b;
        }

        [StructLayout(LayoutKind.Sequential)]
        struct Vector2PlusFloat
        {
            private Vector2 _v;
            private float _f;
        }

        [StructLayout(LayoutKind.Sequential)]
        struct Vector2PlusFloat_2x
        {
            private Vector2PlusFloat _a;
            private Vector2PlusFloat _b;
        }

        [Fact]
        public void SetFieldsTest()
        {
            Vector2 v3 = new Vector2(4f, 5f);
            v3.X = 1.0f;
            v3.Y = 2.0f;
            Assert.Equal(1.0f, v3.X);
            Assert.Equal(2.0f, v3.Y);
            Vector2 v4 = v3;
            v4.Y = 0.5f;
            Assert.Equal(1.0f, v4.X);
            Assert.Equal(0.5f, v4.Y);
            Assert.Equal(2.0f, v3.Y);
        }

        [Fact]
        public void EmbeddedVectorSetFields()
        {
            EmbeddedVectorObject evo = new EmbeddedVectorObject();
            evo.FieldVector.X = 5.0f;
            evo.FieldVector.Y = 5.0f;
            Assert.Equal(5.0f, evo.FieldVector.X);
            Assert.Equal(5.0f, evo.FieldVector.Y);
        }

        private class EmbeddedVectorObject
        {
            public Vector2 FieldVector;
        }
    }
}


text:
<?php

namespace Venyii\DayZWhitey\DataTables\Type;

use Silex\Application;

interface TypeInterface
{
    /**
     * @return string
     */
    public function getId();

    /**
     * @return string
     */
    public function getTable();

    /**
     * @return string
     */
    public function getIndexColumn();

    /**
     * Array of database columns which should be read and sent back to DataTables.
     * Use a space where you want to insert a non-database field (for example a counter or static image)
     *
     * @return array
     */
    public function getReadableColumns();

    public function getAllColumns();

    /**
     * @param  Application $app
     * @param  array       $data
     * @return array
     */
    public function modifyOutputData(Application $app, array $data);

}


text:
'use strict';
var BBPromise = require('bluebird');
var requestPromise = require('request-promise');
var logger = require('@hoist/logger');
var url = require('url');
var errors = require('@hoist/errors');
var _ = require('lodash');
var config = require('config');
var authUrl = 'https://slack.com/oauth/authorize';
var redirectUri = 'https://'+config.get('Hoist.domains.bouncer')+'/bounce';
var authGetTokenUrl = 'https://slack.com/api/oauth.access';
var apiUrl = 'https://slack.com/api';

/*jshint camelcase: false */

function SlackConnector(settings) {
  logger.info({
    settings: settings
  }, 'constructed angel-list-connector');
  this.settings = settings;
}

SlackConnector.prototype.get = function (url, queryParams) {
  logger.info('inside hoist-connector-slack.get');
  return this.request('GET', url, queryParams);
};

SlackConnector.prototype.post = function (url, data) {
  logger.info('inside hoist-connector-slack.post');
  if (!data) {
    throw new errors.connector.request.InvalidError('no data specified in post');
  }
  return this.request('POST', url, null, data);
};

SlackConnector.prototype.request = function (method, path, queryParams, data) {
  if (!path) {
    throw new errors.connector.request.InvalidError('no path specified');
  }
  data = data && (typeof data === 'object') ? data : {};
  if (this.authSettings ) {
    data.token = this.authSettings.get('token');
  } else {
    throw new errors.connector.request.UnauthorizedError();
  }
  var options = {
    method: method,
    json: true,
    resolveWithFullResponse: true,
    uri: apiUrl + path,
  };
  if (method === 'POST') {
    options.form = data;
  }
  if (method === 'GET') {
    var parsedUrl = url.parse(options.uri, true);
    parsedUrl.search = null;
    var query = parsedUrl.query;
    queryParams = queryParams ? queryParams : {};
    queryParams.token = this.authSettings.get('token');
    query = _.extend(query, queryParams);
    options.uri = url.format(parsedUrl);
  }
  logger.info({
    method: method,
    path: path,
    requestOptions: options
  }, 'inside hoist-connector-slack.requestOptions');
  return this.requestPromiseHelper(options)
  .then(function(response) {
    logger.info({responseBody: response.body}, 'inside hoist-connector-slack.request');
    return response.body;
  });
};

/* istanbul ignore next */
SlackConnector.prototype.authorize = function (authSettings) {
  this.authSettings = authSettings;
  return BBPromise.resolve({});
};

SlackConnector.prototype.receiveBounce = function (bounce) {
  if (bounce.query && bounce.query.code) {
    return bounce.set('code', bounce.query.code)
      .bind(this)
      .then(function () {
        return this.requestAccessToken(bounce);
      })
      .then(function (response) {
        logger.info({responseBody: response.body}, 'inside hoist-connector-slack.bounce');
        return bounce.set('token', JSON.parse(response.body).access_token);
      })
      .then(function () {
        return this.requestAccountInformation(bounce);
      })
      .then(function() {
        bounce.done();
      })
      .catch(function(err){
        logger.error(err);
        bounce.done(err);
      });
  } else {
    var scope = '&scope=read,post,identify';
    return bounce.redirect(authUrl + '?client_id=' +this.settings.clientId + scope+'&redirect_uri='+ redirectUri);
  }
};

SlackConnector.prototype.requestAccessToken = function (bounce) {
  var body = {
    code: bounce.get('code'),
    client_id: this.settings.clientId,
    client_secret: this.settings.clientSecret,
    redirect_uri: redirectUri
  };
  var options = {
    method: 'POST',
    uri: authGetTokenUrl,
    formData: body,
    resolveWithFullResponse: true
  };

  return this.requestPromiseHelper(options);
};
SlackConnector.prototype.requestAccountInformation = function(bounce) {

  var options = {
    method: 'GET',
    uri: apiUrl + '/auth.test?token=' + bounce.get('token'),
    resolveWithFullResponse: true
  };

  return this.requestPromiseHelper(options)
    .then(function(response) {
      if(typeof response.body === 'string') {
        response = JSON.parse(response.body);
      }
      return bounce.setDisplayProperty('Team', response.team)
        .then(function() {
          return bounce.setDisplayProperty('User', response.user);
        });
    });

};

/* istanbul ignore next */
SlackConnector.prototype.requestPromiseHelper = function (options) {
  return BBPromise.resolve(requestPromise(options));
};

module.exports = SlackConnector;


text:
package com.healthmarketscience.rmiio.util;

import java.io.IOException;
import java.io.OutputStream;

import com.healthmarketscience.rmiio.PacketOutputStream;

/**
 * Utility class for optimizing different write strategies based on the type
 * of the underlying OutputStream.
 *
 * @author James Ahlborn
 */
public abstract class OutputStreamAdapter
{

  private OutputStreamAdapter() {
  }

  /**
   * @return the underlying OutputStream
   */
  public abstract OutputStream getOutputStream();

  /**
   * Puts the given "packet" into the output stream.  The packet should be
   * filled with data.  The caller is giving control of the buffer to the
   * PacketOutputStream, and therefore should not attempt to use the byte[]
   * again.
   *
   * @param packet fully filled array of bytes to give to the OutputStream
   */
  public abstract void writePacket(byte[] packet) throws IOException;

  /**
   * @param istream stream to wrap and for which the implementation is
   *                optimized
   * @return an OutputStreamAdapter optimized for the stream type
   */
  public static OutputStreamAdapter create(
      OutputStream istream)
  {
    if(istream instanceof PacketOutputStream) {
      return new PacketAdapter((PacketOutputStream)istream);
    }
    return new DefaultAdapter(istream);
  }

  /**
   * OutputStreamAdapter implementation for PacketOutputStreams.
   */
  private static class PacketAdapter extends OutputStreamAdapter
  {
    private final PacketOutputStream _postream;

    private PacketAdapter(PacketOutputStream postream) {
      _postream = postream;
    }

    @Override
    public PacketOutputStream getOutputStream() { return _postream; }

    @Override
    public void writePacket(byte[] packet) throws IOException {
      _postream.writePacket(packet);
    }

  }

  /**
   * OutputStreamAdapter implementation for normal OutputStreams.
   */
  private static class DefaultAdapter extends OutputStreamAdapter
  {
    private final OutputStream _ostream;

    private DefaultAdapter(OutputStream ostream) {
      _ostream = ostream;
    }

    @Override
    public OutputStream getOutputStream() { return _ostream; }

    @Override
    public void writePacket(byte[] packet) throws IOException {
      _ostream.write(packet, 0, packet.length);
    }

  }

}


text:
import httplib as http
import urllib
import urlparse
import bson.objectid
import itsdangerous
from werkzeug.local import LocalProxy
from weakref import WeakKeyDictionary
from flask import request
from framework.flask import app, redirect

from website import settings

from .model import Session

def add_key_to_url(url, scheme, key):
    """Redirects the user to the requests URL with the given key appended
    to the query parameters.

    """
    query = request.args.to_dict()
    query['view_only'] = key
    replacements = {'query': urllib.urlencode(query)}

    if scheme:
        replacements['scheme'] = scheme

    parsed_url = urlparse.urlparse(url)

    if parsed_url.fragment:
        # Fragments should exists server side so this mean some one set up a # in the url
        # WSGI sucks and auto unescapes it so we just shove it back into the path with the escaped hash
        replacements['path'] = '{}%23{}'.format(parsed_url.path, parsed_url.fragment)
        replacements['fragment'] = ''

    parsed_redirect_url = parsed_url._replace(**replacements)
    return urlparse.urlunparse(parsed_redirect_url)

def prepare_private_key():
    """`before_request` handler that checks the Referer header to see if the user
    is requesting from a view-only link. If so, reappend the view-only key.

    NOTE: In order to ensure the execution order of the before_request callbacks,
    this is attached in website.app.init_app rather than using
    @app.before_request.
    """

    # Done if not GET request
    if request.method != 'GET':
        return

    # Done if private_key in args
    key_from_args = request.args.get('view_only', '')
    if key_from_args:
        return

    # grab query key from previous request for not login user
    if request.referrer:
        referrer_parsed = urlparse.urlparse(request.referrer)
        scheme = referrer_parsed.scheme
        key = urlparse.parse_qs(
            urlparse.urlparse(request.referrer).query
        ).get('view_only')
        if key:
            key = key[0]
    else:
        scheme = None
        key = None

    # Update URL and redirect
    if key and not session:
        new_url = add_key_to_url(request.url, scheme, key)
        return redirect(new_url, code=http.TEMPORARY_REDIRECT)

# todo 2-back page view queue
# todo actively_editing date

def set_previous_url(url=None):
    """Add current URL to session history if not in excluded list; cap history
    at set length.
    Does nothing if a user is not logged in

    """
    if not session:
        return

    url = url or request.path
    if any([rule(url) for rule in settings.SESSION_HISTORY_IGNORE_RULES]):
        return
    session.data['history'].append(url)
    while len(session.data['history']) > settings.SESSION_HISTORY_LENGTH:
        session.data['history'].pop(0)

def goback(n=1):
    next_url = request.args.get('next') or request.form.get('next_url')
    if next_url:
        return redirect(next_url)
    if session._get_current_object() is None:
        return redirect('/')
    try:
        for _ in range(n):
            url = session.data['history'].pop()
    except IndexError:
        url = '/dashboard/'
    return redirect(url)

def get_session():
    return sessions.get(request._get_current_object())

def set_session(session):
    sessions[request._get_current_object()] = session

def create_session(response, data=None):
    current_session = get_session()
    if current_session:
        current_session.data.update(data or {})
        current_session.save()
        cookie_value = itsdangerous.Signer(settings.SECRET_KEY).sign(current_session._id)
    else:
        session_id = str(bson.objectid.ObjectId())
        session = Session(_id=session_id, data=data or {})
        session.save()
        cookie_value = itsdangerous.Signer(settings.SECRET_KEY).sign(session_id)
        set_session(session)
    if response is not None:
        response.set_cookie(settings.COOKIE_NAME, value=cookie_value)
        return response

sessions = WeakKeyDictionary()
session = LocalProxy(get_session)

# Request callbacks

# NOTE: This gets attached in website.app.init_app to ensure correct callback
# order
def before_request():

    if request.authorization:

        # Create a session from the API key; if key is
        # not valid, save the HTTP error code in the
        # "auth_error_code" field of session.data

        # Create empty session
        session = Session()

        # Hack: Avoid circular import
        from website.project.model import ApiKey

        api_label = request.authorization.username
        api_key_id = request.authorization.password
        api_key = ApiKey.load(api_key_id)

        if api_key:
            user = api_key.user__keyed and api_key.user__keyed[0]
            node = api_key.node__keyed and api_key.node__keyed[0]

            session.data['auth_api_label'] = api_label
            session.data['auth_api_key'] = api_key._primary_key
            if user:
                session.data['auth_user_username'] = user.username
                session.data['auth_user_id'] = user._primary_key
                session.data['auth_user_fullname'] = user.fullname

            elif node:
                session.data['auth_node_id'] = node._primary_key

            else:
                # Invalid key: Not attached to user or node
                session.data['auth_error_code'] = http.FORBIDDEN

        else:

            # Invalid key: Not found in database
            session.data['auth_error_code'] = http.FORBIDDEN

        set_session(session)
        return

    cookie = request.cookies.get(settings.COOKIE_NAME)
    if cookie:
        try:
            session_id = itsdangerous.Signer(settings.SECRET_KEY).unsign(cookie)
            session = Session.load(session_id) or Session(_id=session_id)
            set_session(session)
            return
        except:
            pass
    ## TODO: Create session in before_request, cookie in after_request
    ## Retry request, preserving status code
    #response = redirect(request.path, code=307)
    return create_session(None)

@app.after_request
def after_request(response):
    # Save if session exists and not authenticated by API
    set_previous_url()
    if session._get_current_object() is not None \
            and not session.data.get('auth_api_key'):
        session.save()
    return response


text:
using namespace cocos2d;

const float NORMAL_SPEED = 150.0f;

ComMove::ComMove(std::vector<Point> path)
{
    setName("ComMove");
    m_path = path;
}

ComMove* ComMove::create(std::vector<Point> path)
{
    ComMove * ret = new ComMove(path);
    if (ret != nullptr && ret->init())
    {
        ret->autorelease();
    }
    else
    {
        CC_SAFE_DELETE(ret);
    }
    return ret;

}

void ComMove::onEnter()
{
    initPath(m_path);
}

void ComMove::startMove()
{
    auto owner = getOwner();
    if (!m_moveActions) {
        CCLOG("Error! Move Action is Empty");
        return;
    }
	owner->setPosition(m_startPos);
	owner->runAction(m_moveActions);
}

void ComMove::initPath(std::vector<cocos2d::Point> path)
{
    if (path.size() == 0)
	{
		return ;
	}
    Vector<FiniteTimeAction*> actionsArray;
	m_startPos = path.at(0);
	for (unsigned int i = 1;i<path.size();++i)
	{
	float duration = path.at(i-1).getDistance(path.at(i));
	float time = duration/NORMAL_SPEED;
	actionsArray.pushBack(CCMoveTo::create(time,path.at(i)));
	}
	actionsArray.pushBack(CallFunc::create([=](){
		auto playground = dynamic_cast<HelloWorld*>(getOwner()->getParent()->getParent());
		auto curLife = playground->changeTowerLife(-1);
		if (curLife == 0) {
			playground->endGame(false);
		}
		else
		{
			playground->removeMonster(getOwner());
		}
	}));

    m_moveActions = CCSequence::create(actionsArray);
}


text:
import styled, {css} from 'styled-components';
import {motion} from 'framer-motion';
import {Error} from '../assets/styles/colors';

const Message = styled(motion.div)<{type: string}>`
  font-size: 16px;
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;

  ${({type}: {type: string}) => {
    if (type === 'error') {
      return css`
        color: ${Error};
        background-color: #ffd8de;
      `;
    }

    if (type === 'warning') {
      return css`
        color: #856d42;
        background-color: #fbf8e5;
      `;
    }
  }}
`;

const Info = ({message, type}: {message?: string; type: string}) => {
  const infoAnime = {
    initial: {
      opacity: 0,
      height: 0,
    },
    animate: {
      opacity: 1,
      height: 'auto',
    },
  };

  message = message || 'Uh Oh, Something went wrong. Please try again.';

  return (
    <Message type={type} variants={infoAnime} initial='initial' animate='animate'>
      {message}
    </Message>
  );
};

export default Info;


text:
using FFImageLoading.Forms.Droid;
using FFImageLoading.Forms;
using Xamarin.Forms;
using ImageFilterSample.Controls;
using ImageFilterSample.Droid.Renderers;
using Android.Graphics;
using ImageFilterSample.Helpers;
using Xamarin.Forms.Platform.Android;
using System.Threading.Tasks;
using Android.Widget;
using ImageFilterSample.Droid.Helpers;
using ImageFilterSample.Droid.Extensions;
using System;

[assembly: ExportRenderer(typeof(FilterImage), typeof(FilterImageRenderer))]
namespace ImageFilterSample.Droid.Renderers
{
	public class FilterImageRenderer : CachedImageRenderer
	{
		//Bitmap originalBitmap;
		//Bitmap filteredImage;
		Bitmap filteredBitmap;
		FilterType currentFilterType = FilterType.NoFilter;
		private static IImageSourceHandler GetHandler(ImageSource source)
		{
			IImageSourceHandler returnValue = null;
			if (source is UriImageSource)
			{
				returnValue = new ImageLoaderSourceHandler();
			}
			else if (source is FileImageSource)
			{
				returnValue = new FileImageSourceHandler();
			}
			else if (source is StreamImageSource)
			{
				returnValue = new StreamImagesourceHandler();
			}
			return returnValue;
		}

		private async Task SetImageSourceAsync(ImageView target, CachedImage model)
		{
			if (target == null || model == null)
				return;
			var source = model.Source;

			using (var bitmap = await this.GetBitmapAsync(source))
			{
				if (bitmap != null)
				{
					target.SetImageBitmap(bitmap.ResizeBitmap(500, 500));

				}
			}
		}

		protected override void OnElementChanged(ElementChangedEventArgs<CachedImage> e)
		{
			base.OnElementChanged(e);

			if (e.OldElement != null)
			{
			}

			if (e.NewElement != null)
			{
				var filterImage = Element as FilterImage;
				filterImage.SelectFilterCommand = new Command<FilterType>((fType) => ApplyFilter(fType), (b) => (filterImage.OriginalSource != null));
				filterImage.ApplyFilterCommand = new Command(async () =>
				{
					//Control.BuildDrawingCache(true);
					//Bitmap bmap = Control.GetDrawingCache(true);
					if (filteredBitmap == null)
						filteredBitmap = await GetBitmapAsync(filterImage.OriginalSource);

					byte[] imgBytes = filteredBitmap.ToByteArray(100, false);
					string name = "SAMPLE-" + System.DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".jpg";

					var file = new Java.IO.File(FileUtils.GetDirectoryForPictures("SAMPLE-TMP"), name);

					string filePath = file.Path;
					System.IO.File.WriteAllBytes(filePath, imgBytes);
					var fInfo = new System.IO.FileInfo(filePath);
					filterImage?.OnFilterApplied(this, new Tuple<string, byte[], long>(filePath, imgBytes, fInfo.Length));
				}, () => (filterImage.OriginalSource != null));
			}
		}

		//Filters
		async void ApplyFilter(FilterType filterType)
		{
			if (currentFilterType == filterType)
				return;

			var filterImage = Element as FilterImage;
			//originalBitmap = await GetBitmapAsync(filterImage.OriginalSource);
			using (Bitmap originalBitmap = await GetBitmapAsync(filterImage.OriginalSource))
			{
				var oldFilteredBitmap = filteredBitmap;
				Bitmap bmp = null;
				switch (filterType)
				{
					case FilterType.NoFilter:
						Element.Source = filterImage.OriginalSource;
						bmp = originalBitmap;
						break;
					case FilterType.BlackAndWhite:
						bmp = ApplyBlackAndWhite(originalBitmap);
						break;
					case FilterType.Hifi:
						bmp = ApplyHiFi(originalBitmap);
						break;
					case FilterType.Saturated:
						bmp = ApplySaturation(originalBitmap, 250);
						break;
					case FilterType.Vintage:
						bmp = ApplyVignette(originalBitmap);
						break;
				}

				filteredBitmap = filterType == FilterType.NoFilter ? null : bmp;
				currentFilterType = filterType;

				using (var resizedBitmap = bmp.ResizeBitmap(500, 500))
				{
					Control.SetImageBitmap(resizedBitmap);
				}

				oldFilteredBitmap?.Recycle();
			}
		}

		protected override async void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
		{
			base.OnElementPropertyChanged(sender, e);
			var filterImage = Element as FilterImage;
			if (e.PropertyName == FilterImage.OriginalSourceProperty.PropertyName)
			{

				//originalBitmap = Control.;
				//await SetImageAsync(filterImage.OriginalSource, Control);

			}
			else if (e.PropertyName == FilterImage.SourceProperty.PropertyName)
			{
				await SetImageSourceAsync(this.Control, this.Element);

			}
		}

		private async Task<Bitmap> GetBitmapAsync(ImageSource source)
		{
			var handler = GetHandler(source);
			var returnValue = (Bitmap)null;

			if (handler != null)
				returnValue = await handler.LoadImageAsync(source, Forms.Context);

			return returnValue;
		}

		#region Filters

		Bitmap ApplyVignette(Bitmap src)
		{
			var bm = src.Copy();
			var width = bm.Width;
			var height = bm.Height;

			var radius = (float)(width / 1.2);
			int c = -0x1000000;
			var colors = new int[] { 0, 0x55000000, c };
			var positions = new float[] { 0.0f, 0.5f, 1.0f };

			var gradient = new RadialGradient(width / 2, height / 2, radius, colors, positions, Shader.TileMode.Clamp);

			//var gradient = new RadialGradient(width / 2, height / 2, radius, Android.Graphics.Color.Transparent, Android.Graphics.Color.Blue, Shader.TileMode.Clamp);

			var canvas = new Canvas(bm);
			canvas.DrawARGB(1, 0, 0, 0);

			var paint = new Paint();
			paint.AntiAlias = true;
			paint.Color = Android.Graphics.Color.Black;
			paint.SetShader(gradient);

			var rect = new Rect(0, 0, bm.Width, bm.Height);
			var rectf = new RectF(rect);

			canvas.DrawRect(rectf, paint);

			paint.SetXfermode(new PorterDuffXfermode(PorterDuff.Mode.SrcIn));
			canvas.DrawBitmap(bm, rect, rect, paint);

			return bm;

			//Element.Source = ImageSource.FromStream(() => bm.GetStream(85, Bitmap.CompressFormat.Jpeg));
		}

		Bitmap ApplySaturation(Bitmap src, int value)
		{
			var bm = src.Copy();
			var f_value = (float)(value / 100.0);

			//var w = c.Width;
			//var h = c.Height;

			//var bm = Bitmap.CreateBitmap(w, h, Bitmap.Config.Argb8888);
			var canvasResult = new Canvas(bm);
			var paint = new Paint();
			var colorMatrix = new ColorMatrix();

			colorMatrix.SetSaturation(f_value);
			var filter = new ColorMatrixColorFilter(colorMatrix);
			paint.SetColorFilter(filter);
			canvasResult.DrawBitmap(bm, 0, 0, paint);

			return bm;
		}

		Bitmap ApplyBlackAndWhite(Bitmap src)
		{
			Bitmap bw = src.Copy();
			//Bitmap bw= Bitmap.CreateBitmap(c);
			//using (Bitmap bw = Bitmap.CreateBitmap(src))

			var canvas = new Canvas(bw);
			var ma = new ColorMatrix();
			ma.SetSaturation(0);

			var paint = new Paint();
			paint.SetColorFilter(new ColorMatrixColorFilter(ma));

			canvas.DrawBitmap(bw, 0, 0, paint);

			return bw;

		}

		Bitmap ApplyHiFi(Bitmap src)
		{
			var bm = src.Copy();

			/*var w = c.Width;
			var h = c.Height;

			var bm = Bitmap.CreateBitmap(w, h, c.GetConfig());*/

			float brightness = 0.25f;
			float contrast = 1.25f;

			var canvasResult = new Canvas(bm);
			var paint = new Paint();
			ColorMatrix colorMatrix = new ColorMatrix(new float[]
			{
				contrast, 0, 0, 0, brightness,
				0, contrast, 0, 0, brightness,
				0, 0, contrast, 0, brightness,
				0, 0, 0, 1, 0
			});

			var filter = new ColorMatrixColorFilter(colorMatrix);
			paint.SetColorFilter(filter);
			canvasResult.DrawBitmap(bm, 0, 0, paint);

			return bm;
		}

		#endregion

	}
}


text:
name: Smart & Final
address_1: 7815 Van Nuys Blvd
address_2: ''
city: Panorama City
state: CA
zip: '91402'
phone: (818) 780-7222
latitude: '34.212681'
longitude: '-118.449484'
category: Supermarket
website: 'http://locations.smartandfinal.com/CA/VAN-NUYS/349/'
active: ''
daycode1: Mon
day1_open: '600'
day1_close: '2200'
daycode2: Tue
day2_open: '600'
day2_close: '2200'
daycode3: Wed
day3_open: '600'
day3_close: '2200'
daycode4: Thu
day4_open: '600'
day4_close: '2200'
daycode5: Fri
day5_open: '600'
day5_close: '2200'
daycode6: Sat
day6_open: '600'
day6_close: '2200'
daycode7: Sun
day7_open: '600'
day7_close: '2200'
title: 'Smart & Final, Food Oasis Los Angeles'
uri: /supermarket/smart-final-7815-van-nuys-blvd/
formatted_daycode1: Monday
formatted_day1_open: 6am
formatted_day1_close: 10pm
formatted_daycode2: Tuesday
formatted_day2_open: 6am
formatted_day2_close: 10pm
formatted_daycode3: Wednesday
formatted_day3_open: 6am
formatted_day3_close: 10pm
formatted_daycode4: Thursday
formatted_day4_open: 6am
formatted_day4_close: 10pm
formatted_daycode5: Friday
formatted_day5_open: 6am
formatted_day5_close: 10pm
formatted_daycode6: Saturday
formatted_day6_open: 6am
formatted_day6_close: 10pm
formatted_daycode7: Sunday
formatted_day7_open: 6am
formatted_day7_close: 10pm

---


text:
#include "UIEventImp.h"

namespace org { namespace w3c { namespace dom { namespace bootstrap {

html::Window UIEventImp::getView()
{
    return view;
}

int UIEventImp::getDetail()
{
    return detail;
}

void UIEventImp::initUIEvent(const std::u16string& typeArg, bool canBubbleArg, bool cancelableArg,
                             html::Window viewArg, int detailArg)
{
    view = viewArg;
    detail = detailArg;
    initEvent(typeArg, canBubbleArg, cancelableArg);
}

}}}}  // org::w3c::dom::bootstrap


text:
package mv.model.cpu;
/**
 * Clase que se encarga del pc, es decir, el contador de programa
 * @author Samuel Lapuente y Héctor Laria
 *
 */

public class ExecutionManager {
	private int currentPC;
	private int nextPC;
	private boolean halt;
	private boolean pause;

	public ExecutionManager() {
		this.currentPC = 0;
		this.nextPC = 1;
		this.halt = false;
		this.pause = false;
	}

	public int getPC() {
		return this.currentPC;
	}

	public int getNextPC() {
		return this.nextPC;
	}

	public void setNextPC (int n) {
		this.nextPC = n;
	}

	public void incrementPC() {
		this.currentPC = this.nextPC;
		this.nextPC++;
	}

	public void reset() {
		this.currentPC = 0;
		this.nextPC = 1;
		this.halt = false;
		this.pause = false;
	}

	public void setHalt (boolean b) {
		this.halt = b;
	}

	public boolean getHalt() {
		return this.halt;
	}

	public void setPause(boolean b) {
		this.pause = b;
	}

	public boolean getPause() {
		return this.pause;
	}
}


text:
import setInputValue from '../actions/setInputValue.js';

export default [
    setInputValue
]


text:
<!DOCTYPE html>

<title>CalendarItem_calendarId_attribute</title>
<meta charset="utf-8"/>


text:
from django import template
from perek_tugas.models import BuktiLaporan

register = template.Library()

@register.filter(name='data_bukti_laporan')
def data_bukti_laporan(value):
    # laporan = BuktiLaporan.objects.filter(tugastambahan__pk=value).values_list('laporan_nomor', flat=True)
    laporan = BuktiLaporan.objects.filter(tugastambahan__pk=value).values()

    return laporan

    # return ',\n '.join(laporan)


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

#pragma once

namespace Algo
{
	/**
	 * Rearranges the elements so that all the elements for which Predicate returns true precede all those for which it returns false.  (not stable)
	 *
	 * @param	First		pointer to the first element
	 * @param	Num			the number of items
	 * @param	Predicate	unary predicate class
	 * @return	index of the first element in the second group
	 */
	template<class T, class UnaryPredicate>
	int32 Partition(T* Elements, const int32 Num, const UnaryPredicate& Predicate)
	{
		T* First = Elements;
		T* Last = Elements + Num;

		while (First != Last)
		{
			while (Predicate(*First))
			{
				++First;
				if (First == Last)
				{
					return First - Elements;
				}
			}

			do
			{
				--Last;
				if (First == Last)
				{
					return First - Elements;
				}
			} while (!Predicate(*Last));

			Exchange(*First, *Last);
			++First;
		}

		return First - Elements;
	}
} //namespace Algo


text:
package com.s4game.server.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 *
 * @Author zeusgooogle@gmail.com
 * @sine 2016年7月7日 上午10:31:03
 *
 */

public class ApplicationInit {

    private static ClassPathXmlApplicationContext ctx;

    public static void init() {
        initSpringContext();
    }

    public static ApplicationContext getApplicationContext() {
        return ctx;
    }

    private static void initSpringContext() {
        ctx = new ClassPathXmlApplicationContext("config/spring/applicationContext.xml");
    }

}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Illinois Biol. Monogr. (Urbana) 17(2): 97 (1939)

#### Original name
Aulographum festucae Lib., 1837

### Remarks
null


text:
Reports chained conversions of a sequence to Set and back, and suggests replacing them with .distinct
  call.

Example:

  Seq(1).toSet.toSeq
  List(1).toSet.toList

After the quick-fix is applied:

  Seq(1).distinct
  List(1).distinct


text:
namespace Bookman.Web.Controllers
{
    using System.Web.Mvc;
    using System.Web.Mvc.Expressions;
    using Bookman.Common;
    using Bookman.Models;
    using Bookman.Services.Abstractions;

    public class NewsController : Controller
    {
        private INewsService newsService;

        public NewsController(INewsService newsService)
        {
            this.newsService = newsService;
        }

       [HttpGet]
       [Authorize(Roles = GlobalConstants.AuthorRole)]
        public ActionResult WriteArticle()
        {
            return View();
        }

        [HttpPost]
        [ValidateAntiForgeryToken]
        [Authorize(Roles = GlobalConstants.AuthorRole)]
        public ActionResult WriteArticle(NewsArticle model)
        {
            if (!this.ModelState.IsValid)
            {
                return this.RedirectToAction<HomeController>(c => c.Index());
            }

            this.newsService.PersistArticle(model);
            return this.RedirectToAction<NewsController>(c => c.Details(model.Id));
        }

        [HttpGet]
        [Route("News/Details/{id}")]
        public ActionResult Details(int id)
        {
            var model = this.newsService.GetArticle(id);

            return View(model);
        }

        [HttpGet]
        [Route("News/All_Articles")]
        public ActionResult All()
        {
            var model = this.newsService.GetAll();

            return View(model);
        }
    }
}