text:
// This is ExFat, an exFAT accessor written in pure C#
// Released under MIT license
// https://github.com/picrap/ExFat

namespace ExFat
{
    using System.Collections;
    using System.Collections.Generic;

    /// <summary>
    /// Cache dictionary
    /// </summary>
    /// <typeparam name="TKey">The type of the key.</typeparam>
    /// <typeparam name="TValue">The type of the value.</typeparam>
    /// <seealso cref="System.Collections.Generic.IDictionary{TKey, TValue}" />
    public class Cache<TKey, TValue> : IDictionary<TKey, TValue>
    {
        private readonly int _capacity;
        private readonly IDictionary<TKey, TValue> _dictionary = new Dictionary<TKey, TValue>();
        private readonly IList<TKey> _orderedKeys = new List<TKey>();

        /// <inheritdoc />
        /// <summary>
        /// Gets the number of elements contained in the <see cref="T:System.Collections.Generic.ICollection`1" />.
        /// </summary>
        public int Count => _dictionary.Count;
        /// <inheritdoc />
        /// <summary>
        /// Gets a value indicating whether the <see cref="T:System.Collections.Generic.ICollection`1" /> is read-only.
        /// </summary>
        public bool IsReadOnly => _dictionary.IsReadOnly;

        /// <inheritdoc />
        /// <summary>
        /// Gets or sets the <see cref="!:TValue" /> with the specified key.
        /// </summary>
        /// <value>
        /// The <see cref="!:TValue" />.
        /// </value>
        /// <param name="key">The key.</param>
        /// <returns></returns>
        public TValue this[TKey key]
        {
            get
            {
                var value = _dictionary[key];
                Touch(key);
                return value;
            }
            set
            {
                _dictionary[key] = value;
                Touch(key);
            }
        }

        /// <inheritdoc />
        /// <summary>
        /// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the keys of the <see cref="T:System.Collections.Generic.IDictionary`2" />.
        /// </summary>
        public ICollection<TKey> Keys => _dictionary.Keys;
        /// <inheritdoc />
        /// <summary>
        /// Gets an <see cref="T:System.Collections.Generic.ICollection`1" /> containing the values in the <see cref="T:System.Collections.Generic.IDictionary`2" />.
        /// </summary>
        public ICollection<TValue> Values => _dictionary.Values;

        /// <summary>
        /// Initializes a new instance of the <see cref="Cache{TKey, TValue}"/> class.
        /// </summary>
        /// <param name="capacity">The capacity.</param>
        public Cache(int capacity)
        {
            _capacity = capacity;
        }

        /// <summary>
        /// Touches the specified key.
        /// </summary>
        /// <param name="key">The key.</param>
        private void Touch(TKey key)
        {
            // remove from anywhere
            _orderedKeys.Remove(key);
            // place at end
            _orderedKeys.Add(key);
            // on capacity overflow
            while (_orderedKeys.Count >= _capacity)
            {
                // oldest key is first
                var lastKey = _orderedKeys[0];
                _orderedKeys.RemoveAt(0);
                _dictionary.Remove(lastKey);
            }
        }

        /// <inheritdoc />
        /// <summary>
        /// Returns an enumerator that iterates through the collection.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.Collections.Generic.IEnumerator`1" /> that can be used to iterate through the collection.
        /// </returns>
        public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
        {
            return _dictionary.GetEnumerator();
        }

        /// <inheritdoc />
        /// <summary>
        /// Returns an enumerator that iterates through a collection.
        /// </summary>
        /// <returns>
        /// An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.
        /// </returns>
        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        /// <inheritdoc />
        /// <summary>
        /// Adds an item to the <see cref="T:System.Collections.Generic.ICollection`1" />.
        /// </summary>
        /// <param name="item">The object to add to the <see cref="T:System.Collections.Generic.ICollection`1" />.</param>
        public void Add(KeyValuePair<TKey, TValue> item)
        {
            _dictionary.Add(item);
            Touch(item.Key);
        }

        /// <inheritdoc />
        /// <summary>
        /// Removes all items from the <see cref="T:System.Collections.Generic.ICollection`1" />.
        /// </summary>
        public void Clear()
        {
            _dictionary.Clear();
            _orderedKeys.Clear();
        }

        /// <inheritdoc />
        /// <summary>
        /// Determines whether the <see cref="T:System.Collections.Generic.ICollection`1" /> contains a specific value.
        /// </summary>
        /// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.ICollection`1" />.</param>
        /// <returns>
        /// true if <paramref name="item" /> is found in the <see cref="T:System.Collections.Generic.ICollection`1" />; otherwise, false.
        /// </returns>
        public bool Contains(KeyValuePair<TKey, TValue> item)
        {
            return _dictionary.Contains(item);
        }

        /// <inheritdoc />
        /// <summary>
        /// Copies the elements of the <see cref="T:System.Collections.Generic.ICollection`1" /> to an <see cref="T:System.Array" />, starting at a particular <see cref="T:System.Array" /> index.
        /// </summary>
        /// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.Generic.ICollection`1" />. The <see cref="T:System.Array" /> must have zero-based indexing.</param>
        /// <param name="arrayIndex">The zero-based index in <paramref name="array" /> at which copying begins.</param>
        public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
        {
            _dictionary.CopyTo(array, arrayIndex);
        }

        /// <inheritdoc />
        /// <summary>
        /// Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.ICollection`1" />.
        /// </summary>
        /// <param name="item">The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1" />.</param>
        /// <returns>
        /// true if <paramref name="item" /> was successfully removed from the <see cref="T:System.Collections.Generic.ICollection`1" />; otherwise, false. This method also returns false if <paramref name="item" /> is not found in the original <see cref="T:System.Collections.Generic.ICollection`1" />.
        /// </returns>
        public bool Remove(KeyValuePair<TKey, TValue> item)
        {
            _dictionary.Remove(item);
            return _orderedKeys.Remove(item.Key);
        }

        /// <inheritdoc />
        /// <summary>
        /// Determines whether the <see cref="T:System.Collections.Generic.IDictionary`2" /> contains an element with the specified key.
        /// </summary>
        /// <param name="key">The key to locate in the <see cref="T:System.Collections.Generic.IDictionary`2" />.</param>
        /// <returns>
        /// true if the <see cref="T:System.Collections.Generic.IDictionary`2" /> contains an element with the key; otherwise, false.
        /// </returns>
        public bool ContainsKey(TKey key)
        {
            return _dictionary.ContainsKey(key);
        }

        /// <inheritdoc />
        /// <summary>
        /// Adds an element with the provided key and value to the <see cref="T:System.Collections.Generic.IDictionary`2" />.
        /// </summary>
        /// <param name="key">The object to use as the key of the element to add.</param>
        /// <param name="value">The object to use as the value of the element to add.</param>
        public void Add(TKey key, TValue value)
        {
            _dictionary.Add(key, value);
            Touch(key);
        }

        /// <inheritdoc />
        /// <summary>
        /// Removes the element with the specified key from the <see cref="T:System.Collections.Generic.IDictionary`2" />.
        /// </summary>
        /// <param name="key">The key of the element to remove.</param>
        /// <returns>
        /// true if the element is successfully removed; otherwise, false.  This method also returns false if <paramref name="key" /> was not found in the original <see cref="T:System.Collections.Generic.IDictionary`2" />.
        /// </returns>
        public bool Remove(TKey key)
        {
            _dictionary.Remove(key);
            return _orderedKeys.Remove(key);
        }

        /// <inheritdoc />
        /// <summary>
        /// Gets the value associated with the specified key.
        /// </summary>
        /// <param name="key">The key whose value to get.</param>
        /// <param name="value">When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the <paramref name="value" /> parameter. This parameter is passed uninitialized.</param>
        /// <returns>
        /// true if the object that implements <see cref="T:System.Collections.Generic.IDictionary`2" /> contains an element with the specified key; otherwise, false.
        /// </returns>
        public bool TryGetValue(TKey key, out TValue value)
        {
            if (!_dictionary.TryGetValue(key, out value))
                return false;
            Touch(key);
            return true;
        }
    }
}


text:
package foundation

import (
	"errors"
	"fmt"
	"runtime/debug"

	"github.com/asaskevich/EventBus"
	"github.com/lara-go/larago/logger"
	"github.com/lara-go/larago/logger/format"
	"github.com/lara-go/larago/support/utils"
	"github.com/urfave/cli"
)

// ExitHandler handles all panics.
type ExitHandler struct {
	Events *EventBus.EventBus
}

// Exit terminates application.
func (h *ExitHandler) Exit(message string, exitCode int) {
	cli.HandleExitCoder(
		cli.NewExitError(message, exitCode),
	)
}

// Defer to handle panics.
func (h *ExitHandler) Defer() {
	var err error
	var ok bool

	// Try to recover.
	if r := recover(); r != nil {
		if err, ok = r.(error); !ok {
			err = errors.New(r.(string))
		}

		h.handleError(err)
	}
}

// HandleError writes error to the output and terminates.
func (h *ExitHandler) handleError(err error) {
	message := err.Error()
	exitCode := 2

	// Check if error is already an instance of cli.ExitCoder
	// and update exit code
	if exitErr, ok := err.(cli.ExitCoder); ok {
		exitCode = exitErr.ExitCode()
	}

	// Color output.
	if logger.IsTTY() {
		message = format.Red(message).Format()
	}

	// Find trower line.
	file, line := utils.Thrower("larago/errors")

	// Publish event.
	if h.Events != nil {
		h.Events.Publish("panic", message, file, line, debug.Stack(), exitCode)
	}

	// Handle exit with formatted error message.
	h.Exit(
		fmt.Sprintf("%s\n--> %s:%d\n%s", message, file, line, debug.Stack()),
		exitCode,
	)
}

redpajama_set_name: RedPajamaGithub


text:
import os, sys, urllib2
def import_module (name, moduleName = None, url = None, glo = globals(), loc = locals()) :
    """
    import a module given its name, look for it on http://www.xavierdupre.fr/...,
    the file is copied at this file location
    @param      name        name of the module
    @param      moduleName  like import name as moduleName, None for name
    @param      url         link to the website to use
    @param      glo         globals()
    @param      loc         locals()
    @return                 modules
    """
    file = "%s.py" % name
    if not os.path.exists (file) :
        path = "../../../../complements_site_web"
        f2 = os.path.join (path, file)
        if os.path.exists (f2) :
            print "ajout de ", f2
            u = open (f2, "r")
            all = u.read ()
            u.close()
        else :
            if url == None : url = "http://www.xavierdupre.fr/enseignement/tutoriel_python/graphviz/"
            url += file
            print "téléchargement de ", url
            u = urllib2.urlopen (url, "r")
            all = u.read ()
            if "404 Not Found" in all and 'if "404 Not Found" in all :' not in all :
                raise Exception ("fichier introuvable: " + name )
            u.close ()
        u = open (file, "w")
        u.write ( all )
        u.close()
    temp = __import__ (name,glo,loc, [], -1)
    if moduleName == None : moduleName = name
    glo[moduleName] = temp
    sys.modules[moduleName] = temp
    return temp

if __name__ == "__main__" :
    use_graphivz2 = import_module("use_graphivz")
    use_graphivz2.check_module()
    use_graphivz.check_module()


text:
<!DOCTYPE html>

    <title>AngularJS</title>
    <meta charset="utf-8">
    <link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../styles/kendo.default.min.css" rel="stylesheet">
    <link href="../../styles/kendo.default.mobile.min.css" rel="stylesheet">

        Back

Select product

        <select kendo-multi-select k-options="selectOptions" k-ng-model="selectedIds"></select>

Selected: {{ selectedIds }}


text:
/*
Theme Name: my-simone
Theme URI: http://underscores.me/
Author: Underscores.me
Author URI: http://underscores.me/
Description: Description
Version: 1.0
License: GNU General Public License
License URI: license.txt
Text Domain: my-simone
Domain Path: /languages/
Tags:

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.

 my-simone is based on Underscores http://underscores.me/, (C) 2012-2014 Automattic, Inc.

Resetting and rebuilding styles have been helped along thanks to the fine work of
Eric Meyer http://meyerweb.com/eric/tools/css/reset/index.html
along with Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normalize.css/
and Blueprint http://www.blueprintcss.org/
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
1.0 - Reset
2.0 - Typography
3.0 - Elements
4.0 - Forms
5.0 - Navigation
        5.1 - Links
        5.2 - Menus
6.0 - Accessibility
7.0 - Alignments
8.0 - Clearings
9.0 - Widgets
10.0 - Content
        10.1 - Posts and pages
        10.2 - Asides
        10.3 - Comments
11.0 - Infinite scroll
12.0 - Media
--------------------------------------------------------------*/

/*--------------------------------------------------------------
1.0 - Reset
--------------------------------------------------------------*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
    border: 0;
    font-family: inherit;
    font-size: 100%;
    font-style: inherit;
    font-weight: inherit;
    margin: 0;
    outline: 0;
    padding: 0;
    vertical-align: baseline;
}
html {
    font-size: 62.5%; /* Corrects text resizing oddly in IE6/7 when body font-size is set using em units http://clagnut.com/blog/348/#c790 */
    overflow-y: scroll; /* Keeps page centered in all browsers regardless of content height */
    -webkit-text-size-adjust: 100%; /* Prevents iOS text size adjust after orientation change, without disabling user zoom */
    -ms-text-size-adjust:     100%; /* www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/ */
}
*,
*:before,
*:after { /* apply a natural box layout model to all elements; see http://www.paulirish.com/2012/box-sizing-border-box-ftw/ */
    -webkit-box-sizing: border-box; /* Not needed for modern webkit but still used by Blackberry Browser 7.0; see http://caniuse.com/#search=box-sizing */
    -moz-box-sizing:    border-box; /* Still needed for Firefox 28; see http://caniuse.com/#search=box-sizing */
    box-sizing:         border-box;
}
body {
    background: #fff;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
main,
nav,
section {
    display: block;
}
ol, ul {
    list-style: none;
}
table { /* tables still need 'cellspacing="0"' in the markup */
    border-collapse: separate;
    border-spacing: 0;
}
caption, th, td {
    font-weight: normal;
    text-align: left;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: "";
}
blockquote, q {
    quotes: "" "";
}
a:focus {
    outline: thin dotted;
}
a:hover,
a:active {
    outline: 0;
}
a img {
    border: 0;
}

/*--------------------------------------------------------------
2.0 Typography
--------------------------------------------------------------*/
body,
button,
input,
select,
textarea {
    color: #404040;
    color: hsl(0, 0%, 25%);
    font-family: 'PT Serif',serif;
    font-size: 18px;
    font-size: 1.8rem;
    line-height: 1.5;
}
h1, h2, h3, h4, h5, h6 {
    clear: right;
    font-weight: 900;
    font-family: 'Lato', sans-serif;
    color: #000;
    color: hsl(0, 0%, 0%);
}
p {
    margin-bottom: 1.5em;
}
b, strong {
    font-weight: bold;
}
dfn, cite, em, i {
    font-style: italic;
}
blockquote {
    margin: 0 1.5em;
}
address {
    margin: 0 0 1.5em;
}
pre {
    background: #eee;
    font-family: "Courier 10 Pitch", Courier, monospace;
    font-size: 15px;
    font-size: 1.5rem;
    line-height: 1.6;
    margin-bottom: 1.6em;
    max-width: 100%;
    overflow: auto;
    padding: 1.6em;
}
code, kbd, tt, var {
    font: 15px Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
}
abbr, acronym {
    border-bottom: 1px dotted #666;
    cursor: help;
}
mark, ins {
    background: #fff9c0;
    text-decoration: none;
}
sup,
sub {
    font-size: 75%;
    height: 0;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}
sup {
    bottom: 1ex;
}
sub {
    top: .5ex;
}
small {
    font-size: 75%;
}
big {
    font-size: 125%;
}

/*--------------------------------------------------------------
3.0 Elements
--------------------------------------------------------------*/
hr {
    background-color: #ccc;
    border: 0;
    height: 1px;
    margin-bottom: 1.5em;
}
ul, ol {
    margin: 0 0 1.5em 3em;
}
ul {
    list-style: disc;
}
ol {
    list-style: decimal;
}
li > ul,
li > ol {
    margin-bottom: 0;
    margin-left: 1.5em;
}
dt {
    font-weight: bold;
}
dd {
    margin: 0 1.5em 1.5em;
}
img {
    height: auto; /* Make sure images are scaled correctly. */
    max-width: 100%; /* Adhere to container width. */
}
figure {
    margin: 0;
}
table {
    margin: 0 0 1.5em;
    width: 100%;
}
th {
    font-weight: bold;
}

/*--------------------------------------------------------------
4.0 Forms
--------------------------------------------------------------*/
button,
input,
select,
textarea {
    font-size: 100%; /* Corrects font size not being inherited in all browsers */
    margin: 0; /* Addresses margins set differently in IE6/7, F3/4, S5, Chrome */
    vertical-align: baseline; /* Improves appearance and consistency in all browsers */
    *vertical-align: middle; /* Improves appearance and consistency in IE6/IE7 */
}
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
    border: 1px solid #ccc;
    border-color: #ccc #ccc #bbb #ccc;
    border-radius: 3px;
    background: #e6e6e6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 15px 17px rgba(255, 255, 255, 0.5), inset 0 -5px 12px rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, .8);
    cursor: pointer; /* Improves usability and consistency of cursor style between image-type 'input' and others */
    -webkit-appearance: button; /* Corrects inability to style clickable 'input' types in iOS */
    font-size: 12px;
    font-size: 1.2rem;
    line-height: 1;
    padding: .6em 1em .4em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover {
    border-color: #ccc #bbb #aaa #bbb;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 15px 17px rgba(255, 255, 255, 0.8), inset 0 -5px 12px rgba(0, 0, 0, 0.02);
}
button:focus,
input[type="button"]:focus,
input[type="reset"]:focus,
input[type="submit"]:focus,
button:active,
input[type="button"]:active,
input[type="reset"]:active,
input[type="submit"]:active {
    border-color: #aaa #bbb #bbb #bbb;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.5), inset 0 2px 5px rgba(0, 0, 0, 0.15);
}
input[type="checkbox"],
input[type="radio"] {
    padding: 0; /* Addresses excess padding in IE8/9 */
}
input[type="search"] {
    -webkit-appearance: textfield; /* Addresses appearance set to searchfield in S5, Chrome */
    -webkit-box-sizing: content-box; /* Addresses box sizing set to border-box in S5, Chrome (include -moz to future-proof) */
    -moz-box-sizing:    content-box;
    box-sizing:         content-box;
}
input[type="search"]::-webkit-search-decoration { /* Corrects inner padding displayed oddly in S5, Chrome on OSX */
    -webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner { /* Corrects inner padding and border displayed oddly in FF3/4 www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/ */
    border: 0;
    padding: 0;
}
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea {
    color: #666;
    border: 1px solid #ccc;
    border-radius: 3px;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus {
    color: #111;
}
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"] {
    padding: 3px;
}
textarea {
    overflow: auto; /* Removes default vertical scrollbar in IE6/7/8/9 */
    padding-left: 3px;
    vertical-align: top; /* Improves readability and alignment in all browsers */
    width: 98%;
}

/*--------------------------------------------------------------
5.0 Navigation
--------------------------------------------------------------*/
/*--------------------------------------------------------------
5.1 Links
--------------------------------------------------------------*/
a {
    text-decoration: none;
    color: #000;
    color: hsl(0, 0%, 0%);
}

a:visited {
    color: #333;
    color: hsl(0, 0%, 20%);
}

a:hover,
a:focus,
a:active {
    text-decoration: underline;
}

/*--------------------------------------------------------------
5.2 Menus
--------------------------------------------------------------*/
.main-navigation {
    position: relative;
    float: left;
    width: 100%;
    display: block;
    clear: both;
    font-family: 'Lato', sans-serif;
    text-transform: uppercase;
    background: #313131;
    background: hsl(0, 0%, 19%);
}
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
}
.main-navigation li {
    float: left;
    position: relative;
}
.main-navigation a {
    display: block;
    padding: 1.3em 1em;
    font-size: 14px;
    font-size: 1.4rem;
    text-decoration: none;
    line-height: 1.3em;
    color: white;
    color: hsl(0, 0%, 100%);
}
.main-navigation ul ul {
    position: absolute;
    left: 0;
    z-index: 99999;
    display: none;
    float: left;
    padding: 0;
    background: #4d4d4d;
    background: hsl(0, 0%, 30%);
}
.main-navigation ul ul ul {
    left: 100%;
    top: 0;
}
.main-navigation ul ul a {
    width: 200px;
}
.main-navigation ul ul li {
}
.main-navigation li:hover > a {
    color: #fff;
    color: hsl(0, 0%, 100%);
    background: #4d4d4d;
    background: hsl(0, 0%, 30%);
}
.main-navigation ul ul :hover > a {
}
.main-navigation ul ul a:hover {
    background: #313131;
    background: hsl(0, 0%, 19%);
}
.main-navigation ul li:hover > ul {
    display: block;
}
.main-navigation .current_page_item > a,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a:hover,
.main-navigation .current-menu-item > a:hover {
    background: white;
    color: #313131;
    color: hsl(0, 0%, 19%);
}
.main-navigation .current_page_ancestor {
    background: #4d4d4d;
    background: hsl(0, 0%, 30%);
}

.main-navigation ul ul .current_page_parent,
.main-navigation .current_page_parent .current_page_item > a {
    color: #fff;
    color: hsl(0, 0%, 100%);
    background: #313131;
    background: hsl(0, 0%, 19%);
}
/* Small menu */
.menu-toggle {
    cursor: pointer;
    display: none;
}
@media screen and (max-width: 600px) {
    .menu-toggle {
        display: block;
        height: 3.75em;
        padding: 0 1em;
        font-weight: normal;
        font-size: 14px;
        font-size: 1.4rem;
        text-decoration: none;
        line-height: 3.75em;
        color: white;
    }

    .main-navigation.toggled .nav-menu {
        display: block;
        border-top: 1px solid;
        border-top-color: #fff;
        border-top-color: hsla(0, 0%, 100%, .5);
    }

    .main-navigation ul {
        display: none;
        padding-left: 0;
    }
    .main-navigation li {
        float: none;
    }

    .main-navigation li a {
        padding: 1.3em 2em;
    }

    .main-navigation li li a {
        padding-left: 4em;
    }

    .main-navigation li li li a {
        padding-left: 6em;
    }

    .main-navigation li:hover > a {
        background: #313131;
        background: hsl(0, 0%, 19%);
    }

    .main-navigation ul ul,
    .main-navigation ul ul ul {
        position: relative;
        top: inherit;
        left: 0;
        display: block;
        float: none;
        background: #313131;
        background: hsl(0, 0%, 19%);
    }

    .main-navigation ul ul a { width: 100%; }

    .main-navigation ul a:hover,
    .main-navigation ul ul a:hover {
        background: #4d4d4d;
        background: hsl(0, 0%, 30%);
    }

    .main-navigation .current_page_ancestor { background: inherit; }

    .main-navigation ul ul .current_page_parent {
        color: inherit;
        background: inherit;
    }

    .main-navigation .current_page_item > a,
    .main-navigation .current_page_item > a:hover,
    .main-navigation .current_page_item li:hover,
    .main-navigation .current_page_parent .current_page_item > a  {
        color: #fff;
        color: hsl(0, 0%, 100%);
        background: #4d4d4d;
        background: hsl(0, 0%, 30%);
    }

}

/* Social Menu */

.menu-social ul {
    float: right;
    text-align: center;
    list-style: none;
}

.menu-social ul li {
    position: relative;
    display:  inline-block;
}
.menu-social li a:before {
    display: inline-block;
    padding: 0 5px;
    vertical-align: top;
    font-family: 'Fontawesome';
    font-size: 20px;
    color: #fff;
    -webkit-font-smoothing: antialiased;
    content: '\f0c0';
}

.menu-social li a[href*="facebook.com"]::before { content: '\f09a'; }

.menu-social li a[href*="twitter.com"]::before { content: '\f099'; }

.menu-social li a[href*="dribbble.com"]::before { content: '\f17d'; }

.menu-social li a[href*="plus.google.com"]::before { content: '\f0d5'; }

.menu-social li a[href*="pinterest.com"]::before { content: '\f0d2'; }

.menu-social li a[href*="github.com"]::before { content: '\f09b'; }

.menu-social li a[href*="tumblr.com"]::before { content: '\f173'; }

.menu-social li a[href*="youtube.com"]::before { content: '\f167'; }

.menu-social li a[href*="flickr.com"]::before { content: '\f16e'; }

.menu-social li a[href*="vimeo.com"]::before { content: '\f194'; }

.menu-social li a[href*="instagram.com"]::before { content: '\f16d'; }

.menu-social li a[href*="linkedin.com"]::before { content: '\f0e1'; }

@media screen and (max-width: 600px) {
    #menu-social ul {
	    position: absolute;
        top: 0;
        right: 6rem;
        display: block;
    }

    #menu-social li a {
        padding-left:.5em;
        padding-right: .5em;
    }
}
.site-main .comment-navigation,
.site-main .paging-navigation,
.site-main .post-navigation {
    margin: 0 0 1.5em;
    overflow: hidden;
}
.comment-navigation .nav-previous,
.paging-navigation .nav-previous,
.post-navigation .nav-previous {
    float: left;
    width: 50%;
}
.comment-navigation .nav-next,
.paging-navigation .nav-next,
.post-navigation .nav-next {
    float: right;
    text-align: right;
    width: 50%;
}

/*--------------------------------------------------------------
6.0 Accessibility
--------------------------------------------------------------*/
/* Text meant only for screen readers */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
}

.screen-reader-text:hover,
.screen-reader-text:active,
.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000; /* Above WP toolbar */
}

/*--------------------------------------------------------------
7.0 Alignments
--------------------------------------------------------------*/
.alignleft {
    display: inline;
    float: left;
    margin-right: 1.5em;
}
.alignright {
    display: inline;
    float: right;
    margin-left: 1.5em;
}
.aligncenter {
    clear: both;
    display: block;
    margin: 0 auto;
}

/*--------------------------------------------------------------
8.0 Clearings
--------------------------------------------------------------*/
.clear:before,
.clear:after,
.entry-content:before,
.entry-content:after,
.comment-content:before,
.comment-content:after,
.site-header:before,
.site-header:after,
.site-content:before,
.site-content:after,
.site-footer:before,
.site-footer:after {
    content: '';
    display: table;
}

.clear:after,
.entry-content:after,
.comment-content:after,
.site-header:after,
.site-content:after,
.site-footer:after {
    clear: both;
}

/*--------------------------------------------------------------
Hun.1 Header
--------------------------------------------------------------*/
.header-image img {
    display: block;
    margin: 0 auto;
}

.header-background-image {
    background: no-repeat center;
    background-size: cover!important;
    -moz-background-size: cover!important;
    -webkit-background-size: cover!important;
}

.header-background-image .title-box {
    background: #333;
    background: hsla(0, 0%, 0%, .7);
}

.site-branding {
    padding: 6rem 0;
    text-align: center;
    background: #2c86ba;
    background: hsl(202, 62%, 45%);
}

.site-title {
    font-weight: 700;
    font-size: 40px;
    font-size: 4.5rem;
    text-transform: uppercase;
    line-height: normal;
    padding-bottom: 1rem;
}

.site-description {
    font-weight: 100;
    font-size: 20px;
    font-size: 2rem;
}
.title-box {
    width: 600px;
    max-width: 75%;
    padding: 4rem;
    margin: 0 auto;
    border: solid 1px #fff;
    border: solid 1px hsla(0, 0%, 100%, .3);
}
.site-title a,
.site-description {
    color: #fff;
    color: hsl(0, 0%, 100%);
}
/* Header responsive */
@media screen and (max-width: 600px) {
    .site-branding { padding: 0; }

    .title-box {
        max-width: 100%;
        margin: 0;
        padding: 4rem;
        border: none;
    }
}

/*--------------------------------------------------------------
9.0 Widgets
--------------------------------------------------------------*/
.widget {
    margin: 0 0 1.5em;
}

/* Make sure select elements fit in widgets */
.widget select {
    max-width: 100%;
}

/* Search widget */
.widget_search .search-submit {
    display: none;
}

/*--------------------------------------------------------------
10.0 Content
--------------------------------------------------------------*/
/*--------------------------------------------------------------
10.1 Posts and pages
--------------------------------------------------------------*/
.sticky {
}
.hentry {
    margin: 0 0 1.5em;
}
.byline,
.updated {
    display: none;
}
.single .byline,
.group-blog .byline {
    display: inline;
}
.page-content,
.entry-content,
.entry-summary {
    margin: 1.5em 0 0;
}
.page-links {
    clear: both;
    margin: 0 0 1.5em;
}

/*--------------------------------------------------------------
10.2 Asides
--------------------------------------------------------------*/
.blog .format-aside .entry-title,
.archive .format-aside .entry-title {
    display: none;
}

/*--------------------------------------------------------------
10.3 Comments
--------------------------------------------------------------*/
.comment-content a {
    word-wrap: break-word;
}
.bypostauthor {
}

/*--------------------------------------------------------------
11.0 Infinite scroll
--------------------------------------------------------------*/
/* Globally hidden elements when Infinite Scroll is supported and in use. */
.infinite-scroll .paging-navigation, /* Older / Newer Posts Navigation (always hidden) */
.infinite-scroll.neverending .site-footer { /* Theme Footer (when set to scrolling) */
    display: none;
}
/* When Infinite Scroll has reached its end we need to re-display elements that were hidden (via .neverending) before */
.infinity-end.neverending .site-footer {
    display: block;
}

/*--------------------------------------------------------------
12.0 Media
--------------------------------------------------------------*/
.page-content img.wp-smiley,
.entry-content img.wp-smiley,
.comment-content img.wp-smiley {
    border: none;
    margin-bottom: 0;
    margin-top: 0;
    padding: 0;
}
.wp-caption {
    border: 1px solid #ccc;
    margin-bottom: 1.5em;
    max-width: 100%;
}
.wp-caption img[class*="wp-image-"] {
    display: block;
    margin: 1.2% auto 0;
    max-width: 98%;
}
.wp-caption-text {
    text-align: center;
}
.wp-caption .wp-caption-text {
    margin: 0.8075em 0;
}
.site-main .gallery {
    margin-bottom: 1.5em;
}
.gallery-caption {
}
.site-main .gallery a img {
    border: none;
    height: auto;
    max-width: 90%;
}
.site-main .gallery dd,
.site-main .gallery figcaption {
    margin: 0;
}
.site-main .gallery-columns-4 .gallery-item {
}
.site-main .gallery-columns-4 .gallery-item img {
}
/* Make sure embeds and iframes fit their containers */
embed,
iframe,
object {
    max-width: 100%;
}


text:
package org.wfanet.anysketch;

import static com.google.common.base.Charsets.UTF_8;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.extensions.proto.ProtoTruth.assertThat;
import static java.util.Collections.singletonList;
import static org.junit.Assert.assertThrows;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.io.Resources;
import com.google.protobuf.TextFormat;
import java.io.IOException;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Consumer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.wfanet.anysketch.Sketch.Register;
import org.wfanet.anysketch.aggregators.Aggregators;
import org.wfanet.anysketch.distributions.Distributions;
import org.wfanet.anysketch.fingerprinters.FarmFingerprinter;
import org.wfanet.anysketch.fingerprinters.SaltedFingerprinter;

@RunWith(JUnit4.class)
public class SketchProtosTest {

  private static final SketchConfig DEFAULT_CONFIG = SketchConfig.getDefaultInstance();

  private static class Mod1000Distribution extends org.wfanet.anysketch.distributions.Distribution {
    public Mod1000Distribution() {
      super(0, 999);
    }

    @Override
    public long apply(String item, Map<String, Long> itemMetadata) {
      return Long.parseLong(item) % 1000;
    }
  }

  private final AnySketch anySketch =
      new AnySketch(
          singletonList(new Mod1000Distribution()),
          ImmutableList.of(
              new ValueFunction(
                  "value-function-1", Aggregators.sum(), Distributions.oracle("feature1", 5, 105)),
              new ValueFunction(
                  "value-function-2",
                  Aggregators.unique(),
                  Distributions.oracle("feature2", 6, 15))));

  @Test
  public void fromAnySketch_invalidArgumentsFails() {
    assertThrows(NullPointerException.class, () -> SketchProtos.fromAnySketch(null, null));
    assertThrows(
        NullPointerException.class, () -> SketchProtos.fromAnySketch(null, DEFAULT_CONFIG));
  }

  @Test
  public void fromAnySketch_emptySketch() {
    Sketch sketch = SketchProtos.fromAnySketch(anySketch, DEFAULT_CONFIG);
    assertThat(sketch).isEqualTo(Sketch.newBuilder().setConfig(DEFAULT_CONFIG).build());
  }

  @Test
  public void fromAnySketch_sketchWithMultipleRegistersSucceeds() {
    anySketch.insert(1L, ImmutableMap.of("feature1", 10L, "feature2", 6L));
    anySketch.insert(2L, ImmutableMap.of("feature1", 11L, "feature2", 7L));
    anySketch.insert(3L, ImmutableMap.of("feature1", 12L, "feature2", 8L));
    anySketch.insert(4L, ImmutableMap.of("feature1", 13L, "feature2", 9L));

    Sketch sketch = SketchProtos.fromAnySketch(anySketch, DEFAULT_CONFIG);

    // We expect feature2 values to be incremented by 1, so that "-1" is represented as "0" in
    // protos.
    Sketch expected =
        Sketch.newBuilder()
            .setConfig(DEFAULT_CONFIG)
            .addAllRegisters(
                Arrays.asList(
                    makeRegister(1L, 10L, 7L),
                    makeRegister(2L, 11L, 8L),
                    makeRegister(3L, 12L, 9L),
                    makeRegister(4L, 13L, 10L)))
            .build();
    assertThat(sketch).isEqualTo(expected);
  }

  @Test
  public void roundTrip_liquidLegions() throws IOException {
    SketchConfig config = readSketchConfigTextproto("liquid_legions");

    Consumer<AnySketch> insertSomeItems =
        (anySketch) -> {
          anySketch.insert("person one", ImmutableMap.of("frequency", 1L));
          anySketch.insert("persona dos", ImmutableMap.of("frequency", 2L));
          anySketch.insert("personne trois", ImmutableMap.of("frequency", 3L));
          anySketch.insert("qof afar", ImmutableMap.of("frequency", 4L));
        };

    AnySketch anySketch1 = SketchProtos.toAnySketch(config);
    insertSomeItems.accept(anySketch1);

    Sketch sketch1 = SketchProtos.fromAnySketch(anySketch1, config);
    AnySketch anySketch2 = SketchProtos.toAnySketch(sketch1);
    Sketch sketch2 = SketchProtos.fromAnySketch(anySketch2, config);

    assertThat(sketch1)
        .ignoringRepeatedFieldOrderOfFields(Sketch.REGISTERS_FIELD_NUMBER)
        .isEqualTo(sketch2);

    AnySketch anySketch3 =
        new AnySketch(
            ImmutableList.of(
                Distributions.exponential(
                    new SaltedFingerprinter("Index", new FarmFingerprinter()), 23.0, 330_000L)),
            ImmutableList.of(
                new ValueFunction(
                    "SamplingIndicator",
                    Aggregators.unique(),
                    Distributions.uniform(
                        new SaltedFingerprinter("SamplingIndicator", new FarmFingerprinter()),
                        0L,
                        9_999_999L)),
                new ValueFunction(
                    "Frequency",
                    Aggregators.sum(),
                    Distributions.oracle("frequency", Long.MIN_VALUE, Long.MAX_VALUE))));
    insertSomeItems.accept(anySketch3);

    Sketch sketch3 = SketchProtos.fromAnySketch(anySketch3, config);
    assertThat(sketch3)
        .ignoringRepeatedFieldOrderOfFields(Sketch.REGISTERS_FIELD_NUMBER)
        .isEqualTo(sketch1);
  }

  private static Register makeRegister(long index, Long... values) {
    return Register.newBuilder().setIndex(index).addAllValues(Arrays.asList(values)).build();
  }

  private static SketchConfig readSketchConfigTextproto(String name) throws IOException {
    String configPath = "testdata/" + name + ".textpb";
    System.err.println(configPath);
    System.err.println(SketchProtosTest.class.getResource(configPath));
    @SuppressWarnings("UnstableApiUsage")
    String textproto = Resources.toString(SketchProtosTest.class.getResource(configPath), UTF_8);
    return TextFormat.parse(textproto, SketchConfig.class);
  }
}


text:
var packageFile = require('../package.json'),
	makebird = require('../' + packageFile.main);

function buildSingle(projectName, callback) {
	var config = require('./options/' + projectName);

	makebird.build(config, function(err, data, times) {
		if (err) {
			callback(err);
			return;
		}
		callback(null, data, times);
	});
}

module.exports = buildSingle;


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
// http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html
exports.default = ["closeclick", "content_changed", "domready", "position_changed", "zindex_changed"];


text:
Insert into document custom fields.

It is called "Example add custom fields 2" in the interface and isn't installed by default in cloud, [self-hosted](https://github.com/ONLYOFFICE/DocumentServer) and [desktop version](https://github.com/ONLYOFFICE/DesktopEditors) of ONLYOFFICE editors.

## How to use

1. Open the Plugins tab and press "Example add custom fields 2".
2. Add textQ or listQ in the corresponding tabs (type necessary text, check necessary options and press the "Save" button).
3. If you nee you can copy necessary field in the corresponding tab.
4. You can insert option into document in "Insert Option" tab (choose an option and press the "Insert" button).

If you need more information about how to use or write your own plugin, please see this https://api.onlyoffice.com/plugin/basic


text:
namespace net {

class AddressList;

// DNSDomainFromDot - convert a domain string to DNS format. From DJB's
// public domain DNS library.
//
//   dotted: a string in dotted form: "www.google.com"
//   out: a result in DNS form: "\x03www\x06google\x03com\x00"
NET_EXPORT_PRIVATE bool DNSDomainFromDot(const base::StringPiece& dotted,
                                         std::string* out);

// Checks that a hostname is valid. Simple wrapper around DNSDomainFromDot.
NET_EXPORT_PRIVATE bool IsValidDNSDomain(const base::StringPiece& dotted);

// Returns true if the character is valid in a DNS hostname label, whether in
// the first position or later in the label.
//
// This function asserts a looser form of the restrictions in RFC 7719 (section
// 2; https://tools.ietf.org/html/rfc7719#section-2): hostnames can include
// characters a-z, A-Z, 0-9, -, and _, and any of those characters (except -)
// are legal in the first position. The looser rules are necessary to support
// service records (initial _), and non-compliant but attested hostnames that
// include _. These looser rules also allow Punycode and hence IDN.
//
// TODO(palmer): In the future, when we can remove support for invalid names,
// this can be a private implementation detail of |DNSDomainFromDot|, and need
// not be NET_EXPORT_PRIVATE.
NET_EXPORT_PRIVATE bool IsValidHostLabelCharacter(char c, bool is_first_char);

// DNSDomainToString converts a domain in DNS format to a dotted string.
// Excludes the dot at the end.
NET_EXPORT_PRIVATE std::string DNSDomainToString(
    const base::StringPiece& domain);

// Return the expanded template when no variables have corresponding values.
NET_EXPORT_PRIVATE std::string GetURLFromTemplateWithoutParameters(
    const std::string& server_template);

// Returns true if the URI template is acceptable for sending requests via the
// given method. The template must be properly formatted, GET requests require
// the template to contain a "dns" variable, an expanded template must parse
// to a valid HTTPS URL, and the "dns" variable may not be part of the hostname.
NET_EXPORT_PRIVATE bool IsValidDoHTemplate(const std::string& server_template,
                                           const std::string& server_method);

#if !defined(OS_NACL)
NET_EXPORT_PRIVATE
base::TimeDelta GetTimeDeltaForConnectionTypeFromFieldTrialOrDefault(
    const char* field_trial_name,
    base::TimeDelta default_delta,
    NetworkChangeNotifier::ConnectionType connection_type);
#endif  // !defined(OS_NACL)

// How similar or different two AddressLists are (see values for details).
// Used in histograms; do not modify existing values.
enum AddressListDeltaType {
  // Both lists contain the same addresses in the same order.
  DELTA_IDENTICAL = 0,
  // Both lists contain the same addresses in a different order.
  DELTA_REORDERED = 1,
  // The two lists have at least one address in common, but not all of them.
  DELTA_OVERLAP = 2,
  // The two lists have no addresses in common.
  DELTA_DISJOINT = 3,
  MAX_DELTA_TYPE
};

// Compares two AddressLists to see how similar or different their addresses
// are. (See |AddressListDeltaType| for details of exactly what's checked.)
NET_EXPORT
AddressListDeltaType FindAddressListDeltaType(const AddressList& a,
                                              const AddressList& b);

}  // namespace net

#endif  // NET_DNS_DNS_UTIL_H_


text:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using Dice;
using Dice.AST;
using Dice.Grammar;

namespace TestDiceRoller.AST
{
    [TestClass]
    public class RollNodeShould : TestBase
    {
        [TestMethod]
        public void Successfully_RollOneDie()
        {
            EvaluateNode(_1d20, Data(Roll9Conf), 1, "1d20 => 9 => 9");
        }

        [TestMethod]
        public void Successfully_RollTwoDice()
        {
            EvaluateNode(_2d20, Data(Roll9Conf), 2, "2d20 => 9 + 9 => 18");
        }

        [TestMethod]
        public void Successfully_RollZeroDice()
        {
            EvaluateNode(new RollNode(RollType.Normal, Zero, Twenty), Data(Roll1Conf), 0, "0d20 => 0 => 0");
        }

        [TestMethod]
        public void FlagCriticals_IfMaxRoll()
        {
            EvaluateNode(_1d20, Data(Roll20Conf), 1, "1d20 => 20! => 20");
        }

        [TestMethod]
        public void FlagFumbles_IfMinRoll()
        {
            EvaluateNode(_1d20, Data(Roll1Conf), 1, "1d20 => 1! => 1");
        }

        [TestMethod]
        public void Successfully_RollStandardFudgeDice()
        {
            EvaluateNode(_1dF, Data(Roll1Conf), 1, "1dF => -1! => -1");
        }

        [TestMethod]
        public void Successfully_RollWackyFudgeDice()
        {
            EvaluateNode(_1dF20, Data(Roll20Conf), 1, "1dF20 => -1 => -1");
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void ThrowArgumentNullException_IfNumDiceIsNullAndRollTypeIsNormal()
        {
            new RollNode(RollType.Normal, null, One);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void ThrowArgumentNullException_IfNumDiceIsNullAndRollTypeIsFudge()
        {
            new RollNode(RollType.Fudge, null, One);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void ThrowArgumentNullException_IfNumSidesIsNullAndRollTypeIsNormal()
        {
            new RollNode(RollType.Normal, One, null);
        }

        // no test for Successfully_RollFudgeDice_IfNumSidesIsNull since base._1dF already passes null numSides
        // if the test framework doesn't fall over when the class is constructed, we know that case succeeds

        [TestMethod]
        public void ThrowsNegativeDice_IfNumDiceIsNegativeAndRollTypeIsNormal()
        {
            EvaluateNode(new RollNode(RollType.Normal, MinusOne, Twenty), Data(Roll9Conf), DiceErrorCode.NegativeDice);
        }

        [TestMethod]
        public void ThrowsNegativeDice_IfNumDiceIsNegativeAndRollTypeIsFudge()
        {
            EvaluateNode(new RollNode(RollType.Fudge, MinusOne, null), Data(Roll9Conf), DiceErrorCode.NegativeDice);
        }

        [TestMethod]
        public void ThrowsTooManyDice_IfNumDiceIsLargeAndRollTypeIsNormal()
        {
            EvaluateNode(new RollNode(RollType.Normal, OneMillion, Twenty), Data(Roll9Conf), DiceErrorCode.TooManyDice);
        }

        [TestMethod]
        public void ThrowsTooManyDice_IfNumDiceIsLargeAndRollTypeIsFudge()
        {
            EvaluateNode(new RollNode(RollType.Fudge, OneMillion, null), Data(Roll9Conf), DiceErrorCode.TooManyDice);
        }

        [TestMethod]
        public void ThrowsBadSides_IfNumSidesIsZeroAndRollTypeIsNormal()
        {
            EvaluateNode(new RollNode(RollType.Normal, One, Zero), Data(Roll9Conf), DiceErrorCode.BadSides);
        }

        [TestMethod]
        public void ThrowsBadSides_IfNumSidesIsZeroAndRollTypeIsFudge()
        {
            EvaluateNode(new RollNode(RollType.Fudge, One, Zero), Data(Roll9Conf), DiceErrorCode.BadSides);
        }

        [TestMethod]
        public void ThrowsBadSides_IfNumSidesIsNegativeAndRollTypeIsNormal()
        {
            EvaluateNode(new RollNode(RollType.Normal, One, MinusOne), Data(Roll9Conf), DiceErrorCode.BadSides);
        }

        [TestMethod]
        public void ThrowsBadSides_IfNumSidesIsNegativeAndRollTypeIsFudge()
        {
            EvaluateNode(new RollNode(RollType.Fudge, One, MinusOne), Data(Roll9Conf), DiceErrorCode.BadSides);
        }

        [TestMethod]
        public void ThrowsBadSides_IfNumSidesIsLargeAndRollTypeIsNormal()
        {
            EvaluateNode(new RollNode(RollType.Normal, One, OneMillion), Data(Roll9Conf), DiceErrorCode.BadSides);
        }

        [TestMethod]
        public void ThrowsBadSides_IfNumSidesIsLargeAndRollTypeIsFudge()
        {
            EvaluateNode(new RollNode(RollType.Fudge, One, OneMillion), Data(Roll9Conf), DiceErrorCode.BadSides);
        }

        [TestMethod]
        public void ThrowsWrongSides_IfNormalSidesOnlyAndNumSidesIsNonstandardAndRollTypeIsNormal()
        {
            EvaluateNode(new RollNode(RollType.Normal, One, Five), Data(NormalOnlyConf), DiceErrorCode.WrongSides);
        }

        [TestMethod]
        public void ThrowsWrongSides_IfNormalSidesOnlyAndNumSidesIsNonstandardAndRollTypeIsFudge()
        {
            EvaluateNode(new RollNode(RollType.Fudge, One, Five), Data(NormalOnlyConf), DiceErrorCode.WrongSides);
        }

        [TestMethod]
        public void Successfully_RollNormalDice_IfNormalSidesOnly()
        {
            EvaluateNode(_1d20, Data(NormalOnlyConf), 1, "1d20 => 1! => 1");
        }

        [TestMethod]
        public void Successfully_RollStandardFudgeDice_IfNormalSidesOnly()
        {
            EvaluateNode(_1dF, Data(NormalOnlyConf), 1, "1dF => -1! => -1");
        }

        [TestMethod]
        public void Successfully_RollWackyFudgeDice_IfNormalSidesOnly()
        {
            EvaluateNode(_1dF20, Data(NormalOnlyConf), 1, "1dF20 => -20! => -20");
        }
    }
}


text:
/*
 * Dynamixel.h
 *
 *  Created on: Mar 16, 2016
 *      Author: Tobie
 */

#ifndef SERVOS_DYNAMIXEL_H_
#define SERVOS_DYNAMIXEL_H_

#include <termio.h>
#include "../../include/controllers/dynamixel.h"

#ifndef ROUND_2_INT
#define ROUND_2_INT(f) ((int)(f >= 0.0 ? (f + 0.5) : (f - 0.5)))
#endif

#define ANGLE_INCREASE 2

enum ERROR_CODE {
	NONE,
	VOLTAGE,
	OVERHEAT,
	ANGLE,
	RANGE,
	OVERLOAD,
	CONNECTION,
	ID,
	BAUDRATE,
	RXCORRUPT,
	RXTIMEOUT,
	RXWAITING,
	RXFAIL,
	TXERROR,
	TXFAIL,
	UNKNOWN_COMM
};

class DynaMX12WServo {
public:
	DynaMX12WServo();
	DynaMX12WServo(int devID, int serID, long baud);
	DynaMX12WServo(const DynaMX12WServo& orig);
	virtual ~DynaMX12WServo();
	ERROR_CODE getErrorCode();
	double getVoltage();
	double getTemperatureF();
	double getTemperatureC();
	double getAngle();
	double getSpeed();
	void setAngle(double angle);
	void setSpeed(double rpm);
	int getModelNumber();
	int getFirmwareVers();
	long getBaudrate();
	void setBaudrate(long bps);
	int getTransDelay();
	void setTransDelay(int usec);
	int getID();
	void setID(int id);
	bool connect();
	bool isConnected();
	void closeConnection();
	bool isMoving();
	void setSingleMove(bool move);
	bool getSingleMove();
	bool moveServo();
	void setServoPosition(double pos);
	double getPosition();

    /**
     * Get the current servo angle in radians.
     * @return return the current angle that the servo is set to in radians.
     */
    double getRadians(void);

    /**
     * Get the maximum angle the servo can physically turn in degrees.
     * @return The maximum angle the servo can physically turn in degrees
     */
    int getMaxAngle();

private:
	int servoID;
	int deviceID;
	long baudRate;
	bool connected;
	ERROR_CODE err;
	bool singleMove;
	double nextAng;

	void setCommunicationError(int error);
	void setServoAngle(double angle);
};

#endif /* SERVOS_DYNAMIXEL_H_ */


text:
using content::UserMetricsAction;

namespace options2 {

CoreOptionsHandler::CoreOptionsHandler()
    : handlers_host_(NULL) {
}

CoreOptionsHandler::~CoreOptionsHandler() {}

void CoreOptionsHandler::Initialize() {
  clear_plugin_lso_data_enabled_.Init(prefs::kClearPluginLSODataEnabled,
                                      Profile::FromWebUI(web_ui()),
                                      this);
  UpdateClearPluginLSOData();
}

void CoreOptionsHandler::GetLocalizedValues(
    DictionaryValue* localized_strings) {
  GetStaticLocalizedValues(localized_strings);
}

void CoreOptionsHandler::GetStaticLocalizedValues(
    base::DictionaryValue* localized_strings) {
  DCHECK(localized_strings);
  // Main
  localized_strings->SetString("optionsPageTitle",
      l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE));

  // Managed prefs
  localized_strings->SetString("policyManagedPrefsBannerText",
      l10n_util::GetStringUTF16(IDS_OPTIONS_POLICY_MANAGED_PREFS));
  localized_strings->SetString("extensionManagedPrefsBannerText",
      l10n_util::GetStringUTF16(IDS_OPTIONS_EXTENSION_MANAGED_PREFS));
  localized_strings->SetString("policyAndExtensionManagedPrefsBannerText",
      l10n_util::GetStringUTF16(IDS_OPTIONS_POLICY_EXTENSION_MANAGED_PREFS));

  // Controlled settings bubble.
  localized_strings->SetString("controlledSettingPolicy",
      l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY));
  localized_strings->SetString("controlledSettingExtension",
      l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_EXTENSION));
  localized_strings->SetString("controlledSettingRecommended",
      l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_RECOMMENDED));
  localized_strings->SetString("controlledSettingApplyRecommendation",
      l10n_util::GetStringUTF16(
          IDS_OPTIONS_CONTROLLED_SETTING_APPLY_RECOMMENDATION));

  // Search
  RegisterTitle(localized_strings, "searchPage", IDS_OPTIONS_SEARCH_PAGE_TITLE);
  localized_strings->SetString("searchPlaceholder",
      l10n_util::GetStringUTF16(IDS_OPTIONS_SEARCH_PLACEHOLDER));
  localized_strings->SetString("searchPageNoMatches",
      l10n_util::GetStringUTF16(IDS_OPTIONS_SEARCH_PAGE_NO_MATCHES));
  localized_strings->SetString("searchPageHelpLabel",
      l10n_util::GetStringUTF16(IDS_OPTIONS_SEARCH_PAGE_HELP_LABEL));
  localized_strings->SetString("searchPageHelpTitle",
      l10n_util::GetStringFUTF16(IDS_OPTIONS_SEARCH_PAGE_HELP_TITLE,
          l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
  localized_strings->SetString("searchPageHelpURL",
                               chrome::kSettingsSearchHelpURL);

  // Common
  localized_strings->SetString("ok",
      l10n_util::GetStringUTF16(IDS_OK));
  localized_strings->SetString("cancel",
      l10n_util::GetStringUTF16(IDS_CANCEL));
  localized_strings->SetString("learnMore",
      l10n_util::GetStringUTF16(IDS_LEARN_MORE));
  localized_strings->SetString("close",
      l10n_util::GetStringUTF16(IDS_CLOSE));
}

void CoreOptionsHandler::Uninitialize() {
  std::string last_pref;
  for (PreferenceCallbackMap::const_iterator iter = pref_callback_map_.begin();
       iter != pref_callback_map_.end();
       ++iter) {
    if (last_pref != iter->first) {
      StopObservingPref(iter->first);
      last_pref = iter->first;
    }
  }
}

void CoreOptionsHandler::Observe(int type,
                                 const content::NotificationSource& source,
                                 const content::NotificationDetails& details) {
  if (type == chrome::NOTIFICATION_PREF_CHANGED) {
    std::string* pref_name = content::Details<std::string>(details).ptr();
    if (*pref_name == prefs::kClearPluginLSODataEnabled) {
      // This preference is stored in Local State, not in the user preferences.
      UpdateClearPluginLSOData();
      return;
    }
    NotifyPrefChanged(*pref_name, std::string());
  }
}

void CoreOptionsHandler::RegisterMessages() {
  registrar_.Init(Profile::FromWebUI(web_ui())->GetPrefs());

  web_ui()->RegisterMessageCallback("coreOptionsInitialize",
      base::Bind(&CoreOptionsHandler::HandleInitialize,
                 base::Unretained(this)));
  web_ui()->RegisterMessageCallback("fetchPrefs",
      base::Bind(&CoreOptionsHandler::HandleFetchPrefs,
                 base::Unretained(this)));
  web_ui()->RegisterMessageCallback("observePrefs",
      base::Bind(&CoreOptionsHandler::HandleObservePrefs,
                 base::Unretained(this)));
  web_ui()->RegisterMessageCallback("setBooleanPref",
      base::Bind(&CoreOptionsHandler::HandleSetBooleanPref,
                 base::Unretained(this)));
  web_ui()->RegisterMessageCallback("setIntegerPref",
      base::Bind(&CoreOptionsHandler::HandleSetIntegerPref,
                 base::Unretained(this)));
  web_ui()->RegisterMessageCallback("setDoublePref",
      base::Bind(&CoreOptionsHandler::HandleSetDoublePref,
                 base::Unretained(this)));
  web_ui()->RegisterMessageCallback("setStringPref",
      base::Bind(&CoreOptionsHandler::HandleSetStringPref,
                 base::Unretained(this)));
  web_ui()->RegisterMessageCallback("setURLPref",
      base::Bind(&CoreOptionsHandler::HandleSetURLPref,
                 base::Unretained(this)));
  web_ui()->RegisterMessageCallback("setListPref",
      base::Bind(&CoreOptionsHandler::HandleSetListPref,
                 base::Unretained(this)));
  web_ui()->RegisterMessageCallback("clearPref",
      base::Bind(&CoreOptionsHandler::HandleClearPref,
                 base::Unretained(this)));
  web_ui()->RegisterMessageCallback("coreOptionsUserMetricsAction",
      base::Bind(&CoreOptionsHandler::HandleUserMetricsAction,
                 base::Unretained(this)));
}

void CoreOptionsHandler::HandleInitialize(const ListValue* args) {
  DCHECK(handlers_host_);
  handlers_host_->InitializeHandlers();
}

base::Value* CoreOptionsHandler::FetchPref(const std::string& pref_name) {
  PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();

  const PrefService::Preference* pref =
      pref_service->FindPreference(pref_name.c_str());
  if (!pref)
    return base::Value::CreateNullValue();

  return CreateValueForPref(pref, NULL);
}

void CoreOptionsHandler::ObservePref(const std::string& pref_name) {
  registrar_.Add(pref_name.c_str(), this);
}

void CoreOptionsHandler::SetPref(const std::string& pref_name,
                                 const base::Value* value,
                                 const std::string& metric) {
  PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();

  switch (value->GetType()) {
    case base::Value::TYPE_BOOLEAN:
    case base::Value::TYPE_INTEGER:
    case base::Value::TYPE_DOUBLE:
    case base::Value::TYPE_STRING:
      pref_service->Set(pref_name.c_str(), *value);
      break;

    default:
      NOTREACHED();
      return;
  }

  ProcessUserMetric(value, metric);
}

void CoreOptionsHandler::ClearPref(const std::string& pref_name,
                                   const std::string& metric) {
  PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
  pref_service->ClearPref(pref_name.c_str());

  if (!metric.empty())
    content::RecordComputedAction(metric);
}

void CoreOptionsHandler::ProcessUserMetric(const base::Value* value,
                                           const std::string& metric) {
  if (metric.empty())
    return;

  std::string metric_string = metric;
  if (value->IsType(base::Value::TYPE_BOOLEAN)) {
    bool bool_value;
    CHECK(value->GetAsBoolean(&bool_value));
    metric_string += bool_value ? "_Enable" : "_Disable";
  }

  content::RecordComputedAction(metric_string);
}

void CoreOptionsHandler::NotifyPrefChanged(
    const std::string& pref_name,
    const std::string& controlling_pref_name) {
  const PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
  const PrefService::Preference* pref =
      pref_service->FindPreference(pref_name.c_str());
  if (!pref)
    return;
  const PrefService::Preference* controlling_pref =
      !controlling_pref_name.empty() ?
          pref_service->FindPreference(controlling_pref_name.c_str()) : NULL;
  std::pair<PreferenceCallbackMap::const_iterator,
            PreferenceCallbackMap::const_iterator> range;
  range = pref_callback_map_.equal_range(pref_name);
  for (PreferenceCallbackMap::const_iterator iter = range.first;
       iter != range.second; ++iter) {
    const std::wstring& callback_function = iter->second;
    ListValue result_value;
    result_value.Append(base::Value::CreateStringValue(pref_name.c_str()));
    result_value.Append(CreateValueForPref(pref, controlling_pref));
    web_ui()->CallJavascriptFunction(WideToASCII(callback_function),
                                     result_value);
  }
}

DictionaryValue* CoreOptionsHandler::CreateValueForPref(
    const PrefService::Preference* pref,
    const PrefService::Preference* controlling_pref) {
  DictionaryValue* dict = new DictionaryValue;
  dict->Set("value", pref->GetValue()->DeepCopy());
  if (!controlling_pref)  // No controlling pref is managing actual pref.
    controlling_pref = pref;  // This means pref is controlling itself.
  if (controlling_pref->IsManaged()) {
    dict->SetString("controlledBy", "policy");
  } else if (controlling_pref->IsExtensionControlled()) {
    dict->SetString("controlledBy", "extension");
  } else if (controlling_pref->IsRecommended()) {
    dict->SetString("controlledBy", "recommended");
  }
  dict->SetBoolean("disabled", !controlling_pref->IsUserModifiable());
  return dict;
}

void CoreOptionsHandler::StopObservingPref(const std::string& path) {
  registrar_.Remove(path.c_str(), this);
}

void CoreOptionsHandler::HandleFetchPrefs(const ListValue* args) {
  // First param is name of callback function, so, there needs to be at least
  // one more element for the actual preference identifier.
  DCHECK_GE(static_cast<int>(args->GetSize()), 2);

  // Get callback JS function name.
  base::Value* callback;
  if (!args->Get(0, &callback) || !callback->IsType(base::Value::TYPE_STRING))
    return;

  string16 callback_function;
  if (!callback->GetAsString(&callback_function))
    return;

  // Get the list of name for prefs to build the response dictionary.
  DictionaryValue result_value;
  base::Value* list_member;

  for (size_t i = 1; i < args->GetSize(); i++) {
    if (!args->Get(i, &list_member))
      break;

    if (!list_member->IsType(base::Value::TYPE_STRING))
      continue;

    std::string pref_name;
    if (!list_member->GetAsString(&pref_name))
      continue;

    result_value.Set(pref_name.c_str(), FetchPref(pref_name));
  }
  web_ui()->CallJavascriptFunction(UTF16ToASCII(callback_function),
                                   result_value);
}

void CoreOptionsHandler::HandleObservePrefs(const ListValue* args) {
  // First param is name is JS callback function name, the rest are pref
  // identifiers that we are observing.
  DCHECK_GE(static_cast<int>(args->GetSize()), 2);

  // Get preference change callback function name.
  string16 callback_func_name;
  if (!args->GetString(0, &callback_func_name))
    return;

  // Get all other parameters - pref identifiers.
  for (size_t i = 1; i < args->GetSize(); i++) {
    base::Value* list_member;
    if (!args->Get(i, &list_member))
      break;

    // Just ignore bad pref identifiers for now.
    std::string pref_name;
    if (!list_member->IsType(base::Value::TYPE_STRING) ||
        !list_member->GetAsString(&pref_name))
      continue;

    if (pref_callback_map_.find(pref_name) == pref_callback_map_.end())
      ObservePref(pref_name);

    pref_callback_map_.insert(
        PreferenceCallbackMap::value_type(pref_name,
                                          UTF16ToWideHack(callback_func_name)));
  }
}

void CoreOptionsHandler::HandleSetBooleanPref(const ListValue* args) {
  HandleSetPref(args, TYPE_BOOLEAN);
}

void CoreOptionsHandler::HandleSetIntegerPref(const ListValue* args) {
  HandleSetPref(args, TYPE_INTEGER);
}

void CoreOptionsHandler::HandleSetDoublePref(const ListValue* args) {
  HandleSetPref(args, TYPE_DOUBLE);
}

void CoreOptionsHandler::HandleSetStringPref(const ListValue* args) {
  HandleSetPref(args, TYPE_STRING);
}

void CoreOptionsHandler::HandleSetURLPref(const ListValue* args) {
  HandleSetPref(args, TYPE_URL);
}

void CoreOptionsHandler::HandleSetListPref(const ListValue* args) {
  HandleSetPref(args, TYPE_LIST);
}

void CoreOptionsHandler::HandleSetPref(const ListValue* args, PrefType type) {
  DCHECK_GT(static_cast<int>(args->GetSize()), 1);

  std::string pref_name;
  if (!args->GetString(0, &pref_name))
    return;

  base::Value* value;
  if (!args->Get(1, &value))
    return;

  scoped_ptr<base::Value> temp_value;

  switch (type) {
    case TYPE_BOOLEAN:
      CHECK_EQ(base::Value::TYPE_BOOLEAN, value->GetType());
      break;
    case TYPE_INTEGER: {
      // In JS all numbers are doubles.
      double double_value;
      CHECK(value->GetAsDouble(&double_value));
      int int_value = static_cast<int>(double_value);
      temp_value.reset(base::Value::CreateIntegerValue(int_value));
      value = temp_value.get();
      break;
    }
    case TYPE_DOUBLE:
      CHECK_EQ(base::Value::TYPE_DOUBLE, value->GetType());
      break;
    case TYPE_STRING:
      CHECK_EQ(base::Value::TYPE_STRING, value->GetType());
      break;
    case TYPE_URL: {
      std::string original;
      CHECK(value->GetAsString(&original));
      GURL fixed = URLFixerUpper::FixupURL(original, std::string());
      temp_value.reset(base::Value::CreateStringValue(fixed.spec()));
      value = temp_value.get();
      break;
    }
    case TYPE_LIST: {
      // In case we have a List pref we got a JSON string.
      std::string json_string;
      CHECK(value->GetAsString(&json_string));
      temp_value.reset(
          base::JSONReader().JsonToValue(json_string,
                                         false,  // no check_root
                                         false));  // no trailing comma
      value = temp_value.get();
      CHECK_EQ(base::Value::TYPE_LIST, value->GetType());
      break;
    }
    default:
      NOTREACHED();
  }

  std::string metric;
  if (args->GetSize() > 2 && !args->GetString(2, &metric))
    LOG(WARNING) << "Invalid metric parameter: " << pref_name;
  SetPref(pref_name, value, metric);
}

void CoreOptionsHandler::HandleClearPref(const ListValue* args) {
  DCHECK_GT(static_cast<int>(args->GetSize()), 0);

  std::string pref_name;
  if (!args->GetString(0, &pref_name))
    return;

  std::string metric;
  if (args->GetSize() > 1) {
    if (!args->GetString(1, &metric))
      NOTREACHED();
  }

  ClearPref(pref_name, metric);
}

void CoreOptionsHandler::HandleUserMetricsAction(const ListValue* args) {
  std::string metric = UTF16ToUTF8(ExtractStringValue(args));
  if (!metric.empty())
    content::RecordComputedAction(metric);
}

void CoreOptionsHandler::UpdateClearPluginLSOData() {
  scoped_ptr<base::Value> enabled(
      base::Value::CreateBooleanValue(
          clear_plugin_lso_data_enabled_.GetValue()));
  web_ui()->CallJavascriptFunction(
      "OptionsPage.setClearPluginLSODataEnabled", *enabled);
}

}  // namespace options2


text:
void dispatch_syncmain(void (^block)(void)) {
    [NSThread performBlockOnMainAndWait:block];
}

void dispatch_asyncmain(void (^block)(void)) {
    dispatch_async(dispatch_get_main_queue(), block);
}

@implementation NSThread (AnobiKit)

+ (void)performBlockOnMain:(void (^)(void))block {
    dispatch_asyncmain(block);
}

+ (void)performBlockOnMainAndWait:(void (^)(void))block {
    if ([self isMainThread]) {
        block();
    } else {
        dispatch_sync(dispatch_get_main_queue(), block);
    }
}

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>impala</groupId>
  <artifactId>impala-tcli</artifactId>
  <versioning>
    <release>0.1</release>
    <versions>
      <version>0.1</version>
    </versions>
    <lastUpdated>20181005115323</lastUpdated>
  </versioning>
</metadata>


text:
package edu.purdue.voltag.interfaces;

import edu.purdue.voltag.data.Game;

/**
 * Created by mike on 4/26/14.
 */
public interface OnEnterLobbyListener {

    public void onLobbyEnter(Game g);

}


text:
//
//  Menu.m
//  IDMPhotoBrowser
//
//  Created by Michael Waterfall on 21/10/2010.
//  Copyright 2010 d3i. All rights reserved.
//

#import "Menu.h"

@implementation UIAlertView (UIAlertViewWithTitle)

+ (void)showAlertViewWithTitle:(NSString*)title {
    [[[UIAlertView alloc] initWithTitle:title message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
}

@end

@implementation Menu

#pragma mark - Initialization

- (id)initWithStyle:(UITableViewStyle)style {
    if ((self = [super initWithStyle:style])) {
		self.title = @"IDMPhotoBrowser";
    }
    return self;
}

#pragma mark - View Lifecycle

- (void)viewDidLoad
{
    [self setupTableViewFooterView];
}

#pragma mark - Interface Orientation

- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    //return UIInterfaceOrientationPortrait | UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationLandscapeRight;
    return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationPortrait | UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationLandscapeRight;
    //return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
}

/*- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    NSLog(@"Menu  willRotateToInterfaceOrientation");
}

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    NSLog(@"Menu  didRotateFromInterfaceOrientation");
}*/

#pragma mark - Layout

- (BOOL)prefersStatusBarHidden
{
	return NO;
}

/*- (void)viewWillLayoutSubviews
{
    //NSLog(@"viewWillLayoutSubviews Menu  |  statusBarOrientation = %d", [[UIApplication sharedApplication] statusBarOrientation]);
    [super viewWillLayoutSubviews];
}

- (void)viewDidLayoutSubviews
{
    //NSLog(@"viewDidLayoutSubviews  Menu  |  statusBarOrientation = %d", [[UIApplication sharedApplication] statusBarOrientation]);
    [super viewDidLayoutSubviews];
}*/

#pragma mark - General

- (void)setupTableViewFooterView
{
    UIView *tableViewFooter = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 426 * 0.9 + 40)];

    UIButton *buttonWithImageOnScreen1 = [UIButton buttonWithType:UIButtonTypeCustom];
    buttonWithImageOnScreen1.frame = CGRectMake(15, 0, 640/3 * 0.9, 426/2 * 0.9);
    buttonWithImageOnScreen1.tag = 101;
    buttonWithImageOnScreen1.adjustsImageWhenHighlighted = NO;
    [buttonWithImageOnScreen1 setImage:[UIImage imageNamed:@"photo1m.jpg"] forState:UIControlStateNormal];
    buttonWithImageOnScreen1.imageView.contentMode = UIViewContentModeScaleAspectFill;
    buttonWithImageOnScreen1.backgroundColor = [UIColor blackColor];
    [buttonWithImageOnScreen1 addTarget:self action:@selector(buttonWithImageOnScreenPressed:) forControlEvents:UIControlEventTouchUpInside];
    [tableViewFooter addSubview:buttonWithImageOnScreen1];

    UIButton *buttonWithImageOnScreen2 = [UIButton buttonWithType:UIButtonTypeCustom];
    buttonWithImageOnScreen2.frame = CGRectMake(15, 426/2 * 0.9 + 20, 640/2 * 0.9, 426/2 * 0.9);
    buttonWithImageOnScreen2.tag = 102;
    buttonWithImageOnScreen2.adjustsImageWhenHighlighted = NO;
    [buttonWithImageOnScreen2 setImage:[UIImage imageNamed:@"photo3m.jpg"] forState:UIControlStateNormal];
    buttonWithImageOnScreen2.imageView.contentMode = UIViewContentModeScaleAspectFit;
    buttonWithImageOnScreen2.backgroundColor = [UIColor blackColor];
    [buttonWithImageOnScreen2 addTarget:self action:@selector(buttonWithImageOnScreenPressed:) forControlEvents:UIControlEventTouchUpInside];
    [tableViewFooter addSubview:buttonWithImageOnScreen2];

    self.tableView.tableFooterView = tableViewFooter;
}

#pragma mark - Actions

- (void)buttonWithImageOnScreenPressed:(id)sender
{
    UIButton *buttonSender = (UIButton*)sender;

    // Create an array to store IDMPhoto objects
    NSMutableArray *photos = [NSMutableArray new];

    IDMPhoto *photo;

    if(buttonSender.tag == 101)
    {
        photo = [IDMPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"photo1l" ofType:@"jpg"]];
        photo.caption = @"Grotto of the Madonna";
        [photos addObject:photo];
    }

    photo = [IDMPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"photo3l" ofType:@"jpg"]];
    photo.caption = @"York Floods";
    [photos addObject:photo];

    photo = [IDMPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"photo2l" ofType:@"jpg"]];
    photo.caption = @"The London Eye is a giant Ferris wheel situated on the banks of the River Thames, in London, England.";
    [photos addObject:photo];

    photo = [IDMPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"photo4l" ofType:@"jpg"]];
    photo.caption = @"Campervan";
    [photos addObject:photo];

    if(buttonSender.tag == 102)
    {
        photo = [IDMPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"photo1l" ofType:@"jpg"]];
        photo.caption = @"Grotto of the Madonna";
        [photos addObject:photo];
    }

    // Create and setup browser
    IDMPhotoBrowser *browser = [[IDMPhotoBrowser alloc] initWithPhotos:photos animatedFromView:sender]; // using initWithPhotos:animatedFromView: method to use the zoom-in animation
    browser.delegate = self;
    browser.displayActionButton = NO;
    browser.displayArrowButton = YES;
    browser.displayCounterLabel = YES;
    browser.scaleImage = buttonSender.currentImage;
    if(buttonSender.tag == 102) browser.useWhiteBackgroundColor = YES;

    // Show
    [self presentViewController:browser animated:YES completion:nil];
}

#pragma mark - TableView DataSource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 3;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    NSInteger rows = 0;

    if(section == 0)
        rows = 1;
    else if(section == 1)
        rows = 3;
    else if(section == 2)
        rows = 0;

    return rows;
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
    NSString *title = @"";

    if(section == 0)
        title = @"Single photo";
    else if(section == 1)
        title = @"Multiple photos";
    else if(section == 2)
        title = @"Photos on screen";

    return title;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
	// Create
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }

    // Configure
    if(indexPath.section == 0)
    {
        cell.textLabel.text = @"Local photo";
    }
    else if(indexPath.section == 1)
    {
        if(indexPath.row == 0)
            cell.textLabel.text = @"Local photos";
        else if(indexPath.row == 1)
            cell.textLabel.text = @"Photos from Flickr";
        else if(indexPath.row == 2)
            cell.textLabel.text = @"Photos from Flickr - Custom";
    }

    return cell;
}

#pragma mark - TableView Delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Create an array to store IDMPhoto objects
	NSMutableArray *photos = [NSMutableArray new];

    IDMPhoto *photo;

    if(indexPath.section == 0) // Local photo
    {
        photo = [IDMPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"photo2l" ofType:@"jpg"]];
        photo.caption = @"The London Eye is a giant Ferris wheel situated on the banks of the River Thames, in London, England.";
        [photos addObject:photo];
	}
    else if(indexPath.section == 1) // Multiple photos
    {
        if(indexPath.row == 0) // Local Photos
        {
            photo = [IDMPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"photo1l" ofType:@"jpg"]];
            photo.caption = @"Grotto of the Madonna";
			[photos addObject:photo];

            photo = [IDMPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"photo2l" ofType:@"jpg"]];
            photo.caption = @"The London Eye is a giant Ferris wheel situated on the banks of the River Thames, in London, England.";
			[photos addObject:photo];

            photo = [IDMPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"photo3l" ofType:@"jpg"]];
            photo.caption = @"York Floods";
			[photos addObject:photo];

            photo = [IDMPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"photo4l" ofType:@"jpg"]];
            photo.caption = @"Campervan";
			[photos addObject:photo];
        }
        else if(indexPath.row == 1 || indexPath.row == 2) // Photos from Flickr or Flickr - Custom
        {
            NSArray *photosWithURL = [IDMPhoto photosWithURLs:[NSArray arrayWithObjects:[NSURL URLWithString:@"http://farm4.static.flickr.com/3567/3523321514_371d9ac42f_b.jpg"], @"http://farm4.static.flickr.com/3629/3339128908_7aecabc34b_b.jpg", [NSURL URLWithString:@"http://farm4.static.flickr.com/3364/3338617424_7ff836d55f_b.jpg"], @"http://farm4.static.flickr.com/3590/3329114220_5fbc5bc92b_b.jpg", nil]];

            photos = [NSMutableArray arrayWithArray:photosWithURL];
        }
    }

    // Create and setup browser
    IDMPhotoBrowser *browser = [[IDMPhotoBrowser alloc] initWithPhotos:photos];
    browser.delegate = self;

    if(indexPath.section == 1) // Multiple photos
    {
        if(indexPath.row == 1) // Photos from Flickr
        {
            browser.displayCounterLabel = YES;
            browser.displayActionButton = NO;
        }
        else if(indexPath.row == 2) // Photos from Flickr - Custom
        {
            browser.actionButtonTitles      = @[@"Option 1", @"Option 2", @"Option 3", @"Option 4"];
            browser.displayCounterLabel     = YES;
            browser.useWhiteBackgroundColor = YES;
            browser.leftArrowImage          = [UIImage imageNamed:@"IDMPhotoBrowser_customArrowLeft.png"];
            browser.rightArrowImage         = [UIImage imageNamed:@"IDMPhotoBrowser_customArrowRight.png"];
            browser.leftArrowSelectedImage  = [UIImage imageNamed:@"IDMPhotoBrowser_customArrowLeftSelected.png"];
            browser.rightArrowSelectedImage = [UIImage imageNamed:@"IDMPhotoBrowser_customArrowRightSelected.png"];
            browser.doneButtonImage         = [UIImage imageNamed:@"IDMPhotoBrowser_customDoneButton.png"];

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
            browser.view.tintColor          = [UIColor orangeColor];
#else

#endif

            browser.progressTintColor       = [UIColor orangeColor];
            browser.trackTintColor          = [UIColor colorWithWhite:0.8 alpha:1];
        }
    }

    // Show
    [self presentViewController:browser animated:YES completion:nil];
    //[self.navigationController pushViewController:browser animated:YES];

	[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
}

#pragma mark - IDMPhotoBrowser Delegate

- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser didDismissAtPageIndex:(NSUInteger)pageIndex
{
    id <IDMPhoto> photo = [photoBrowser photoAtIndex:pageIndex];
    NSLog(@"Did dismiss photoBrowser with photo index: %d, photo caption: %@", pageIndex, photo.caption);
}

- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser didDismissActionSheetWithButtonIndex:(NSUInteger)buttonIndex photoIndex:(NSUInteger)photoIndex
{
    id <IDMPhoto> photo = [photoBrowser photoAtIndex:photoIndex];
    NSLog(@"Did dismiss actionSheet with photo index: %d, photo caption: %@", photoIndex, photo.caption);

    NSString *title = [NSString stringWithFormat:@"Option %d", buttonIndex+1];
    [UIAlertView showAlertViewWithTitle:title];
}

@end


text:
========================
vim-autopep8
========================

vim-autopep8 is a Vim plugin that applies autopep8 to your current file.
autopep8 automatically formats Python code to conform to the PEP 8 style guide.

Required
=====================

* `autopep8 <https://pypi.python.org/pypi/autopep8/>`_

Installation
=====================

Simply put the contents of this repository in your ~/.vim/bundle directory.

But on some platforms the following extra steps might be necessary to enable the plugin to be loaded in vim:

- ensure you have the `~/.vim/plugin` directory
- either copy or symlink the file `ftplugin/python_autopep8.vim` into the `~/.vim/plugin` directory

Documentation (Read The Docs)
==============================

* https://vim-autopep8.readthedocs.org/en/latest/

Usage
=====================

call function

::

 :Autopep8

with arguments

::

 :Autopep8 --range 1 5

 or

 :call Autopep8(" --range 1 5")

range selection

::

 :'<,'>Autopep8

.. caution::

  This plugin remove default <F8> key mapping since v1.1.0.
  It is the user's business to decide which key to be mapped to.

Customization
=====================

For example, to map it to `<F8>`:

::

 autocmd FileType python noremap <buffer> <F8> :call Autopep8()<CR>

Do not fix these errors/warnings (default: E226,E24,W6)

::

 let g:autopep8_ignore="E501,W293"

Fix only these errors/warnings (e.g. E4,W)

::

 let g:autopep8_select="E501,W293"

Maximum number of additional pep8 passes (default: 100)

::

 let g:autopep8_pep8_passes=100

Set maximum allowed line length (default: 79)

::

 let g:autopep8_max_line_length=79

Enable possibly unsafe changes (E711, E712) (default: non defined)

::

 # add aggressive option (--aggressive)
 let g:autopep8_aggressive=1

 # add more aggressive options (--aggressive --aggressive)
 let g:autopep8_aggressive=2

Number of spaces per indent level (default: 4)

::

 let g:autopep8_indent_size=2

Disable show diff window

::

 let g:autopep8_disable_show_diff=1

Chose diff window type. (default: horizontal)

::

 # default
 let g:autopep8_diff_type='horizontal'

 let g:autopep8_diff_type='vertical'

Automatically format every time saving a file.

::

 let g:autopep8_on_save = 1

Tips
=====================

If you want to use 「=」 with autopep8. It's good to set it as follows.
But please be careful as "vim-autopep8" setting will not be inherited.

::

 autocmd FileType python set equalprg=autopep8\ -

Author
==============================

* tell-k

License
==============================

* MIT License


text:
class InitFixedCategoryPositionsValue < ActiveRecord::Migration
  def up
    # Look at existing categories to determine if positions have been specified
    result = Category.exec_sql("SELECT count(*) FROM categories WHERE position IS NOT NULL")

    # Greater than 4 because uncategorized, meta, staff, lounge all have positions by default
    if result[0]['count'].to_i > 4
      execute "INSERT INTO site_settings (name, data_type, value, created_at, updated_at) VALUES ('fixed_category_positions', 5, 't', now(), now())"
    end
  end

  def down
    execute "DELETE FROM site_settings WHERE name = 'fixed_category_positions'"
  end
end


text:
/**
 * Contains the classes which implements the console user interface for the game Othello.
 *
 * @since 1.0
 * @author Yves Kaufmann
 */
package org.yvka.Beleg2.console;


text:
package org.sagebionetworks.web.client;

import java.util.List;
import org.sagebionetworks.repo.model.AccessRequirement;
import org.sagebionetworks.repo.model.BatchAccessApprovalInfoRequest;
import org.sagebionetworks.repo.model.BatchAccessApprovalInfoResponse;
import org.sagebionetworks.repo.model.RestrictableObjectDescriptor;
import org.sagebionetworks.repo.model.dataaccess.AccessRequirementConversionRequest;
import org.sagebionetworks.repo.model.dataaccess.AccessRequirementStatus;
import org.sagebionetworks.repo.model.dataaccess.AccessorGroupRequest;
import org.sagebionetworks.repo.model.dataaccess.AccessorGroupResponse;
import org.sagebionetworks.repo.model.dataaccess.CreateSubmissionRequest;
import org.sagebionetworks.repo.model.dataaccess.OpenSubmissionPage;
import org.sagebionetworks.repo.model.dataaccess.RequestInterface;
import org.sagebionetworks.repo.model.dataaccess.ResearchProject;
import org.sagebionetworks.repo.model.dataaccess.Submission;
import org.sagebionetworks.repo.model.dataaccess.SubmissionOrder;
import org.sagebionetworks.repo.model.dataaccess.SubmissionPage;
import org.sagebionetworks.repo.model.dataaccess.SubmissionState;
import com.google.gwt.user.client.rpc.AsyncCallback;

public interface DataAccessClientAsync {
	void getResearchProject(Long id, AsyncCallback<ResearchProject> asyncCallback);

	void updateResearchProject(ResearchProject researchProject, AsyncCallback<ResearchProject> asyncCallback);

	void getDataAccessRequest(Long id, AsyncCallback<RequestInterface> asyncCallback);

	void updateDataAccessRequest(RequestInterface dataAccessRequest, AsyncCallback<RequestInterface> asyncCallback);

	void submitDataAccessRequest(CreateSubmissionRequest dataAccessRequest, Long arId, AsyncCallback<Void> asyncCallback);

	void getAccessRequirements(RestrictableObjectDescriptor subject, Long limit, Long offset, AsyncCallback<List<AccessRequirement>> callback);

	void getAccessRequirementStatus(String accessRequirementId, AsyncCallback<AccessRequirementStatus> callback);

	void cancelDataAccessSubmission(String submissionId, AsyncCallback<Void> asyncCallback);

	void createLockAccessRequirement(String entityId, AsyncCallback<Void> callback);

	void updateDataAccessSubmissionState(String submissionId, SubmissionState newState, String reason, AsyncCallback<Submission> callback);

	void getOpenSubmissions(String nextPageToken, AsyncCallback<OpenSubmissionPage> callback);

	void getAccessRequirementStatus(BatchAccessApprovalInfoRequest request, AsyncCallback<BatchAccessApprovalInfoResponse> callback);

	void listAccessorGroup(AccessorGroupRequest request, AsyncCallback<AccessorGroupResponse> asyncCallback);

	void revokeGroup(String accessRequirementId, String submitterId, AsyncCallback<Void> callback);

	void convertAccessRequirement(AccessRequirementConversionRequest request, AsyncCallback<AccessRequirement> callback);
}


text:
'use strict';
const finalhandler = require('finalhandler')
const http = require('http');
const path = require('path');
const DistanceSensor = require('./distance-sensor');
const GroupRoutine = require('./routines/group');
const config = require('./config');
const serveStatic = require('serve-static');
const routines = {};

var groupRoutine = null;

// initialize sensors and set up a recipe
const distanceSensors = config.sensors.map(
  sensorData => new DistanceSensor(sensorData)
);

const stopRoutines = () => {
  if(groupRoutine){
    groupRoutine.destroy();
    groupRoutine = null;
  }
  Object.keys(routines).forEach(
    id => {
      const routine = routines[id];
      if(routine){
        routine.destroy();
      }
    }
  );
}

const applyRoutine = routineName => {
  try {
    console.log(`attempting to apply routine ${routineName}`);
    const Routine = require(`./routines/${routineName}`);
    stopRoutines();
    distanceSensors.forEach(sensor => {
      let routine = routines[sensor.lightId];
      routines[sensor.lightId] = new Routine(sensor, sensor.lightId);
    });
  } catch(err) {
    console.error(`Error applying routine ${routineName}`, err.stack);
  }
}

const applyGroupRoutine = () => {
  try {
    stopRoutines();
    groupRoutine = new GroupRoutine(
      distanceSensors.map(s => s.lightId)
    );
  } catch(err) {
    console.error('Error applying group routine', err.stack);
    console.error(err.stack);
  }
}

applyRoutine('blue-brightness-white-exit');
// applyGroupRoutine();

const serve = serveStatic(path.join(__dirname, 'public'));

const server = http.createServer(
  (req, res) => {
    try {
      // eg. `/set-routine/flicker-move`
      if(req.url.match(/^\/set-routine\//)){
        applyRoutine(path.basename(req.url));
        res.end('OK');
      }
      // eg. `/set-group-routine/stairstep-fade`
      if(req.url.match(/^\/set-group-routine\//)){
        applyGroupRoutine(path.basename(req.url));
        res.end('OK');
      }
      // serve static
      serve(req, res, finalhandler(req, res));
    } catch(err) {
      console.error(err);
      res.end('FAIL');
    }
  }
);

server.listen(3000, () => {
  console.log('Server listening on port 3000');
});

process.on('uncaughtException', err => {
  console.error('An exception error occurred');
  console.error(err);
  process.exit();
});

process.on('error', err => {
  console.error('An application error occurred');
  console.error(err);
});

module.exports = {
  routines,
  // distanceSensors: distanceSensors
};