text:
package blog;

import java.util.Objects;

public class Config
{
    private String pandoc = "/usr/local/bin/pandoc";

    private String data = "src/data";
    private String siteMetadataFile;

    private String published = "src/posts/published";
    private String drafts = "src/posts/drafts";
    private String privatePosts = "src/posts/private";
    private String layouts = "src/layouts";
    private String includes = "src/includes";
    private String templates = "src/templates";

    private String[] staticContent = new String[]{ "src/static/chrome", "src/static/uploads" };

    private String site = "site";
    private boolean renderDrafts = false;
    private boolean renderPrivate = false;
    private boolean renderRss = true;
    private int rssFeedPostCount = 50;
    private boolean latestFirst = true;

    private String ftpHost;
    private int ftpPort = -1;
    private String ftpUser;
    private String ftpPassword;
    private String ftpDirectory;

    private String ftpProxyHost;
    private int ftpProxyPort;
    private String ftpProxyUser;
    private String ftpProxyPassword;

    public boolean renderDrafts(){
        return renderDrafts;
    }

    public boolean renderPrivate(){
        return renderPrivate;
    }

    public boolean renderRss(){
        return renderRss;
    }

    // <editor-fold  defaultstate="collapsed"  desc="generated code">

    public Config() {
    }

    public Config( String siteMetadataFile, String ftpHost, String ftpUser, String ftpPassword, String ftpDirectory, String ftpProxyHost, int ftpProxyPort, String ftpProxyUser, String ftpProxyPassword, boolean latestFirst ) {
        this.siteMetadataFile = siteMetadataFile;
        this.ftpHost = ftpHost;
        this.ftpUser = ftpUser;
        this.ftpPassword = ftpPassword;
        this.ftpDirectory = ftpDirectory;
        this.ftpProxyHost = ftpProxyHost;
        this.ftpProxyPort = ftpProxyPort;
        this.ftpProxyUser = ftpProxyUser;
        this.ftpProxyPassword = ftpProxyPassword;
        this.latestFirst = latestFirst;
    }

    public String getPublished() {
        return published;
    }

    public void setPublished( String published ) {
        this.published = published;
    }

    public String getDrafts() {
        return drafts;
    }

    public void setDrafts( String drafts ) {
        this.drafts = drafts;
    }

    public String getPrivatePosts() {
        return privatePosts;
    }

    public void setPrivatePosts( String privatePosts ) {
        this.privatePosts = privatePosts;
    }

    public String getLayouts() {
        return layouts;
    }

    public void setLayouts( String layouts ) {
        this.layouts = layouts;
    }

    public String getIncludes() {
        return includes;
    }

    public void setIncludes( String includes ) {
        this.includes = includes;
    }

    public String getData() {
        return data;
    }

    public void setData( String data ) {
        this.data = data;
    }

    public String[] getStaticContent() {
        return staticContent;
    }

    public void setStaticContent( String[] staticContent ) {
        this.staticContent = staticContent;
    }

    public String getTemplates() {
        return templates;
    }

    public void setTemplates( String templates ) {
        this.templates = templates;
    }

    public String getSite() {
        return site;
    }

    public void setSite( String site ) {
        this.site = site;
    }

    public String getSiteMetadataFile() {
        return siteMetadataFile;
    }

    public void setSiteMetadataFile( String siteMetadataFile ) {
        this.siteMetadataFile = siteMetadataFile;
    }

    public String getPandoc() {
        return pandoc;
    }

    public void setPandoc( String pandoc ) {
        this.pandoc = pandoc;
    }

    public boolean isRenderDrafts() {
        return renderDrafts;
    }

    public void setRenderDrafts( boolean renderDrafts ) {
        this.renderDrafts = renderDrafts;
    }

    public boolean isRenderPrivate() {
        return renderPrivate;
    }

    public void setRenderPrivate( boolean renderPrivate ) {
        this.renderPrivate = renderPrivate;
    }

    public boolean isRenderRss() {
        return renderRss;
    }

    public void setRenderRss( boolean renderRss ) {
        this.renderRss = renderRss;
    }

    public int getRssFeedPostCount() {
        return rssFeedPostCount;
    }

    public void setRssFeedPostCount( int rssFeedPostCount ) {
        this.rssFeedPostCount = rssFeedPostCount;
    }

    public String getFtpHost() {
        return ftpHost;
    }

    public void setFtpHost( String ftpHost ) {
        this.ftpHost = ftpHost;
    }

    public int getFtpPort() {
        return ftpPort;
    }

    public void setFtpPort( int ftpPort ) {
        this.ftpPort = ftpPort;
    }

    public String getFtpUser() {
        return ftpUser;
    }

    public void setFtpUser( String ftpUser ) {
        this.ftpUser = ftpUser;
    }

    public String getFtpPassword() {
        return ftpPassword;
    }

    public void setFtpPassword( String ftpPassword ) {
        this.ftpPassword = ftpPassword;
    }

    public String getFtpDirectory() {
        return ftpDirectory;
    }

    public void setFtpDirectory( String ftpDirectory ) {
        this.ftpDirectory = ftpDirectory;
    }

    public String getFtpProxyHost() {
        return ftpProxyHost;
    }

    public void setFtpProxyHost( String ftpProxyHost ) {
        this.ftpProxyHost = ftpProxyHost;
    }

    public int getFtpProxyPort() {
        return ftpProxyPort;
    }

    public void setFtpProxyPort( int ftpProxyPort ) {
        this.ftpProxyPort = ftpProxyPort;
    }

    public String getFtpProxyUser() {
        return ftpProxyUser;
    }

    public void setFtpProxyUser( String ftpProxyUser ) {
        this.ftpProxyUser = ftpProxyUser;
    }

    public String getFtpProxyPassword() {
        return ftpProxyPassword;
    }

    public void setFtpProxyPassword( String ftpProxyPassword ) {
        this.ftpProxyPassword = ftpProxyPassword;
    }

    public boolean isLatestFirst() {
        return latestFirst;
    }

    public void setLatestFirst( boolean latestFirst ) {
        this.latestFirst = latestFirst;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 23 * hash + Objects.hashCode( this.published );
        hash = 23 * hash + Objects.hashCode( this.drafts );
        hash = 23 * hash + Objects.hashCode( this.privatePosts );
        hash = 23 * hash + Objects.hashCode( this.layouts );
        hash = 23 * hash + Objects.hashCode( this.includes );
        hash = 23 * hash + Objects.hashCode( this.data );
        hash = 23 * hash + Objects.hashCode( this.staticContent );
        hash = 23 * hash + Objects.hashCode( this.templates );
        hash = 23 * hash + Objects.hashCode( this.site );
        hash = 23 * hash + Objects.hashCode( this.siteMetadataFile );
        hash = 23 * hash + Objects.hashCode( this.pandoc );
        hash = 23 * hash + ( this.renderDrafts ? 1 : 0 );
        hash = 23 * hash + ( this.renderPrivate ? 1 : 0 );
        hash = 23 * hash + ( this.renderRss ? 1 : 0 );
        hash = 23 * hash + this.rssFeedPostCount;
        hash = 23 * hash + Objects.hashCode( this.ftpHost );
        hash = 23 * hash + this.ftpPort;
        hash = 23 * hash + Objects.hashCode( this.ftpUser );
        hash = 23 * hash + Objects.hashCode( this.ftpPassword );
        hash = 23 * hash + Objects.hashCode( this.ftpDirectory );
        hash = 23 * hash + Objects.hashCode( this.ftpProxyHost );
        hash = 23 * hash + this.ftpProxyPort;
        hash = 23 * hash + Objects.hashCode( this.latestFirst );
        hash = 23 * hash + Objects.hashCode( this.ftpProxyUser );
        hash = 23 * hash + Objects.hashCode( this.ftpProxyPassword );
        return hash;
    }

    @Override
    public boolean equals( Object obj ) {
        if( this == obj ) {
            return true;
        }
        if( obj == null ) {
            return false;
        }
        if( getClass() != obj.getClass() ) {
            return false;
        }
        final Config other = (Config)obj;
        if( this.renderDrafts != other.renderDrafts ) {
            return false;
        }
        if( this.renderPrivate != other.renderPrivate ) {
            return false;
        }
        if( this.renderRss != other.renderRss ) {
            return false;
        }
        if( this.rssFeedPostCount != other.rssFeedPostCount ) {
            return false;
        }
        if( this.ftpPort != other.ftpPort ) {
            return false;
        }
        if( this.ftpProxyPort != other.ftpProxyPort ) {
            return false;
        }
        if( !Objects.equals( this.published, other.published ) ) {
            return false;
        }
        if( !Objects.equals( this.drafts, other.drafts ) ) {
            return false;
        }
        if( !Objects.equals( this.privatePosts, other.privatePosts ) ) {
            return false;
        }
        if( !Objects.equals( this.layouts, other.layouts ) ) {
            return false;
        }
        if( !Objects.equals( this.includes, other.includes ) ) {
            return false;
        }
        if( !Objects.equals( this.data, other.data ) ) {
            return false;
        }
        if( !Objects.equals( this.staticContent, other.staticContent ) ) {
            return false;
        }
        if( !Objects.equals( this.templates, other.templates ) ) {
            return false;
        }
        if( !Objects.equals( this.site, other.site ) ) {
            return false;
        }
        if( !Objects.equals( this.siteMetadataFile, other.siteMetadataFile ) ) {
            return false;
        }
        if( !Objects.equals( this.pandoc, other.pandoc ) ) {
            return false;
        }
        if( !Objects.equals( this.ftpHost, other.ftpHost ) ) {
            return false;
        }
        if( !Objects.equals( this.ftpUser, other.ftpUser ) ) {
            return false;
        }
        if( !Objects.equals( this.ftpPassword, other.ftpPassword ) ) {
            return false;
        }
        if( !Objects.equals( this.ftpDirectory, other.ftpDirectory ) ) {
            return false;
        }
        if( !Objects.equals( this.ftpProxyHost, other.ftpProxyHost ) ) {
            return false;
        }
        if( !Objects.equals( this.ftpProxyUser, other.ftpProxyUser ) ) {
            return false;
        }
        if( !Objects.equals( this.ftpProxyPassword, other.ftpProxyPassword ) ) {
            return false;
        }
        if( !Objects.equals( this.latestFirst, other.latestFirst ) ) {
            return false;
        }

        return true;
    }

    @Override
    public String toString() {
        return "Config{" + "published=" + published + ", drafts=" + drafts + ", privatePosts=" + privatePosts + ", layouts=" + layouts + ", includes=" + includes + ", data=" + data + ", templates=" + templates + ", site=" + site + ", latestFirst=" + latestFirst + ", siteMetadataFile=" + siteMetadataFile + ", pandoc=" + pandoc + ", staticContent=" + staticContent + ", renderDrafts=" + renderDrafts + ", renderPrivate=" + renderPrivate + ", renderRss=" + renderRss + ", rssFeedPostCount=" + rssFeedPostCount + ", ftpHost=" + ftpHost + ", ftpPort=" + ftpPort + ", ftpUser=" + ftpUser + ", ftpPassword=" + ftpPassword + ", ftpDirectory=" + ftpDirectory + ", ftpProxyHost=" + ftpProxyHost + ", ftpProxyPort=" + ftpProxyPort + ", ftpProxyUser=" + ftpProxyUser + ", ftpProxyPassword=" + ftpProxyPassword + '}';
    }

    // </editor-fold>
}


text:
<?php

namespace CachetHQ\Cachet\Http\Controllers;

use CachetHQ\Cachet\Facades\Setting;
use CachetHQ\Cachet\Models\ComponentGroup;
use CachetHQ\Cachet\Models\Incident;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Response;
use Thujohn\Rss\RssFacade;

class RssController extends Controller
{
    /**
     * Generates an RSS feed of all incidents.
     *
     * @param \CachetHQ\Cachet\Models\ComponentGroup|null $group
     *
     * @return \Illuminate\Http\Response
     */
    public function feedAction(ComponentGroup $group = null)
    {
        $feed = RssFacade::feed('2.0', 'UTF-8');
        $feed->channel([
            'title'       => Setting::get('app_name'),
            'description' => trans('cachet.feed'),
            'link'        => Setting::get('app_domain'),
        ]);

        if ($group) {
            $group->components->map(function ($component) use ($feed) {
                $component->incidents()->orderBy('created_at', 'desc')->get()->map(function ($incident) use ($feed) {
                    $this->feedAddItem($feed, $incident);
                });
            });
        } else {
            Incident::orderBy('created_at', 'desc')->get()->map(function ($incident) use ($feed) {
                $this->feedAddItem($feed, $incident);
            });
        }

        return Response::make($feed, 200, ['Content-Type' => 'text/xml']);
    }

    /**
     * Adds an item to the feed.
     *
     * @param \Thujohn\Rss\Rss                 $feed
     * @param \CachetHQ\Cachet\Models\Incident $incident
     *
     * @return void
     */
    private function feedAddItem(& $feed, $incident)
    {
        $feed->item([
            'title'       => $incident->name,
            'description' => $incident->message,
            'pubDate'     => $incident->created_at->toRssString(),
            'guid'        => $incident->id,
        ]);
    }
}

redpajama_set_name: RedPajamaGithub


text:
window.onLoad = init();

var gCanvas;
var ctx;

var gameState;

function init () {
	gCanvas = document.getElementById("gameCanvas");
	gCanvas.width = window.innerWidth;
	gCanvas.height = window.innerHeight;

	ctx = gCanvas.getContext("2d")
	ctx.imageSmoothingEnabled = false;
	ctx.webkitImageSmoothEnabled = false;
	ctx.mozImageSmoothingEnabled = false;

	gameState = "main";

	console.log("Game Canvas Initialized");
	main();
}

function main () {

	gCanvas.onclick = function () {
		nameInput.focus();
	}

	var nameInput = new CanvasInput({
		canvas: gCanvas,
		x: 4,
		y: 700,
		width: 1425,
		height: 27,
		backgroundColor: "#000",
		borderWidth: 0,
		fontColor: "#fff",
		placeHolder: "Type here your REAL name...",
		fontFamily: "Courier",
		fontSize: 25,
		onsubmit: function () {
			var selectedText = nameInput.selectText();
			var text = selectedText._value;
			gameState = text.toLowerCase();
			console.log(gameState);
			switch (gameState) {
				case "lopes":
					nameInput.destroy();
					lopes();
					break;
				case "canteiro":
					nameInput.destroy();
					canteiro();
				default:
					ctx.fillText("> I don't know you, maybe you typed the name wrong?", 25, 85);
					break;
			}
		}
	});

	ctx.fillStyle = "#ffffff";
	ctx.font = "25px Courier";
	ctx.fillText("> Hello", 25, 35);
	ctx.fillText("> I'm Rift, what's your name?", 25, 60);
}

function lopes () {
	ctx.clearRect(0, 0, gCanvas.width, gCanvas.height);

	gCanvas.onclick = function () {
		inputLopes.focus();
	}

	var inputLopes = new CanvasInput({
		canvas: gCanvas,
		x: 4,
		y: 700,
		width: 1425,
		height: 27,
		backgroundColor: "#000",
		borderWidth: 0,
		fontColor: "#fff",
		placeHolder: "Type here...",
		fontFamily: "Courier",
		fontSize: 25,
		onsubmit: function () {
			var selectedText = inputLopes.selectText();
			var text = selectedText._value;
			var answer = text.toLowerCase();
			switch (answer) {
				case "1":
					lopes1();
					break;
				case "2":
					lopes2();
					break;
			}
		}
	});

	ctx.fillStyle = "#ffffff";
	ctx.font = "25px Courier";
	ctx.fillText("> Rendering Scenario...", 25, 35);
	setTimeout(function() {
		ctx.fillText("> Success", 25, 60);
	}, 2000)
	setTimeout(function() {
		ctx.fillText("> Olhas \340 tua volta. V\352s 2 pessoas, o Fred e o Rodri. Est\341s em casa do Fred.", 25, 85);
	}, 2500)
	setTimeout(function() {
		ctx.fillText("> 1) Partir o cubo m\341gico e culpar o Rodri", 25, 110);
		ctx.fillText("> 2) Meter o Fred na varanda", 25, 135);
	}, 4000)
}

function lopes1() {
	ctx.clearRect(0, 0, gCanvas.width, gCanvas.height);

	gCanvas.onclick = function () {
		inputLopes.focus();
	}
	ctx.fillStyle = "#ffffff";
	ctx.fillText("> O Rodri fica triste", 25, 35);
}

function lopes2() {
	ctx.clearRect(0, 0, gCanvas.width, gCanvas.height);

	gCanvas.onclick = function () {
		inputLopes.focus();
	}

	ctx.fillStyle = "#ffffff";
	ctx.font = "25px Courier";

	if (Math.random() > 0.5) {
		ctx.fillText("> O Fred n\343o te deixa o meteres na varanda e luta contigo. Acabas no ch\343o.", 25, 35);
		ctx.fillText("> Game Over.", 25, 60);
	} else if (Math.random() <= 0.5) {
		ctx.fillText("> Apanhas o Fred desprevenido e empurras-o para a varanda.", 25, 35);
		ctx.fillText("> Win.", 25, 60);
	}
}

function canteiro() {
	ctx.clearRect(0, 0, gCanvas.width, gCanvas.height);

	gCanvas.onclick = function () {
		inputCanteiro.focus();
	}
	ctx.fillStyle = "#ffffff";
	ctx.font = "25px Courier";
}


text:
@interface MOBProjectionEPSG3798 : MOBProjection

@end


text:
require 'spec_helper'
require 'whois/record/parser/whois.nic.it.rb'

describe Whois::Record::Parser::WhoisNicIt, "property_status_redemption_no_provider.expected" do

  subject do
    file = fixture("responses", "whois.nic.it/property_status_redemption_no_provider.txt")
    part = Whois::Record::Part.new(:body => File.read(file))
    described_class.new(part)
  end

  describe "#status" do
    it do
      subject.status.should == :redemption
    end
  end
  describe "#available?" do
    it do
      subject.available?.should == false
    end
  end
  describe "#registered?" do
    it do
      subject.registered?.should == true
    end
  end
end


text:
A tool aimed at parsing and generating a nested BigQuery table schema based on a given XSD schema. The tool is meant for use cases related to ingesting XML based data into BigQuery while maintaining the same nested structure.

## How it works
Given an XSD Schema representing XML data such as
```
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name='document'>
    <xs:complexType>
      <xs:sequence>
        <xs:element name='Customers'>
          <xs:complexType>
            <xs:sequence>
              <xs:element name='Customer' type='CustomerType' minOccurs='0' maxOccurs='unbounded' />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name='Orders'>
          <xs:complexType>
            <xs:sequence>
              <xs:element name='Order' type='OrderType' minOccurs='0' maxOccurs='unbounded' />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:complexType name='CustomerType'>
    <xs:sequence>
      <xs:element name='CompanyName' type='xs:string'/>
      <xs:element name='FullAddress' type='AddressType'/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name='AddressType'>
    <xs:sequence>
      <xs:element name='Address' type='xs:string'/>
      <xs:element name='City' type='xs:string'/>
      <xs:element name='Country' type='xs:string'/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name='OrderType'>
    <xs:sequence>
      <xs:element name='CustomerID' type='xs:token'/>
      <xs:element name='EmployeeID' type='xs:token'/>
      <xs:element name='ShipInfo' type='ShipInfoType'/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name='ShipInfoType'>
    <xs:sequence>
      <xs:element name='ShipVia' type='xs:integer'/>
      <xs:element name='Freight' type='xs:decimal'/>
      <xs:element name='ShipName' type='xs:string'/>
    </xs:sequence>
  </xs:complexType>
</xs:schema>
```
The tool can convert the nested and repeated structure of the XML file represented in the above XSD into a JSON BigQuery schema, taking into consideration STRUCT, REPEATED fields and custom type definitions. Resulting JSON would look something like:

```
[{
	"name": "Customers",
	"type": "RECORD",
	"fields": [{
		"name": "Customer",
		"type": "RECORD",
		"fields": [{
			"name": "CompanyName",
			"type": "STRING"
		}, {
			"name": "FullAddress",
			"type": "RECORD",
			"fields": [{
				"name": "Address",
				"type": "STRING"
			}, {
				"name": "City",
				"type": "STRING"
			}, {
				"name": "Country",
				"type": "STRING"
			}]
		}],
		"mode": "REPEATED"
	}]
}, {
	"name": "Orders",
	"type": "RECORD",
	"fields": [{
		"name": "Order",
		"type": "RECORD",
		"fields": [{
			"name": "CustomerID",
			"type": "STRING"
		}, {
			"name": "EmployeeID",
			"type": "STRING"
		}, {
			"name": "ShipInfo",
			"type": "RECORD",
			"fields": [{
				"name": "ShipVia",
				"type": "DECIMAL"
			}, {
				"name": "Freight",
				"type": "DECIMAL"
			}, {
				"name": "ShipName",
				"type": "STRING"
			}]
		}],
		"mode": "REPEATED"
	}]
}]
```

## Setup
This project implements a setuptools `setup.py` file, you can install it into a Python environment by navigating to the root of the project and running `pip install .`.

## Usage
After install, you can run the command directly to generate the JSON schema into stdout or direct the output into a JSON file
```
xsd2bq \
    --root="Root" \
    --xsd_file="./tests/sample_data/customer_orders.xsd" \
    > schema.json
```
You can then use the `bq mk` command to generate a bq table from the generated schema via:

```
bq mk \
    --table \
    xml-ingest:xml_multistream_out.orders \
    schema.json
```

## Contributing
PRs related to adding features or fixing bugs for this tool are welcome and should follow the guidelines of the parent / host repository this tool is part of. At a minimum, all code contributed should be formatted to follow the Google python style guide for open source projects. The below checks can be run to ensure that along with the .pylintcr file included in this project.
```
flake8 --exclude=.git,__pycache__,.env,env --select=E9,F,C
pylint xsd2bq/*
python3 -m yapf -i -r --style="google" xsd2bq/*
```

Unit tests use the unittest module and are available under the tests/* directory, they can be run via
```
python -m unittest tests/*.py
```

## License
Apache 2.0

## Disclaimer
This project is not an official Google project.


text:
module Locomotive
  class PluginProperties < Locomotive::Application
    # GET /plugin_properties
    # GET /plugin_properties.xml
    def index
      @plugin_properties = Locomotive::PluginProperty.all
      display @plugin_properties
    end

    # GET /plugin_properties/1
    # GET /plugin_properties/1.xml
    def show(id)
      @plugin_property = Locomotive::PluginProperty.get(id)
      raise NotFound unless @plugin_property
      display @plugin_property
    end

    # GET /plugin_properties/new
    def new
      only_provides :html
      @plugin_property = Locomotive::PluginProperty.new
      display @plugin_property
    end

    # GET /plugin_properties/1/edit
    def edit(id)
      only_provides :html
      @plugin_property = Locomotive::PluginProperty.get(id)
      raise NotFound unless @plugin_property
      display @plugin_property
    end

    # POST /plugin_properties
    # POST /plugin_properties.xml
    def create(plugin_property)
      @plugin_property = Locomotive::PluginProperty.new(plugin_property)

      if @plugin_property.save
        redirect resource(@plugin_property), :message => {:notice => "Plugin property was successfully created"}
      else
        render :new
      end
    end

    # PUT /plugin_properties/1
    # PUT /plugin_properties/1.xml
    def update(id, plugin_property)
      @plugin_property = Locomotive::PluginProperty.get(id)
      raise NotFound unless @plugin_property
      if @plugin_property.update_attributes(plugin_property)
        redirect resource(@plugin_property), :message => {:notice => "Plugin property was successfully updated"}
      else
        render :edit
      end
    end

    def delete(id)
      @plugin_property = Locomotive::PluginProperty.get(id)
      raise NotFound unless @plugin_property
      display @plugin_property
    end

    # DELETE /plugin_properties/1
    # DELETE /plugin_properties/1.xml
    def destroy(id)
      @plugin_property = Locomotive::PluginProperty.get(id)
      raise NotFound unless @plugin_property
      if @plugin_property.destroy
        redirect resource(:plugin_instances)
      else
        raise InternalServerError
      end
    end
  end
end


text:
import CellSizeCache from './defaultCellSizeCache'

describe('CellSizeCache', () => {
  function verifyUniformColumnWidths (cellSizeCache) {
    cellSizeCache.setColumnWidth(1, 1)
    expect(cellSizeCache.getColumnWidth(1)).toEqual(1)
    expect(cellSizeCache.getColumnWidth(2)).toEqual(1)
    cellSizeCache.setColumnWidth(2, 2)
    expect(cellSizeCache.getColumnWidth(1)).toEqual(2)
    expect(cellSizeCache.getColumnWidth(2)).toEqual(2)
    expect(cellSizeCache.getColumnWidth(3)).toEqual(2)
    cellSizeCache.clearColumnWidth(1)
    expect(cellSizeCache.getColumnWidth(1)).toEqual(undefined)
    expect(cellSizeCache.getColumnWidth(2)).toEqual(undefined)
  }

  function verifyUniformRowHeights (cellSizeCache) {
    cellSizeCache.setRowHeight(1, 1)
    expect(cellSizeCache.getRowHeight(1)).toEqual(1)
    expect(cellSizeCache.getRowHeight(2)).toEqual(1)
    cellSizeCache.setRowHeight(2, 2)
    expect(cellSizeCache.getRowHeight(1)).toEqual(2)
    expect(cellSizeCache.getRowHeight(2)).toEqual(2)
    expect(cellSizeCache.getRowHeight(3)).toEqual(2)
    cellSizeCache.clearRowHeight(1)
    expect(cellSizeCache.getRowHeight(1)).toEqual(undefined)
    expect(cellSizeCache.getRowHeight(2)).toEqual(undefined)
  }

  function verifyVaryingColumnWidths (cellSizeCache) {
    cellSizeCache.setColumnWidth(1, 1)
    expect(cellSizeCache.getColumnWidth(1)).toEqual(1)
    expect(cellSizeCache.getColumnWidth(2)).toEqual(undefined)
    cellSizeCache.setColumnWidth(2, 2)
    expect(cellSizeCache.getColumnWidth(1)).toEqual(1)
    expect(cellSizeCache.getColumnWidth(2)).toEqual(2)
    expect(cellSizeCache.getColumnWidth(3)).toEqual(undefined)
    cellSizeCache.clearColumnWidth(1)
    expect(cellSizeCache.getColumnWidth(1)).toEqual(undefined)
    expect(cellSizeCache.getColumnWidth(2)).toEqual(2)
    cellSizeCache.clearAllColumnWidths()
    expect(cellSizeCache.getColumnWidth(1)).toEqual(undefined)
    expect(cellSizeCache.getColumnWidth(2)).toEqual(undefined)
  }

  function verifyVaryingRowHeights (cellSizeCache) {
    cellSizeCache.setRowHeight(1, 1)
    expect(cellSizeCache.getRowHeight(1)).toEqual(1)
    expect(cellSizeCache.getRowHeight(2)).toEqual(undefined)
    cellSizeCache.setRowHeight(2, 2)
    expect(cellSizeCache.getRowHeight(1)).toEqual(1)
    expect(cellSizeCache.getRowHeight(2)).toEqual(2)
    expect(cellSizeCache.getRowHeight(3)).toEqual(undefined)
    cellSizeCache.clearRowHeight(1)
    expect(cellSizeCache.getRowHeight(1)).toEqual(undefined)
    expect(cellSizeCache.getRowHeight(2)).toEqual(2)
    cellSizeCache.clearAllRowHeights()
    expect(cellSizeCache.getRowHeight(1)).toEqual(undefined)
    expect(cellSizeCache.getRowHeight(2)).toEqual(undefined)
  }

  it('should support uniform height and width', () => {
    const cellSizeCache = new CellSizeCache({
      uniformColumnWidth: true,
      uniformRowHeight: true
    })
    verifyUniformColumnWidths(cellSizeCache)
    verifyUniformRowHeights(cellSizeCache)
  })

  it('should support uniform height only', () => {
    const cellSizeCache = new CellSizeCache({
      uniformColumnWidth: false,
      uniformRowHeight: true
    })
    verifyVaryingColumnWidths(cellSizeCache)
    verifyUniformRowHeights(cellSizeCache)
  })

  it('should support uniform width only', () => {
    const cellSizeCache = new CellSizeCache({
      uniformColumnWidth: true,
      uniformRowHeight: false
    })
    verifyUniformColumnWidths(cellSizeCache)
    verifyVaryingRowHeights(cellSizeCache)
  })

  it('should support varying height and width', () => {
    const cellSizeCache = new CellSizeCache({
      uniformColumnWidth: false,
      uniformRowHeight: false
    })
    verifyVaryingColumnWidths(cellSizeCache)
    verifyVaryingRowHeights(cellSizeCache)
  })
})


text:
// Copyright (c) Andy Sipe. All rights reserved. Licensed under the MIT License (MIT). See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Maddir.IntegrationTests.Infrastructure {
  public class DevelopmentRoot {
    public string Get() {
      return FindDevelopmentRoot(Directory.GetCurrentDirectory());
    }

    public string FindDevelopmentRoot(string dir) {
      return IsDevelopmentRoot(dir)
               ? dir
               : FindDevelopmentRoot(Path.GetDirectoryName(dir));
    }

    private static bool IsDevelopmentRoot(string dir) {
      return GetChecks(dir).All(f => f());
    }

    private static IEnumerable<Func<bool>> GetChecks(string dir) {
      yield return () => File.Exists(Path.Combine(dir, "README.md"));
      yield return () => File.Exists(Path.Combine(dir, ".gitignore"));
      yield return () => Directory.Exists(Path.Combine(dir, "thirdparty"));
      yield return () => Directory.Exists(Path.Combine(dir, "src"));
      yield return () => File.Exists(Path.Combine(dir, "start.minion.ps1"));
      yield return () => File.Exists(Path.Combine(dir, "LICENSE.txt"));
    }
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
                      http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
    <changeSet id="iam-management-schema" author="Tsimafei.Markusenka">
        <createTable tableName="users">
            <column name="id" type="BIGINT">
                <constraints primaryKey="true" primaryKeyName="pk_users"/>
            </column>
            <column name="login" type="VARCHAR(32)">
                <constraints nullable="false" unique="true" uniqueConstraintName="uk_users_login"/>
            </column>
            <column name="password" type="VARCHAR(60)">
                <constraints nullable="false" unique="true" uniqueConstraintName="uk_users_password"/>
            </column>
            <column name="email" type="VARCHAR(255)">
                <constraints nullable="false" unique="true" uniqueConstraintName="uk_users_email"/>
            </column>
            <column name="registration_date" type="DATE">
                <constraints nullable="false"/>
            </column>
            <column name="role" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
        </createTable>

        <createSequence sequenceName="roles_seq" startValue="1" incrementBy="1"/>
        <createSequence sequenceName="users_seq" startValue="1" incrementBy="1"/>
    </changeSet>

    <changeSet id="payment-management-schema" author="Tsimafei.Markusenka">
        <createTable tableName="bills">
            <column name="id" type="BIGINT">
                <constraints primaryKey="true" primaryKeyName="pk_bills"/>
            </column>
            <column name="value" type="NUMERIC(20,0)">
                <constraints nullable="false"/>
            </column>
            <column name="amount" type="NUMERIC(12,2)">
                <constraints nullable="false"/>
            </column>
        </createTable>

        <createTable tableName="vendors">
            <column name="id" type="BIGINT">
                <constraints primaryKey="true" primaryKeyName="pk_vendors"/>
            </column>
            <column name="name" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="bill_id" type="BIGINT">
                <constraints nullable="false" foreignKeyName="fk_vendors_bill_id" referencedColumnNames="id"
                             referencedTableName="bills"/>
            </column>
        </createTable>

        <createTable tableName="vendees">
            <column name="id" type="BIGINT">
                <constraints primaryKey="true" primaryKeyName="pk_vendees"/>
            </column>
            <column name="name" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="bill_id" type="BIGINT">
                <constraints nullable="false" foreignKeyName="fk_vendees_bill_id" referencedColumnNames="id"
                             referencedTableName="bills"/>
            </column>
        </createTable>

        <createTable tableName="deals">
            <column name="id" type="BIGINT">
                <constraints primaryKey="true" primaryKeyName="pk_deals"/>
            </column>
            <column name="vendor_id" type="BIGINT">
                <constraints nullable="false" foreignKeyName="fk_deals_vendors_vendor_id"
                             referencedColumnNames="id" referencedTableName="vendors"/>
            </column>
            <column name="vendee_id" type="BIGINT">
                <constraints nullable="false" foreignKeyName="fk_deals_vendees_vendee_id"
                             referencedColumnNames="id" referencedTableName="vendees"/>
            </column>
            <column name="bid_id" type="BIGINT">
                <constraints nullable="false" unique="true"/>
            </column>
            <column name="amount" type="NUMERIC(12,2)">
                <constraints nullable="false"/>
            </column>
            <column name="status" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
        </createTable>

        <createSequence sequenceName="bills_seq" startValue="2" incrementBy="1"/>
        <createSequence sequenceName="vendors_seq" startValue="1" incrementBy="1"/>
        <createSequence sequenceName="vendees_seq" startValue="1" incrementBy="1"/>
        <createSequence sequenceName="deals_seq" startValue="1" incrementBy="1"/>
    </changeSet>

    <changeSet id="payment-management-insert" author="Tsimafei.Markusenka">
        <insert tableName="bills">
            <column name="id">1</column>
            <column name="value">10000000000000000000</column>
            <column name="amount">1000000</column>
        </insert>
    </changeSet>

    <changeSet id="bid-management-schema" author="Tsimafei.Markusenka">
        <createTable tableName="sellers">
            <column name="id" type="BIGINT">
                <constraints primaryKey="true" primaryKeyName="pk_sellers"/>
            </column>
            <column name="name" type="VARCHAR(255)">
                <constraints nullable="false" unique="true"/>
            </column>
        </createTable>

        <createTable tableName="investors">
            <column name="id" type="BIGINT">
                <constraints primaryKey="true" primaryKeyName="pk_investors"/>
            </column>
            <column name="name" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
        </createTable>

        <createTable tableName="bid_images">
            <column name="id" type="BIGINT">
                <constraints primaryKey="true" primaryKeyName="pk_bid_images"/>
            </column>
            <column name="path" type="VARCHAR(255)"/>
            <column name="name" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="extension" type="VARCHAR(255)"/>
        </createTable>

        <createTable tableName="bids">
            <column name="id" type="BIGINT">
                <constraints primaryKey="true" primaryKeyName="pk_bids"/>
            </column>
            <column name="seller_id" type="BIGINT">
                <constraints nullable="false" foreignKeyName="fk_bids_sellers_seller_id" referencedColumnNames="id"
                             referencedTableName="sellers"/>
            </column>
            <column name="status" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="title" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="featured_image_id" type="BIGINT">
                <constraints nullable="false" foreignKeyName="fk_bids_bid_images_featured_image_id"
                             referencedColumnNames="id" referencedTableName="bid_images"/>
            </column>
            <column name="type" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="quantity" type="INT">
                <constraints nullable="false"/>
            </column>
            <column name="description" type="VARCHAR(2000)">
                <constraints nullable="false"/>
            </column>
            <column name="start_price" type="NUMERIC(12,2)">
                <constraints nullable="false"/>
            </column>
            <column name="creation_date" type="TIMESTAMP WITHOUT TIME ZONE">
                <constraints nullable="false"/>
            </column>
            <column name="expiration_date" type="TIMESTAMP WITHOUT TIME ZONE">
                <constraints nullable="false"/>
            </column>
            <column name="payment_type" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="comment" type="VARCHAR(1000)"/>
            <column name="winner_id" type="BIGINT">
                <constraints foreignKeyName="fk_bets_investors_winner_id"
                             referencedColumnNames="id" referencedTableName="investors"/>
            </column>
        </createTable>

        <createTable tableName="bets">
            <column name="id" type="BIGINT">
                <constraints primaryKey="true" primaryKeyName="pk_bets"/>
            </column>
            <column name="investor_id" type="BIGINT">
                <constraints nullable="false" foreignKeyName="fk_bets_investors_investor_id"
                             referencedColumnNames="id" referencedTableName="investors"/>
            </column>
            <column name="bid_id" type="BIGINT">
                <constraints nullable="false" foreignKeyName="fk_bets_bids_bid_id"
                             referencedColumnNames="id" referencedTableName="bids"/>
            </column>
            <column name="value" type="NUMERIC(12,2)">
                <constraints nullable="false"/>
            </column>
            <column name="date_time" type="TIMESTAMP WITHOUT TIME ZONE">
                <constraints nullable="false"/>
            </column>
        </createTable>

        <createTable tableName="steps">
            <column name="id" type="BIGINT">
                <constraints primaryKey="true" primaryKeyName="pk_steps"/>
            </column>
            <column name="low" type="NUMERIC(12,2)">
                <constraints nullable="false"/>
            </column>
            <column name="high" type="NUMERIC(12,2)">
                <constraints nullable="false"/>
            </column>
            <column name="value" type="NUMERIC(12,2)">
                <constraints nullable="false"/>
            </column>
        </createTable>

        <createSequence sequenceName="sellers_seq" startValue="1" incrementBy="1"/>
        <createSequence sequenceName="bid_images_seq" startValue="1" incrementBy="1"/>
        <createSequence sequenceName="bids_seq" startValue="1" incrementBy="1"/>
        <createSequence sequenceName="investors_seq" startValue="1" incrementBy="1"/>
        <createSequence sequenceName="bets_seq" startValue="1" incrementBy="1"/>
        <createSequence sequenceName="steps_seq" startValue="1" incrementBy="1"/>
    </changeSet>

    <changeSet id="bid-management-insert" author="Tsimafei.Markusenka">
        <insert tableName="steps">
            <column name="id">1</column>
            <column name="low">0.01</column>
            <column name="high">0.99</column>
            <column name="value">0.05</column>
        </insert>
        <insert tableName="steps">
            <column name="id">2</column>
            <column name="low">1</column>
            <column name="high">4.99</column>
            <column name="value">0.25</column>
        </insert>
        <insert tableName="steps">
            <column name="id">3</column>
            <column name="low">5</column>
            <column name="high">24.99</column>
            <column name="value">0.50</column>
        </insert>
        <insert tableName="steps">
            <column name="id">4</column>
            <column name="low">25</column>
            <column name="high">99.99</column>
            <column name="value">1</column>
        </insert>
        <insert tableName="steps">
            <column name="id">5</column>
            <column name="low">100</column>
            <column name="high">249.99</column>
            <column name="value">2.50</column>
        </insert>
        <insert tableName="steps">
            <column name="id">6</column>
            <column name="low">250</column>
            <column name="high">499.99</column>
            <column name="value">5</column>
        </insert>
        <insert tableName="steps">
            <column name="id">7</column>
            <column name="low">500</column>
            <column name="high">999.99</column>
            <column name="value">10</column>
        </insert>
        <insert tableName="steps">
            <column name="id">8</column>
            <column name="low">1000</column>
            <column name="high">2499.99</column>
            <column name="value">25</column>
        </insert>
        <insert tableName="steps">
            <column name="id">9</column>
            <column name="low">2500</column>
            <column name="high">4999.99</column>
            <column name="value">50</column>
        </insert>
        <insert tableName="steps">
            <column name="id">10</column>
            <column name="low">5000</column>
            <column name="high">1000000</column>
            <column name="value">100</column>
        </insert>
    </changeSet>
</databaseChangeLog>


text:
/**
 *
 */
package org.set4j.impl;

import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

/**
 * @author Tomas Mikenda
 *
 */
public class Defaults implements InvocationHandler
{
	public static <A extends Annotation> A of(Class<A> annotation)
	{
		return (A) Proxy.newProxyInstance(annotation.getClassLoader(), new Class[] { annotation }, new Defaults());
	}

	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
	{
		return method.getDefaultValue();
	}

	/*
	 * http://stackoverflow.com/questions/266903/create-annotation-instance-with-defaults-in-java
	 *
	 * Settings s = Defaults.of(Settings.class);
	 * System.out.printf("%s\n%s\n%s\n", s.a(), s.b(), s.c());
	 */
	/*
	 * nebo
	 * class GetSettings
		{
		    public static void main ( String [ ] args )
		    {
		    @ Settings final class c { }
		    Settings settings = c . class . getAnnotation ( Settings . class ) ;
		    System . out . println ( settings . aaa ( ) ) ;
		    }
		}

	 * java.lang.reflect.ParameterizedType
	 **/
}


text:
from msrest.serialization import Model

class CreationData(Model):
    """Data used when creating a disk.

    :param create_option: This enumerates the possible sources of a disk's
     creation. Possible values include: 'Empty', 'Attach', 'FromImage',
     'Import', 'Copy'
    :type create_option: str or :class:`DiskCreateOption
     <azure.mgmt.compute.compute.v2017_03_30.models.DiskCreateOption>`
    :param storage_account_id: If createOption is Import, the Azure Resource
     Manager identifier of the storage account containing the blob to import as
     a disk. Required only if the blob is in a different subscription
    :type storage_account_id: str
    :param image_reference: Disk source information.
    :type image_reference: :class:`ImageDiskReference
     <azure.mgmt.compute.compute.v2017_03_30.models.ImageDiskReference>`
    :param source_uri: If creationOption is Import, this is the URI of a blob
     to be imported into a managed disk.
    :type source_uri: str
    :param source_resource_id: If createOption is Copy, this is the ARM id of
     the source snapshot or disk.
    :type source_resource_id: str
    """

    _validation = {
        'create_option': {'required': True},
    }

    _attribute_map = {
        'create_option': {'key': 'createOption', 'type': 'DiskCreateOption'},
        'storage_account_id': {'key': 'storageAccountId', 'type': 'str'},
        'image_reference': {'key': 'imageReference', 'type': 'ImageDiskReference'},
        'source_uri': {'key': 'sourceUri', 'type': 'str'},
        'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'},
    }

    def __init__(self, create_option, storage_account_id=None, image_reference=None, source_uri=None, source_resource_id=None):
        self.create_option = create_option
        self.storage_account_id = storage_account_id
        self.image_reference = image_reference
        self.source_uri = source_uri
        self.source_resource_id = source_resource_id


text:
[![build status](https://secure.travis-ci.org/ded/R2.png)](http://travis-ci.org/ded/R2)
[![NPM version](https://badge.fury.io/js/R2.png)](http://badge.fury.io/js/R2)
R2
---
R2 helps you achieve cross-language layout-friendly websites (including bi-directional text). It looks like this:

``` css
/* before */
#content {
  float: left;
  margin-right: 2px;
  padding: 1px 2px 3px 4px;
  left: 5px;
}
.info {
  text-align: right;
}

/* after */
#content {
  float: right;
  margin-left: 2px;
  padding: 1px 4px 3px 2px;
  right: 5px;
}
.info {
  text-align: left;
}
```

Install it
----------

    $ [sudo] npm install R2 -g

Use it as a CLI
---------------

### Print to stdout

    $ r2 input.css

### Print to output file

    $ r2 input.css output.css

### Print to output file without compression

    $ r2 input.css output.css  --no-compress

### Read from output of another command

    $ lessc input.less | r2 > output.css

Require it as a Node module
------------------------------

``` js
var output = require('R2').swap(css)
```

Test It
----------

   $ npm test

Caution
--------
R2 will only work as good as what you give it, therefore *inline-styles* embedded in your HTML will not converted, and therefore may cause unexpected results. However inline-styles apart from R2 is still a bad idea, and you should avoid it anyway in favor of separating content from presentation.

**Happy layout Swapping!**


text:
Sign In

        Email
        <input type="email" name="email" ng-model="vm.email">

        password
        <input type="password" name="password" ng-model="vm.password">

    <button class="btn-primary" ng-click="vm.login()">Login</button>

Or Create a new account

        Email
        <input type="email" name="email" ng-model="vm.signupEmail">

        password
        <input type="password" name="password" ng-model="vm.signupPassword">

    <button class="btn-primary" ng-click="vm.signup()">Login</button>


text:
<?php

class Facade_Exception extends Exception {}


text:
<!--
   This file is part of the X12Parser library that provides tools to
   manipulate X12 messages using Ruby native syntax.

   http://x12parser.rubyforge.org

   Copyright (C) 2009 APP Design, Inc.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

   $Id: LOD.xml 78 2009-05-12 22:27:26Z ikk $
-->

<Segment name="LOD" comment="To provide a general description of the area where an entity is located">
  <Field name="GeneralTerritoryCode" required="y" min="1" max="2" validation="T1632" comment="Code identifying a general location or territory"/>
  <Field name="ConditionIndicator" required="y" min="2" max="3" validation="T1321" comment="Code indicating a condition"/>
  <Field name="FreeFormMessage1" required="y" min="1" max="30" comment="Free-form information"/>
  <Field name="ThoroughfareTypeQualifier" required="y" min="1" max="1" validation="T1630" comment="Code specifying thoroughfare"/>
  <Field name="ThoroughfareTypeCode" required="y" min="1" max="1" validation="T1631" comment="Code identifying type of thoroughfare"/>
  <Field name="FreeFormMessage2" required="y" min="1" max="30" comment="Free-form information"/>
</Segment>