text:
package de.codemakers.bot.supreme.exceptions;

import de.codemakers.bot.supreme.commands.Command;
import de.codemakers.bot.supreme.util.Standard;
import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.entities.Channel;

/**
 * ArgumentException
 *
 * @author Panzer1119
 */
public class ArgumentException extends BotException {

    private Command command = null;
    private String argument = null;

    //event.sendMessage(new ArgumentException().setCommand(this).setArgument("1").getMessage(event.getTextChannel()).build());
    public final Command getCommand() {
        return command;
    }

    public final ArgumentException setCommand(Command command) {
        this.command = command;
        return this;
    }

    public final String getArgument() {
        return argument;
    }

    public final ArgumentException setArgument(String argument) {
        this.argument = argument;
        return this;
    }

    @Override
    public final String getMessage() {
        if (argument == null) {
            return super.getMessage();
        }
        return String.format("Wrong argument in \"%s:%s\"!", command.getInvokers().get(0).getInvoker(), argument);
    }

    @Override
    public final EmbedBuilder getMessage(Channel channel) {
        return super.getMessage(channel).appendDescription(Standard.NEW_LINE_DISCORD + "Please check the help command for more information on how to use this command.");
    }

}


text:
import { TestBed, inject } from '@angular/core/testing';

import { CalendarService } from './calendar.service';

describe('CalendarService', () => {
  beforeEach(() => {
    TestBed.configureTestingModule({
      providers: [CalendarService]
    });
  });

  it('should be created', inject([CalendarService], (service: CalendarService) => {
    expect(service).toBeTruthy();
  }));
});

redpajama_set_name: RedPajamaGithub


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE126_Buffer_Overread__malloc_char_loop_66a.c
Label Definition File: CWE126_Buffer_Overread__malloc.label.xml
Template File: sources-sink-66a.tmpl.c
*/
/*
 * @description
 * CWE: 126 Buffer Over-read
 * BadSource:  Use a small buffer
 * GoodSource: Use a large buffer
 * Sinks: loop
 *    BadSink : Copy data to string using a loop
 * Flow Variant: 66 Data flow: data passed in an array from one function to another in different source files
 *
 * */

#include "std_testcase.h"

#include <wchar.h>

#ifndef OMITBAD

/* bad function declaration */
void CWE126_Buffer_Overread__malloc_char_loop_66b_badSink(char * dataArray[]);

void CWE126_Buffer_Overread__malloc_char_loop_66_bad()
{
    char * data;
    char * dataArray[5];
    data = NULL;
    /* FLAW: Use a small buffer */
    data = (char *)malloc(50*sizeof(char));
    if (data == NULL) {exit(-1);}
    memset(data, 'A', 50-1); /* fill with 'A's */
    data[50-1] = '\0'; /* null terminate */
    /* put data in array */
    dataArray[2] = data;
    CWE126_Buffer_Overread__malloc_char_loop_66b_badSink(dataArray);
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodG2B uses the GoodSource with the BadSink */
void CWE126_Buffer_Overread__malloc_char_loop_66b_goodG2BSink(char * dataArray[]);

static void goodG2B()
{
    char * data;
    char * dataArray[5];
    data = NULL;
    /* FIX: Use a large buffer */
    data = (char *)malloc(100*sizeof(char));
    if (data == NULL) {exit(-1);}
    memset(data, 'A', 100-1); /* fill with 'A's */
    data[100-1] = '\0'; /* null terminate */
    dataArray[2] = data;
    CWE126_Buffer_Overread__malloc_char_loop_66b_goodG2BSink(dataArray);
}

void CWE126_Buffer_Overread__malloc_char_loop_66_good()
{
    goodG2B();
}

#endif /* OMITGOOD */

/* Below is the main(). It is only used when building this testcase on
 * its own for testing or for building a binary to use in testing binary
 * analysis tools. It is not used when compiling all the testcases as one
 * application, which is how source code analysis tools are tested.
 */

#ifdef INCLUDEMAIN

int main(int argc, char * argv[])
{
    /* seed randomness */
    srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
    printLine("Calling good()...");
    CWE126_Buffer_Overread__malloc_char_loop_66_good();
    printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
    printLine("Calling bad()...");
    CWE126_Buffer_Overread__malloc_char_loop_66_bad();
    printLine("Finished bad()");
#endif /* OMITBAD */
    return 0;
}

#endif


text:
using System;
using System.Collections;
using System.Collections.Generic;

namespace cAlgo.MQ4
{
	public class Mq4Array<T> : IMq4Array<T>, IEnumerable
	{
		private List<T> _data = new List<T>();
		private readonly T _defaultValue;

		public Mq4Array(int size = 0)
		{
			_defaultValue = (T)DefaultValues.GetDefaultValue<T>();
		}

		public IEnumerator GetEnumerator()
		{
			return _data.GetEnumerator();
		}

		private bool _isInverted;
		public bool IsInverted
		{
			get { return _isInverted; }
			set { _isInverted = value; }
		}

		public void Add(T value)
		{
			_data.Add(value);
		}

		private void EnsureCountIsEnough(int index)
		{
			while (_data.Count <= index)
				_data.Add(_defaultValue);
		}

		public int Length
		{
			get { return _data.Count; }
		}

		public void Resize(int newSize)
		{
			while (newSize < _data.Count)
				_data.RemoveAt(_data.Count - 1);

			while (newSize > _data.Count)
				_data.Add(_defaultValue);
		}

		public T this[int index]
		{
			get
			{
				if (index < 0)
					return _defaultValue;

				EnsureCountIsEnough(index);

				return _data[index];
			}
			set
			{
				if (index < 0)
					return;

				EnsureCountIsEnough(index);

				_data[index] = value;
				Changed.Raise(index, value);
			}
		}
		public event Action<int, T> Changed;
	}

}


text:
import Vue from 'vue'
import axios from 'axios'
import router from './router'
import store from './store'
import { sync } from 'vuex-router-sync'
import App from 'components/app-root'
Vue.prototype.$http = axios;

sync(store, router)

Vue.use(axios)

const app = new Vue({
    store,
    router,
    ...App

})

export {
    app,
    router,
    store
}


text:
<?php
/**
 * FileManagerPage
 *
 * PHP version 5
 *
 * @category Class
 * @package  ultracart\v2
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * UltraCart Rest API V2
 *
 * UltraCart REST API Version 2
 *
 * OpenAPI spec version: 2.0.0
 * Contact: support@ultracart.com
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 * Swagger Codegen version: 2.4.15-SNAPSHOT
 */

/**
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */

namespace ultracart\v2\models;

use \ArrayAccess;
use \ultracart\v2\ObjectSerializer;

/**
 * FileManagerPage Class Doc Comment
 *
 * @category Class
 * @package  ultracart\v2
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class FileManagerPage implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $swaggerModelName = 'FileManagerPage';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'current_storefront_fs_directory_oid' => 'int',
        'directories' => '\ultracart\v2\models\FileManagerDirectory[]',
        'files' => '\ultracart\v2\models\FileManagerFile[]',
        'hostname' => 'string',
        'parent_storefront_fs_directory_oid' => 'int',
        'path' => 'string',
        'path_list' => '\ultracart\v2\models\FileManagerDirectory[]',
        'storefront_oid' => 'int'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'current_storefront_fs_directory_oid' => 'int32',
        'directories' => null,
        'files' => null,
        'hostname' => null,
        'parent_storefront_fs_directory_oid' => 'int32',
        'path' => null,
        'path_list' => null,
        'storefront_oid' => 'int32'
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function swaggerTypes()
    {
        return self::$swaggerTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function swaggerFormats()
    {
        return self::$swaggerFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'current_storefront_fs_directory_oid' => 'current_storefront_fs_directory_oid',
        'directories' => 'directories',
        'files' => 'files',
        'hostname' => 'hostname',
        'parent_storefront_fs_directory_oid' => 'parent_storefront_fs_directory_oid',
        'path' => 'path',
        'path_list' => 'path_list',
        'storefront_oid' => 'storefront_oid'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'current_storefront_fs_directory_oid' => 'setCurrentStorefrontFsDirectoryOid',
        'directories' => 'setDirectories',
        'files' => 'setFiles',
        'hostname' => 'setHostname',
        'parent_storefront_fs_directory_oid' => 'setParentStorefrontFsDirectoryOid',
        'path' => 'setPath',
        'path_list' => 'setPathList',
        'storefront_oid' => 'setStorefrontOid'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'current_storefront_fs_directory_oid' => 'getCurrentStorefrontFsDirectoryOid',
        'directories' => 'getDirectories',
        'files' => 'getFiles',
        'hostname' => 'getHostname',
        'parent_storefront_fs_directory_oid' => 'getParentStorefrontFsDirectoryOid',
        'path' => 'getPath',
        'path_list' => 'getPathList',
        'storefront_oid' => 'getStorefrontOid'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$swaggerModelName;
    }

    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['current_storefront_fs_directory_oid'] = isset($data['current_storefront_fs_directory_oid']) ? $data['current_storefront_fs_directory_oid'] : null;
        $this->container['directories'] = isset($data['directories']) ? $data['directories'] : null;
        $this->container['files'] = isset($data['files']) ? $data['files'] : null;
        $this->container['hostname'] = isset($data['hostname']) ? $data['hostname'] : null;
        $this->container['parent_storefront_fs_directory_oid'] = isset($data['parent_storefront_fs_directory_oid']) ? $data['parent_storefront_fs_directory_oid'] : null;
        $this->container['path'] = isset($data['path']) ? $data['path'] : null;
        $this->container['path_list'] = isset($data['path_list']) ? $data['path_list'] : null;
        $this->container['storefront_oid'] = isset($data['storefront_oid']) ? $data['storefront_oid'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }

    /**
     * Gets current_storefront_fs_directory_oid
     *
     * @return int
     */
    public function getCurrentStorefrontFsDirectoryOid()
    {
        return $this->container['current_storefront_fs_directory_oid'];
    }

    /**
     * Sets current_storefront_fs_directory_oid
     *
     * @param int $current_storefront_fs_directory_oid current_storefront_fs_directory_oid
     *
     * @return $this
     */
    public function setCurrentStorefrontFsDirectoryOid($current_storefront_fs_directory_oid)
    {
        $this->container['current_storefront_fs_directory_oid'] = $current_storefront_fs_directory_oid;

        return $this;
    }

    /**
     * Gets directories
     *
     * @return \ultracart\v2\models\FileManagerDirectory[]
     */
    public function getDirectories()
    {
        return $this->container['directories'];
    }

    /**
     * Sets directories
     *
     * @param \ultracart\v2\models\FileManagerDirectory[] $directories directories
     *
     * @return $this
     */
    public function setDirectories($directories)
    {
        $this->container['directories'] = $directories;

        return $this;
    }

    /**
     * Gets files
     *
     * @return \ultracart\v2\models\FileManagerFile[]
     */
    public function getFiles()
    {
        return $this->container['files'];
    }

    /**
     * Sets files
     *
     * @param \ultracart\v2\models\FileManagerFile[] $files files
     *
     * @return $this
     */
    public function setFiles($files)
    {
        $this->container['files'] = $files;

        return $this;
    }

    /**
     * Gets hostname
     *
     * @return string
     */
    public function getHostname()
    {
        return $this->container['hostname'];
    }

    /**
     * Sets hostname
     *
     * @param string $hostname hostname
     *
     * @return $this
     */
    public function setHostname($hostname)
    {
        $this->container['hostname'] = $hostname;

        return $this;
    }

    /**
     * Gets parent_storefront_fs_directory_oid
     *
     * @return int
     */
    public function getParentStorefrontFsDirectoryOid()
    {
        return $this->container['parent_storefront_fs_directory_oid'];
    }

    /**
     * Sets parent_storefront_fs_directory_oid
     *
     * @param int $parent_storefront_fs_directory_oid parent_storefront_fs_directory_oid
     *
     * @return $this
     */
    public function setParentStorefrontFsDirectoryOid($parent_storefront_fs_directory_oid)
    {
        $this->container['parent_storefront_fs_directory_oid'] = $parent_storefront_fs_directory_oid;

        return $this;
    }

    /**
     * Gets path
     *
     * @return string
     */
    public function getPath()
    {
        return $this->container['path'];
    }

    /**
     * Sets path
     *
     * @param string $path path
     *
     * @return $this
     */
    public function setPath($path)
    {
        $this->container['path'] = $path;

        return $this;
    }

    /**
     * Gets path_list
     *
     * @return \ultracart\v2\models\FileManagerDirectory[]
     */
    public function getPathList()
    {
        return $this->container['path_list'];
    }

    /**
     * Sets path_list
     *
     * @param \ultracart\v2\models\FileManagerDirectory[] $path_list path_list
     *
     * @return $this
     */
    public function setPathList($path_list)
    {
        $this->container['path_list'] = $path_list;

        return $this;
    }

    /**
     * Gets storefront_oid
     *
     * @return int
     */
    public function getStorefrontOid()
    {
        return $this->container['storefront_oid'];
    }

    /**
     * Sets storefront_oid
     *
     * @param int $storefront_oid storefront_oid
     *
     * @return $this
     */
    public function setStorefrontOid($storefront_oid)
    {
        $this->container['storefront_oid'] = $storefront_oid;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}


text:
package SnapPrep;

import java.util.Collections;
import java.util.PriorityQueue;

public class _0295FindMedianFromDataStream {

	public static void main(String[] args) {
		MedianFinder mf = new MedianFinder();
		mf.addNum(1);
		mf.addNum(2);
		System.out.println(mf.findMedian());// -> 1.5
		mf.addNum(3);
		System.out.println(mf.findMedian());// -> 2
	}

	static class MedianFinder {
		PriorityQueue<Integer> maxHeap, minHeap;

		/** initialize your data structure here. */
		public MedianFinder() {
			maxHeap = new PriorityQueue<Integer>();
			minHeap = new PriorityQueue<Integer>(Collections.reverseOrder());
		}

		public void addNum(int num) {
			maxHeap.offer(num);
			minHeap.offer(maxHeap.poll());

			if (minHeap.size() > maxHeap.size())
				maxHeap.offer(minHeap.poll());
		}

		public double findMedian() {
			if (minHeap.size() == maxHeap.size()) {
				return (minHeap.peek() + maxHeap.peek()) / (double) 2;
			}
			return maxHeap.peek();
		}
	}

}


text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee181027884">
<name type="corporate">
 <namePart>United States Government Printing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">printer</roleTerm>
  <roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States District Court District of Maryland</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2011-11-15</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2010-01-07</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-mdd-8_07-cv-02186</identifier>
<identifier type="local">P0b002ee181027884</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2011-11-15</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2011-11-15</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-mdd-8_07-cv-02186</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-mdd-8_07-cv-02186</accessId>
 <courtType>District</courtType>
 <courtCode>mdd</courtCode>
 <courtCircuit>4th</courtCircuit>
 <courtState>Maryland</courtState>
 <courtSortOrder>2230</courtSortOrder>
 <caseNumber>8:07-cv-02186</caseNumber>
 <caseOffice>Greenbelt</caseOffice>
 <caseType>civil</caseType>
 <natureSuitCode>320</natureSuitCode>
 <natureSuit>Assault, Libel, and Slander</natureSuit>
 <party firstName="Craig" fullName="Craig B. Doring" lastName="Doring" middleName="B." role="Defendant"></party>
 <party firstName="Linda" fullName="Linda Durbin" lastName="Durbin" role="Plaintiff"></party>
 <party firstName="Sean" fullName="Sean Haring" lastName="Haring" role="Defendant"></party>
 <party firstName="Kelly" fullName="Kelly Melby" lastName="Melby" role="Plaintiff"></party>
 <party firstName="Robert" fullName="Robert Melby" lastName="Melby" role="Plaintiff"></party>
</extension>
<titleInfo>
 <title>Durbin et al v. Doring et al</title>
 <partNumber>8:07-cv-02186</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-mdd-8_07-cv-02186/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">8:07-cv-02186;07-2186</identifier>
<name type="corporate">
 <namePart>United States District Court District of Maryland</namePart>
 <namePart>4th Circuit</namePart>
 <namePart>Greenbelt</namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>Craig B. Doring</displayForm>
 <namePart type="family">Doring</namePart>
 <namePart type="given">Craig</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>Linda Durbin</displayForm>
 <namePart type="family">Durbin</namePart>
 <namePart type="given">Linda</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<name type="personal">
 <displayForm>Sean Haring</displayForm>
 <namePart type="family">Haring</namePart>
 <namePart type="given">Sean</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>Kelly Melby</displayForm>
 <namePart type="family">Melby</namePart>
 <namePart type="given">Kelly</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<name type="personal">
 <displayForm>Robert Melby</displayForm>
 <namePart type="family">Melby</namePart>
 <namePart type="given">Robert</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-mdd-8_07-cv-02186</accessId>
 <courtType>District</courtType>
 <courtCode>mdd</courtCode>
 <courtCircuit>4th</courtCircuit>
 <courtState>Maryland</courtState>
 <courtSortOrder>2230</courtSortOrder>
 <caseNumber>8:07-cv-02186</caseNumber>
 <caseOffice>Greenbelt</caseOffice>
 <caseType>civil</caseType>
 <natureSuitCode>320</natureSuitCode>
 <natureSuit>Assault, Libel, and Slander</natureSuit>
 <party firstName="Craig" fullName="Craig B. Doring" lastName="Doring" middleName="B." role="Defendant"></party>
 <party firstName="Linda" fullName="Linda Durbin" lastName="Durbin" role="Plaintiff"></party>
 <party firstName="Sean" fullName="Sean Haring" lastName="Haring" role="Defendant"></party>
 <party firstName="Kelly" fullName="Kelly Melby" lastName="Melby" role="Plaintiff"></party>
 <party firstName="Robert" fullName="Robert Melby" lastName="Melby" role="Plaintiff"></party>
 <state>Maryland</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-mdd-8_07-cv-02186-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-mdd-8_07-cv-02186/USCOURTS-mdd-8_07-cv-02186-0/mods.xml">
 <titleInfo>
  <title>Durbin et al v. Doring et al</title>
  <subTitle>MEMORANDUM OPINION. Signed by Judge Roger W Titus on 1/6/10. (ch, Deputy Clerk)</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2010-01-07</dateIssued>
</originInfo>
 <relatedItem xlink:href="http://www.gpo.gov/fdsys/pkg/pdf/USCOURTS-mdd-8_07-cv-02186-0.pdf" type="otherFormat">
  <identifier type="FDsys Unique ID">D09002ee1810d493e</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-mdd-8_07-cv-02186/USCOURTS-mdd-8_07-cv-02186-0</identifier>
 <identifier type="former granule identifier">mdd-8_07-cv-02186_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-mdd-8_07-cv-02186/USCOURTS-mdd-8_07-cv-02186-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-mdd-8_07-cv-02186/pdf/USCOURTS-mdd-8_07-cv-02186-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 8:07-cv-02186; Durbin et al v. Doring et al; </searchTitle>
  <courtName>United States District Court District of Maryland</courtName>
  <state>Maryland</state>
  <accessId>USCOURTS-mdd-8_07-cv-02186-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2010-01-07</dateIssued>
  <docketText>MEMORANDUM OPINION. Signed by Judge Roger W Titus on 1/6/10. (ch, Deputy Clerk)</docketText>
</extension>
</relatedItem>
</mods>


text:
(function () {
  angular
    .module('oracle-client')
    .service('oracleClient', oracleClient);

  oracleClient.$inject = ['$rootScope', '$location'];

  function oracleClient($rootScope, $location) {
    var port = $location.port() !== 80 ? `:${$location.port()}`: '';
    var url = `${$location.protocol()}://${$location.host()}${port}`;
    var socket = io.connect(url);

    var service = {
      connectionId: null,
      connecting: false,
      connect: connect,
      disconnect: disconnect,
      execute: execute
    };

    return service;

    function connect(config) {
      return new Promise((resolve, reject) => {
        service.connecting = true;
        socket.emit('db-connect', config, (err, connectionId) => {
          service.connecting = false;
          if(err) {
            reject(err);
          } else {
            service.connectionId = connectionId;
            resolve(connectionId);
            $rootScope.$emit('oracle-client:connected');
          }
        });
      });
    }

    function disconnect() {
      return new Promise((resolve, reject) => {
        socket.emit('db-release', service.connectionId, (err) => {
          if(err) {
            reject(err);
          } else {
            resolve(service.connectionId);
            service.connectionId = null;
            $rootScope.$emit('oracle-client:disconnected');
          }
        });
      });
    }

    function execute(sql) {
      return new Promise((resolve, reject) => {
        socket.emit('db-execute', service.connectionId, sql, null, (err, res) => {
          if(err) { reject(err); } else { resolve(res); }
        });
      });
    }
  }
})();


text:
---
layout: post
title: How To Create an Animated Pickup in CSS and HTML
header: Creating a CSS and HTML Animated Pickup
category: Deconstructions
author: george
---

This week I came across the [7mml](http://7mml.org/) website and I loved the loaded symbol. An animated car with a scrolling background. It was rather sluggish so I looked at how it was built. It was actually built using a large background image with javascript changing the background position.

### What is it?
I am going to rebuild the car/pickup in HTML, SVG and CSS. I was going to build it all in CSS but as it is a complicated shape SVG is probably better. Here's my version:

{% highlight html %}

{% endhighlight %}

Let's break it down.

#### The Wheels
I started building the car using just HTML and CSS so theses are circles built using border-radius. I used the :before and :after pseudo-elements too for the inner circles. You may be asking "Why did you not use a border on the inner circle?" - if I used border I would not be able to use percentage widths. Then I added an infinite spin animation which works well because of the slightly inconsistent size;

{% highlight css %}
@keyframes spin {
    0% { transform: rotate(0); }
    100% { transform: rotate(360deg); }
}

.wheel,
.wheel:after,
.wheel:before {
    bottom: -20%;
    width: 12.8%;
    height: 46.38%;
    border-radius: 100%;
    background: #1e2327;
}

.wheel {
    left: 21.5%;
    -webkit-animation: spin 0.4s infinite linear;
    animation: spin 0.4s infinite linear;
}

.wheel.front {
    left: 82%;
}

.wheel:after,
.wheel:before {
    content: "";
    position: absolute;
    display: block;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 60%;
}

.wheel:before {
    background: #aaa;
}

.wheel:after {
    top: 40%;
    left: 40%;
    width: 20%;
    height: 20%;
}
{% endhighlight %}

#### The Body

I started building the body with HTML elements and CSS but felt I was using the wrong tool for the job. I decided to use SVG instead. There are actually two images to be exact and I overlay one on the other with a slight rotation and vertical transition to give it a bit of character.

{% highlight css %}
@keyframes bobbing {
    0%{
        transform: rotate(0) translateY(0);
    }
    100%{
        transform: rotate(0.1deg) translateY(5px);
    }
}

.body {
    width: 100%;
    position: relative;
    transform-origin: right center;
    animation: bobbing 0.2s infinite ease-in-out forwards alternate;
}

.frame {
    position: relative;
}

.truck img {
    width: 100%;
    height: auto;
    top: 0;
    left: 0;
    margin: 0;
}
{% endhighlight %}

#### The Shine
This uses the same effect as the [Facebook content placeholder](http://cloudcannon.com/deconstructions/2014/11/15/facebook-content-placeholder-deconstruction.html). It has the bobble animation as it's placed inside the .body of the truck. The first image is to show the gradient and the shape which is achieved using transforms and a linear gradient. The second one has an animation applied.

{% highlight css %}
@keyframes shine {
    0%{
        opacity: 0.1;
        background-position: 50px top;
    }
    30% { opacity: 1; }
    50%, 100%{
        opacity: 0.2;
        background-position: -500px 0;
    }
}

.shine {
    /* Position it in the gap */
    width: 67%;
    height: 37%;
    left: 9%;
    top: 6%;

    /* Shape of the div to fit the windows */
    transform: skew(33deg, 1deg);
    border-radius: 56px 100px 20px 0;

    /* The background */
    background: linear-gradient(to right, transparent 76%, rgba(255,255,255,0.8) 78%, rgba(255,255,255,0.8) 96%, transparent 98%);
    background-repeat: no-repeat;
    background-size: cover;

    /* The animation */
    animation: shine 3s infinite ease forwards;
}
{% endhighlight %}

#### The Speed Things
These are simple shrinking and growing divs.

{% highlight css %}
@keyframes thingy {
    0%{
        transform: translateX(0);
        width: 0;
        opacity: 0;
    }
    10%{
        width: 10%;
        opacity: 1;
    }
    30%, 100%{
        transform: translateX(-250px);
        width: 0;
        opacity: 0;
    }
}

.speed-thingy {
    position: absolute;
    width: 20px;
    border-radius: 10px;
    height: 5%;
    background: #fff;
    top: -10%;
    left: 50%;
    animation: thingy 3s infinite ease forwards;
}

.speed-thingy.second {
    top: 50%;
    left: 30%;
    animation-delay: 0.1s;
}
{% endhighlight %}

#### A Shadow to top it all off
This makes the bobbing effect seem more realistic and shows a platform for the wheels to sit on. We want it to stay still at the front so we change the transform origin to the front. Once that's done we scale it ever so slightly with timing to match the body.

{% highlight css %}
@keyframes shadow {
    0%{
        transform: scale(1);
    }
    100%{
        transform: scale(1.01);
    }
}

.shadow {
    width: 90%;
    border-radius: 100%;
    height: 20px;
    bottom: -25%;
    left: 5%;
    background: rgba(0,0,0,0.1);
    animation: shadow 0.2s infinite ease-in-out forwards alternate;
    transform-origin: right center;
}
{% endhighlight %}

#### All Together Again

### Why would I ever use this?
Using CSS animations rather than sprite sheets will give you:

- A crisp look on all screen resolutions
- Seamless tweening between states.
- Flexibility to reuse work (It's much easier to change code then recreate images)

### That's it
I have altered the original quite a bit and the key with these animations was subtlety. Each part adds up to a make it look like it is traveling forward even without the background animations. Going back to [Tim's one word idea](http://cloudcannon.com/operations/2014/12/03/this-is-operations.html), for animations it would be to "subtlety" or "reactive". Animations should not surprise the user, they should feel natural and help convey a real world metaphor. If an animation is off continued use will annoy the user not improve their experience. Hope you enjoyed this deconstruction, comment below if you have any questions.


text:
require "spec_helper"

require "importu/backends/middleware/duplicate_manager_proxy"
require "importu/definition"

RSpec.describe Importu::Backends::Middleware::DuplicateManagerProxy do
  subject(:middleware) { described_class.new(dummy_backend, backend_config) }

  let(:dummy_backend) { DummyBackend.new(backend_config) }
  let(:backend_config) { definition.config[:backend] }

  let(:definition) do
    Class.new(Importu::Definition) do
      fields :foo, :bar, :baz
      find_by :foo, :bar
    end
  end

  describe "#create" do
    it "returns the status and object from the backend" do
      status, object = middleware.create(foo: 1, bar: 1, baz: 1)
      expect(status).to eq :created
      expect(object).to include(foo: 1, bar: 1, baz: 1)
    end

    it "perform duplicate detection on the record" do
      middleware.create(foo: 1, bar: 1, baz: 1)
      expect { middleware.create(foo: 2, bar: 1, baz: 2) } # :baz is a dupe find_by
        .to raise_error(Importu::DuplicateRecord)
    end

    it "records created object for subsequent dupe detection" do
      middleware.create(foo: 1, bar: 1, baz: 1)
      expect { middleware.create(foo: 2, bar: 1, baz: 2) }
        .to raise_error(Importu::DuplicateRecord)
    end
  end

  describe "#update" do
    it "returns the status and object from the backend" do
      _, object = dummy_backend.create(foo: 1, bar: 1, baz: 1)
      status, new_object = middleware.update({foo: 2, bar: 2, baz: 2}, object)

      expect(status).to eq :updated
      expect(new_object).to include(foo: 2, bar: 2, baz: 2)
    end

    it "perform duplicate detection on the record" do
      _status, object = middleware.create(foo: 1, bar: 1, baz: 1)

      expect(dummy_backend).to_not receive(:update)
      expect { middleware.update({foo: 1, bar: 2, baz: 2}, object) } # :foo is a dupe
        .to raise_error(Importu::DuplicateRecord)
    end

    it "performs duplicate detection on object" do
      # Existing db record, never accessed through dupe detector
      _status, object = dummy_backend.create(foo: 1, bar: 1, baz: 1)

      # Update via :foo, first encounter of k/v and first encounter of object
      expect { middleware.update({foo: 1, bar: 2, baz: 3}, object) }.to_not raise_error

      # Update via :bar, first encounter of k/v, but second encounter of object
      expect { middleware.update({foo: 2, bar: 1, baz: 3}, object) }
        .to raise_error(Importu::DuplicateRecord)
    end
  end

end


text:
#include <QFile>
#include <QJsonDocument>
#include <QJsonObject>
#include <QScopedPointer>
#include <QTest>
#include <QVariantMap>

#include <qhttpengine/socket.h>
#include <qhttpengine/localauthmiddleware.h>

#include "common/qsimplehttpclient.h"
#include "common/qsocketpair.h"

const QByteArray HeaderName = "X-Test";
const QByteArray CustomName = "Name";
const QByteArray CustomData = "Data";

class TestLocalAuthMiddleware : public QObject
{
    Q_OBJECT

private Q_SLOTS:

    void testAuth();
    void testRemoval();
};

void TestLocalAuthMiddleware::testAuth()
{
    QSocketPair pair;
    QTRY_VERIFY(pair.isConnected());

    QSimpleHttpClient client(pair.client());
    QHttpEngine::Socket socket(pair.server(), &pair);

    QHttpEngine::LocalAuthMiddleware localAuth;
    localAuth.setData(QVariantMap{
        {CustomName, CustomData}
    });
    localAuth.setHeaderName(HeaderName);
    QVERIFY(localAuth.exists());

    QFile file(localAuth.filename());
    QVERIFY(file.open(QIODevice::ReadOnly));

    QVariantMap data = QJsonDocument::fromJson(file.readAll()).object().toVariantMap();
    QVERIFY(data.contains("token"));
    QCOMPARE(data.value(CustomName).toByteArray(), CustomData);

    client.sendHeaders("GET", "/", QHttpEngine::Socket::HeaderMap{
        {HeaderName, data.value("token").toByteArray()}
    });
    QTRY_VERIFY(socket.isHeadersParsed());

    QVERIFY(localAuth.process(&socket));
}

void TestLocalAuthMiddleware::testRemoval()
{
    QScopedPointer<QHttpEngine::LocalAuthMiddleware> localAuth(
                new QHttpEngine::LocalAuthMiddleware);
    QString filename = localAuth->filename();

    QVERIFY(QFile::exists(filename));
    delete localAuth.take();
    QVERIFY(!QFile::exists(filename));
}

QTEST_MAIN(TestLocalAuthMiddleware)
#include "TestLocalAuthMiddleware.moc"


text:
<?php

declare(strict_types=1);

namespace Hail\Http\Client;

use Hail\Http\Client\Exception\ClientException;
use Hail\Http\Client\Exception\NetworkException;
use Hail\Http\Client\Exception\RequestException;
use Hail\Http\Factory;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;

/**
 * Base client class with helpers for working with cURL.
 */
abstract class AbstractCurl extends AbstractClient
{
    private $handles = [];

    private $maxHandles = 5;

    public function __construct(array $options = [])
    {
        static::$default['curl'] = [];
        static::$types['curl'] = 'array';

        parent::__construct($options);
    }

    /**
     * Creates a new cURL resource.
     *
     * @return resource A new cURL resource
     *
     * @throws ClientException If unable to create a cURL resource
     */
    protected function createHandle()
    {
        $curl = $this->handles ? \array_pop($this->handles) : \curl_init();
        if (false === $curl) {
            throw new ClientException('Unable to create a new cURL handle');
        }

        return $curl;
    }

    /**
     * Release a cUrl resource. This function is from Guzzle.
     *
     * @param resource $curl
     */
    protected function releaseHandle($curl): void
    {
        if (\count($this->handles) >= $this->maxHandles) {
            \curl_close($curl);
        } else {
            // Remove all callback functions as they can hold onto references
            // and are not cleaned up by curl_reset. Using curl_setopt_array
            // does not work for some reason, so removing each one
            // individually.
            \curl_setopt($curl, \CURLOPT_HEADERFUNCTION, null);
            \curl_setopt($curl, \CURLOPT_READFUNCTION, null);
            \curl_setopt($curl, \CURLOPT_WRITEFUNCTION, null);
            \curl_setopt($curl, \CURLOPT_PROGRESSFUNCTION, null);
            \curl_reset($curl);

            if (!\in_array($curl, $this->handles)) {
                $this->handles[] = $curl;
            }
        }
    }

    /**
     * Prepares a cURL resource to send a request.
     *
     * @param resource         $curl
     * @param RequestInterface $request
     * @param array            $options
     *
     * @return ResponseInterface
     */
    protected function prepare($curl, RequestInterface $request, array $options): ResponseInterface
    {
        if (\defined('CURLOPT_PROTOCOLS')) {
            \curl_setopt($curl, \CURLOPT_PROTOCOLS, \CURLPROTO_HTTP | \CURLPROTO_HTTPS);
            \curl_setopt($curl, \CURLOPT_REDIR_PROTOCOLS, \CURLPROTO_HTTP | \CURLPROTO_HTTPS);
        }

        \curl_setopt($curl, \CURLOPT_HEADER, false);
        \curl_setopt($curl, \CURLOPT_RETURNTRANSFER, false);
        \curl_setopt($curl, \CURLOPT_FAILONERROR, false);

        $this->setOptionsFromParameter($curl, $options);
        $this->setOptionsFromRequest($curl, $request);

        $response = Factory::response();
        \curl_setopt($curl, \CURLOPT_HEADERFUNCTION, function ($ch, $data) use ($response) {
            $str = \trim($data);
            if ('' !== $str) {
                if (0 === \stripos($str, 'http/')) {
                    $this->setStatus($response, $str);
                } else {
                    $this->addHeader($response, $str);
                }
            }

            return \strlen($data);
        });

        \curl_setopt($curl, \CURLOPT_WRITEFUNCTION, function ($ch, $data) use ($response) {
            return $response->getBody()->write($data);
        });

        // apply additional options
        if ($options['curl'] !== []) {
            \curl_setopt_array($curl, $options['curl']);
        }

        return $response;
    }

    /**
     * Sets options on a cURL resource based on a request.
     *
     * @param resource         $curl    A cURL resource
     * @param RequestInterface $request A request object
     */
    private function setOptionsFromRequest($curl, RequestInterface $request): void
    {
        $options = [
            \CURLOPT_CUSTOMREQUEST => $request->getMethod(),
            \CURLOPT_URL => $request->getUri()->__toString(),
            \CURLOPT_HTTPHEADER => $this->toHeaders($request->getHeaders()),
        ];

        if (0 !== $version = $this->getProtocolVersion($request)) {
            $options[\CURLOPT_HTTP_VERSION] = $version;
        }

        if ($request->getUri()->getUserInfo()) {
            $options[\CURLOPT_USERPWD] = $request->getUri()->getUserInfo();
        }

        switch (strtoupper($request->getMethod())) {
            case 'HEAD':
                $options[\CURLOPT_NOBODY] = true;
                break;

            case 'GET':
                $options[\CURLOPT_HTTPGET] = true;
                break;

            case 'POST':
            case 'PUT':
            case 'DELETE':
            case 'PATCH':
            case 'OPTIONS':
                $body = $request->getBody();
                $bodySize = $body->getSize();
                if (0 !== $bodySize) {
                    if ($body->isSeekable()) {
                        $body->rewind();
                    }

                    // Message has non empty body.
                    if (null === $bodySize || $bodySize > 1024 * 1024) {
                        // Avoid full loading large or unknown size body into memory
                        $options[\CURLOPT_UPLOAD] = true;
                        if (null !== $bodySize) {
                            $options[\CURLOPT_INFILESIZE] = $bodySize;
                        }
                        $options[\CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) {
                            return $body->read($length);
                        };
                    } else {
                        // Small body can be loaded into memory
                        $options[\CURLOPT_POSTFIELDS] = (string)$body;
                    }
                }
        }

        \curl_setopt_array($curl, $options);
    }

    /**
     * @param resource $curl
     * @param array    $options
     */
    private function setOptionsFromParameter($curl, array $options): void
    {
        if (null !== $proxy = $options['proxy']) {
            \curl_setopt($curl, \CURLOPT_PROXY, $proxy);
        }

        $canFollow = !\ini_get('safe_mode') && !\ini_get('open_basedir') && $options['allow_redirects'];
        \curl_setopt($curl, \CURLOPT_FOLLOWLOCATION, $canFollow);
        \curl_setopt($curl, \CURLOPT_MAXREDIRS, $canFollow ? $options['max_redirects'] : 0);
        \curl_setopt($curl, \CURLOPT_SSL_VERIFYPEER, $options['verify'] ? 1 : 0);
        \curl_setopt($curl, \CURLOPT_SSL_VERIFYHOST, $options['verify'] ? 2 : 0);
        \curl_setopt($curl, \CURLOPT_TIMEOUT, $options['timeout']);
    }

    /**
     * @param RequestInterface $request
     * @param int              $errno
     * @param resource         $curl
     *
     * @throws NetworkException
     * @throws RequestException
     */
    protected function parseError(RequestInterface $request, int $errno, $curl): void
    {
        switch ($errno) {
            case \CURLE_OK:
                // All OK, create a response object
                break;
            case \CURLE_COULDNT_RESOLVE_PROXY:
            case \CURLE_COULDNT_RESOLVE_HOST:
            case \CURLE_COULDNT_CONNECT:
            case \CURLE_OPERATION_TIMEOUTED:
            case \CURLE_SSL_CONNECT_ERROR:
                throw new NetworkException($request, \curl_error($curl), $errno);
            default:
                throw new RequestException($request, \curl_error($curl), $errno);
        }
    }

    private function getProtocolVersion(RequestInterface $request): int
    {
        switch ($request->getProtocolVersion()) {
            case '1.0':
                return \CURL_HTTP_VERSION_1_0;
            case '1.1':
                return \CURL_HTTP_VERSION_1_1;
            case '2.0':
                if (\defined('CURL_HTTP_VERSION_2_0')) {
                    return \CURL_HTTP_VERSION_2_0;
                }

                throw new \UnexpectedValueException('libcurl 7.33 needed for HTTP 2.0 support');
            default:
                return 0;
        }
    }
}


text:
<?php

declare(strict_types=1);

namespace Test\Functional\Krizalys\Onedrive\Traits;

use Facebook\WebDriver\Chrome\ChromeOptions;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

trait WebdriverTrait
{
    private static $arguments = [
        '--headless',
        '--incognito',
    ];

    private static function withWebdriver($webdriverBaseUri, callable $callback)
    {
        $opts = new ChromeOptions();
        $opts->addArguments(self::$arguments);
        $caps = DesiredCapabilities::chrome();
        $caps->setCapability(ChromeOptions::CAPABILITY, $opts);
        $webdriver = RemoteWebDriver::create($webdriverBaseUri, $caps);

        try {
            return $callback($webdriver);
        } catch (\Exception $exception) {
            throw $exception;
        } finally {
            $webdriver->quit();
        }
    }
}


text:
"""
模拟 streaming  每分钟的数据聚合一次
"""
from pyspark.sql import SparkSession
from pyspark.sql.functions import explode, split, window

spark = SparkSession.builder.master(
    "spark://192.168.33.50:7077"
).getOrCreate()

stream_data = spark \
    .readStream \
    .format("socket") \
    .option("host", "localhost") \
    .option("port", 9999) \
    .option('includeTimestamp', 'true') \
    .load()
stream_data.printSchema()

# 数据分割转成列
words = stream_data.select(
    explode(
        split(stream_data.value, " ")
    ).alias("zhexiao"),
    stream_data.timestamp
)
words.printSchema()

window_words = words.withWatermark(
    "timestamp", "1 minutes"
).groupBy(
    window(
        words.timestamp,
        '1 minutes',
        '1 minutes'
    ),
    words.zhexiao
).count()

# Start running the query that prints the running counts to the console
query = window_words \
    .writeStream \
    .trigger(processingTime='1 minutes') \
    .outputMode("update") \
    .format("console") \
    .option('truncate', 'false') \
    .start() \
    .awaitTermination()


text:
<problems>
    <problem>
        <file>test.kt</file>
        <line>5</line>
        <module>light_idea_test_case</module>
        <entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
        <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can be replaced with function reference</problem_class>
        <description>Lambda can be converted to a reference</description>
    </problem>
    <problem>
        <file>test.kt</file>
        <line>9</line>
        <module>light_idea_test_case</module>
        <entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
        <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can be replaced with function reference</problem_class>
        <description>Lambda can be converted to a reference</description>
    </problem>
    <problem>
        <file>test.kt</file>
        <line>13</line>
        <module>light_idea_test_case</module>
        <entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
        <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Can be replaced with function reference</problem_class>
        <description>Lambda can be converted to a reference</description>
    </problem>
</problems>


text:
package org.locationtech.geomesa.kafka.tools.status

import com.beust.jcommander._
import org.locationtech.geomesa.kafka.tools.{KafkaDataStoreCommand, ProducerKDSConnectionParams}
import org.locationtech.geomesa.kafka08.KafkaDataStoreSchemaManager
import org.locationtech.geomesa.tools.{Command, RequiredTypeNameParam}
import org.locationtech.geomesa.tools.utils.KeywordParamSplitter

import scala.collection.JavaConversions._

class KafkaKeywordsCommand extends KafkaDataStoreCommand {

  import org.locationtech.geomesa.utils.geotools.RichSimpleFeatureType.RichSimpleFeatureType

  override val name: String = "keywords"
  override val params = new KafkaKeywordsParams()

  override def execute(): Unit = withDataStore { (ds) =>
    val sft = ds.getSchema(params.featureName)

    var keywordsModified = false

    if (params.removeAll) {
      val confirm = System.console().readLine("Remove all keywords? (y/n): ").toLowerCase
      if (confirm.equals("y") || confirm.equals("yes")) {
        sft.removeAllKeywords()
        keywordsModified = true
      } else {
        Command.user.info("Aborting operation")
        ds.dispose()
        return
      }
    } else if (params.keywordsToRemove != null) {
      sft.removeKeywords(params.keywordsToRemove.toSet)
      keywordsModified = true
    }

    if (params.keywordsToAdd != null) {
      sft.addKeywords(params.keywordsToAdd.toSet)
      keywordsModified = true
    }

    // Update the existing schema
    ds.asInstanceOf[KafkaDataStoreSchemaManager].updateKafkaSchema(sft.getTypeName, sft)

    if (params.list) {
      val reloadedSft = ds.getSchema(params.featureName)
      Command.output.info("Keywords: " + reloadedSft.getKeywords.mkString(", "))
    }

    ds.dispose()
  }
}

@Parameters(commandDescription = "Add/Remove/List keywords on an existing schema")
class KafkaKeywordsParams extends ProducerKDSConnectionParams with RequiredTypeNameParam {

  @Parameter(names = Array("-a", "--add"), description = "A keyword to add. Can be specified multiple times", splitter = classOf[KeywordParamSplitter])
  var keywordsToAdd: java.util.List[String] = null

  @Parameter(names = Array("-r", "--remove"), description = "A keyword to remove. Can be specified multiple times", splitter = classOf[KeywordParamSplitter])
  var keywordsToRemove: java.util.List[String] = null

  @Parameter(names = Array("-l", "--list"), description = "List all keywords on the schema")
  var list: Boolean = false

  @Parameter(names = Array("--removeAll"), description = "Remove all keywords on the schema")
  var removeAll: Boolean = false

}


text:
VERILOG = ../../../Murax.v toplevel.v toplevel_pll.v

generate :
	(cd ../../..; sbt "runMain vexriscv.demo.MuraxWithRamInit")

../../../Murax.v :
	(cd ../../..; sbt "runMain vexriscv.demo.MuraxWithRamInit")

../../../Murax.v*.bin:

bin/toplevel.blif : ${VERILOG} ../../../Murax.v*.bin
	mkdir -p bin
	rm -f Murax.v*.bin
	cp ../../../Murax.v*.bin . | true
	yosys -v3 -p "synth_ice40 -top toplevel -blif bin/toplevel.blif" ${VERILOG}

bin/toplevel.asc : toplevel.pcf bin/toplevel.blif
	arachne-pnr -p toplevel.pcf -d 8k --max-passes 600 -P ct256 bin/toplevel.blif -o bin/toplevel.asc

bin/toplevel.bin : bin/toplevel.asc
	icepack bin/toplevel.asc bin/toplevel.bin

compile : bin/toplevel.bin

time: bin/toplevel.bin
	icetime -tmd hx8k bin/toplevel.asc

prog : bin/toplevel.bin
	iceprogduino bin/toplevel.bin

sudo-prog : bin/toplevel.bin
	sudo iceprogduino bin/toplevel.bin

clean :
	rm -rf bin
	rm -f Murax.v*.bin


text:
package org.apache.camel.component.properties;

import java.io.FileNotFoundException;

import org.apache.camel.ContextTestSupport;
import org.apache.camel.FailedToCreateRouteException;
import org.apache.camel.ResolveEndpointFailedException;
import org.apache.camel.builder.RouteBuilder;
import org.junit.Test;

public class PropertiesComponentDefaultTest extends ContextTestSupport {

    @Test
    public void testPropertiesComponentDefault() throws Exception {
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start").to("properties:bar.end?locations=org/apache/camel/component/properties/bar.properties");
            }
        });
        context.start();

        getMockEndpoint("mock:bar").expectedMessageCount(1);

        template.sendBody("direct:start", "Hello World");

        assertMockEndpointsSatisfied();
    }

    @Test
    public void testPropertiesComponentDefaultNoFileFound() throws Exception {
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start").to("properties:bar.end?locations=org/apache/camel/component/properties/unknown.properties");
            }
        });
        try {
            context.start();
            fail("Should throw exception");
        } catch (FailedToCreateRouteException e) {
            ResolveEndpointFailedException cause = assertIsInstanceOf(ResolveEndpointFailedException.class, e.getCause());
            FileNotFoundException fnfe = assertIsInstanceOf(FileNotFoundException.class, cause.getCause());
            assertEquals("Properties file org/apache/camel/component/properties/unknown.properties not found in classpath", fnfe.getMessage());
        }
    }

    @Test
    public void testIgnoreMissingPropertyFilesOnClasspath() throws Exception {
        System.setProperty("bar.end", "mock:bar");
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start").to("properties:bar.end?locations=org/apache/camel/component/properties/unknown.properties&ignoreMissingLocation=true");
            }
        });
        context.start();
        getMockEndpoint("mock:bar").expectedMessageCount(1);
        template.sendBody("direct:start", "Hello World");
        assertMockEndpointsSatisfied();
    }

    @Test
    public void testIgnoreMissingPropertyFilesFromRegistry() throws Exception {
        System.setProperty("bar.end", "mock:bar");
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start").to("properties:bar.end?locations=ref:unknown.properties&ignoreMissingLocation=true");
            }
        });
        context.start();
        getMockEndpoint("mock:bar").expectedMessageCount(1);
        template.sendBody("direct:start", "Hello World");
        assertMockEndpointsSatisfied();
    }

    @Test
    public void testIgnoreMissingPropertyFilesFromFilePath() throws Exception {
        System.setProperty("bar.end", "mock:bar");
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start").to("properties:bar.end?locations=file:unknown.properties&ignoreMissingLocation=true");
            }
        });
        context.start();
        getMockEndpoint("mock:bar").expectedMessageCount(1);
        template.sendBody("direct:start", "Hello World");
        assertMockEndpointsSatisfied();
    }

    @Test
    public void testIgnoreMissingPropertySystemPropertyOnClasspath() throws Exception {
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start").to("properties:bar.end?locations=${my.home}/unknown.properties,org/apache/camel/component/properties/bar.properties"
                        + "&ignoreMissingLocation=true");
            }
        });
        context.start();
        getMockEndpoint("mock:bar").expectedMessageCount(1);
        template.sendBody("direct:start", "Hello World");
        assertMockEndpointsSatisfied();
    }

    @Test
    public void testNotIgnoreMissingPropertySystemPropertyOnClasspath() throws Exception {
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start").to("properties:bar.end?locations=${my.home}/unknown.properties,org/apache/camel/component/properties/bar.properties"
                        + "&ignoreMissingLocation=false");
            }
        });
        try {
            context.start();
            fail("Should have thrown exception");
        } catch (FailedToCreateRouteException e) {
            assertEquals("Cannot find JVM system property with key: my.home", e.getCause().getCause().getMessage());
        }
    }

    @Override
    public boolean isUseRouteBuilder() {
        return false;
    }
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.03.23 at 01:49:06 PM CET
//

package org.sdmx.resources.sdmxml.schemas.v2_0.common;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlElementRefs;
import javax.xml.bind.annotation.XmlType;

/**
 * Key allows for sets of component references - holding the name of the component's concept - and a permitted value for that component. This conctruct can be repeated as many times as dessired, but must describe complete keys according to teh relevant structure definition (key family).
 *
 *
Java class for KeyType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="KeyType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence maxOccurs="unbounded">
 *         <element name="ComponentRef" type="{http://www.SDMX.org/resources/SDMXML/schemas/v2_0/common}IDType"/>
 *         <element name="Value" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "KeyType", propOrder = {
    "componentRefAndValue"
})
public class KeyType {

    @XmlElementRefs({
        @XmlElementRef(name = "ComponentRef", namespace = "http://www.SDMX.org/resources/SDMXML/schemas/v2_0/common", type = JAXBElement.class),
        @XmlElementRef(name = "Value", namespace = "http://www.SDMX.org/resources/SDMXML/schemas/v2_0/common", type = JAXBElement.class)
    })
    protected List<JAXBElement<String>> componentRefAndValue;

    /**
     * Gets the value of the componentRefAndValue property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the componentRefAndValue property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getComponentRefAndValue().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link JAXBElement }{@code <}{@link String }{@code >}
     * {@link JAXBElement }{@code <}{@link String }{@code >}
     *
     *
     */
    public List<JAXBElement<String>> getComponentRefAndValue() {
        if (componentRefAndValue == null) {
            componentRefAndValue = new ArrayList<JAXBElement<String>>();
        }
        return this.componentRefAndValue;
    }

}


text:
<?php
class FormHelper {
    protected $values = array();

    public function __construct($values = array()) {
        if ($_SERVER['REQUEST_METHOD'] == 'POST') {
            $this->values = $_POST;
        } else {
            $this->values = $values;
        }
    }

    public function input($type, $attributes = array(), $isMultiple = false) {
        $attributes['type'] = $type;
        if (($type == 'radio') || ($type == 'checkbox')) {
            if ($this->isOptionSelected($attributes['name'] ?? null,
                                        $attributes['value'] ?? null)) {
                $attributes['checked'] = true;
            }
        }
        return $this->tag('input', $attributes, $isMultiple);
    }

    public function select($options, $attributes = array()) {
        $multiple = $attributes['multiple'] ?? false;
        return
            $this->start('select', $attributes, $multiple) .
            $this->options($attributes['name'] ?? null, $options) .
            $this->end('select');
    }

    public function textarea($attributes = array()) {
        $name = $attributes['name'] ?? null;
        $value = $this->values[$name] ?? '';
        return $this->start('textarea', $attributes) .
               htmlentities($value) .
               $this->end('textarea');
    }

    public function tag($tag, $attributes = array(), $isMultiple = false) {
        return "<$tag {$this->attributes($attributes, $isMultiple)} />";
    }
    public function start($tag, $attributes = array(), $isMultiple = false) {
        // <select> and <textarea> tags don't get value attributes on them
        $valueAttribute = (! (($tag == 'select')||($tag == 'textarea')));
        $attrs = $this->attributes($attributes, $isMultiple, $valueAttribute);
        return "<$tag $attrs>";
    }
    public function end($tag) {
        return "</$tag>";
    }

    protected function attributes($attributes, $isMultiple,
                                  $valueAttribute = true) {
        $tmp = array();
        // If this tag could include a value attribute and it
        // has a name and there's an entry for the name
        // in the values array, then set a value attribute
        if ($valueAttribute && isset($attributes['name']) &&
            array_key_exists($attributes['name'], $this->values)) {
            $attributes['value'] = $this->values[$attributes['name']];
        }
        foreach ($attributes as $k => $v) {
            // True boolean value means boolean attribute
            if (is_bool($v)) {
                if ($v) { $tmp[] = $this->encode($k); }
            }
            // Otherwise k=v
            else {
                $value = $this->encode($v);
                // If this is an element that might have multiple values,
                // tack [] onto its name
                if ($isMultiple && ($k == 'name')) {
                    $value .= '[]';
                }
                $tmp[] = "$k=\"$value\"";
            }
        }
        return implode(' ', $tmp);
    }

    protected function options($name, $options) {
        $tmp = array();
        foreach ($options as $k => $v) {
            $s = "<option  value=\"{$this->encode($k)}\"";
            if ($this->isOptionSelected($name, $k)) {
                $s .= ' selected';
            }
            $s .= ">{$this->encode($v)}</option>";
            $tmp[] = $s;
        }
        return implode('', $tmp);
    }

    protected function isOptionSelected($name, $value) {
        // If there's no entry for $name in the values array,
        // then this option can't be selected
        if (! isset($this->values[$name])) {
            return false;
        }
        // If the entry for $name in the values array is itself
        // an array, check if $value is in that array
        else if (is_array($this->values[$name])) {
            return in_array($value, $this->values[$name]);
        }
        // Otherwise, compare $value to the entry to for $name
        // in the values array
        else {
            return $value == $this->values[$name];
        }
    }

    public function encode($s) {
        return htmlentities($s);
    }
}


text:
package com.yuxie.tgd.pojo.bean.dataMerge;

import java.io.Serializable;

public class ColumnDataAndBaseFormProperty implements Serializable {
    //序列化ID
    private static final long serialVersionUID = 1L;
    //该列的排序
    private int columnOrder;
    //该列的key
    private String columnKey;
    //该列的值
    private Object columnData;
    //使用的组件类型
    private String moduleType;

    @Override
    public String toString() {
        return "ColumnDataAndBaseFormProperty{" +
                "columnKey='" + columnKey + '\'' +
                ", columnData=" + columnData +
                ", columnOrder=" + columnOrder +
                ", moduleType='" + moduleType + '\'' +
                '}';
    }

    public String getColumnKey() {
        return columnKey;
    }

    public void setColumnKey(String columnKey) {
        this.columnKey = columnKey;
    }

    public Object getColumnData() {
        return columnData;
    }

    public void setColumnData(Object columnData) {
        this.columnData = columnData;
    }

    public int getColumnOrder() {
        return columnOrder;
    }

    public void setColumnOrder(int columnOrder) {
        this.columnOrder = columnOrder;
    }

    public String getModuleType() {
        return moduleType;
    }

    public void setModuleType(String moduleType) {
        this.moduleType = moduleType;
    }
}


text:
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;

namespace ReplaceExe
{
  class Program
  {
    const string regBasePath = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options";
    const string regValueName = "Debugger";

    static void Main(string[] args)
    {
      try
      {
        if (args.Length > 2 && args[0] == "-i") // -i <orig exe> <command args...>
          Install(args[1], args.Skip(2).ToArray());
        else if (args.Length > 1 && args[0] == "-u") // -u <orig exe>
          Uninstall(args[1]);
        else if (args.Length > 2) // <args> <command args...> <orig exe> file1 file2 ...
          Run(args);
        else
          PrintHelp();
      }
      catch (Exception ex)
      {
        System.Console.Error.WriteLine(string.Join(" ", args));
        // just catch and print anything
        System.Console.Error.WriteLine(ex.ToString());
      }
    }

    static void Install(string image, string[] command)
    {
      string myPath = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath;
      // <this exe> <number of following args> <args...>
      string fullCommand = string.Format("\"{0}\" {1} {2}", myPath, command.Length, string.Join(" ", command));

      var baseKey = Registry.LocalMachine.OpenSubKey(regBasePath, true);
      var key = baseKey.CreateSubKey(image);
      key.SetValue(regValueName, fullCommand);
    }

    static void Uninstall(string image)
    {
      var baseKey = Registry.LocalMachine.OpenSubKey(regBasePath, true);
      var key = baseKey.OpenSubKey(image, true);
      if (key != null)
        key.DeleteValue(regValueName, false);
    }

    static void Run(string[] args)
    {
      int len = int.Parse(args[0]);
      string command = args[1];
      string[] commandArgs = args.Skip(2).Take(len - 1).ToArray();
      string[] replaceArgs = args.Skip(2 + len).Select(a => '"' + a + '"').ToArray();
      string joinedArgs = string.Join(" ", commandArgs) + ' ' + string.Join(" ", replaceArgs);

      Process proc = Process.Start(command, joinedArgs);
      // stop when the other process stops, to allow waiting on the replaced exe
      proc.WaitForExit();
    }

    static void PrintHelp()
    {
      System.Console.WriteLine("usage:");
      System.Console.WriteLine();
      System.Console.WriteLine("install:");
      System.Console.WriteLine("  -i <image to replace> <command> <args...>");
      System.Console.WriteLine("uninstall:");
      System.Console.WriteLine("  -u <image to replace>");
    }
  }
}


text:
import {
  optionsHaveIgnoredAtRule,
  report,
  ruleMessages,
  validateOptions,
} from "../../utils"
import { atRules } from "../../reference/keywordSets"
import { isString } from "lodash"
import { vendor } from "postcss"

export const ruleName = "at-rule-no-unknown"

export const messages = ruleMessages(ruleName, {
  rejected: (atRule) => `Unexpected unknown at-rule "${atRule}"`,
})

export default function (actual, options) {
  return (root, result) => {
    const validOptions = validateOptions(result, ruleName, { actual }, {
      actual: options,
      possible: {
        ignoreAtRules: [isString],
      },
      optional: true,
    })

    if (!validOptions) { return }

    root.walkAtRules(atRule => {
      const { name } = atRule

      // Return early if at-rule is to be ignored
      if (optionsHaveIgnoredAtRule(options, atRule)) { return }

      if (vendor.prefix(name) || atRules.has(name.toLowerCase())) { return }

      report({
        message: messages.rejected(`@${name}`),
        node: atRule,
        ruleName,
        result,
      })
    })
  }
}


text:
// Gulp workflow from: https://www.sitepoint.com/simple-gulpy-workflow-sass/

var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
var del = require('del');

var input = './scss/**/*.scss';
var output = './dist/css';

var sassOptions = {
    errLogToConsole: true,
    outputStyle: 'compressed'
};

// Clean
gulp.task('clean', function() {
    return del('dist/**', {force:true})
        .then(paths => {
            console.log('Deleted files and folders:\n', paths.join('\n'))
        });
});

// Sass
gulp.task('sass', function() {
    return gulp
        .src(input)
        .pipe(sourcemaps.init())
        .pipe(sass(sassOptions).on('error', sass.logError))
        .pipe(sourcemaps.write())
        .pipe(autoprefixer())
        .pipe(gulp.dest(output))
});

// Watch
gulp.task('watch', function() {
    return gulp
        .watch(input, ['clean', 'sass'])
        .on('change', function(event) {
            console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
        })
});

// Default
gulp.task('default', ['sass', 'watch']);


text:
                    Giddone

                    Todos for

                    /

                        {{ snapshot.repo.user }}

                    /

                            {{ snapshot.repo.repo }}

                    branch: {{ snapshot.repo.branch }}

                            {{ file }}

                                {{ line.line }}

                                {{ line.body }}


text:
//-----------------------------------------------------------------------
// <copyright file="BusinessItem.cs" company="Marimer LLC">
//     Copyright (c) Marimer LLC. All rights reserved.
//     Website: https://cslanet.com
// </copyright>
// <summary>no summary</summary>
//-----------------------------------------------------------------------
using System;
using Csla.Silverlight;
using Csla.Serialization;
using Csla;
using Csla.Server;

namespace Csla.Testing.Business.ObjectFactory
{
  [Serializable]
  public class BusinessItem : BusinessBase<BusinessItem>
  {
    public BusinessItem() { }
    private static PropertyInfo<string> IdProperty = RegisterProperty<string>(new PropertyInfo<string>("Id", "Id"));

    public string Id
    {
      get
      {
        return GetProperty(IdProperty);
      }
      set
      {
        SetProperty(IdProperty, value);
      }
    }

    private static PropertyInfo<string> OperationResultProperty = RegisterProperty<string>(new PropertyInfo<string>("OperationResult", "Operation Result"));

    public string OperationResult
    {
      get
      {
        return GetProperty(OperationResultProperty);
      }
      set
      {
        SetProperty(OperationResultProperty, value);
      }
    }
  }
}


text:
using System;

namespace oneCRM.Model
{
    public class CheckableString
    {
        public String Title { get; set; }

        public Boolean IsSelected { get; set; }
    }
}


text:
module RnaSec::CtParser

  # Represents a row from (una|m)fold's connected-table (CT) format.
  #
  # A CT file contains six columns separated by tabs:
  #
  # 1. i (index)
  # 2. r_i (nucleotide character)
  # 3. Index of the 5' connecting base. 0 if there is no 5' predecessor.
  # 4. Index of the 3' connecting base. 0 if there is no 3' successor.
  # 5. Index of the paired base. 0 if it's not paired.
  # 6. i (same as #1)
  #
  class Record

    attr_reader :idx
    attr_reader :nuc
    attr_reader :five_idx
    attr_reader :three_idx
    attr_reader :pair_idx

    # Input the first five columns of a CT file.
    #
    # @param [Fixnum] i
    # @param [Symbol] nuc
    # @param [Fixnum] five_idx
    # @param [Fixnum] three_idx
    # @param [Fixnum] pair_idx
    #
    def initialize(i, nuc, five_idx, three_idx, pair_idx)
      @idx       = i
      @nuc       = nuc
      @five_idx  = five_idx
      @three_idx = three_idx
      @pair_idx  = pair_idx
    end

    # Returns a record from an array.
    #
    # @param  [Array] arr Array of strings
    # @return [Record]
    #
    def self.from_array(arr)
      Record.new(
        arr[0].to_i,
        arr[1].downcase.to_sym,
        arr[2].to_i,
        arr[3].to_i,
        arr[4].to_i
      )
    end

  end

end


text:
extern crate byteorder;

pub mod zpu;
pub mod assembler;


text:
# selector-list-comma-space-after

Require a single space or disallow whitespace after the commas of selector lists.

```css
    a, b { color: pink; }
/**  ↑
 * The space after this comma */
```

## Options

`string`: `"always"|"never"|"always-single-line"|"never-single-line"`

### `"always"`

There *must always* be a single space after the commas.

The following patterns are considered warnings:

```css
a,b { color: pink; }
```

```css
a ,b { color: pink; }
```

The following patterns are *not* considered warnings:

```css
a, b { color: pink; }
```

```css
a , b { color: pink; }
```

### `"never"`

There *must never* be whitespace after the commas.

The following patterns are considered warnings:

```css
a, b { color: pink; }
```

```css
a , b { color: pink; }
```

The following patterns are *not* considered warnings:

```css
a,b { color: pink; }
```

```css
a ,b { color: pink; }
```

### `"always-single-line"`

There *must always* be a single space after the commas in single-line selector lists.

The following patterns are considered warnings:

```css
a,b { color: pink; }
```

The following patterns are *not* considered warnings:

```css
a
,b { color: pink; }
```

### `"never-single-line"`

There *must never* be a single space after the commas in single-line selector lists.

The following patterns are considered warnings:

```css
a, b { color: pink; }
```

The following patterns are *not* considered warnings:

```css
a
, b { color: pink; }
```


text:
using System;

public class Heal : Ability
{
    private readonly int _amountToHeal;

    public Heal( int amountToHeal )
    {
        Name = "Heal Self";
        TurnsToRefresh = 60;
        TurnsUntilRefreshed = 0;
        _amountToHeal = amountToHeal;
    }

    protected override bool PerformAbility()
    {
        Player player = Game.Player;

        player.Health = Math.Min( player.MaxHealth, player.Health + _amountToHeal );

        return true;
    }
}