text:
/*
 * This file is part of CT-MOLE.
 *
 * CT-MOLE is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License.
 *
 * This program 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	Schema = mongoose.Schema;

/**
 * Alteration Schema
 */
var MMTrialSchema = new Schema({
	id: {
		type: String,
		required: 'Please fill NCT ID',
		trim: true
	},
	briefTitle: {
		type: String,
		trim: true
	},
	locations: {
		type: Array
	},
	phase: {
		type: String,
		trim: true
	},
	startDate: {
		type: String,
		trim: true
	},
	status: {
		type: String,
		trim: true
	},
	studyType: {
		type: String,
		trim: true
	},
	title: {
		type: String,
		trim: true
	},
	_score: {
		type: String,
		trim: true
	},
	interventions: {
		type: Array
	},
	tags: {
		type: Array
	}
});

module.exports = mongoose.model('MMTrial', MMTrialSchema);

redpajama_set_name: RedPajamaGithub


text:
layout: post
title: Release Notes for 2019-07-23
---

Latest release notes for 2019-07-23 at 1228-UTC.

<div class='updates' markdown='1'>

#### Updates

- {:.update} Minor enhancements, fixes or environment changes not listed in detail.

</div>


text:
/* jshint node: true, mocha: true */
'use strict';

var mongoose = require('mongoose');

mongoose.connect('mongodb://localhost/mongoose-integer');
mongoose.connection.on('error', function() {
	throw new Error('Unable to connect to database.');
});

describe('Mongoose Integer', function() {
	require('./tests/validation')();
	require('./tests/message')();
	require('./tests/path')();
	require('./tests/value')();
});


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface org.apache.uima.resource.metadata.TypePriorityList (Apache UIMA Java SDK 2.8.1 User-Level API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
org.apache.uima.resource.metadata.TypePriorityList

Packages that use TypePriorityList

Package
Description

org.apache.uima

The main package for the Unstructured Information Management Middleware
Architecture.

org.apache.uima.resource.metadata

Interfaces for objects that represent metadata for a
Resource.

Uses of TypePriorityList in org.apache.uima

Methods in org.apache.uima that return TypePriorityList

Modifier and Type
Method and Description

TypePriorityList
ResourceSpecifierFactory.createTypePriorityList()

Creates an TypePriorityList.

Uses of TypePriorityList in org.apache.uima.resource.metadata

Fields in org.apache.uima.resource.metadata declared as TypePriorityList

Modifier and Type
Field and Description

static TypePriorityList[]
TypePriorityList.EMPTY_TYPE_PRIORITY_LISTS

Methods in org.apache.uima.resource.metadata that return TypePriorityList

Modifier and Type
Method and Description

TypePriorityList
TypePriorities.addPriorityList()

Creates a new, empty TypePriorityList and adds it to this object.

TypePriorityList[]
TypePriorities.getPriorityLists()

Gets the TypePriorityLists that define the priorities.

Methods in org.apache.uima.resource.metadata with parameters of type TypePriorityList

Modifier and Type
Method and Description

void
TypePriorities.addPriorityList(TypePriorityList aPriorityList)

Adds a TypePriorityList.

void
TypePriorities.removePriorityList(TypePriorityList aPriorityList)

Removes a TypePriorityList.

void
TypePriorities.setPriorityLists(TypePriorityList[] aPriorityLists)

Sets the TypePriorityLists that define the priorities.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2006–2015 The Apache Software Foundation. All rights reserved.


text:
<?php
// Copyright 2021 Peter Beverloo. All rights reserved.
// Use of this source code is governed by the MIT license, a copy of which can
// be found in the LICENSE file.

error_reporting((E_ALL | E_STRICT) & ~E_WARNING);
ini_set('display_errors', 1);

// -------------------------------------------------------------------------------------------------
// This tool provides an overview of the volunteering teams available in the AnimeCon organisation,
// specifically those backed by this tool. It pulls information from the backend, so will generally
// be up-to-date with the latest information and availability.
// -------------------------------------------------------------------------------------------------

require __DIR__ . '/../vendor/autoload.php';

$configuration = \Anime\Configuration::getInstance();
$environments = \Anime\EnvironmentFactory::getAll($configuration);

$teams = [
    'gophers.team'  => [
        'title'         => 'Gophers',
        'class'         => 'gophers',
        'event'         => null,

        'description'   =>
            'Gophers are responsible for delivering an incredible experience to our visitors, ' .
            'starting from welcoming them at the registration desk upon arrival, to manning the ' .
            'bag room, video rooms, and many other jobs behind the scenes.',
    ],
    'hosts.team'    => [
        'title'         => 'Festival Hosts',
        'class'         => 'hosts',
        'event'         => null,

        'description'   =>
            'Festival Hosts are responsible for making sure that our guests are met with great ' .
            'memorable impressions, making them feel welcome, and that all their questions are ' .
            'answered while moving around on the festival grounds.',
    ],
    'stewards.team' => [
        'title'         => 'Stewards',
        'class'         => 'stewards',
        'event'         => null,

        'description'   =>
            'Stewards are the first line of defense when trouble arises, and responsible for ' .
            'crowd management, safety checks, escorting special guests and assisting our ' .
            'security and first aid teams before and during the festival.',
    ]
];

foreach ($environments as $environment) {
    $latestAvailableEvent = null;
    $latestJoinableEvent = null;

    foreach ($environment->getEvents() as $event) {
        if ($event->enableRegistration())
            $latestJoinableEvent = $event;
        else if ($event->enableContent())
            $latestAvailableEvent = $event;
    }

    $teams[$environment->getHostname()]['event'] = $latestJoinableEvent ?? $latestJoinableEvent ?? null;
}

?>
<!doctype html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
    <title>AnimeCon Volunteering Opportunities</title>

      <object type="image/svg+xml" alt="J-POP Logo"
              data="/images/logo.svg?color=%230d3e59&title=Volunteering+Teams"></object>

<?php
foreach ($teams as $hostname => $info) {
?>
      <article class="<?php echo $info['class']; ?>">
        <a href="https://<?php echo $hostname; ?>">

<?php echo $info['title']; ?>

          <?php echo $info['description'] . PHP_EOL; ?>

<?php

    if (is_null($info['event'])) {
?>

          There are no events that this team is recruiting for at the moment.

<?php
    } else if ($info['event']->enableRegistration()) {
        $link = 'https://' . $hostname . '/registration/' . $info['event']->getIdentifier() . '/';
?>
        <a class="team-link" href="<?php echo $link; ?>">
          Apply to join the <?php echo $info['title']; ?>!

<?php
    } else {
?>
        <a class="team-link" href="https://gophers.team/registration/<?php echo $teams['gophers.team']->getIdentifier(); ?>/">
          Learn more about the <?php echo $info['title'] . PHP_EOL; ?>

<?php
    }
?>

<?php
}
?>


text:
export var PlayVoicemailRequest_Voicemails = {
  "playTimestamp": false,
  "position": 0
};


text:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import './strings.m.js';

import {assert} from 'chrome://resources/js/assert.m.js';
import {addWebUIListener} from 'chrome://resources/js/cr.m.js';
import {getUrlForCss} from 'chrome://resources/js/icon.js';
import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
import {parseHtmlSubset} from 'chrome://resources/js/parse_html_subset.m.js';
import {$, appendParam, getRequiredElement} from 'chrome://resources/js/util.m.js';

import {AppInfo} from './app_info.js';
import {APP_LAUNCH, AppsPage} from './apps_page.js';
import {PageListView} from './page_list_view.js';

/**
 * @fileoverview New tab page 4
 * This is the main code for a previous version of the Chrome NTP ("NTP4").
 * Some parts of this are still used for the chrome://apps page.
 */

// Use an anonymous function to enable strict mode just for this file (which
// will be concatenated with other files when embedded in Chrome

/** @type {!NewTabView|undefined} */
let newTabView;

/**
 * The time when all sections are ready.
 * @type {number|undefined}
 * @private
 */
let startTime;

/**
 * The number of sections to wait on.
 * @type {number}
 */
let sectionsToWaitFor = -1;

/**
 * The time in milliseconds for most transitions.  This should match what's
 * in new_tab.css.  Unfortunately there's no better way to try to time
 * something to occur until after a transition has completed.
 * @type {number}
 * @const
 */
const DEFAULT_TRANSITION_TIME = 500;

/**
 * Creates a NewTabView object. NewTabView extends PageListView with
 * new tab UI specific logics.
 * @constructor
 * @extends {PageListView}
 */
function NewTabView() {
  const pageSwitcherStart =
      /** @type {!Element} */ (getRequiredElement('page-switcher-start'));
  const pageSwitcherEnd =
      /** @type {!Element} */ (getRequiredElement('page-switcher-end'));
  this.initialize(
      getRequiredElement('page-list'), getRequiredElement('dot-list'),
      getRequiredElement('card-slider-frame'), getRequiredElement('trash'),
      pageSwitcherStart, pageSwitcherEnd);
}

// TODO(dbeam): NewTabView is now the only extender of PageListView; these
// classes should be merged.
NewTabView.prototype = {
  __proto__: PageListView.prototype
};

/**
 * Invoked at startup once the DOM is available to initialize the app.
 */
function onLoad() {
  sectionsToWaitFor = 1;
  measureNavDots();

  newTabView = new NewTabView();

  if (!loadTimeData.getBoolean('showWebStoreIcon')) {
    const webStoreIcon = $('chrome-web-store-link');
    // Not all versions of the NTP have a footer, so this may not exist.
    if (webStoreIcon) {
      webStoreIcon.hidden = true;
    }
  } else {
    const webStoreLink = loadTimeData.getString('webStoreLink');
    const url = appendParam(webStoreLink, 'utm_source', 'chrome-ntp-launcher');
    $('chrome-web-store-link').href = url;
    $('chrome-web-store-link')
        .addEventListener('auxclick', onChromeWebStoreButtonClick);
    $('chrome-web-store-link')
        .addEventListener('click', onChromeWebStoreButtonClick);
  }

  // We need to wait for all the footer menu setup to be completed before
  // we can compute its layout.
  layoutFooter();

  doWhenAllSectionsReady(function() {
    // Tell the slider about the pages.
    newTabView.updateSliderCards();
    // Mark the current page.
    newTabView.cardSlider.currentCardValue.navigationDot.classList.add(
        'selected');

    document.documentElement.classList.remove('starting-up');

    startTime = Date.now();

    addWebUIListener('theme-changed', () => {
      $('themecss').href = 'chrome://theme/css/new_tab_theme.css?' + Date.now();
    });
    chrome.send('observeThemeChanges');
  });
}

/**
 * Launches the chrome web store app with the chrome-ntp-launcher
 * source.
 * @param {!Event} e The click/auxclick event.
 */
function onChromeWebStoreButtonClick(e) {
  if (e.button > 1) {
    return;
  }  // Ignore buttons other than left and middle.
  chrome.send(
      'recordAppLaunchByURL',
      [e.currentTarget.href, APP_LAUNCH.NTP_WEBSTORE_FOOTER]);
}

/**
 * Queued callbacks which lie in wait for all sections to be ready.
 * @type {Array}
 */
const readyCallbacks = [];

/**
 * Fired as each section of pages becomes ready.
 */
document.addEventListener('sectionready', function(e) {
  if (--sectionsToWaitFor <= 0) {
    while (readyCallbacks.length) {
      readyCallbacks.shift()();
    }
  }
});

/**
 * This is used to simulate a fire-once event (i.e. $(document).ready() in
 * jQuery or Y.on('domready') in YUI. If all sections are ready, the callback
 * is fired right away. If all pages are not ready yet, the function is queued
 * for later execution.
 * @param {Function} callback The work to be done when ready.
 */
function doWhenAllSectionsReady(callback) {
  assert(typeof callback == 'function');
  if (sectionsToWaitFor > 0) {
    readyCallbacks.push(callback);
  } else {
    window.setTimeout(callback, 0);
  }  // Do soon after, but asynchronously.
}

/**
 * Measure the width of a nav dot with a given title.
 * @param {string} id The loadTimeData ID of the desired title.
 * @return {number} The width of the nav dot.
 */
function measureNavDot(id) {
  const measuringDiv = $('fontMeasuringDiv');
  measuringDiv.textContent = loadTimeData.getString(id);
  // The 4 is for border and padding.
  return Math.max(measuringDiv.clientWidth * 1.15 + 4, 80);
}

/**
 * Fills in an invisible div with the longest dot title string so that
 * its length may be measured and the nav dots sized accordingly.
 */
function measureNavDots() {
  const styleElement = document.createElement('style');
  styleElement.type = 'text/css';
  // max-width is used because if we run out of space, the nav dots will be
  // shrunk.
  const pxWidth = measureNavDot('appDefaultPageName');
  styleElement.textContent = '.dot { max-width: ' + pxWidth + 'px; }';
  document.querySelector('head').appendChild(styleElement);
}

/**
 * Layout the footer so that the nav dots stay centered.
 */
function layoutFooter() {
  // We need the image to be loaded.
  const logo = $('logo-img');
  const logoImg = logo.querySelector('img');

  // Only compare the width after the footer image successfully loaded.
  if (!logoImg.complete || logoImg.width === 0) {
    logoImg.onload = layoutFooter;
    return;
  }

  const menu = $('footer-menu-container');
  if (menu.clientWidth > logoImg.width) {
    logo.style.WebkitFlex = '0 1 ' + menu.clientWidth + 'px';
  } else {
    menu.style.WebkitFlex = '0 1 ' + logoImg.width + 'px';
  }
}

/**
 * Set the dominant color for a node. This will be called in response to
 * getFaviconDominantColor. The node represented by |id| better have a setter
 * for stripeColor.
 * @param {string} id The ID of a node.
 * @param {string} color The color represented as a CSS string.
 */
function setFaviconDominantColor(id, color) {
  const node = $(id);
  if (node) {
    node.stripeColor = color;
  }
}

/**
 * Wrappers to forward the callback to corresponding PageListView member.
 */

/**
 * Called by chrome when a new app has been added to chrome or has been
 * enabled if previously disabled.
 * @param {AppInfo} appData A data structure full of relevant information for
 *     the app.
 * @param {boolean=} opt_highlight Whether the app about to be added should
 *     be highlighted.
 */
function appAdded(appData, opt_highlight) {
  newTabView.appAdded(appData, opt_highlight);
}

/**
 * Called by chrome when an app has changed positions.
 * @param {AppInfo} appData The data for the app. This contains page and
 *     position indices.
 */
function appMoved(appData) {
  newTabView.appMoved(appData);
}

/**
 * Called by chrome when an existing app has been disabled or
 * removed/uninstalled from chrome.
 * @param {AppInfo} appData A data structure full of relevant information for
 *     the app.
 * @param {boolean} isUninstall True if the app is being uninstalled;
 *     false if the app is being disabled.
 * @param {boolean} fromPage True if the removal was from the current page.
 */
function appRemoved(appData, isUninstall, fromPage) {
  newTabView.appRemoved(appData, isUninstall, fromPage);
}

/**
 * Callback invoked by chrome whenever an app preference changes.
 * @param {Object} data An object with all the data on available
 *     applications.
 */
function appsPrefChangeCallback(data) {
  newTabView.appsPrefChangedCallback(data);
}

/**
 * Called whenever tiles should be re-arranging themselves out of the way
 * of a moving or insert tile.
 */
export function enterRearrangeMode() {
  newTabView.enterRearrangeMode();
}

/**
 * Callback invoked by chrome with the apps available.
 *
 * Note that calls to this function can occur at any time, not just in
 * response to a getApps request. For example, when a user
 * installs/uninstalls an app on another synchronized devices.
 * @param {{apps: Array<AppInfo>, appPageNames: Array<string>}} data
 *     An object with all the data on available applications.
 */
function getAppsCallback(data) {
  newTabView.getAppsCallback(data);
}

/**
 * Return the index of the given apps page.
 * @param {AppsPage} page The AppsPage we wish to find.
 * @return {number} The index of |page| or -1 if it is not in the collection.
 */
export function getAppsPageIndex(page) {
  return newTabView.getAppsPageIndex(page);
}

export function getCardSlider() {
  return newTabView.cardSlider;
}

/**
 * Invoked whenever some app is released
 */
export function leaveRearrangeMode() {
  newTabView.leaveRearrangeMode();
}

/**
 * Save the name of an apps page.
 * Store the apps page name into the preferences store.
 * @param {AppsPage} appPage The app page for which we wish to save.
 * @param {string} name The name of the page.
 */
export function saveAppPageName(appPage, name) {
  newTabView.saveAppPageName(appPage, name);
}

// Return an object with all the exports
const exports = {
  appAdded,
  appMoved,
  appRemoved,
  appsPrefChangeCallback,
  getAppsCallback,
  setFaviconDominantColor,
};

window['ntp'] = window['ntp'] || {};
for (const key of Object.keys(exports)) {
  window['ntp'][key] = exports[key];
}

document.addEventListener('DOMContentLoaded', onLoad);


text:
package kien.lmbseditor.core.motion;

import java.util.LinkedHashMap;

public class SkillMotionCommandWaitFall extends SkillMotionCommandBase {
	public final String type = "waitfall";
	public final int dur = 1;
	@Override
	public void setProperty(LinkedHashMap<String, Object> list) throws Exception {

	}

	@Override
	public String commandListName() {
		return "Wait Until Falling End";
	}

	@Override
	public String typeName() {
		return type;
	}

	@Override
	public LinkedHashMap<String, Object> obtainPropertyList() {
		return null;
	}

	@Override
	protected void updatePropertyFromMap(LinkedHashMap<String, Object> data) {

	}

}


text:
using MangoFramework;
using Microsoft.AspNetCore.Http;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Threading.Tasks;

namespace tetsujin.Models
{
    [MongoDoc]
    public class Session
    {
        public const string SESSION_COOKIE = "markofcain";
        private static string hashkey = "";
        public static string Hashkey
        {
            set { Session.hashkey = value; }
            get
            {
                if (String.IsNullOrEmpty(Session.hashkey))
                {
                    throw new ArgumentNullException("Hashkey for session isn't given. Set hashkey in environment value as 'HASHKEY'.");
                }
                return Session.hashkey;
            }
        }

        public const string CollectionName = "Session";

        [BsonId]
        [BsonRepresentation(BsonType.String)]
        public string Id { get; set; }

        [BsonElement("createdAt")]
        [BsonRepresentation(BsonType.DateTime)]
        [BsonRequired]
        public DateTime CreatedAt { get; set; }

        public static List<CreateIndexModel<BsonDocument>> indexModels = new List<CreateIndexModel<BsonDocument>>()
        {
            new CreateIndexModel<BsonDocument>(
                new IndexKeysDefinitionBuilder<BsonDocument>().Ascending(new StringFieldDefinition<BsonDocument>("createdAt")),
                new CreateIndexOptions(){ ExpireAfter = TimeSpan.FromDays(10) }
            )
        };

        /// <summary>
        /// ログインしているかの状態を返す
        /// </summary>
        /// <param name="token">セッショントークン</param>
        /// <returns>bool</returns>
        public static bool IsAuthorized(string token)
        {
            if (token == null)
            {
                return false;
            }
            var collection = DbConnection.Db.GetCollection<Session>(Session.CollectionName);
            var sessionManager = collection.Find<Session>(d => d.Id == token)
                                           .FirstOrDefault<Session>();
            var isLogin = (sessionManager == null) ? false : true;
            return isLogin;
        }

        /// <summary>
        /// ランダムトークンを取得
        /// </summary>
        /// <returns>ランダムトークン</returns>
        private static string GetToken()
        {
            var rng = RandomNumberGenerator.Create();
            var buff = new byte[25];
            rng.GetBytes(buff);
            return Convert.ToBase64String(buff);
        }

        /// <summary>
        /// ユーザIDとパスワードからハッシュを作成する
        /// </summary>
        /// <param name="userName">ユーザID</param>
        /// <param name="pw">パスワード</param>
        /// <returns>ハッシュ</returns>
        private static string GetSHA256(string userName, string pw)
        {
            //HMAC-SHA1を計算する文字列
            var s = $"{userName}-{pw}";
            //キーとする文字列
            var key = Session.Hashkey;
            if (String.IsNullOrEmpty(key))
            {
                throw new ArgumentException("Couldn't get Hashkey.");
            }

            //文字列をバイト型配列に変換する
            byte[] data = System.Text.Encoding.UTF8.GetBytes(s);
            byte[] keyData = System.Text.Encoding.UTF8.GetBytes(key);

            byte[] bs;
            //HMACSHA1オブジェクトの作成
            using (var hmac = new HMACSHA256(keyData))
            {
                //ハッシュ値を計算
                bs = hmac.ComputeHash(data);
            }

            //byte型配列を16進数に変換
            var result = BitConverter.ToString(bs).ToLower().Replace("-", "");

            return result;
        }

        /// <summary>
        /// ログインを実行する
        /// </summary>
        /// <param name="id">ユーザID</param>
        /// <param name="pw">パスワード</param>
        /// <param name="cookies">クッキー</param>
        /// <returns>ログインの成否</returns>
        public static bool Login(string id, string pw, IResponseCookies cookies)
        {
            var userCollection = DbConnection.Db.GetCollection<Master>(Master.CollectionName);
            var filter = Builders<Master>.Filter.Eq("_id", id);
            var master = userCollection.Find<Master>(filter).FirstOrDefault<Master>();
            if (master == null) // ユーザが登録されていない場合
            {
                return false;
            }
            else // ユーザが登録されていた場合
            {
                // パスワードをハッシュ化
                var sha256 = GetSHA256(master.Id, pw);

                // パスワードの一致確認
                if (sha256 != master.Password)
                {
                    return false;
                }
                else
                {
                    // トークンを使ってセッションを開始
                    var token = GetToken();
                    var collection = DbConnection.Db.GetCollection<Session>(Session.CollectionName);
                    collection.InsertOne(new Session
                    {
                        Id = token,
                        CreatedAt = DateTime.Now
                    });

                    // cookieにsecure属性を付与
                    var cookieOption = new CookieOptions()
                    {
                        Secure = true,
                        SameSite = SameSiteMode.Strict
                    };
                    cookies.Append(SESSION_COOKIE, token, cookieOption);

                    return true;
                }
            }
        }

    }
}


text:
import os.path
from setuptools import setup, find_packages

def auto_version_setup(**kwargs):
    pkg_name = kwargs["packages"][0]

    # Populate the "version" argument from the "VERSION" file.
    pkg_path = os.path.join(os.path.dirname(__file__), pkg_name)
    with open(os.path.join(pkg_path, "VERSION"), "r") as handle:
        pkg_version = handle.read().strip()
    kwargs["version"] = pkg_version

    # Make sure the "VERSION" file is included when we build the package.
    package_data = kwargs.setdefault("package_data", {})
    this_pkg_data = package_data.setdefault(pkg_name, [])
    if "VERSION" not in this_pkg_data:
        this_pkg_data.append("VERSION")

    setup(**kwargs)

auto_version_setup(
    name="behave_graph",
    author="Jenda Mudron",
    author_email="jenmud@gmail.com",
    maintainer="Jenda Mudron",
    maintainer_email="jenmud@optiver.com",
    url="https://github.com/jenmud/ansible-graph",
    keywords="behave graph",
    description="Generate a behave dependency graph.",
    packages=find_packages(),
    package_data={
        "behave_graph": [
            "VERSION",
        ],
    },
    install_requires=[
        "behave",
        "ruruki-eye"
    ],
    entry_points={
        "console_scripts": [
            "behave-graph = behave_graph:main",
        ],
    },
)


text:
int main(int argc, const char * argv[])
{

    // Read in the user's username. It shows on screen as you would expect.
    char username[50];
    printf("Username: ");
    scanf("%s", username);

    // Switch on input protection.
    protectInput();

    // Read in the user's password. Because of the prevoius protectInput() call the user's input will be hidden.
    char password[100];
    printf("Password: ");
    scanf("%s", password);

    // We read the password, so we can unprotect all user inputs from here on.
    unprotectInput();

    // Print out the user's username and password just to prove that we read all user inputs successfully.
    printf("\nYour username: %s\n",username);
    printf("Your password: %s\n",password);

    return EXIT_SUCCESS;
}


text:
package org.anddev.andengine.entity.sprite.batch;

import java.util.ArrayList;
import java.util.Collection;

import org.anddev.andengine.entity.sprite.BaseSprite;
import org.anddev.andengine.opengl.texture.Texture;
import org.anddev.andengine.util.IMatcher;
import org.anddev.andengine.util.ParameterCallable;
import org.anddev.andengine.util.SmartList;

/**
 * @author Nicolas Gramlich
 * @since 12:10:35 - 15.06.2011
 */
public class SpriteGroup extends SpriteBatch {
	// ===========================================================
	// Constants
	// ===========================================================

	// ===========================================================
	// Fields
	// ===========================================================

	private final SmartList<BaseSprite> mSprites;

	// ===========================================================
	// Constructors
	// ===========================================================

	public SpriteGroup(final Texture pTexture, final int pCapacity) {
		super(pTexture, pCapacity);

		this.mSprites = new SmartList<BaseSprite>(pCapacity);
	}

	// ===========================================================
	// Getter & Setter
	// ===========================================================

	// ===========================================================
	// Methods for/from SuperClass/Interfaces
	// ===========================================================

	public void add(final BaseSprite pBaseSprite) {
		this.mSprites.add(pBaseSprite);
	}

	public void addAll(final Collection<? extends BaseSprite> pBaseSprites) {
		this.mSprites.addAll(pBaseSprites);
	}

	public void remove(final BaseSprite pBaseSprite) {
		this.mSprites.remove(pBaseSprite);
	}

	public void removeAll(final Collection<? extends BaseSprite> pBaseSprites) {
		this.mSprites.removeAll(pBaseSprites);
	}

	public void remove(final BaseSprite pBaseSprite, final ParameterCallable<BaseSprite> pBaseSpriteParameterCallable) {
		this.mSprites.remove(pBaseSprite, pBaseSpriteParameterCallable);
	}

	public void remove(final IMatcher<BaseSprite> pBaseSpriteMatcher) {
		this.mSprites.remove(pBaseSpriteMatcher);
	}

	public void removeAll(final IMatcher<BaseSprite> pBaseSpriteMatcher) {
		this.mSprites.removeAll(pBaseSpriteMatcher);
	}

	public void removeAll(final IMatcher<BaseSprite> pBaseSpriteMatcher, final ParameterCallable<BaseSprite> pBaseSpriteParameterCallable) {
		this.mSprites.removeAll(pBaseSpriteMatcher, pBaseSpriteParameterCallable);
	}

	@Override
	protected void onManagedUpdate(final float pSecondsElapsed) {
		super.onManagedUpdate(pSecondsElapsed);
		final ArrayList<BaseSprite> sprites = this.mSprites;
		final int spriteCount = sprites.size();
		for(int i = 0; i < spriteCount; i++) {
			sprites.get(i).onUpdate(pSecondsElapsed);
		}
	}

	@Override
	protected void onDrawSpriteBatch() {
		final ArrayList<BaseSprite> sprites = this.mSprites;
		final int spriteCount = sprites.size();
		for(int i = 0; i < spriteCount; i++) {
			final BaseSprite baseSprite = sprites.get(i);
			if(baseSprite.isVisible()) {
				super.draw(baseSprite);
			}
		}
	}

	// ===========================================================
	// Methods
	// ===========================================================

	// ===========================================================
	// Inner and Anonymous Classes
	// ===========================================================
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _03.SortArrayOfStrings
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] text = Console.ReadLine().Split(' ').ToArray();
            var something = text[0].CompareTo(text[1]);
            BubleSortArr(text);

            Console.WriteLine(string.Join(" ", text));
        }

        static void BubleSortArr(string[] numbers)
        {
            bool swapped = true;
            while (swapped)
            {
                swapped = false;
                for (int i = 0; i < numbers.Length - 1; i++)
                {
                    if (numbers[i].CompareTo(numbers[i + 1]) > 0)
                    {
                        Swap(numbers, i, i + 1);
                        swapped = true;
                        break;
                    }
                }
            }
        }

        static void Swap(string[] numbers, int first, int second)
        {
            string temp = numbers[first];
            numbers[first] = numbers[second];
            numbers[second] = temp;
        }
    }
}


text:
package net.mostlyoriginal.game.system.logic;

import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Wire;
import com.artemis.systems.EntityProcessingSystem;
import net.mostlyoriginal.api.component.graphics.Anim;
import net.mostlyoriginal.api.event.common.EventManager;
import net.mostlyoriginal.game.component.Team;
import net.mostlyoriginal.game.component.TeamMember;
import net.mostlyoriginal.game.component.ui.Clickable;
import net.mostlyoriginal.game.events.TeamChangeEvent;

/**
 * Switch team with middle mouse button.
 *
 * @author Daan van Yperen
 */
@Wire
public class TeamChangingSystem extends EntityProcessingSystem {

	protected ComponentMapper<Clickable> mClickable;
	protected ComponentMapper<TeamMember> mTeamMember;
	protected ComponentMapper<Anim> mAnim;
	public EventManager em;

	@SuppressWarnings("unchecked")
	public TeamChangingSystem() {
		super(Aspect.getAspectForAll(TeamMember.class, Clickable.class, Anim.class));
	}

	@Override
	protected void process(Entity e) {
		TeamMember teamMember = mTeamMember.get(e);

		if (mClickable.get(e).state == Clickable.ClickState.CLICKED_MIDDLE) {
			if (teamMember.team == null) {
				teamMember.team = Team.MARINE;
			} else {
				switch (teamMember.team) {
					case ALIEN:
						teamMember.team = null;
						break;
					case MARINE:
						teamMember.team = Team.ALIEN;
						break;
				}
			}
			em.dispatch(new TeamChangeEvent(e));
		}

		Anim anim = mAnim.get(e);
		anim.id = teamMember.team != null ? teamMember.art.get(teamMember.team) : teamMember.artUnaligned;
	}
}


text:
<?php

declare(strict_types=1);

namespace Roave\BetterReflectionTest\Reflection\StringCast;

use PHPUnit\Framework\TestCase;
use Roave\BetterReflection\Reflection\ReflectionIntersectionType;
use Roave\BetterReflection\Reflection\ReflectionNamedType;
use Roave\BetterReflection\Reflection\ReflectionUnionType;
use Roave\BetterReflection\Reflection\StringCast\ReflectionTypeStringCast;
use Roave\BetterReflection\Reflector\DefaultReflector;
use Roave\BetterReflection\SourceLocator\Type\StringSourceLocator;
use Roave\BetterReflectionTest\BetterReflectionSingleton;

use function assert;

/** @covers \Roave\BetterReflection\Reflection\StringCast\ReflectionTypeStringCast */
final class ReflectionTypeStringCastTest extends TestCase
{
    /** @return list<array{0: ReflectionNamedType|ReflectionUnionType|ReflectionIntersectionType, 1: string}> */
    public function toStringProvider(): array
    {
        $reflector = new DefaultReflector(new StringSourceLocator(
            <<<'PHP'
<?php

interface A {}
interface B {}
function a(): int|string|null {}
function b(): int|null {}
function c(): ?int {}
function d(): A&B {}
function e(): int {}
function f(): null|int {}
function g(): string|null|int {}
function h(): null {}
function i(): (A&B)|null {}
function j(): (A&B)|(A&C) {}
function k(): null|(A&B)|(A&C) {}
PHP
            ,
            BetterReflectionSingleton::instance()
                ->astLocator(),
        ));

        $returnTypeForFunction = static function (string $function) use ($reflector): ReflectionNamedType|ReflectionUnionType|ReflectionIntersectionType {
            $type = $reflector->reflectFunction($function)
                ->getReturnType();

            assert($type !== null);

            return $type;
        };

        return [
            [$returnTypeForFunction('a'), 'int|string|null'],
            [$returnTypeForFunction('b'), '?int'],
            [$returnTypeForFunction('c'), '?int'],
            [$returnTypeForFunction('d'), 'A&B'],
            [$returnTypeForFunction('e'), 'int'],
            [$returnTypeForFunction('f'), '?int'],
            [$returnTypeForFunction('g'), 'string|null|int'],
            [$returnTypeForFunction('h'), 'null'],
            [$returnTypeForFunction('i'), '(A&B)|null'],
            [$returnTypeForFunction('j'), '(A&B)|(A&C)'],
            [$returnTypeForFunction('k'), 'null|(A&B)|(A&C)'],
        ];
    }

    /** @dataProvider toStringProvider */
    public function testToString(
        ReflectionNamedType|ReflectionUnionType|ReflectionIntersectionType $type,
        string $expectedString,
    ): void {
        self::assertSame($expectedString, ReflectionTypeStringCast::toString($type));
    }
}


text:
import { PrecompileOption } from '@templatejs/precompiler';
export interface Options extends PrecompileOption {
    global?: string;
}


text:
/*
 *  This file is part of the Heritrix web crawler (crawler.archive.org).
 *
 *  Licensed to the Internet Archive (IA) by one or more individual
 *  contributors.
 *
 *  The IA licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package org.archive.crawler.postprocessor;

import static org.archive.modules.SchedulingConstants.HIGH;
import static org.archive.modules.SchedulingConstants.MEDIUM;
import static org.archive.modules.SchedulingConstants.NORMAL;
import static org.archive.modules.fetcher.FetchStatusCodes.S_PREREQUISITE_UNSCHEDULABLE_FAILURE;

import java.util.logging.Level;
import java.util.logging.Logger;

import org.apache.commons.httpclient.URIException;
import org.archive.crawler.framework.Scoper;
import org.archive.modules.CrawlURI;
import org.archive.modules.deciderules.DecideResult;
import org.archive.modules.deciderules.DecideRule;
import org.archive.modules.deciderules.RejectDecideRule;
import org.archive.modules.extractor.Hop;
import org.archive.modules.extractor.Link;

/**
 * Determine which extracted links are within scope.
 * TODO: To test scope, requires that Link be converted to
 * a CrawlURI.  Make it so don't have to make a CrawlURI to test
 * if Link is in scope.
 *
Since this scoper has to create CrawlURIs, no sense
 * discarding them since later in the processing chain CrawlURIs rather
 * than Links are whats needed scheduling extracted links w/ the
 * Frontier (Frontier#schedule expects CrawlURI, not Link).  This class
 * replaces Links w/ the CrawlURI that wraps the Link in the CrawlURI.
 *
 * @deprecated Use CandidatesProcessor and CandidateChain/CandidateScoper instead
 *
 * @author gojomo
 * @author stack
 */
public class LinksScoper extends Scoper {

    private static final long serialVersionUID = -3L;

    private static Logger LOGGER =
        Logger.getLogger(LinksScoper.class.getName());

    /**
     * If enabled, any URL found because a seed redirected to it (original seed
     * returned 301 or 302), will also be treated as a seed.
     */
    {
        setSeedsRedirectNewSeeds(true);
    }
    public boolean getSeedsRedirectNewSeeds() {
        return (Boolean) kp.get("seedsRedirectNewSeeds");
    }
    public void setSeedsRedirectNewSeeds(boolean redirect) {
        kp.put("seedsRedirectNewSeeds",redirect);
    }

    /**
     * DecideRules applied after an URI has been rejected. If the rules return
     * {@link DecideResult#ACCEPT}, the URI is logged (if the logging level is
     * INFO). Depends on {@link Scoper#OVERRIDE_LOGGER} being enabled.
     */
    {
        setLogRejectsRule(new RejectDecideRule());
    }
    public DecideRule getLogRejectsRule() {
        return (DecideRule) kp.get("logRejectsRule");
    }
    public void setLogRejectsRule(DecideRule rule) {
        kp.put("logRejectsRule", rule);
    }

    /**
     * Number of hops (of any sort) from a seed up to which a URI has higher
     * priority scheduling than any remaining seed. For example, if set to 1
     * items one hop (link, embed, redirect, etc.) away from a seed will be
     * scheduled with HIGH priority. If set to -1, no preferencing will occur,
     * and a breadth-first search with seeds processed before discovered links
     * will proceed. If set to zero, a purely depth-first search will proceed,
     * with all discovered links processed before remaining seeds. Seed
     * redirects are treated as one hop from a seed.
     */
    {
        setPreferenceDepthHops(-1); // no limit
    }
    public int getPreferenceDepthHops() {
        return (Integer) kp.get("preferenceDepthHops");
    }
    public void setPreferenceDepthHops(int depth) {
        kp.put("preferenceDepthHops",depth);
    }

    /**
     * @param name Name of this filter.
     */
    public LinksScoper() {
        super();
    }

    @Override
    protected boolean shouldProcess(CrawlURI puri) {
        if (!(puri instanceof CrawlURI)) {
            return false;
        }
        CrawlURI curi = (CrawlURI)puri;

        // If prerequisites, nothing to be done in here.
        if (curi.hasPrerequisiteUri()) {
            handlePrerequisite(curi);
            return false;
        }

        // Don't extract links of error pages.
        if (curi.getFetchStatus() < 200 || curi.getFetchStatus() >= 400) {
            curi.getOutLinks().clear();
            return false;
        }

        if (curi.getOutLinks().isEmpty()) {
            // No outlinks to process.
            return false;
        }

        return true;
    }

    @Override
    protected void innerProcess(final CrawlURI puri) {
        CrawlURI curi = (CrawlURI)puri;
        final boolean redirectsNewSeeds = getSeedsRedirectNewSeeds();
        int preferenceDepthHops = getPreferenceDepthHops();

        for (Link wref: curi.getOutLinks()) try {
            int directive = getSchedulingFor(curi, wref, preferenceDepthHops);
            CrawlURI caURI = curi.createCrawlURI(curi.getBaseURI(),
                    wref, directive,
                    considerAsSeed(curi, wref, redirectsNewSeeds));
            if (isInScope(caURI)) {
                curi.getOutCandidates().add(caURI);
            }
        } catch (URIException e) {
            loggerModule.logUriError(e, curi.getUURI(),
                    wref.getDestination().toString());
        }
        curi.getOutLinks().clear();
    }

    /**
     * The CrawlURI has a prerequisite; apply scoping and update
     * Link to CrawlURI in manner analogous to outlink handling.
     * @param curi CrawlURI with prereq to consider
     */
    protected void handlePrerequisite(CrawlURI curi) {
        CrawlURI caUri = curi.getPrerequisiteUri();
// FIXME!!!            getController().setStateProvider(caUri);
        if(isInScope(caUri)) {
            // replace link with CrawlURI
            curi.setPrerequisiteUri(caUri);
        } else {
            // prerequisite is out-of-scope; mark CrawlURI as error,
            // preventing normal S_DEFERRED handling
            curi.clearPrerequisiteUri();
            curi.setFetchStatus(S_PREREQUISITE_UNSCHEDULABLE_FAILURE);
        }
    }

    // TODO: move similar outOfScope logging to CandidatesProcessor/CandidateChain/CandidateScoper
    protected void outOfScope(CrawlURI caUri) {
        super.outOfScope(caUri);
        if (!LOGGER.isLoggable(Level.INFO)) {
            return;
        }
        DecideRule seq = getLogRejectsRule();
        if (seq.decisionFor(caUri) == DecideResult.ACCEPT) {
            LOGGER.info(caUri.getUURI().toString());
        }
    }

    private boolean considerAsSeed(final CrawlURI curi, final Link wref,
            final boolean redirectsNewSeeds) {
        return redirectsNewSeeds && curi.isSeed()
                && wref.getHopType() == Hop.REFER;
    }

    /**
     * Determine scheduling for the  curi.
     * As with the LinksScoper in general, this only handles extracted links,
     * seeds do not pass through here, but are given MEDIUM priority.
     * Imports into the frontier similarly do not pass through here,
     * but are given NORMAL priority.
     */
    protected int getSchedulingFor(final CrawlURI curi, final Link wref,
            final int preferenceDepthHops) {
        final Hop c = wref.getHopType();
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest(curi + " with path=" + curi.getPathFromSeed() +
                " isSeed=" + curi.isSeed() + " with fetchStatus=" +
                curi.getFetchStatus() + " -> " + wref.getDestination() +
                " type " + c + " with context=" + wref.getContext());
        }

        switch (c) {
            case REFER:
                // Treat redirects somewhat urgently
                // This also ensures seed redirects remain seed priority
                return (preferenceDepthHops >= 0 ? HIGH : MEDIUM);
            default:
                if (preferenceDepthHops == 0)
                    return HIGH;
                    // this implies seed redirects are treated as path
                    // length 1, which I belive is standard.
                    // curi.getPathFromSeed() can never be null here, because
                    // we're processing a link extracted from curi
                if (preferenceDepthHops > 0 &&
                    curi.getPathFromSeed().length() + 1 <= preferenceDepthHops)
                    return HIGH;
                // Everything else normal (at least for now)
                return NORMAL;
        }
    }
}


text:
[![Build Status](https://travis-ci.org/Arnavion/libjass.png?branch=master)](https://travis-ci.org/Arnavion/libjass)

libjass is a JavaScript library written in TypeScript to render ASS subs on HTML5 video in the browser. [Check out the demo.](http://arnavion.github.io/libjass/demo/index.xhtml)

### What's special about libjass?

* libjass requires no tweaks to the ASS file from the original video.

* libjass uses the browser's native CSS engine by converting the components of each line in the ASS script into a series of styled <div> and <span> elements. This allows all the layout and rendering to be handled by the browser instead of requiring complex and costly drawing and animation code. For example, libjass uses CSS3 animations to simulate tags such as \fad. While a canvas-drawing library would have to re-draw such a subtitle on the canvas for every frame of the video, libjass only renders it once and lets the browser render the fade effect.

As a result, libjass is able to render subtitles with very low CPU usage. The downside to libjass's aproach is that it is hard (and potentially impossible) to map all effects possible in ASS (using \t, ASS draw) etc. into DOM elements. As of now, the subset of tags supported by libjass has no such problems.

### I want to use libjass for my website. What do I need to do?

You can install the latest release of libjass

* using npm with `npm install libjass` and load with `var libjass = require("libjass");`
* using bower with `bower install https://github.com/Arnavion/libjass/releases/download/<release name>/libjass.zip`
* using jspm with `jspm install github:Arnavion/libjass` and load with `import libjass from "Arnavion/libjass";`

Inside the package, you will find libjass.js and libjass.css, which you need to load on your website with your video.

Alternatively, you can build libjass from source by cloning this repository and running `npm install`. This will install the dependencies and run the build. libjass.js and libjass.css will be found in the lib/ directory.

Only libjass.js and libjass.css are needed to use libjass on your website. The other files are only used during the build process and you don't need to deploy them to your website.

### What are all these files?

* The src/ directory contains the source of libjass. They are TypeScript files and get compiled into JavaScript for the browser using the TypeScript compiler.

* build.js is the build script. The build command will use this script to build libjass.js. The build/ directory contains other files used for the build.

* The tests/ directory contains unit and functional tests.

* The lib/ directory contains libjass.js and libjass.css. You will need to deploy these to your website.

### How do I use libjass?

The API documentation is linked in the Links section below. Here's an overview:

* The [ASS.fromUrl()](http://arnavion.github.io/libjass/api.xhtml#libjass.ASS.fromUrl) function takes in a URL to an ASS script and returns a promise that resolves to an [ASS](http://arnavion.github.io/libjass/api.xhtml#libjass.ASS) object. This ASS object represents the script properties, the line styles and dialogue lines in it. Alternatively, you can use [ASS.fromString()](http://arnavion.github.io/libjass/api.xhtml#libjass.ASS.fromString) to convert a string of the script contents into an ASS object.

* Next, you initialize a renderer to render the subtitles. libjass ships with an easy-to-use renderer, the [DefaultRenderer](http://arnavion.github.io/libjass/api.xhtml#libjass.renderers.DefaultRenderer). It uses information from the ASS object to build up a series of div elements around the video tag. There is a wrapper (.libjass-subs) containing div's corresponding to the layers in the ASS script, and each layer has div's corresponding to the 9 alignment directions. libjass.css contains styles for these div's to render them at the correct location.

* The renderer uses [window.requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/window.requestAnimationFrame) as a source of timer ticks. In each tick, it determines the set of dialogues to be shown at the current video time, renders each of them as a div, and appendChild's the div into the appropriate layer+alignment div.

* The renderer can be told to dynamically change the size of the subtitles based on user input by calling [WebRenderer.resize()](http://arnavion.github.io/libjass/api.xhtml#libjass.renderers.WebRenderer.resize) DefaultRenderer also handles resizing the subtitles automatically when the user clicks the browser's native fullscreen-video button.

* Lastly, the renderer contains an implementation of preloading fonts before playing the video. It uses a map of font names to URLs - this map can be conveniently created from a CSS file containing @font-face rules using [RendererSettings.makeFontMapFromStyleElement()](http://arnavion.github.io/libjass/api.xhtml#libjass.renderers.RendererSettings.makeFontMapFromStyleElement)

* For an example of using libjass, check out [the demo.](http://arnavion.github.io/libjass/demo/index.xhtml) It has comments explaining basic usage and pointers to some advanced usage.

### What browser and JavaScript features does libjass need?

* libjass uses some ES5 features like getters and setters (via Object.defineProperty), and assumptions like the behavior of parseInt with leading zeros. It cannot be used with an ES3 environment.

* libjass will use ES6 Set, Map and Promise if they're available on the global object. If they're not present, it will use its own minimal internal implementations. If you have implementations of these that you would like libjass to use but don't want to register them on the global object, you can provide them to libjass specifically by setting the [libjass.Set](http://arnavion.github.io/libjass/api.xhtml#libjass.Set), [libjass.Map](http://arnavion.github.io/libjass/api.xhtml#libjass.Map) and [libjass.Promise](http://arnavion.github.io/libjass/api.xhtml#libjass.Promise) properties.

* [AutoClock](http://arnavion.github.io/libjass/api.xhtml#libjass.renderers.AutoClock) and [VideoClock](http://arnavion.github.io/libjass/api.xhtml#libjass.renderers.VideoClock) use [window.requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame) to generate clock ticks.

* [WebRenderer](http://arnavion.github.io/libjass/api.xhtml#libjass.renderers.WebRenderer) and [DefaultRenderer](http://arnavion.github.io/libjass/api.xhtml#libjass.renderers.DefaultRenderer) use [SVG filter effects for HTML](http://caniuse.com/#feat=svg-html) to render outlines and blur. This feature is not available on all browsers, so you can tell them to fall back to more widely available CSS methods by setting the [RendererSettings.enableSvg](http://arnavion.github.io/libjass/api.xhtml#libjass.renderers.RendererSettings.enableSvg) property to false.

* WebRenderer and DefaultRenderer use [CSS3 animations](http://caniuse.com/#feat=css-animation) for effects like \mov and \fad.

### Can I use libjass in node?

libjass's parser works in node. Entire scripts can be parsed via [ASS.fromString()](http://arnavion.github.io/libjass/api.xhtml#libjass.ASS.fromString)

```javascript
> var libjass = require("libjass")
undefined
> var ass; libjass.ASS.fromString(fs.readFileSync("mysubs.ass", "utf8")).then(function (result) { ass = result; })
{}
> ass.properties.resolutionX
1280
> ass.dialogues.length
9
> ass.dialogues[0].toString()
'#0 [646.460-652.130] {\\fad(200,0)}Sapien rhoncus, suscipit posuere in nunc pellentesque'
> var parts = ass.dialogues[0].parts
undefined
> parts.length
2
> parts[0] instanceof libjass.parts.Fade
true
> parts[0].toString()
'Fade { start: 0.2, end: 0 }'
```

[libjass.parser.parse](http://arnavion.github.io/libjass/api.xhtml#libjass.parser.parse) parses the first parameter using the second parameter as the rule name. For example, the [dialogueParts](http://arnavion.github.io/libjass/api.xhtml#./parser/parse.ParserRun.parse_dialogueParts) rule can be used to get an array of [libjass.parts](http://arnavion.github.io/libjass/api.xhtml#libjass.parts) objects that represent the parts of an ASS dialogue line.

```javascript
> var parts = libjass.parser.parse("{\\an8}Are {\\i1}you{\\i0} the one who stole the clock?!", "dialogueParts")
undefined
> parts.join(" ")
'Alignment { value: 8 } Text { value: Are  } Italic { value: true } Text { value: you } Italic { value: false } Text { value:  the one who stole the clock?! }'
> parts.length
6
> parts[0].toString()
'Alignment { value: 8 }'
> parts[0] instanceof libjass.parts.Alignment
true
> parts[0].value
8
```

The rule names are derived from the methods on the [ParserRun class](http://arnavion.github.io/libjass/api.xhtml#./parser/parse.ParserRun).

See the tests, particularly the ones in tests/unit/miscellaneous.js, for examples.

### Can I contribute?

Yes! Feature requests, suggestions, bug reports and pull requests are welcome! I'm especially looking for details and edge-cases of the ASS syntax that libjass doesn't support.

You can also join the IRC channel in the links section below and ask any questions.

### Supported features

* Styles: Italic, Bold, Underline, StrikeOut, FontName, FontSize, ScaleX, ScaleY, Spacing, PrimaryColor, OutlineColor, BackColor, Outline, Shadow, Alignment, MarginL, MarginR, MarginV
* Tags: \i, \b, \u, \s, \bord, \xbord, \ybord, \shad, \xshad, \yshad, \be, \blur, \fn, \fs, \fscx, \fscy, \fsp, \frx, \fry, \frz, \fr, \fax, \fay, \c, \1c, \3c, \4c, \alpha, \1a, \3a, \4a, \an, \a, \k, \q, \r, \pos, \move, \fad, \fade, \t (experimental), \p
* Custom fonts, using CSS web fonts.

### Known issues

* Unsupported tags: \fe, \2c, \2a, \K, \kf, \ko, \org, \clip, \iclip
* \an4, \an5, \an6 aren't positioned correctly.
* Smart line wrapping is not supported. Such lines are rendered as [wrapping style 1 (end-of-line wrapping).](http://docs.aegisub.org/3.0/ASS_Tags/#wrapstyle)
* Lines with multiple rotations aren't rotated the same as VSFilter or libass. See [#14](https://github.com/Arnavion/libjass/issues/14)

### Links

* [GitHub](https://github.com/Arnavion/libjass/)
* IRC channel - #libjass on irc.rizon.net
* [API documentation](http://arnavion.github.io/libjass/api.xhtml)
* [Aegisub's documentation on ASS](http://docs.aegisub.org/3.0/ASS_Tags/)

### License

```
libjass

https://github.com/Arnavion/libjass

Copyright 2013 Arnav Singh

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```


text:
var cdb = require('cartodb.js');
cdb.admin = require('cdb.admin');
var randomQuote = require('../../../../../common/view_helpers/random_quote');

/*
 *  Content result default view
 */

module.exports = cdb.core.View.extend({

  events: {
    'click .js-mail-link': '_onMailClick',
    'click .js-link':      '_onLinkClick'
  },

  initialize: function() {
    if (!this.options.defaultUrl) {
      throw new Error('defaultUrl is required')
    }
    this.user = this.options.user;
    this.routerModel = this.options.routerModel;
    this.template = cdb.templates.getTemplate(this.options.template);

    this._initBinds();
  },

  render: function() {
    var type = this.routerModel.get('content_type');

    this.$el.html(this.template({
      defaultUrl:     this.options.defaultUrl,
      page:           this.routerModel.get('page'),
      tag:            this.routerModel.get('tag'),
      q:              this.routerModel.get('q'),
      shared:         this.routerModel.get('shared'),
      locked:         this.routerModel.get('locked'),
      library:        this.routerModel.get('library'),
      quote:          randomQuote(),
      type:           type,
      totalItems:     this.collection.size(),
      totalEntries:   this.collection.total_entries
    }));

    return this;
  },

  _initBinds: function() {
    this.routerModel.bind('change', this.render, this);
    this.collection.bind('reset', this.render, this);
    this.add_related_model(this.routerModel);
    this.add_related_model(this.collection);
  },

  _onMailClick: function(e) {
    if (e) e.stopPropagation()
  },

  _onLinkClick: function() {
    debugger;
  }

});


text:
layout: md
category: sweet
name: The Simpson
image: simpson.svg
---

##The Simpson

The Simpson donut is a classic flavour. A vanilla cake base with strawberry icing, and rainbow sprinkles.

**Box of 6:** $12.00

**Box of 12:** $24.00

**Box of 24:** $48.00

![the simpson]({{site.baseurl}}/images/simpson.svg)


text:
package com.splunk;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import java.util.*;

public class ModularInputKindsTest extends SDKTestCase {
    private ResourceCollection<ModularInputKind> inputKinds;

    public void checkModularInputKind(ModularInputKind m) {
        if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
            return;
        } else {
            installApplicationFromTestData("modular-inputs");
            inputKinds = service.getModularInputKinds();
        }

        if (m.getName().equals("test1")) {
            Assert.assertEquals("Test \"Input\" - 1", m.getTitle());
            Assert.assertEquals("xml", m.getStreamingMode());
        } else if (m.getName().equals("test2")) {
            Assert.assertEquals("test2", m.getTitle());
            Assert.assertEquals("simple", m.getStreamingMode());
        }

    }

    @Test
    public void testListInputKinds() {
        if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
            return;
        } else {
            installApplicationFromTestData("modular-inputs");
            inputKinds = service.getModularInputKinds();
        }

        for (ModularInputKind kind : inputKinds.values()) {
            checkModularInputKind(kind);
        }
    }

    @Test
    public void testInputByName() {
        if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
            return;
        } else {
            installApplicationFromTestData("modular-inputs");
            inputKinds = service.getModularInputKinds();
        }
        ModularInputKind m;
        m = inputKinds.get("test1");
        checkModularInputKind(m);
        m = inputKinds.get("test2");
        checkModularInputKind(m);
    }

    @Test
    public void testNonexistantArg() {
        if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
            return;
        } else {
            installApplicationFromTestData("modular-inputs");
            inputKinds = service.getModularInputKinds();
        }
        ModularInputKind test1 = inputKinds.get("test1");
        Assert.assertFalse(test1.hasArgument("nonexistant_argument"));
        Assert.assertNull(test1.getArgument("nonexistant_argument"));
    }

    @Test
    public void testInputKindDescriptionAndTitle() {
        if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
            return;
        } else {
            installApplicationFromTestData("modular-inputs");
            inputKinds = service.getModularInputKinds();
        }
        ModularInputKind test1 = inputKinds.get("test1");
        String expectedDescription1 = "A description of test input 1 with special characters: //;!*%";
        Assert.assertEquals(expectedDescription1, test1.getDescription());
        Assert.assertEquals("Test \"Input\" - 1", test1.getTitle());

        ModularInputKind test2 = inputKinds.get("test2");
        Assert.assertEquals(null, test2.getDescription());
        Assert.assertEquals("test2", test2.getTitle());
    }

    @Test
    public void testArgDescription() {
        if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
            return;
        } else {
            installApplicationFromTestData("modular-inputs");
            inputKinds = service.getModularInputKinds();
        }

        ModularInputKind test1 = inputKinds.get("test1");

        ModularInputKindArgument arg;

        Map<String,String> expectedValues = new HashMap<String,String>();
        expectedValues.put("key_id", "The key of the system");
        expectedValues.put("no_description", null);
        expectedValues.put("empty_description", null);

        for (String key : expectedValues.keySet()) {
            Assert.assertTrue(test1.hasArgument(key));
            arg = test1.getArgument(key);
            String expectedDescription = expectedValues.get(key);
            String foundDescription = arg.getDescription();
            Assert.assertEquals(expectedDescription, foundDescription);
        }
    }

    @Test
    public void testArgDataType() {
        if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
            return;
        } else {
            installApplicationFromTestData("modular-inputs");
            inputKinds = service.getModularInputKinds();
        }

        ModularInputKind test1 = inputKinds.get("test1");

        ModularInputKindArgument arg;

        Map<String,ModularInputKindArgument.Type> expectedValues =
                new HashMap<String,ModularInputKindArgument.Type>();
        expectedValues.put("number_field", ModularInputKindArgument.Type.NUMBER);
        expectedValues.put("boolean_field", ModularInputKindArgument.Type.BOOLEAN);
        expectedValues.put("string_field", ModularInputKindArgument.Type.STRING);

        for (String key : expectedValues.keySet()) {
            Assert.assertTrue(test1.hasArgument(key));
            arg = test1.getArgument(key);
            Assert.assertEquals(expectedValues.get(key), arg.getType());
        }
    }

    @Test
    public void testRequiredOnCreate() {
        if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
            return;
        } else {
            installApplicationFromTestData("modular-inputs");
            inputKinds = service.getModularInputKinds();
        }

        ModularInputKind test1 = inputKinds.get("test1");

        ModularInputKindArgument arg;

        Map<String,Boolean> expectedValues = new HashMap<String,Boolean>();
        expectedValues.put("required_on_create", true);
        expectedValues.put("not_required_on_create", false);

        for (String key : expectedValues.keySet()) {
            Assert.assertTrue(test1.hasArgument(key));
            arg = test1.getArgument(key);
            Assert.assertEquals((boolean) expectedValues.get(key), arg.getRequiredOnCreate());
        }
    }

    @Test
    public void testRequiredOnEdit() {
        if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
            return;
        } else {
            installApplicationFromTestData("modular-inputs");
            inputKinds = service.getModularInputKinds();
        }

        ModularInputKind test1 = inputKinds.get("test1");

        ModularInputKindArgument arg;

        Map<String,Boolean> expectedValues = new HashMap<String,Boolean>();
        expectedValues.put("arg_required_on_edit", true);
        expectedValues.put("not_required_on_edit", false);

        for (String key : expectedValues.keySet()) {
            Assert.assertTrue(test1.hasArgument(key));
            arg = test1.getArgument(key);
            Assert.assertEquals((boolean) expectedValues.get(key), arg.getRequiredOnEdit());
        }
    }

    @Test
    public void testGetArguments() {
        if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
            return;
        } else {
            installApplicationFromTestData("modular-inputs");
            inputKinds = service.getModularInputKinds();
        }

        ModularInputKind test1 = inputKinds.get("test1");
        Map<String, ModularInputKindArgument> args = test1.getArguments();

        Set<String> expectedKeys = new HashSet<String>();
        expectedKeys.add("name");
        expectedKeys.add("resname");
        expectedKeys.add("key_id");
        expectedKeys.add("no_description");
        expectedKeys.add("empty_description");
        expectedKeys.add("arg_required_on_edit");
        expectedKeys.add("not_required_on_edit");
        expectedKeys.add("required_on_create");
        expectedKeys.add("not_required_on_create");
        expectedKeys.add("number_field");
        expectedKeys.add("string_field");
        expectedKeys.add("boolean_field");

        Assert.assertEquals(expectedKeys, args.keySet());
    }
}


text:
<?php

$config = GetConfig();
$files = GetFilesList($_SERVER['DOCUMENT_ROOT']."/modules", "");

for($i = 0; $i < sizeof($files); $i++)
{
	$file_name = $files[$i]['name'];
	$file_path = "/modules/".$files[$i]['name'];
	$file_size = round($files[$i]['size']/1024);
	$file_modify_date = $files[$i]['modified'];

	//
	$disable_hide = "";
	$enable_hide = "display: none;";
	//
	$settings = GetSettings();
	$disabled_modules = $settings['disabled_modules'];

	if(in_array($file_name, $disabled_modules))
	{
		$disable_hide = "display: none;";
		$enable_hide = "";
	}

	$module_title = $file_name;

	$manifest_path = $_SERVER['DOCUMENT_ROOT'].$file_path.StringFormat("/{0}.json", $file_name);
	if(file_exists($manifest_path))
	{
		$data = LoadJSON($manifest_path, array("title" => "", "version" => ""));
		$module_title = StringFormat("{0} (v {1})", $data['title'], $data['version']);
	}

	$module_icon = "";
	$icon_path = $file_path.StringFormat("/{0}.png", $file_name);
	if(file_exists($_SERVER['DOCUMENT_ROOT'].$icon_path))
	{
		$module_icon = StringFormat("background-image: url({0});", $icon_path);
	}
	//

	$markup = "

".$module_title."

".$file_path."

Изменен ".GetTime($file_modify_date)."

Параметры

Включено

Отключено

	";

	Draw($markup);
}

if(sizeof($files) == 0)Draw("
Нет модулей...

");

/*

if(true)
{
	if(true)
	{

		?>

#

Имя

Путь

Дата изменения

			<?

			for($i = 0; $i < sizeof($files); $i++)
			{
				$file_name = $files[$i]['name'];
				$file_path = "/modules/".$files[$i]['name'];
				$file_size = round($files[$i]['size']/1024);
				$file_modify_date = $files[$i]['modified'];

				//
				$disable_hide = "";
				$enable_hide = "display: none;";
				//
				$settings = GetSettings();
				$disabled_modules = $settings['disabled_modules'];

				if(in_array($file_name, $disabled_modules))
				{
					$disable_hide = "display: none;";
					$enable_hide = "";
				}

				//

				$markup = "

".($i + 1).".

".$file_name."

".$file_path."

".GetTime($file_modify_date)."

						Параметры

Отключить

Подключить

				";

				Draw($markup);
			}

			?>

		<?

		if(sizeof($files) == 0)Draw("
Нет модулей...

");
	}
}

*/

?>


text:
import libtcodpy as libtcod

SCREEN_WIDTH = 80
SCREEN_HEIGHT = 50
FONT_FLAGS = libtcod.FONT_TYPE_GREYSCALE | libtcod.FONT_LAYOUT_TCOD
FONT_FILE = 'fonts/dejavu12x12_gs_tc.png'
LIMIT_FPS = 25
TITLE = 'Neko (noise test)'

libtcod.sys_set_fps(LIMIT_FPS)
libtcod.console_set_custom_font(FONT_FILE, FONT_FLAGS)
libtcod.console_init_root(SCREEN_WIDTH, SCREEN_HEIGHT, TITLE, False)

rng = libtcod.random_new()
noise2d = libtcod.noise_new(2, random=rng)
libtcod.noise_set_type(noise2d, libtcod.NOISE_SIMPLEX)

while not libtcod.console_is_window_closed():
    libtcod.console_set_default_foreground(0, libtcod.white)
    libtcod.console_clear(0)
    for i in range(SCREEN_HEIGHT):
        for j in range(SCREEN_WIDTH):
            x, y = float(j) / SCREEN_WIDTH, float(i) / SCREEN_HEIGHT
            n = libtcod.noise_get_fbm(noise2d, [x, y], 16)
            v = int((n + 1) * 128)
            c = libtcod.Color(v, v, v)
            libtcod.console_set_char_background(0, j, i, c, libtcod.BKGND_SET)

    libtcod.console_flush()
    libtcod.console_check_for_keypress(libtcod.KEY_PRESSED)


text:
//-----------------------------------------------------------------------
// <copyright file="Extensions.cs" company="Akka.NET Project">
//     Copyright (C) 2009-2020 Lightbend Inc. <http://www.lightbend.com>
//     Copyright (C) 2013-2020 .NET Foundation <https://github.com/akkadotnet/akka.net>
// </copyright>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Akka.Actor;

#if CORECLR
using Microsoft.Extensions.DependencyModel;
#endif
namespace Akka.DI.Core
{
    /// <summary>
    /// This class contains extension methods used to simplify working with dependency injection (DI) inside an <see cref="ActorSystem"/>.
    /// </summary>
    public static class Extensions
    {
        /// <summary>
        /// Registers a dependency resolver with a given actor system.
        /// </summary>
        /// <param name="system">The actor system in which to register the given dependency resolver.</param>
        /// <param name="dependencyResolver">The dependency resolver being registered to the actor system.</param>
        /// <exception cref="ArgumentNullException">
        /// This exception is thrown when either the specified <paramref name="system"/> or the specified <paramref name="dependencyResolver"/> is undefined.
        /// </exception>
        public static void AddDependencyResolver(this ActorSystem system, IDependencyResolver dependencyResolver)
        {
            if (system == null) throw new ArgumentNullException(nameof(system), $"ActorSystem requires a valid {nameof(system)}");
            if (dependencyResolver == null) throw new ArgumentNullException(nameof(dependencyResolver), $"ActorSystem requires {nameof(dependencyResolver)} to be provided");
            system.RegisterExtension(DIExtension.DIExtensionProvider);
            DIExtension.DIExtensionProvider.Get(system).Initialize(dependencyResolver);
        }

        /// <summary>
        /// Creates an adapter used to generate <see cref="Akka.Actor.Props"/> configuration objects using the DI extension using a given actor system.
        /// </summary>
        /// <param name="system">The actor system that contains the DI extension.</param>
        /// <returns>An adapter used to generate <see cref="Akka.Actor.Props"/> configuration objects using the DI extension.</returns>
        public static DIActorSystemAdapter DI(this ActorSystem system)
        {
            return new DIActorSystemAdapter(system);
        }

        /// <summary>
        /// Creates an adapter used to generate <see cref="Akka.Actor.Props"/> configuration objects using the DI extension using a given actor context.
        /// </summary>
        /// <param name="context">The actor context associated with a system that contains the DI extension.</param>
        /// <returns>An adapter used to generate <see cref="Akka.Actor.Props"/> configuration objects using the DI extension.</returns>
        public static DIActorContextAdapter DI(this IActorContext context)
        {
            return new DIActorContextAdapter(context);
        }

        /// <summary>
        /// Retrieves the <see cref="Type"/> with a given name from the current <see cref="AppDomain"/>.
        /// </summary>
        /// <param name="typeName">The string representation of the type to retrieve.</param>
        /// <returns>The <see cref="Type"/> with the given name.</returns>
        public static Type GetTypeValue(this string typeName)
        {
            var firstTry = Type.GetType(typeName);
            Func<Type> searchForType = () =>
                GetLoadedAssemblies()
                    .SelectMany(x => x.GetTypes())
                    .FirstOrDefault(t => t.Name.Equals(typeName));
            return firstTry ?? searchForType();
        }

        /// <summary>
        /// Gets the list of loaded assemblies
        /// </summary>
        /// <returns>The list of loaded assemblies</returns>
        private static IEnumerable<Assembly> GetLoadedAssemblies()
        {
#if APPDOMAIN
            return AppDomain.CurrentDomain.GetAssemblies();
#elif CORECLR
            var assemblies = new List<Assembly>();
            var dependencies = DependencyContext.Default.RuntimeLibraries;
            foreach (var library in dependencies)
            {
                try
                {
                    var assembly = Assembly.Load(new AssemblyName(library.Name));
                    assemblies.Add(assembly);
                }
                catch
                {
                    //do nothing can't if can't load assembly
                }
            }
            return assemblies;
#else
#warning Method not implemented
            throw new NotImplementedException();
#endif
        }
    }
}


text:
<?php
namespace tests\app\decibel\debug;

use app\decibel\debug\DProfiler;
use app\decibel\test\DTestCase;

/**
 * Test class for DProfiler.
 * Generated by Decibel on 2011-10-31 at 14:09:00.
 */
class DProfilerTest extends DTestCase
{
    /**
     * @covers app\decibel\debug\DProfiler::continueActivity
     */
    public function testContinueActivity()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers {className}::{origMethodName}
     * @todo Implement testStartActivity().
     */
    public function testStartActivity()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers {className}::{origMethodName}
     * @todo Implement testStopActivity().
     */
    public function testStopActivity()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers {className}::{origMethodName}
     * @todo Implement testStop().
     */
    public function testStop()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers {className}::{origMethodName}
     * @todo Implement testTrackCacheAction().
     */
    public function testTrackCacheAction()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers {className}::{origMethodName}
     * @todo Implement testTrackQuery().
     */
    public function testTrackQuery()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers {className}::{origMethodName}
     * @todo Implement testTrackMemoryCacheAction().
     */
    public function testTrackMemoryCacheAction()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers {className}::{origMethodName}
     * @todo Implement testTrackObjectLoad().
     */
    public function testTrackObjectLoad()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers {className}::{origMethodName}
     * @todo Implement testGetActivityDetails().
     */
    public function testGetActivityDetails()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers {className}::{origMethodName}
     * @todo Implement testGetQueryDetails().
     */
    public function testGetQueryDetails()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers {className}::{origMethodName}
     * @todo Implement testGetQueryExecutionTime().
     */
    public function testGetQueryExecutionTime()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers {className}::{origMethodName}
     * @todo Implement testReport().
     */
    public function testReport()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers {className}::{origMethodName}
     * @todo Implement testGenerateReport().
     */
    public function testGenerateReport()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers {className}::{origMethodName}
     * @todo Implement testCleanDatabase().
     */
    public function testCleanDatabase()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }
}


text:
package mud.objects;

/**
 * Exit Types include Door, Portal, and Standard and work as follows:
 *
 * Door - any kind of door, such as a shaped piece of wood, metal, or some other material that
 * is used to block an entrance, usually into an enclosed space like a building or cave. May also
 * apply to extradimensional doors if they are not portals
 *
 * Portal - magical "portals" of the one or two way varieties that lead to other places on the same
 * plane or other planes, dimensions, etc
 *
 * Standard - the representation of a "virtual" exit such as may exist between to game areas, and
 * may have no physical representation of any kind (i.e. kind of like the border between two countries,
 * which exists, but rarely has a physical presence.
 *
 * Window - represents any opening that generally permits entrance/exit from a -building- but
 * which isn't a door.
 */
public enum ExitType {
	DOOR("DOOR"),     // 0
	PORTAL("PORTAL"), // 1
	STD("STD"),       // 2
	WINDOW("WINDOW"); // 3

	private String name;

	ExitType(String name) {
		this.name = name;
	}

	public String getName() {
		return this.name;
	}
}


text:
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

// This was extracted from https://github.com/microsoft/cpprestsdk/blob/cdae258bfb22f948c7b768b4dc56f5f4a2d9b2ce/Release/src/utilities/asyncrt_utils.cpp#L305

#include <string>
#include <stdexcept>

typedef std::basic_string<uint16_t> utf16string;

#define LOW_3BITS 0x7
#define LOW_4BITS 0xF
#define LOW_5BITS 0x1F
#define LOW_6BITS 0x3F
#define BIT4 0x8
#define BIT5 0x10
#define BIT6 0x20
#define BIT7 0x40
#define BIT8 0x80
#define L_SURROGATE_START 0xDC00
#define L_SURROGATE_END 0xDFFF
#define H_SURROGATE_START 0xD800
#define H_SURROGATE_END 0xDBFF
#define SURROGATE_PAIR_START 0x10000

// Create a dedicated type for characters to avoid the issue
// of different platforms defaulting char to be either signed
// or unsigned.
using UtilCharInternal_t = signed char;

inline size_t count_utf8_to_utf16(const std::string& s)
{
  const size_t sSize = s.size();
  auto const sData = reinterpret_cast<const UtilCharInternal_t*>(s.data());
  size_t result {sSize};

  for (size_t index = 0; index < sSize;)
  {
    if (sData[index] >= 0)
    {
      // use fast inner loop to skip single byte code points (which are
      // expected to be the most frequent)
      while ((++index < sSize) && (sData[index] >= 0))
        ;

      if (index >= sSize) break;
    }

    // start special handling for multi-byte code points
    const UtilCharInternal_t c {sData[index++]};

    if ((c & BIT7) == 0)
    {
      throw std::range_error("UTF-8 string character can never start with 10xxxxxx");
    }
    else if ((c & BIT6) == 0) // 2 byte character, 0x80 to 0x7FF
    {
      if (index == sSize)
      {
        throw std::range_error("UTF-8 string is missing bytes in character");
      }

      const UtilCharInternal_t c2 {sData[index++]};
      if ((c2 & 0xC0) != BIT8)
      {
        throw std::range_error("UTF-8 continuation byte is missing leading bit mask");
      }

      // can't require surrogates for 7FF
      --result;
    }
    else if ((c & BIT5) == 0) // 3 byte character, 0x800 to 0xFFFF
    {
      if (sSize - index < 2)
      {
        throw std::range_error("UTF-8 string is missing bytes in character");
      }

      const UtilCharInternal_t c2 {sData[index++]};
      const UtilCharInternal_t c3 {sData[index++]};
      if (((c2 | c3) & 0xC0) != BIT8)
      {
        throw std::range_error("UTF-8 continuation byte is missing leading bit mask");
      }

      result -= 2;
    }
    else if ((c & BIT4) == 0) // 4 byte character, 0x10000 to 0x10FFFF
    {
      if (sSize - index < 3)
      {
        throw std::range_error("UTF-8 string is missing bytes in character");
      }

      const UtilCharInternal_t c2 {sData[index++]};
      const UtilCharInternal_t c3 {sData[index++]};
      const UtilCharInternal_t c4 {sData[index++]};
      if (((c2 | c3 | c4) & 0xC0) != BIT8)
      {
        throw std::range_error("UTF-8 continuation byte is missing leading bit mask");
      }

      const uint32_t codePoint =
          ((c & LOW_3BITS) << 18) | ((c2 & LOW_6BITS) << 12) | ((c3 & LOW_6BITS) << 6) | (c4 & LOW_6BITS);
      result -= (3 - (codePoint >= SURROGATE_PAIR_START));
    }
    else
    {
      throw std::range_error("UTF-8 string has invalid Unicode code point");
    }
  }

  return result;
}

utf16string /*__cdecl conversions::*/utf8_to_utf16(const std::string& s)
{
  // Save repeated heap allocations, use the length of resulting sequence.
  const size_t srcSize = s.size();
  auto const srcData = reinterpret_cast<const UtilCharInternal_t*>(s.data());
  utf16string dest(count_utf8_to_utf16(s), L'\0');
  utf16string::value_type* const destData = &dest[0];
  size_t destIndex = 0;

  for (size_t index = 0; index < srcSize; ++index)
  {
    UtilCharInternal_t src = srcData[index];
    switch (src & 0xF0)
    {
      case 0xF0: // 4 byte character, 0x10000 to 0x10FFFF
      {
        const UtilCharInternal_t c2 {srcData[++index]};
        const UtilCharInternal_t c3 {srcData[++index]};
        const UtilCharInternal_t c4 {srcData[++index]};
        uint32_t codePoint =
            ((src & LOW_3BITS) << 18) | ((c2 & LOW_6BITS) << 12) | ((c3 & LOW_6BITS) << 6) | (c4 & LOW_6BITS);
        if (codePoint >= SURROGATE_PAIR_START)
        {
          // In UTF-16 U+10000 to U+10FFFF are represented as two 16-bit code units, surrogate pairs.
          //  - 0x10000 is subtracted from the code point
          //  - high surrogate is 0xD800 added to the top ten bits
          //  - low surrogate is 0xDC00 added to the low ten bits
          codePoint -= SURROGATE_PAIR_START;
          destData[destIndex++] = static_cast<utf16string::value_type>((codePoint >> 10) | H_SURROGATE_START);
          destData[destIndex++] =
              static_cast<utf16string::value_type>((codePoint & 0x3FF) | L_SURROGATE_START);
        }
        else
        {
          // In UTF-16 U+0000 to U+D7FF and U+E000 to U+FFFF are represented exactly as the Unicode code point
          // value. U+D800 to U+DFFF are not valid characters, for simplicity we assume they are not present
          // but will encode them if encountered.
          destData[destIndex++] = static_cast<utf16string::value_type>(codePoint);
        }
      }
        break;
      case 0xE0: // 3 byte character, 0x800 to 0xFFFF
      {
        const UtilCharInternal_t c2 {srcData[++index]};
        const UtilCharInternal_t c3 {srcData[++index]};
        destData[destIndex++] = static_cast<utf16string::value_type>(
            ((src & LOW_4BITS) << 12) | ((c2 & LOW_6BITS) << 6) | (c3 & LOW_6BITS));
      }
        break;
      case 0xD0: // 2 byte character, 0x80 to 0x7FF
      case 0xC0:
      {
        const UtilCharInternal_t c2 {srcData[++index]};
        destData[destIndex++] =
            static_cast<utf16string::value_type>(((src & LOW_5BITS) << 6) | (c2 & LOW_6BITS));
      }
        break;
      default: // single byte character, 0x0 to 0x7F
        // try to use a fast inner loop for following single byte characters,
        // since they are quite probable
        do
        {
          destData[destIndex++] = static_cast<utf16string::value_type>(srcData[index++]);
        } while (index < srcSize && srcData[index] > 0);
        // adjust index since it will be incremented by the for loop
        --index;
    }
  }
  return dest;
}

inline size_t count_utf16_to_utf8(const utf16string& w)
{
  const utf16string::value_type* const srcData = &w[0];
  const size_t srcSize = w.size();
  size_t destSize(srcSize);
  for (size_t index = 0; index < srcSize; ++index)
  {
    const utf16string::value_type ch(srcData[index]);
    if (ch <= 0x7FF)
    {
      if (ch > 0x7F) // 2 bytes needed (11 bits used)
      {
        ++destSize;
      }
    }
      // Check for high surrogate.
    else if (ch >= H_SURROGATE_START && ch <= H_SURROGATE_END) // 4 bytes needed (21 bits used)
    {
      ++index;
      if (index == srcSize)
      {
        throw std::range_error("UTF-16 string is missing low surrogate");
      }

      const auto lowSurrogate = srcData[index];
      if (lowSurrogate < L_SURROGATE_START || lowSurrogate > L_SURROGATE_END)
      {
        throw std::range_error("UTF-16 string has invalid low surrogate");
      }

      destSize += 2;
    }
    else // 3 bytes needed (16 bits used)
    {
      destSize += 2;
    }
  }

  return destSize;
}

std::string /*__cdecl conversions::*/utf16_to_utf8(const utf16string& w)
{
  const size_t srcSize = w.size();
  const utf16string::value_type* const srcData = &w[0];
  std::string dest(count_utf16_to_utf8(w), '\0');
  std::string::value_type* const destData = &dest[0];
  size_t destIndex(0);

  for (size_t index = 0; index < srcSize; ++index)
  {
    const utf16string::value_type src = srcData[index];
    if (src <= 0x7FF)
    {
      if (src <= 0x7F) // single byte character
      {
        destData[destIndex++] = static_cast<char>(src);
      }
      else // 2 bytes needed (11 bits used)
      {
        destData[destIndex++] = static_cast<char>(char((src >> 6) | 0xC0));        // leading 5 bits
        destData[destIndex++] = static_cast<char>(char((src & LOW_6BITS) | BIT8)); // trailing 6 bits
      }
    }
      // Check for high surrogate.
    else if (src >= H_SURROGATE_START && src <= H_SURROGATE_END)
    {
      const auto highSurrogate = src;
      const auto lowSurrogate = srcData[++index];

      // To get from surrogate pair to Unicode code point:
      // - subtract 0xD800 from high surrogate, this forms top ten bits
      // - subtract 0xDC00 from low surrogate, this forms low ten bits
      // - add 0x10000
      // Leaves a code point in U+10000 to U+10FFFF range.
      uint32_t codePoint = highSurrogate - H_SURROGATE_START;
      codePoint <<= 10;
      codePoint |= lowSurrogate - L_SURROGATE_START;
      codePoint += SURROGATE_PAIR_START;

      // 4 bytes needed (21 bits used)
      destData[destIndex++] = static_cast<char>((codePoint >> 18) | 0xF0);               // leading 3 bits
      destData[destIndex++] = static_cast<char>(((codePoint >> 12) & LOW_6BITS) | BIT8); // next 6 bits
      destData[destIndex++] = static_cast<char>(((codePoint >> 6) & LOW_6BITS) | BIT8);  // next 6 bits
      destData[destIndex++] = static_cast<char>((codePoint & LOW_6BITS) | BIT8);         // trailing 6 bits
    }
    else // 3 bytes needed (16 bits used)
    {
      destData[destIndex++] = static_cast<char>((src >> 12) | 0xE0);              // leading 4 bits
      destData[destIndex++] = static_cast<char>(((src >> 6) & LOW_6BITS) | BIT8); // middle 6 bits
      destData[destIndex++] = static_cast<char>((src & LOW_6BITS) | BIT8);        // trailing 6 bits
    }
  }

  return dest;
}


text:
import codecs
import json

import networkx as nx
from networkx.readwrite import json_graph

class NetworkxJson:
  def __init__(self, graph):
    self.graph = graph

  def nx_export(self, export_type, output_file):
    data = getattr(json_graph, "%s_data" % export_type)(self.graph)

    target = codecs.open(output_file, "w", "utf-8")
    json.dump(data,target, sort_keys=True, indent=2, ensure_ascii=False)
    print "export node-link: %s" % output_file


text:
import { fireEvent, getByTestId as getByTestIdDefault } from '@testing-library/dom';
import { act } from '@testing-library/react';
import loudRejection from 'loud-rejection';

import { MIME_TYPES } from '@proton/shared/lib/constants';

import { releaseCryptoProxy, setupCryptoProxyForTesting } from '../../../helpers/test/crypto';
import {
    addApiKeys,
    addApiMock,
    addKeysToAddressKeysCache,
    clearAll,
    generateKeys,
    getDropdown,
    render,
    setFeatureFlags,
    tick,
} from '../../../helpers/test/helper';
import Composer from '../Composer';
import { AddressID, ID, fromAddress, prepareMessage, props, toAddress } from './Composer.test.helpers';

loudRejection();

const password = 'password';

describe('Composer outside encryption', () => {
    beforeAll(async () => {
        await setupCryptoProxyForTesting();
    });

    afterAll(async () => {
        await releaseCryptoProxy();
    });

    afterEach(clearAll);

    const setup = async () => {
        setFeatureFlags('EORedesign', true);

        addApiMock(`mail/v4/messages/${ID}`, () => ({ Message: {} }), 'put');

        const fromKeys = await generateKeys('me', fromAddress);
        addKeysToAddressKeysCache(AddressID, fromKeys);
        addApiKeys(false, toAddress, []);

        const result = await render(<Composer {...props} messageID={ID} />);

        return result;
    };

    it('should set outside encryption and display the expiration banner', async () => {
        prepareMessage({
            localID: ID,
            data: { MIMEType: 'text/plain' as MIME_TYPES },
            messageDocument: { plainText: '' },
        });

        const { getByTestId, getByText, container } = await setup();

        const expirationButton = getByTestId('composer:password-button');
        fireEvent.click(expirationButton);
        await tick();

        // modal is displayed and we can set a password
        getByText('Encrypt message');

        const passwordInput = getByTestId('encryption-modal:password-input');
        fireEvent.change(passwordInput, { target: { value: password } });

        const setEncryptionButton = getByTestId('modal-footer:set-button');
        fireEvent.click(setEncryptionButton);

        // The expiration banner is displayed
        getByText(/This message will expire on/);

        // Trigger manual save to avoid unhandledPromiseRejection
        await act(async () => {
            fireEvent.keyDown(container, { key: 'S', ctrlKey: true });
        });
    });

    it('should set outside encryption with a default expiration time', async () => {
        // Message will expire tomorrow
        prepareMessage({
            localID: ID,
            data: { MIMEType: 'text/plain' as MIME_TYPES },
            messageDocument: { plainText: '' },
            draftFlags: {
                expiresIn: 25 * 3600, // expires in 25 hours
            },
        });

        const { getByTestId, getByText } = await setup();

        const expirationButton = getByTestId('composer:password-button');
        fireEvent.click(expirationButton);
        await tick();

        // Modal and expiration date are displayed
        getByText('Edit encryption');
        getByText('Your message will expire tomorrow.');
    });

    it('should be able to edit encryption', async () => {
        prepareMessage({
            localID: ID,
            data: { MIMEType: 'text/plain' as MIME_TYPES },
            messageDocument: { plainText: '' },
        });

        const { getByTestId, getByText, container } = await setup();

        const expirationButton = getByTestId('composer:password-button');
        fireEvent.click(expirationButton);
        await tick();

        // modal is displayed and we can set a password
        getByText('Encrypt message');

        const passwordInput = getByTestId('encryption-modal:password-input');
        fireEvent.change(passwordInput, { target: { value: password } });

        const setEncryptionButton = getByTestId('modal-footer:set-button');
        fireEvent.click(setEncryptionButton);

        // Trigger manual save to avoid unhandledPromiseRejection
        await act(async () => {
            fireEvent.keyDown(container, { key: 'S', ctrlKey: true });
        });

        // Edit encryption
        // Open the encryption dropdown
        const encryptionDropdownButton = getByTestId('composer:encryption-options-button');
        fireEvent.click(encryptionDropdownButton);

        const dropdown = await getDropdown();

        // Click on edit button
        const editEncryptionButton = getByTestIdDefault(dropdown, 'composer:edit-outside-encryption');
        await act(async () => {
            fireEvent.click(editEncryptionButton);
        });

        const passwordInputAfterUpdate = getByTestId('encryption-modal:password-input') as HTMLInputElement;
        const passwordValue = passwordInputAfterUpdate.value;

        expect(passwordValue).toEqual(password);

        // Trigger manual save to avoid unhandledPromiseRejection
        await act(async () => {
            fireEvent.keyDown(container, { key: 'S', ctrlKey: true });
        });
    });

    it('should be able to remove encryption', async () => {
        prepareMessage({
            localID: ID,
            data: { MIMEType: 'text/plain' as MIME_TYPES },
            messageDocument: { plainText: '' },
        });

        const { getByTestId, getByText, queryByText, container } = await setup();

        const expirationButton = getByTestId('composer:password-button');
        fireEvent.click(expirationButton);
        await tick();

        // modal is displayed and we can set a password
        getByText('Encrypt message');

        const passwordInput = getByTestId('encryption-modal:password-input');
        fireEvent.change(passwordInput, { target: { value: password } });

        const setEncryptionButton = getByTestId('modal-footer:set-button');
        fireEvent.click(setEncryptionButton);

        // Edit encryption
        // Open the encryption dropdown
        const encryptionDropdownButton = getByTestId('composer:encryption-options-button');
        fireEvent.click(encryptionDropdownButton);

        const dropdown = await getDropdown();

        // Click on remove button
        const editEncryptionButton = getByTestIdDefault(dropdown, 'composer:remove-outside-encryption');
        await act(async () => {
            fireEvent.click(editEncryptionButton);
        });

        expect(queryByText(/This message will expire on/)).toBe(null);

        // Trigger manual save to avoid unhandledPromiseRejection
        await act(async () => {
            fireEvent.keyDown(container, { key: 'S', ctrlKey: true });
        });
    });
});