text:
<?php

namespace Propel\Generator\Model;

/**
 * A name generation factory.
 *
 * @author Hans Lellelid <hans@xmpl.org> (Propel)
 * @author Daniel Rall <dlr@finemaltcoding.com> (Torque)
 * @author Hugo Hamon <webmaster@apprendre-php.com> (Propel)
 */
class NameFactory
{
    /**
     * The class name of the PHP name generator.
     */
    public const PHP_GENERATOR = '\Propel\Generator\Model\PhpNameGenerator';

    /**
     * The fully qualified class name of the constraint name generator.
     */
    public const CONSTRAINT_GENERATOR = '\Propel\Generator\Model\ConstraintNameGenerator';

    /**
     * The cache of NameGeneratorInterface algorithms in use for
     * name generation, keyed by fully qualified class name.
     *
     * @var \Propel\Generator\Model\NameGeneratorInterface[]
     */
    private static $algorithms = [];

    /**
     * Factory method which retrieves an instance of the named generator.
     *
     * @param string $name The fully qualified class name of the name
     *                     generation algorithm to retrieve.
     *
     * @return \Propel\Generator\Model\NameGeneratorInterface
     */
    protected static function getAlgorithm($name)
    {
        if (!isset(self::$algorithms[$name])) {
            self::$algorithms[$name] = new $name();
        }

        return self::$algorithms[$name];
    }

    /**
     * Given a list of String objects, implements an
     * algorithm which produces a name.
     *
     * @param string $algorithmName The fully qualified class name of the {@link NameGeneratorInterface}
     *                                        implementation to use to generate names.
     * @param string[] $inputs Inputs used to generate a name.
     *
     * @return string The generated name.
     */
    public static function generateName($algorithmName, $inputs)
    {
        $algorithm = self::getAlgorithm($algorithmName);

        return $algorithm->generateName($inputs);
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>cds: cds::intrusive::lazy_list::link_checker< Node > Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

cds
    1.4.0

Main Page

Modules

Namespaces

Data Structures

Files

Data Structures

Class Hierarchy

Data Fields

cds

intrusive

lazy_list

link_checker

Static Public Member Functions

cds::intrusive::lazy_list::link_checker< Node > Struct Template Reference

Check link.
 More...

#include <cds/intrusive/lazy_list_base.h>

Static Public Member Functions

static void 	is_empty (node_type const *pNode)

 	Checks if the link field of node pNode is NULL.  More...

Detailed Description

template<typename Node>

struct cds::intrusive::lazy_list::link_checker< Node >

Check link.

Member Function Documentation

template<typename Node >

          static void cds::intrusive::lazy_list::link_checker< Node >::is_empty
          (
          node_type const *
          pNode	)

inlinestatic

Checks if the link field of node pNode is NULL.

An asserting is generated if pNode link field is not NULL

The documentation for this struct was generated from the following file:

cds/intrusive/lazy_list_base.h

			cds 1.4.0
			Developed by Maxim Khiszinsky aka khizmax 2007 - 2012

			Autogenerated Mon May 20 2013 00:38:00 by Doxygen 1.8.3.1

redpajama_set_name: RedPajamaGithub


text:
using NUnit.Framework;
using osu.Framework.Lists;
using osu.Game.Rulesets.Timing;
using osu.Game.Rulesets.UI.Scrolling.Algorithms;

namespace osu.Game.Tests.ScrollAlgorithms
{
    [TestFixture]
    public class SequentialScrollTest
    {
        private IScrollAlgorithm algorithm;

        [SetUp]
        public void Setup()
        {
            var controlPoints = new SortedList<MultiplierControlPoint>
            {
                new MultiplierControlPoint(0) { Velocity = 1 },
                new MultiplierControlPoint(10000) { Velocity = 2f },
                new MultiplierControlPoint(20000) { Velocity = 0.5f }
            };

            algorithm = new SequentialScrollAlgorithm(controlPoints);
        }

        [Test]
        public void TestDisplayStartTime()
        {
            // easy cases - time range adjusted for velocity fits within control point duration
            Assert.AreEqual(2500, algorithm.GetDisplayStartTime(5000, 0, 2500, 1)); // 5000 - (2500 / 1)
            Assert.AreEqual(13750, algorithm.GetDisplayStartTime(15000, 0, 2500, 1)); // 15000 - (2500 / 2)
            Assert.AreEqual(20000, algorithm.GetDisplayStartTime(25000, 0, 2500, 1)); // 25000 - (2500 / 0.5)

            // hard case - time range adjusted for velocity exceeds control point duration

            // 1st multiplier point takes 10000 / 2500 = 4 scroll lengths
            // 2nd multiplier point takes 10000 / (2500 / 2) = 8 scroll lengths
            // 3rd multiplier point takes 2500 / (2500 * 2) = 0.5 scroll lengths up to hitobject start

            // absolute position of the hitobject = 1000 * (4 + 8 + 0.5) = 12500
            // minus one scroll length allowance = 12500 - 1000 = 11500 = 11.5 [scroll lengths]
            // therefore the start time lies within the second multiplier point (because 11.5 < 4 + 8)
            // its exact time position is = 10000 + 7.5 * (2500 / 2) = 19375
            Assert.AreEqual(19375, algorithm.GetDisplayStartTime(22500, 0, 2500, 1000));
        }

        [Test]
        public void TestLength()
        {
            Assert.AreEqual(1f / 5, algorithm.GetLength(0, 1000, 5000, 1)); // Like constant
            Assert.AreEqual(1f / 5, algorithm.GetLength(10000, 10500, 5000, 1)); // (10500 - 10000) / 0.5 / 5000
            Assert.AreEqual(1f / 5, algorithm.GetLength(20000, 22000, 5000, 1)); // (22000 - 20000) * 0.5 / 5000
        }

        [Test]
        public void TestPosition()
        {
            // Basically same calculations as TestLength()
            Assert.AreEqual(1f / 5, algorithm.PositionAt(1000, 0, 5000, 1));
            Assert.AreEqual(1f / 5, algorithm.PositionAt(10500, 10000, 5000, 1));
            Assert.AreEqual(1f / 5, algorithm.PositionAt(22000, 20000, 5000, 1));
        }

        [TestCase(1000)]
        [TestCase(10000)]
        [TestCase(15000)]
        [TestCase(20000)]
        [TestCase(25000)]
        public void TestTime(double time)
        {
            Assert.AreEqual(time, algorithm.TimeAt(algorithm.PositionAt(time, 0, 5000, 1), 0, 5000, 1), 0.001);
            Assert.AreEqual(time, algorithm.TimeAt(algorithm.PositionAt(time, 5000, 5000, 1), 5000, 5000, 1), 0.001);
        }
    }
}


text:
package com.mateuszkoslacz.moviper.base.view.fragment.autoinject.passive.butterknife;

import android.view.View;

import com.hannesdorfmann.mosby.mvp.lce.MvpLceView;
import com.mateuszkoslacz.moviper.base.view.fragment.autoinject.passive.ViperLceAiPassiveFragment;
import com.mateuszkoslacz.moviper.iface.view.ViperLceView;

import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * Created by mateuszkoslacz on 14.12.2016.
 */

public abstract class ViperButterKnifeLcePassiveFragment
        <ContentView extends View,
                Model,
                ViewType extends MvpLceView<Model>>
        extends ViperLceAiPassiveFragment<ContentView, Model, ViewType>
        implements ViperLceView<Model> {

    private Unbinder unbinder;

    @Override
    protected void injectViews(View view) {
        super.injectViews(view);
        unbinder = ButterKnife.bind(this, view);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }
}


text:
var cluster = require('cluster');

module.exports = function (rootDir, config) {
    var App = cluster.isMaster ? require('./master_app.js') : require('./worker_app.js');
    return new App(rootDir, config);
}


text:
<?php
namespace Wave\StorageLayer;

use Wave\Scope;

use Wave\Base\FileSystem\IFileAccess;
use Wave\Base\FileSystem\IJsonFileAccess;
use Wave\Base\StorageLayer\IServers;

use Wave\Objects\Server;

class Servers implements IServers
{
	/** @var IJsonFileAccess */
	private $access;

	/**
	 * @param IFileAccess $access
	 * @return static
	 */
	public function setFileAccess(IFileAccess $access)
	{
		$this->access = Scope::skeleton(IJsonFileAccess::class);
		$this->access->useFileAccess($access);
		return $this;
	}

	/**
	 * @return Server[]
	 */
	public function load()
	{
		$data = $this->access->readAll(true);
		$servers = [];

		if (!$data) return [];

		foreach ($data as $serverData)
		{
			$server = new Server();
			$server->fromArray($serverData);
			$servers[] = $server;
		}

		return $servers;
	}

	/**
	 * @param Server[] $servers
	 */
	public function save(array $servers)
	{
		$data = [];

		foreach ($servers as $server)
		{
			$data[] = $server->toArray();
		}

		$this->access->writeAll($data);
	}
}


text:
                  <form [formGroup]="addForm" (ngSubmit)="addAccount()" class="box textBox">
                  <input type="text" placeholder="Add Account" formControlName="Account_no" class="form-control no-border no-bg box-shadow-z0 addproductliststyle textinput" />
                  </form>

                  <form [formGroup]="addForm" (ngSubmit)="updateAccount()" class="box">
                  <input type="text" [value]="selectedAccount.Account_no" placeholder="Add Account" formControlName="Account_no" class="form-control no-border no-bg box-shadow-z0 addproductinput" />
                  </form>

                           {{data.Account_no}}


text:
<?php

namespace PhalconRest\Mvc\Rest\Engine;

use Exception;
use Phalcon\DiInterface;
use Phalcon\Mvc\View\Engine\Php;
use Phalcon\Mvc\ViewInterface;

class Json extends Php
{

    /** @var int Default: JSON_UNESCAPED_UNICODE | JSON_BIGINT_AS_STRING */
    protected $json_encode_options;

    /** @var string */
    protected $callback_param_name = 'callback';

    /** @var string */
    protected $json_content_type = 'application/json';

    /** @var string */
    protected $jsonp_content_type = 'application/javascript';

    public function __construct(\Phalcon\Mvc\ViewBaseInterface $view, DiInterface $dependencyInjector = null)
    {
        $this->_view = $view;
        $this->setDI($dependencyInjector);
        $this->_view->envelope = new \PhalconRest\Http\Envelope\Json();
        $this->json_encode_options = JSON_UNESCAPED_UNICODE | JSON_BIGINT_AS_STRING;
    }

    /**
     * @param string $path
     * @param array  $params
     * @param bool   $mustClean
     * @throws Exception
     */
    public function render($path, $params, $mustClean = null)
    {
        $responser = require $path;
        if (!is_callable($responser, true)) {
            throw new Exception("Responser in '$path' is not callable");
        }

        $data = $responser($params);

        if ($mustClean === false) {
            $this->_view->setData($data);

            return;
        }

        if (!$this->_view->envelope->isDisabled()) {
            $data = $this->_view->envelope->setData($data)->make();
        }

        $content = json_encode($data, $this->json_encode_options);
        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new Exception(json_last_error_msg());
        }

        /** @var \Phalcon\Http\RequestInterface $request */
        $request = $this->getDI()->get('request');

        /** @var \Phalcon\Http\ResponseInterface $response */
        $response = $this->getDI()->get('response');

        if ($request->has($this->callback_param_name)) {
            $callback = $request->get($this->callback_param_name);
            $content = "$callback($content);";
			$content_type = $this->jsonp_content_type;
        } else {
			$content_type = $this->json_content_type;
        }

        $response->setHeader('Content-Type', $content_type);
        $this->_view->setContent($content);
    }

    /**
     * @return mixed
     */
    public function getJsonEncodeOptions()
    {
        return $this->json_encode_options;
    }

    /**
     * @param mixed $json_encode_options
     * @return $this
     */
    public function setJsonEncodeOptions($json_encode_options)
    {
        $this->json_encode_options = $json_encode_options;

        return $this;
    }

    /**
     * @return string
     */
    public function getJsonContentType()
    {
        return $this->json_content_type;
    }

    /**
     * @param string $json_content_type
     * @return $this
     */
    public function setJsonContentType($json_content_type)
    {
        $this->json_content_type = $json_content_type;

        return $this;
    }

    /**
     * @return string
     */
    public function getJsonpContentType()
    {
        return $this->jsonp_content_type;
    }

    /**
     * @param string $jsonp_content_type
     * @return $this
     */
    public function setJsonpContentType($jsonp_content_type)
    {
        $this->jsonp_content_type = $jsonp_content_type;

        return $this;
    }

    /**
     * @return string
     */
    public function getCallbackParamName()
    {
        return $this->callback_param_name;
    }

    /**
     * @param string $callback_param_name
     * @return $this
     */
    public function setCallbackParamName($callback_param_name)
    {
        $this->callback_param_name = $callback_param_name;

        return $this;
    }
}


text:
"""Functionality to check for the availability and version of dependencies.

This file is generated by l2tdevtools update-dependencies.py, any dependency
related changes should be made in dependencies.ini.
"""

from __future__ import print_function
from __future__ import unicode_literals

import re

# Dictionary that contains version tuples per module name.
#
# A version tuple consists of:
# (version_attribute_name, minimum_version, maximum_version, is_required)
#
# Where version_attribute_name is either a name of an attribute,
# property or method.
PYTHON_DEPENDENCIES = {
    'artifacts': ('__version__', '20190305', None, True),
    'bencode': ('', '', None, True),
    'certifi': ('__version__', '2016.9.26', None, True),
    'chardet': ('__version__', '2.0.1', None, True),
    'cryptography': ('__version__', '2.0.2', None, True),
    'dateutil': ('__version__', '1.5', None, True),
    'defusedxml': ('__version__', '0.5.0', None, True),
    'dfdatetime': ('__version__', '20200824', None, True),
    'dfvfs': ('__version__', '20201114', None, True),
    'dfwinreg': ('__version__', '20201002', None, True),
    'dtfabric': ('__version__', '20200621', None, True),
    'elasticsearch': ('__versionstr__', '6.0', None, False),
    'future': ('__version__', '0.16.0', None, True),
    'idna': ('__version__', '2.5', None, True),
    'lz4': ('__version__', '0.10.0', None, True),
    'pefile': ('__version__', '2018.8.8', None, True),
    'psutil': ('__version__', '5.4.3', None, True),
    'pybde': ('get_version()', '20140531', None, True),
    'pycreg': ('get_version()', '20200725', None, True),
    'pyesedb': ('get_version()', '20150409', None, True),
    'pyevt': ('get_version()', '20191104', None, True),
    'pyevtx': ('get_version()', '20141112', None, True),
    'pyewf': ('get_version()', '20131210', None, True),
    'pyfsapfs': ('get_version()', '20201107', None, True),
    'pyfsext': ('get_version()', '20200819', None, True),
    'pyfshfs': ('get_version()', '20201103', None, True),
    'pyfsntfs': ('get_version()', '20200805', None, True),
    'pyfsxfs': ('get_version()', '20201114', None, True),
    'pyfvde': ('get_version()', '20160719', None, True),
    'pyfwnt': ('get_version()', '20180117', None, True),
    'pyfwsi': ('get_version()', '20150606', None, True),
    'pylnk': ('get_version()', '20150830', None, True),
    'pyluksde': ('get_version()', '20200101', None, True),
    'pymsiecf': ('get_version()', '20150314', None, True),
    'pyolecf': ('get_version()', '20151223', None, True),
    'pyparsing': ('__version__', '2.3.0', '3.0.0', True),
    'pyqcow': ('get_version()', '20131204', None, True),
    'pyregf': ('get_version()', '20201002', None, True),
    'pyscca': ('get_version()', '20190605', None, True),
    'pysigscan': ('get_version()', '20190629', None, True),
    'pysmdev': ('get_version()', '20140529', None, True),
    'pysmraw': ('get_version()', '20140612', None, True),
    'pytsk3': ('get_version()', '20160721', None, True),
    'pytz': ('__version__', '', None, True),
    'pyvhdi': ('get_version()', '20131210', None, True),
    'pyvmdk': ('get_version()', '20140421', None, True),
    'pyvshadow': ('get_version()', '20160109', None, True),
    'pyvslvm': ('get_version()', '20160109', None, True),
    'redis': ('__version__', '3.4', None, True),
    'requests': ('__version__', '2.18.0', None, True),
    'six': ('__version__', '1.1.0', None, True),
    'urllib3': ('__version__', '1.21.1', None, True),
    'xlsxwriter': ('__version__', '0.9.3', None, True),
    'yaml': ('__version__', '3.10', None, True),
    'yara': ('YARA_VERSION', '3.4.0', None, True),
    'zmq': ('__version__', '2.1.11', None, True)}

_VERSION_SPLIT_REGEX = re.compile(r'\.|\-')

def _CheckPythonModule(
    module_name, version_attribute_name, minimum_version,
    is_required=True, maximum_version=None, verbose_output=True):
  """Checks the availability of a Python module.

  Args:
    module_name (str): name of the module.
    version_attribute_name (str): name of the attribute that contains
       the module version or method to retrieve the module version.
    minimum_version (str): minimum required version.
    is_required (Optional[bool]): True if the Python module is a required
        dependency.
    maximum_version (Optional[str]): maximum required version. Should only be
        used if there is a later version that is not supported.
    verbose_output (Optional[bool]): True if output should be verbose.

  Returns:
    bool: True if the Python module is available and conforms to
        the minimum required version, False otherwise.
  """
  module_object = _ImportPythonModule(module_name)
  if not module_object:
    if not is_required:
      print('[OPTIONAL]\tmissing: {0:s}.'.format(module_name))
      return True

    print('[FAILURE]\tmissing: {0:s}.'.format(module_name))
    return False

  if not version_attribute_name or not minimum_version:
    if verbose_output:
      print('[OK]\t\t{0:s}'.format(module_name))
    return True

  module_version = None
  if not version_attribute_name.endswith('()'):
    module_version = getattr(module_object, version_attribute_name, None)
  else:
    version_method = getattr(module_object, version_attribute_name[:-2], None)
    if version_method:
      module_version = version_method()

  if not module_version:
    if not is_required:
      print((
          '[OPTIONAL]\tunable to determine version information '
          'for: {0:s}').format(module_name))
      return True

    print((
        '[FAILURE]\tunable to determine version information '
        'for: {0:s}').format(module_name))
    return False

  # Make sure the module version is a string.
  module_version = '{0!s}'.format(module_version)

  # Remove a version suffix, such as: 0.7.0~rc1
  module_version_list = _VERSION_SPLIT_REGEX.split(module_version)

  try:
    int(module_version_list[-1], 10)
  except (TypeError, ValueError):
    module_version_list.pop()

  # Split the version string and convert every digit into an integer.
  # A string compare of both version strings will yield an incorrect result.
  module_version_map = list(map(int, module_version_list))
  minimum_version_map = list(
      map(int, _VERSION_SPLIT_REGEX.split(minimum_version)))

  if module_version_map < minimum_version_map:
    if not is_required:
      print((
          '[OPTIONAL]\t{0:s} version: {1!s} is too old, {2!s} or later '
          'required.').format(module_name, module_version, minimum_version))
      return True

    print((
        '[FAILURE]\t{0:s} version: {1!s} is too old, {2!s} or later '
        'required.').format(module_name, module_version, minimum_version))
    return False

  if maximum_version:
    maximum_version_map = list(
        map(int, _VERSION_SPLIT_REGEX.split(maximum_version)))
    if module_version_map > maximum_version_map:
      if not is_required:
        print((
            '[OPTIONAL]\t{0:s} version: {1!s} is too recent, {2!s} or earlier '
            'required.').format(module_name, module_version, minimum_version))
        return True

      print((
          '[FAILURE]\t{0:s} version: {1!s} is too recent, {2!s} or earlier '
          'required.').format(module_name, module_version, maximum_version))
      return False

  if verbose_output:
    print('[OK]\t\t{0:s} version: {1!s}'.format(module_name, module_version))

  return True

def _ImportPythonModule(module_name):
  """Imports a Python module.

  Args:
    module_name (str): name of the module.

  Returns:
    module: Python module or None if the module cannot be imported.
  """
  try:
    module_object = list(map(__import__, [module_name]))[0]
  except ImportError:
    return None

  # If the module name contains dots get the upper most module object.
  if '.' in module_name:
    for submodule_name in module_name.split('.')[1:]:
      module_object = getattr(module_object, submodule_name, None)

  return module_object

def CheckDependencies(verbose_output=True):
  """Checks the availability of the dependencies.

  Args:
    verbose_output (Optional[bool]): True if output should be verbose.

  Returns:
    bool: True if the dependencies are available, False otherwise.
  """
  print('Checking availability and versions of dependencies.')
  check_result = True

  for module_name, version_tuple in sorted(PYTHON_DEPENDENCIES.items()):
    if not _CheckPythonModule(
        module_name, version_tuple[0], version_tuple[1],
        is_required=version_tuple[3], maximum_version=version_tuple[2],
        verbose_output=verbose_output):
      check_result = False

  if check_result and not verbose_output:
    print('[OK]')

  print('')
  return check_result


text:
$(function() {

	var App = {

		init: function() {
			this.bindForm();
		},

		bindForm: function() {
			$('.search_form').on('submit', 'form', function(e){
				e.preventDefault()
				$('p.error').remove();
				$('div.song_list').remove();

				var emptyFields = $('input', this).filter(function() { return $.trim(this.value).length === 0;}).length;
				if ( emptyFields === 3 ) {
					$(this).append("
Please fill in at least one field.
");
				}
				else {
					var search =
					$.ajax({
						url: "/search",
						type: "GET",
						data: $(this).serialize()
					});

					search.done( function(response){
						$('.search').append("

Song List
"+response+"
");
					});
				}
			});
		}
	}

	App.init();
});


text:
require 'ffi'
require 'ffi-compiler/loader'

module Argon2
  # Direct external bindings. Call these methods via the Engine class to ensure points are dealt with
  module Ext
    extend FFI::Library
    ffi_lib FFI::Compiler::Loader.find('argon2_wrap')

    # int argon2i_hash_raw(const uint32_t t_cost, const uint32_t m_cost,
    #   const uint32_t parallelism, const void *pwd,
    #   const size_t pwdlen, const void *salt,
    #   const size_t saltlen, void *hash, const size_t hashlen);

    attach_function :argon2i_hash_raw, [
      :uint, :uint, :uint, :pointer,
      :size_t, :pointer, :size_t, :pointer, :size_t], :int, :blocking => true

    # void argon2_wrap(uint8_t *out, char *pwd, size_it pwdlen,
    # uint8_t *salt, uint32_t t_cost,
    #    uint32_t m_cost, uint32_t lanes,
    #    uint8_t *secret, uint32_t secretlen)
    attach_function :argon2_wrap, [
      :pointer, :pointer, :size_t, :pointer, :uint,
      :uint, :uint, :pointer, :size_t], :uint, :blocking => true

    # int argon2i_verify(const char *encoded, const void *pwd,
    # const size_t pwdlen);
    attach_function :wrap_argon2_verify, [:pointer, :pointer, :size_t,
      :pointer, :size_t], :int, :blocking => true
  end

  # The engine class shields users from the FFI interface.
  # It is generally not advised to directly use this class.
  class Engine
    def self.hash_argon2i(password, salt, t_cost, m_cost)
      result = ''
      FFI::MemoryPointer.new(:char, Constants::OUT_LEN) do |buffer|
        ret = Ext.argon2i_hash_raw(t_cost, 1 << m_cost, 1, password,
           password.length, salt, salt.length,
            buffer, Constants::OUT_LEN)
        raise ArgonHashFail, ERRORS[ret.abs] unless ret == 0
        result = buffer.read_string(Constants::OUT_LEN)
      end
      result.unpack('H*').join
    end

    def self.hash_argon2i_encode(password, salt, t_cost, m_cost, secret)
      result = ''
      secretlen = secret.nil? ? 0 : secret.bytesize
      passwordlen = password.nil? ? 0 : password.bytesize
      if salt.length != Constants::SALT_LEN
        raise ArgonHashFail, "Invalid salt size"
      end
      FFI::MemoryPointer.new(:char, Constants::ENCODE_LEN) do |buffer|
        ret = Ext.argon2_wrap(buffer, password, passwordlen,
            salt, t_cost, (1 << m_cost),
            1, secret, secretlen)
        raise ArgonHashFail, ERRORS[ret.abs] unless ret == 0
        result = buffer.read_string(Constants::ENCODE_LEN)
      end
      result.delete "\0"
    end

    def self.argon2i_verify(pwd, hash, secret)
      secretlen = secret.nil? ? 0 : secret.bytesize
      passwordlen = pwd.nil? ? 0 : pwd.bytesize

      ret = Ext.wrap_argon2_verify(hash, pwd, passwordlen, secret, secretlen)
      return false if ERRORS[ret.abs] == 'ARGON2_DECODING_FAIL'
      raise ArgonHashFail, ERRORS[ret.abs] unless ret == 0
      true
    end
  end
end


text:
require 'puma/events'
require_relative "helper"

class TestEvents < Minitest::Test
  def test_register_callback_with_block
    res = false

    events = Puma::Events.new

    events.register(:exec) { res = true }

    events.fire(:exec)

    assert_equal true, res
  end

  def test_register_callback_with_object
    obj = Object.new

    def obj.res
      @res || false
    end

    def obj.call
      @res = true
    end

    events = Puma::Events.new

    events.register(:exec, obj)

    events.fire(:exec)

    assert_equal true, obj.res
  end

  def test_fire_callback_with_multiple_arguments
    res = []

    events = Puma::Events.new

    events.register(:exec) { |*args| res.concat(args) }

    events.fire(:exec, :foo, :bar, :baz)

    assert_equal [:foo, :bar, :baz], res
  end

  def test_on_booted_callback
    res = false

    events = Puma::Events.new

    events.on_booted { res = true }

    events.fire_on_booted!

    assert res
  end
end


text:
app.config(['$stateProvider', function(stateProvider) {

	stateProvider
		.state('app.admin.home', {
			templateUrl: '../templates/admin/home/home.tpl.html',
			controller: 'AdminHomeCtrl'
		})
		.state('app.admin.new-post', {
			url: '/new-post',
			templateUrl: '../templates/admin/posts/post.tpl.html',
			controller: 'NewPostCtrl'
		})
		.state('app.admin.posts', {
			url: '/posts',
			templateUrl: '../templates/admin/posts/list.tpl.html',
			controller: 'AllPostsCtrl'
		})
		.state('app.admin.drafts', {
			url: '/drafts',
			templateUrl: '../templates/admin/posts/list.tpl.html',
			controller: 'DraftPostsCtrl'
		})
		.state('app.admin.music', {
			url: '/music',
			templateUrl: '../templates/admin/music/main.tpl.html',
			controller: 'AdminMusicCtrl'
		})
			.state('app.admin.music.all', {
				url: '/',
				templateUrl: '../templates/admin/music/list.tpl.html',
				controller: 'AdminAllMusicCtrl'
			})
			.state('app.admin.music.playlist', {
				url: '/:playlist_id',
				templateUrl: '../templates/admin/music/list.tpl.html',
				controller: 'AdminPlaylistCtrl'
			})
		.state('app.admin.post', {
			url: '/posts/:post_id',
			templateUrl: '../templates/admin/posts/post.tpl.html',
			controller: 'EditPostCtrl'
		})
		;

}]);


text:
package org.wso2.carbon.apimgt.rest.api.store.v1.mappings;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.apache.commons.io.IOUtils;
import org.wso2.carbon.apimgt.api.APIDefinition;
import org.wso2.carbon.apimgt.api.APIManagementException;
import org.wso2.carbon.apimgt.api.model.Scope;
import org.wso2.carbon.apimgt.impl.APIConstants;
import org.wso2.carbon.apimgt.impl.APIManagerConfiguration;
import org.wso2.carbon.apimgt.impl.definitions.OASParserUtil;
import org.wso2.carbon.apimgt.impl.dto.Environment;
import org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder;
import org.wso2.carbon.apimgt.impl.utils.APIUtil;
import org.wso2.carbon.apimgt.rest.api.common.RestApiCommonUtil;
import org.wso2.carbon.apimgt.rest.api.store.v1.dto.SettingsDTO;
import org.wso2.carbon.apimgt.rest.api.store.v1.dto.SettingsIdentityProviderDTO;
import org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.identity.application.authentication.framework.exception.FrameworkException;
import org.wso2.carbon.identity.application.authentication.framework.util.FrameworkUtils;
import org.wso2.carbon.identity.application.common.model.Property;
import org.wso2.carbon.user.api.RealmConfiguration;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.core.UserStoreManager;
import org.wso2.carbon.user.core.service.RealmService;
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class SettingsMappingUtil {

    private static final Log log = LogFactory.getLog(SettingsMappingUtil.class);

    public SettingsDTO fromSettingstoDTO(Boolean isUserAvailable, Boolean moneatizationEnabled,
                                         boolean recommendationEnabled, boolean anonymousEnabled) throws APIManagementException {
        SettingsDTO settingsDTO = new SettingsDTO();
        settingsDTO.setScopes(GetScopeList());
        settingsDTO.setApplicationSharingEnabled(APIUtil.isMultiGroupAppSharingEnabled());
        settingsDTO.setRecommendationEnabled(recommendationEnabled);
        settingsDTO.setMapExistingAuthApps(APIUtil.isMapExistingAuthAppsEnabled());
        settingsDTO.setMonetizationEnabled(moneatizationEnabled);
        SettingsIdentityProviderDTO identityProviderDTO = new SettingsIdentityProviderDTO();
        identityProviderDTO.setExternal(APIUtil.getIdentityProviderConfig() != null);
        settingsDTO.setIdentityProvider(identityProviderDTO);
        settingsDTO.setIsAnonymousModeEnabled(anonymousEnabled);
        APIManagerConfiguration config = ServiceReferenceHolder.getInstance().
                getAPIManagerConfigurationService().getAPIManagerConfiguration();
        boolean enableChangePassword =
                Boolean.parseBoolean(config.getFirstProperty(APIConstants.ENABLE_CHANGE_PASSWORD));
        settingsDTO.setIsPasswordChangeEnabled(enableChangePassword);

        String username = RestApiCommonUtil.getLoggedInUsername();
        String tenantDomain = MultitenantUtils.getTenantDomain(username);
        int tenantId = APIUtil.getTenantIdFromTenantDomain(tenantDomain);

        String userStorePasswordPattern = null;
        String passwordPolicyPattern = null;
        int passwordPolicyMinLength = -1;
        int passwordPolicyMaxLength = -1;

        try {
            // Get password pattern from the UserStoreManager configuration
            RealmConfiguration realmConfiguration = null;
            RealmService realmService = ServiceReferenceHolder.getInstance().getRealmService();

            if (realmService != null && tenantId != MultitenantConstants.INVALID_TENANT_ID) {
                UserStoreManager userStoreManager = null;
                userStoreManager = (UserStoreManager) realmService.getTenantUserRealm(tenantId).getUserStoreManager();
                realmConfiguration = userStoreManager.getRealmConfiguration();
            }

            if (realmConfiguration != null) {
                String passwordJavaRegEx = realmConfiguration.getUserStoreProperty(APIConstants.PASSWORD_JAVA_REGEX_PROPERTY);
                if (passwordJavaRegEx != null && !passwordJavaRegEx.trim().isEmpty()) {
                    userStorePasswordPattern = passwordJavaRegEx;
                }
            }

            // Get password pattern from the Password policy
            Property passwordPolicyEnabledProperty = FrameworkUtils.getResidentIdpConfiguration(
                    APIConstants.IS_PASSWORD_POLICY_ENABLED_PROPERTY, tenantDomain);
            boolean isPasswordPolicyEnabled = Boolean.parseBoolean(passwordPolicyEnabledProperty.getValue());
            if (isPasswordPolicyEnabled) {
                passwordPolicyPattern =
                        FrameworkUtils.getResidentIdpConfiguration(APIConstants.PASSWORD_POLICY_PATTERN_PROPERTY,
                                tenantDomain).getValue();
                passwordPolicyMinLength = Integer.parseInt(FrameworkUtils.getResidentIdpConfiguration(
                        APIConstants.PASSWORD_POLICY_MIN_LENGTH_PROPERTY, tenantDomain).getValue());
                passwordPolicyMaxLength = Integer.parseInt(FrameworkUtils.getResidentIdpConfiguration(
                        APIConstants.PASSWORD_POLICY_MAX_LENGTH_PROPERTY, tenantDomain).getValue());
            }
        } catch (UserStoreException e) {
            String errorMessage = "Error occurred in getting userRealm for the tenant: " + tenantId;
            throw new APIManagementException(errorMessage, e);
        } catch (FrameworkException e) {
            String errorMessage = "Error occurred in getting Resident Idp Configurations for tenant: " + tenantId;
            throw new APIManagementException(errorMessage, e);
        }
        settingsDTO.setUserStorePasswordPattern(userStorePasswordPattern);
        settingsDTO.setPasswordPolicyPattern(passwordPolicyPattern);
        settingsDTO.setPasswordPolicyMinLength(passwordPolicyMinLength);
        settingsDTO.setPasswordPolicyMaxLength(passwordPolicyMaxLength);

        if (isUserAvailable) {
            settingsDTO.setGrantTypes(APIUtil.getGrantTypes());
            Map<String, Environment> environments = APIUtil.getEnvironments();
            if (environments.isEmpty()) {
                settingsDTO.apiGatewayEndpoint("http://localhost:8280, https://localhost:8243");
            } else {
                for (Map.Entry<String, Environment> entry : environments.entrySet()) {
                    Environment environment = environments.get(entry.getKey());
                    if (environment.isDefault()) {
                        settingsDTO.apiGatewayEndpoint(environment.getApiGatewayEndpoint());
                        break;
                    }
                }
                if (settingsDTO.getApiGatewayEndpoint() == null) {
                    Map.Entry<String, Environment> entry = environments.entrySet().iterator().next();
                    Environment environment = environments.get(entry.getKey());
                    settingsDTO.apiGatewayEndpoint(environment.getApiGatewayEndpoint());
                }
            }
        }
        return settingsDTO;
    }

    private List<String> GetScopeList() throws APIManagementException {
        String definition = null;
        try {
            definition = IOUtils
                    .toString(RestApiUtil.class.getResourceAsStream("/store-api.yaml"), "UTF-8");
        } catch (IOException e) {
            log.error("Error while reading the swagger definition", e);
        }
        APIDefinition oasParser = OASParserUtil.getOASParser(definition);
        Set<Scope> scopeSet = oasParser.getScopes(definition);
        List<String> scopeList = new ArrayList<>();
        for (Scope entry : scopeSet) {
            scopeList.add(entry.getKey());
        }
        return scopeList;
    }
}


text:
namespace FluentNHibernate.Cfg.Db
{
    public class DB2400ConnectionStringBuilder : ConnectionStringBuilder
    {
        string _dataSource;
        string _userID;
        string _password;

        protected internal override string Create()
        {
            var connectionString = base.Create();

            if (!string.IsNullOrEmpty(connectionString))
                return connectionString;

            return string.Format("DataSource={0};UserID={1};Password={2};DataCompression=True;", _dataSource, _userID, _password);
        }

        public DB2400ConnectionStringBuilder Password(string password)
        {
            _password = password;
            IsDirty = true;
            return this;
        }

        public DB2400ConnectionStringBuilder UserID(string userID)
        {
            _userID = userID;
            IsDirty = true;
            return this;
        }

        public DB2400ConnectionStringBuilder DataSource(string datasource)
        {
            _dataSource = datasource;
            IsDirty = true;
            return this;
        }

    }
}


text:
Parallel port library for general IO

Tests:
pariotest is provided to test functionality, at the moment the port number is hardcoded in main.cpp
USAGE: pariotest
All data pins on the port will toggle on/off for 10 seconds

Troubleshooting:
- Errors claiming the port: Check the output of 'cat /proc/sys/dev/parport/parportN/devices/active'. The 'lp' driver specifically cannot share access to the port, and will claim it on boot. Use 'rmmod lp' to let pario claim the port.


text:
title:  inquiere
date:   29/11/2019
---

**inquiere**

Comparte con tu clase de Escuela Sabática, o con tu grupo de estudio de la Biblia, algunas ideas del versículo que has memorizado y del estudio de la Biblia de esta semana, así como cualquier otro dato, observaciones y preguntas.

Plantéate con el resto del grupo las siguientes reflexiones y cómo aplicarlas en la vida real.

`1. ¿Eres una especie de Tobías que tan solo habla, o eres un Nehemías que actúa?`

`2. ¿Cómo deberías enfrentar los ataques personales que se realizan en contra de tu manera de actuar y de trabajar, o de tu carácter?`

`3. ¿Cómo puedes influir en los demás con el fin de que ellos se pongan en acción en favor de Cristo de manera positiva?`

`4. ¿Cómo puede la oración hacer que se fortalezca la valentía de una persona?`

`5. ¿Qué otro personaje de la Biblia fue vilipendiado y estuvo sometido a los efectos de la intriga, al igual que Nehemías?`

`6. ¿Quiénes eran los otros falsos profetas? ¿Qué puedes aprender de ellos?`

`7. ¿En qué circunstancias el temor ha conmovido tu fe?`

`8. ¿En qué circunstancias la reverencia y el santo temor han conmovido tu fe?`

`9. ¿Cómo podemos mantener vigente nuestra fe, de manera especial ante el temor y el asombro?`

`10. ¿Cuál es tu relación con el Espíritu de Profecía?`


text:
#include "ABI43_0_0DebugStringConvertible.h"

#include <folly/Conv.h>
#include <folly/Format.h>

namespace ABI43_0_0facebook {
namespace ABI43_0_0React {

#if ABI43_0_0RN_DEBUG_STRING_CONVERTIBLE

std::string DebugStringConvertible::getDebugChildrenDescription(
    DebugStringConvertibleOptions options) const {
  if (options.depth >= options.maximumDepth) {
    return "";
  }

  options.depth++;

  auto trailing = options.format ? std::string{"\n"} : std::string{""};
  auto childrenString = std::string{""};

  for (auto child : getDebugChildren()) {
    if (!child) {
      continue;
    }

    childrenString += child->getDebugDescription(options) + trailing;
  }

  if (!childrenString.empty() && !trailing.empty()) {
    // Removing trailing fragment.
    childrenString.erase(childrenString.end() - 1);
  }

  return childrenString;
}

std::string DebugStringConvertible::getDebugPropsDescription(
    DebugStringConvertibleOptions options) const {
  if (options.depth >= options.maximumDepth) {
    return "";
  }

  options.depth++;

  auto propsString = std::string{""};

  for (auto prop : getDebugProps()) {
    if (!prop) {
      continue;
    }

    auto name = prop->getDebugName();
    auto value = prop->getDebugValue();
    auto children = prop->getDebugPropsDescription(options);
    auto valueAndChildren =
        value + (children.empty() ? "" : "(" + children + ")");
    propsString +=
        " " + name + (valueAndChildren.empty() ? "" : "=" + valueAndChildren);
  }

  if (!propsString.empty()) {
    // Removing leading space character.
    propsString.erase(propsString.begin());
  }

  return propsString;
}

std::string DebugStringConvertible::getDebugDescription(
    DebugStringConvertibleOptions options) const {
  auto nameString = getDebugName();
  auto valueString = getDebugValue();

  // Convention:
  // If `name` and `value` are empty, `description` is also empty.
  if (nameString.empty() && valueString.empty()) {
    return "";
  }

  // Convention:
  // If `name` is empty and `value` isn't empty, `description` equals `value`.
  if (nameString.empty()) {
    return valueString;
  }

  auto childrenString = getDebugChildrenDescription(options);
  auto propsString = getDebugPropsDescription(options);

  auto leading =
      options.format ? std::string(options.depth * 2, ' ') : std::string{""};
  auto trailing = options.format ? std::string{"\n"} : std::string{""};

  return leading + "<" + nameString +
      (valueString.empty() ? "" : "=" + valueString) +
      (propsString.empty() ? "" : " " + propsString) +
      (childrenString.empty() ? "/>"
                              : ">" + trailing + childrenString + trailing +
               leading + "</" + nameString + ">");
}

std::string DebugStringConvertible::getDebugName() const {
  return "Node";
}

std::string DebugStringConvertible::getDebugValue() const {
  return "";
}

SharedDebugStringConvertibleList DebugStringConvertible::getDebugChildren()
    const {
  return SharedDebugStringConvertibleList();
}

SharedDebugStringConvertibleList DebugStringConvertible::getDebugProps() const {
  return SharedDebugStringConvertibleList();
}

/*
 * `toString`-family implementation.
 */
std::string toString(std::string const &value) {
  return value;
}
std::string toString(int const &value) {
  return folly::to<std::string>(value);
}
std::string toString(bool const &value) {
  return folly::to<std::string>(value);
}
std::string toString(float const &value) {
  return folly::to<std::string>(value);
}
std::string toString(double const &value) {
  return folly::to<std::string>(value);
}
std::string toString(void const *value) {
  if (value == nullptr) {
    return "null";
  }
  return folly::sformat("0x{0:016x}", reinterpret_cast<size_t>(value));
}

#endif

} // namespace ABI43_0_0React
} // namespace ABI43_0_0facebook


text:
<?php

namespace umi\templating\extension\helper\type\head;

/**
 * Список параметров.
 */
abstract class BaseParamCollection
{
    /**
     * @var array $params список скриптов
     */
    protected static $params = [];

    /**
     * Добавляет параметр в конец списка.
     * @param mixed $param параметр
     * @return $this
     */
    protected function appendParam($param)
    {
        static::$params[] = $param;

        return $this;
    }

    /**
     * Добавляет параметр вначала списка.
     * @param mixed $param параметр
     * @return $this
     */
    protected function prependParam($param)
    {
        static::$params = array_merge([$param], static::$params);

        return $this;
    }
}


text:
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include "zymogen.h"

extern void vm_test(void);

void segfault(int signal, siginfo_t* si, void* arg)
{
	/* This is POSIX non-compliant... but whatever */
	printf("caught segfault %p\n", si->si_addr);
	exit(0);
}

int main(int argc, char** argv)
{

	/* Install segmentation fault handler */
	struct sigaction sa;
	memset(&sa, 0, sizeof(struct sigaction));
	sigemptyset(&sa.sa_mask);
	sa.sa_sigaction = segfault;
	sa.sa_flags = SA_SIGINFO;
	if(sigaction(SIGSEGV, &sa, NULL)) {
		fprintf(stderr, "Fatal error - could not install signal handler\n");
		exit(0);
	}

	z_runtime_initialize();
	vm_test();

	struct object* exp;
	for(;;) {
		printf("user> ");
		exp = z_read(stdin);
		exp = z_eval(exp, global);
		printf("====> ");
		z_print_exp(exp);
		printf("\n");
	}

	return 0;

}


text:
"""Keeps track of syndicated feeds (e.g, RSS).

A feed is treated by the recommendation algorithm as a pseudo user that
recommends everything in the feed.
"""

from __future__ import division

from datetime import datetime
from datetime import timedelta
import io
import logging
import time

import feedparser

from google.appengine.api import memcache
from google.appengine.api import urlfetch
from google.appengine.api import urlfetch_errors
from google.appengine.ext import db
from google.appengine.ext import ndb

from recommender import feed_util
from recommender import items
from recommender import url_util
from protos import cache_pb2

# 0 - means we do not clean up old feed items.
MAX_ITEMS_PER_FEED = 0
CLEAN_UP_ITEMS_PER_UPDATE = 1000

class Feed(ndb.Model):
  """A syndicated feed (RSS) is a source of information.

  It is treated like a pseudo user that recommends everything in the feed. Keyed
  by url.
  """
  title = ndb.StringProperty()
  item_count = ndb.IntegerProperty(default=0)
  has_active_connections = ndb.BooleanProperty(default=False)
  has_active_connections_updated = ndb.DateTimeProperty()
  # These two fields are used to save bandwidth.
  modified = ndb.DateTimeProperty()
  etag = ndb.StringProperty()
  last_updated = ndb.DateTimeProperty()

  def GetUrl(self):
    return self.key.id()

  def Update(self, canonicalize=None):
    return self.UpdateAsync(
        canonicalize=canonicalize, enable_async=False).get_result()

  # Updates the list of items in the feed.
  # Returns the list of newly added items.
  @ndb.tasklet
  def UpdateAsync(self, canonicalize=None, enable_async=True):
    now = datetime.now()
    if canonicalize is None:
      canonicalize = lambda url: url
    modified_tuple = None
    etag = self.etag
    if self.modified is not None:
      modified_tuple = self.modified.timetuple()
      # Don't use etag if we have modified time. Some servers are generating new
      # etags when nothing actually changes and modified date stays the same.
      etag = None
    url = self.GetUrl()
    if enable_async:
      if url.startswith('feed:http'):
        url = url[5:]
      elif url.startswith('feed:'):
        url = 'http:' + url[5:]
      rpc = urlfetch.create_rpc(deadline=url_util.URL_FETCH_DEADLINE_SECONDS)
      referrer = None
      auth = None
      request_headers = {}
      # Build the headers the same way feedparser.parse() does.
      # pylint: disable=protected-access
      request = feedparser._build_urllib2_request(url, feedparser.USER_AGENT,
                                                  etag, modified_tuple,
                                                  referrer, auth,
                                                  request_headers)
      # pylint: enable=protected-access
      headers = {key: value for (key, value) in request.header_items()}
      # We remove this header so that we do not get gzipped content from
      # urlfetch.
      # Without this header passed explicitly urlfetch adds this header
      # implicitly and unzips the response for us.
      headers.pop('Accept-encoding')
      try:
        result = (yield urlfetch.make_fetch_call(rpc, url, headers=headers))
      except urlfetch_errors.Error as e:
        logging.warning('Error fetching feed: %s error: %s', url, e)
        raise ndb.Return([])
      content = result.content
      if isinstance(content, unicode):
        stream = io.BytesIO(content.encode('utf-8'))
      else:
        stream = io.BytesIO(content)
      parsed = feedparser.parse(stream)
    else:
      try:
        parsed = feedparser.parse(url, etag=etag, modified=modified_tuple)
      except StandardError as e:
        logging.warning('Failed to parse feed: %s error: %s', url, e)
        # Try to read content ourselves and pass it to the parser:
        try:
          content, _, _, _ = url_util.GetPageContent(url)
          parsed = feedparser.parse(content)
        except url_util.Error as e:
          logging.warning('Failed to parse feed %s with fallback error: %s',
                          url, e)
          raise ndb.Return([])
    if hasattr(parsed, 'modified_parsed') and parsed.modified_parsed:
      self.modified = datetime.fromtimestamp(
          time.mktime(parsed.modified_parsed))
    if hasattr(parsed, 'etag'):
      self.etag = parsed.etag
    new_items = []
    for entry in parsed.entries:
      if not hasattr(entry, 'link') or not entry.link:
        continue
      if hasattr(entry, 'id') and entry.id:
        entry_id = entry.id
      else:
        # Some feeds don't specify the id so we use the link as the id.
        entry_id = entry.link
      entry_date = feed_util.GetEntryDate(
          entry, min_date=self.last_updated, max_date=now)
      if not entry_date:
        entry_date = datetime.now()
      title = None
      if hasattr(entry, 'title'):
        title = entry.title
      item = FeedItem.query(FeedItem.feed_url == self.GetUrl(),
                            FeedItem.id == entry_id).get()
      if item is None:
        try:
          canonical_url = canonicalize(entry.link)
          new_item = FeedItem(
              id=entry_id,
              url=canonical_url,
              title=title,
              feed_url=self.GetUrl(),
              retrieved_date=now,
              published_date=entry_date,
              item_id=items.UrlToItemId(canonical_url))
          new_items.append(new_item)
          new_item.put()
        except db.BadValueError as e:
          logging.warning('Error creating a feed item:' + str(e))
      # We should not be adding more new items than we are able to cleanup.
      if len(new_items) >= CLEAN_UP_ITEMS_PER_UPDATE:
        break
    self.item_count += len(new_items)
    self.last_updated = now
    self.put()
    # Remove the old items.
    if MAX_ITEMS_PER_FEED > 0:
      ndb.delete_multi(
          FeedItem.query(FeedItem.feed_url == self.GetUrl()).order(
              -FeedItem.published_date).iter(
                  keys_only=True,
                  limit=CLEAN_UP_ITEMS_PER_UPDATE,
                  offset=MAX_ITEMS_PER_FEED))
    feed_url = self.GetUrl()
    for time_period_in_days in CACHE_TIME_PERIODS_IN_DAYS:
      _UpdateCachedItemIds(feed_url, time_period_in_days).get_result()
    raise ndb.Return(new_items)

TIME_BETWEEN_UPDATES = timedelta(minutes=30)

# The time periods that we cache feed items for
CACHE_TIME_PERIODS_IN_DAYS = [1, 3, 7, 14, 30, 60, 100000]

def _TimeToMillis(t):
  ms = time.mktime(t.utctimetuple()) * 1000
  ms += getattr(t, 'microseconds', 0) / 1000
  return int(ms)

def _MillisToDatetime(ms):
  return datetime.utcfromtimestamp(ms // 1000).replace(microsecond=ms % 1000 *
                                                       1000)

ITEM_ID_CACHE_PREFIX = 'fid:'

class FeedItemId(object):

  def __init__(self, feed_url, item_id, published_date):
    self.feed_url = feed_url
    self.item_id = item_id
    self.published_date = published_date

@ndb.tasklet
def GetBulkItemIdsAsync(feed_urls, since_time):
  """Returns item ids from feeds that were published after a given time.

  Args:
    feed_urls: The list of feed urls we want the items from.
    since_time: The oldest published time that we are interested in.

  Returns:
    A map of feed url to a list of feed items. Each feed item is a tuple of item
    url and publishing date.
  """
  now = datetime.now()
  since_time_millis = _TimeToMillis(since_time)
  minimum_published_time_millis = (
      _TimeToMillis(since_time - TIME_BETWEEN_UPDATES)
      if since_time != datetime.min else since_time_millis)
  time_period_in_days = None
  for days in CACHE_TIME_PERIODS_IN_DAYS:
    time_period_in_days = days
    if timedelta(days=days) > now - since_time:
      break
  client = memcache.Client()
  feed_url_to_recent_items = yield client.get_multi_async(
      feed_urls,
      key_prefix=ITEM_ID_CACHE_PREFIX + str(time_period_in_days) + ':')
  queries = {}
  for feed_url in feed_urls:
    if feed_url in feed_url_to_recent_items:
      feed_url_to_recent_items[feed_url] = [
          item for item in cache_pb2.FeedItems.FromString(
              feed_url_to_recent_items[feed_url]).feed_item
          if (item.published_timestamp_millis > minimum_published_time_millis
              and item.retrieved_timestamp_millis > since_time_millis)
      ]
    else:
      queries[feed_url] = _UpdateCachedItemIds(feed_url, time_period_in_days)
  for feed_url, query in queries.iteritems():
    items_proto = yield query
    feed_url_to_recent_items[feed_url] = [
        item for item in items_proto.feed_item
        if (item.published_timestamp_millis > minimum_published_time_millis and
            item.retrieved_timestamp_millis > since_time_millis)
    ]
  for feed_url in feed_url_to_recent_items:
    feed_url_to_recent_items[feed_url] = [
        FeedItemId(feed_url, item.item_id,
                   _MillisToDatetime(item.published_timestamp_millis))
        for item in feed_url_to_recent_items[feed_url]
    ]
  raise ndb.Return(feed_url_to_recent_items)

@ndb.tasklet
def _UpdateCachedItemIds(feed_url, time_period_in_days):
  oldest_date = (
      datetime.now() - timedelta(days=time_period_in_days) -
      TIME_BETWEEN_UPDATES)
  feed_items = yield FeedItem.query(
      FeedItem.feed_url == feed_url, FeedItem.published_date >=
      oldest_date).order(-FeedItem.published_date).fetch_async(
          100, projection=['item_id', 'published_date', 'retrieved_date'])
  items_proto = cache_pb2.FeedItems()
  for i in feed_items:
    item_proto = items_proto.feed_item.add()
    item_proto.item_id = i.item_id
    item_proto.published_timestamp_millis = _TimeToMillis(i.published_date)
    item_proto.retrieved_timestamp_millis = _TimeToMillis(i.retrieved_date or
                                                          i.published_date)
  client = memcache.Client()
  client.set(ITEM_ID_CACHE_PREFIX + str(time_period_in_days) + ':' + feed_url,
             items_proto.SerializeToString())
  raise ndb.Return(items_proto)

def GetFeed(url):
  return ndb.Key(Feed, url).get()

def AddFeed(url, title):
  key = ndb.Key(Feed, url)
  feed = key.get()
  if feed is None:
    feed = Feed(key=key, title=title, last_updated=datetime.min)
    feed.put()
  return feed

class FeedItem(ndb.Model):
  url = ndb.StringProperty()
  id = ndb.StringProperty()
  title = ndb.StringProperty()
  feed_url = ndb.StringProperty()
  published_date = ndb.DateTimeProperty()
  retrieved_date = ndb.DateTimeProperty()
  item_id = ndb.IntegerProperty()


text:
This is the documentation for **databench.js**, the JavaScript part of Databench.
The main documentation is at [databench.trivial.io](http://databench.trivial.io).

Databench.js exports `{` [[Connection]], [connect](globals.html#connect),
[attach](globals.html#attach), [[ui]] `}`.


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

/**
* Dealing with raw magnet input from a Cardboard device
*/
public class ParsedMagnetData {
  private struct MagnetMoment {
  	public float deltaTime;
  	public float yMagnitude;
    public MagnetMoment(float deltaTime, float yMagnitude) {
      this.deltaTime = deltaTime;
      this.yMagnitude = yMagnitude;
    }
  }
  private struct MagnetWindowState {
    public float ratio;
    public float delta;
  }
  private List<MagnetMoment> magnetWindow;
  private MagnetWindowState currentMagnetWindow;
  private float MAX_WINDOW_SECONDS = 0.1f;
  #if UNITY_IOS
  private float MAGNET_RATIO_MIN_THRESHOLD = 0.005f;
  private float MAGNET_RATIO_MAX_THRESHOLD = 0.2f;
  private float MAGNET_MAGNITUDE_THRESHOLD = 800.0f;
  #else
  private float MAGNET_RATIO_MIN_THRESHOLD = 0.03f;
  private float MAGNET_RATIO_MAX_THRESHOLD = 0.2f;
  private float MAGNET_MAGNITUDE_THRESHOLD = 500.0f;
  #endif
  private float STABLE_RATIO_THRESHOLD = 0.001f;
  private float STABLE_DELTA_THRESHOLD = 2.0f;
  private float windowLength = 0.0f;

  enum TriggerState {
    Negative,
    Neutral,
    Positive
  };
  private TriggerState triggerState = TriggerState.Neutral;
  private bool isDown = false;
  private bool isStable = false;

  public ParsedMagnetData() {
    Input.compass.enabled = true;
    magnetWindow = new List<MagnetMoment>();
    windowLength = 0.0f;
  }

  public void Update() {
    TrimMagnetWindow();
    AddToMagnetWindow();
    currentMagnetWindow = CaptureMagnetWindow();

    TriggerState newTriggerState = CheckTriggerState();
    isStable = CheckStability();
    if (!isStable) ResetState();

    if (isStable && newTriggerState != TriggerState.Neutral && triggerState != newTriggerState) {
      isDown = !isDown;
      triggerState = newTriggerState;
    }
  }

  private bool CheckStability() {
    // Delta approximates how fast the device is moving relative to the magnet
    // Ratio approximates how still the device is over time
    if (MagnetAbsent()) return false;
    else if(currentMagnetWindow.delta < STABLE_DELTA_THRESHOLD &&
            currentMagnetWindow.ratio < 1f+STABLE_RATIO_THRESHOLD &&
            currentMagnetWindow.ratio > 1f-STABLE_RATIO_THRESHOLD) return true;
    return isStable;
  }

  private TriggerState CheckTriggerState() {
    if (IsNegative()) return TriggerState.Negative;
    if (IsPositive()) return TriggerState.Positive;
    return TriggerState.Neutral;
  }

  private bool MagnetAbsent() {
    return Input.compass.rawVector.magnitude < MAGNET_MAGNITUDE_THRESHOLD;
  }

  private bool IsNegative() {
    return (currentMagnetWindow.ratio < 1f-MAGNET_RATIO_MIN_THRESHOLD &&
            currentMagnetWindow.ratio > 1f-MAGNET_RATIO_MAX_THRESHOLD);
  }

  private bool IsPositive() {
    return (currentMagnetWindow.ratio > 1f+MAGNET_RATIO_MIN_THRESHOLD &&
            currentMagnetWindow.ratio < 1f+MAGNET_RATIO_MAX_THRESHOLD);
  }

  public void TrimMagnetWindow() {
    while (windowLength > MAX_WINDOW_SECONDS) {
      MagnetMoment moment = magnetWindow[0];
      magnetWindow.RemoveAt(0);
      windowLength -= moment.deltaTime;
    }
  }

  public void AddToMagnetWindow() {
    magnetWindow.Add(new MagnetMoment(Time.deltaTime, Input.compass.rawVector.magnitude));
    windowLength += Time.deltaTime;
  }

  private MagnetWindowState CaptureMagnetWindow() {
    MagnetWindowState newState = new MagnetWindowState();
    int middle = magnetWindow.Count / 2;
    List<MagnetMoment> firstHalf = magnetWindow.GetRange(0, middle);
    List<MagnetMoment> lastHalf = magnetWindow.GetRange(middle, magnetWindow.Count - middle);
    newState.ratio = Average(firstHalf) / Average(lastHalf);
    newState.delta = Mathf.Abs(magnetWindow[magnetWindow.Count-1].yMagnitude - magnetWindow[0].yMagnitude);
    return newState;
  }

  private float Average(List<MagnetMoment> moments) {
    if (moments.Count == 0) return 0.0f;
    float sum = 0.0f;
    for (int index = 0; index < moments.Count; index++) {
      sum += moments[index].yMagnitude;
    }
    return sum / moments.Count;
  }

  private bool IsMagnetGoingDown(float min, float max, float start) {
    float minDelta = Mathf.Abs(min - start);
    float maxDelta = Mathf.Abs(max - start);
    return minDelta > maxDelta;
  }

  public bool IsDown() {
    return triggerState != TriggerState.Neutral && isDown;
  }

  public bool IsUp() {
    return triggerState != TriggerState.Neutral && !isDown;
  }

  public void ResetState() {
    triggerState = TriggerState.Neutral;
    isDown = false;
  }

  public void PrintDebug() {
    Debug.Log("--- Magnetometer\nmagnitude: " + Input.compass.rawVector.magnitude +
              "\nratio: " + currentMagnetWindow.ratio +
              "\ndelta: " + currentMagnetWindow.delta +
              "\nstable: " + isStable +
              "\nstate: " + triggerState);
  }
}


text:
// This file is automatically generated.

package adila.db;

/*
 * Samsung Galaxy J5
 *
 * DEVICE: j5lte
 * MODEL: SM-J500G
 */
final class j5lte_sm2dj500g {
    public static final String DATA = "Samsung|Galaxy J5|Galaxy J";
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Limitless - Responsive Web Application Kit by Eugene Kopyov</title>

	<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700,900" rel="stylesheet" type="text/css">
	<link href="assets/css/icons/icomoon/styles.css" rel="stylesheet" type="text/css">
	<link href="assets/css/bootstrap.css" rel="stylesheet" type="text/css">
	<link href="assets/css/core.css" rel="stylesheet" type="text/css">
	<link href="assets/css/components.css" rel="stylesheet" type="text/css">
	<link href="assets/css/colors.css" rel="stylesheet" type="text/css">

						Git updates
						9

							Git updates

									Drop the IE specific hacks for temporal inputs

4 minutes ago

									Add full font overrides for popovers and tooltips

36 minutes ago

									Chris Arney created a new Design branch

2 hours ago

									Eugene Kopyov merged Master and Dev branches

Dec 18, 18:36

									Have Carousel ignore keyboard events

Dec 12, 05:46

				Online

							Users

								Users online

										Jordana Ansley
										Lead web developer

										Will Brason
										Marketing manager

										Hanna Walden
										Project manager

										Dori Laperriere
										Business developer

										Vanessa Aurelius
										UX expert

							Messages
							2

								Messages

										5

											James Alexander
											04:58

										who knows, maybe that would be the best thing for me...

										4

											Margo Baker
											12:16

										That was something he was unable to do because...

											Jeremy Victorino
											22:48

										But that would be extremely strained and suspicious...

											Beatrix Diaz
											Tue

										What a strenuous career it is that I've chosen...

											Richard Vango
											Mon

										Other travelling salesmen live a life of luxury...

							Victoria

 My profile

 My balance

58  Messages

 Account settings

 Logout

									Victoria Baker

										  Santa Ana, CA

Main

 Dashboard

									 Page layouts

Fixed navbar

Fixed navbar & sidebar

Fixed sidebar native scroll

Hideable navbar

Hideable & fixed sidebar

Fixed footer

Boxed with default sidebar

Boxed with mini sidebar

Boxed full width

									 Layouts

Layout 1

Layout 2 Current

Layout 3

Layout 4

Layout 5

Layout 6 Coming soon

									 Color system

Primary palette

Danger palette

Success palette

Warning palette

Info palette

Pink palette

Violet palette

Purple palette

Indigo palette

Blue palette

Teal palette

Green palette

Orange palette

Brown palette

Grey palette

Slate palette

									 Starter kit

Horizontal navigation

1 column

2 columns

											3 columns

Dual sidebars

Double sidebars

4 columns

											Detached layout

Left sidebar

Right sidebar

Sticky sidebar

Boxed layout

Fixed main navbar

Fixed secondary navbar

Both navbars fixed

Fixed layout

 Changelog 1.4

 RTL version

Forms

									 Form components

Basic inputs

Checkboxes & radios

Input groups

Extended controls

Floating labels

											Selects

Select2 selects

Bootstrap multiselect

SelectBoxIt selects

Bootstrap selects

Tag inputs

Dual Listboxes

Editable forms

Validation

Inputs grid

									 JSON forms

Basic inputs

Advanced inputs

Controls

									 Wizards

Steps wizard

Form wizard

Stepy wizard

									 Editors

Summernote editor

CKEditor

WYSIHTML5 editor

Code editor

									 Pickers

Date & time pickers

Color pickers

Location pickers

									 Form layouts

Vertical form

Horizontal form

Appearance

									 Components

Modals

Dropdown menus

Tabs component

Pills component

Accordion and navs

Buttons

PNotify notifications

Other notifications

Tooltips and popovers

Alerts

Pagination

Labels and badges

Loaders and bars

Thumbnails

Page header

Breadcrumbs

Media objects

Affix and Scrollspy

									 Content appearance

Content panels

Panel heading elements

Panel footer elements

Draggable panels

Text styling

Typography

Helper classes

Syntax highlighter

Grid system

									 Extra components

NoUI sliders

Ion range sliders

Session timeout

Idle timeout

Dynamic tree views

Context menu

Floating action buttons

									 Animations

CSS3 animations

											Velocity animations

Basic usage

UI pack effects

Advanced examples

									 Icons

Glyphicons

Icomoon

Font awesome

Layout

									 Sidebars

Default collapsible

Default hideable

Mini collapsible

Mini hideable

											Dual sidebar

Dual sidebar

Dual double collapse

Dual double hide

Swap sidebars

											Double sidebar

Collapse main sidebar

Hide main sidebar

Fix default width

Fix mini width

Opposite sidebar visible

											Detached sidebar

Left position

Right position

Sticky (custom scroll)

Sticky (native scroll)

Separate categories

Hidden sidebar

Light sidebar

Sidebar components

									 Vertical navigation

Collapsible menu

Accordion menu

Navigation sizing

Bordered navigation

Right icons

Labels and badges

Disabled navigation links

									 Horizontal navigation

Submenu on click

Submenu on hover

With custom elements

Tabbed navigation

Disabled navigation links

Horizontal mega menu

									 Navbars

Single navbar

											Multiple navbars

Navbar + navbar

Navbar + header

Header + navbar

Top + bottom

Color options

Sizing options

Hide on scroll

Navbar components

									 Menu levels

 Second level

											 Second level with child

 Third level

													 Third level with child

 Fourth level

 Fourth level

 Third level

 Second level

Data visualization

									 Echarts library

Lines and areas

Columns and waterfalls

Bars and tornados

Scatter charts

Pies and donuts

Funnels and chords

Candlesticks and others

Chart combinations

									 D3 library

Simple lines

Advanced lines

Simple bars

Advanced bars

Pie charts

Circle diagrams

Tree layout

Other charts

									 Dimple library

											Line charts

Horizontal orientation

Vertical orientation

											Bar charts

Horizontal orientation

Vertical orientation

											Area charts

Horizontal orientation

Vertical orientation

											Step charts

Horizontal orientation

Vertical orientation

Pie charts

Ring charts

Scatter charts

Bubble charts

									 C3 library

Lines and areas

Bars and pies

Advanced examples

Chart axis

Grid options

									 Google visualization

Line charts

Bar charts

Pie charts

Bubble & scatter charts

Other charts

									 Maps integration

											Google maps

Basics

Controls

Markers

Map drawings

Layers

Vector maps

Extensions

									 Extensions

Image cropper

Block UI

Drag and drop

									 JQuery UI

Interactions

Forms

Components

Sliders

Navigation

									 File uploaders

Plupload

Bootstrap file uploader

Dropzone

									 Event calendars

Basic views

Event styling

Language and time

Advanced usage

									 Internationalization

Direct translation

Querystring parameter

Set language on init

Set language after init

Language fallback

Callbacks

Tables

									 Basic tables

Basic examples

Table sizing

Table borders

Table styling

Table elements

									 Data tables

Basic initialization

Basic styling

Advanced examples

Sorting options

Using API

Data sources

									 Data tables extensions

Columns reorder

Row reorder

Fixed columns

Fixed header

Auto fill

Key table

Scroller

Select

											Buttons

Initialization

Flash buttons

Print buttons

HTML5 buttons

Columns visibility

									 Handsontable

Basic configuration

Advanced setup

Column features

Cell features

Basic cell types

Custom & checkboxes

Autocomplete & password

Search

Context menu

									 Responsive options

Responsive basic tables

Responsive data tables

Page kits

									 Task manager

Task grid

Task list

Task detailed

									 Invoicing

Invoice template

Invoice grid

Invoice archive

									 User pages

User cards

User list

Simple profile

Profile with cover

									 Login & registration

Simple login

More login info

Simple registration

More registration info

Unlock user

Reset password

Hide navbar

Transparent box

Background option

With validation

Tabbed form

Inside modals

									 Timelines

Left timeline

Right timeline

Centered timeline

									 Support

Conversation layouts

Conversation options

Knowledgebase

FAQ page

									 Search

Basic search results

User search results

Image search results

Video search results

									 Gallery

Media grid

Media with titles

Media with description

Media library

									 Error pages

Error 403

Error 404

Error 405

Error 500

Error 503

Offline page

 Icons - Icomoon

								Statistics
								 Invoices
								 Schedule

 Home

Icons

Icomoon

 Support

									Settings

 Account security

 Analytics

 Accessibility

 All settings

Icomoon icon set

Icomoon is a custom icon set, includes 1145 icon glyphs based on 16px grid. This set is a default icon set of the template, majority of components are using Icomoon font family for UI elements instead of images, so all of them are retina-ready. Glyphicon and FontAwesome icon sets are also added, but as optional choice. In order to get the best look of UI elements, I recommend to include this icon set only as you can find perfectly crafted icons according to most of your common needs.

 icon-home

 icon-home2

 icon-home5

 icon-home7

 icon-home8

 icon-home9

 icon-office

 icon-city

 icon-newspaper

 icon-magazine

 icon-design

 icon-pencil

 icon-pencil3

 icon-pencil4

 icon-pencil5

 icon-pencil6

 icon-pencil7

 icon-eraser

 icon-eraser2

 icon-eraser3

 icon-quill2

 icon-quill4

 icon-pen

 icon-pen-plus

 icon-pen-minus

 icon-pen2

 icon-blog

 icon-pen6

 icon-brush

 icon-spray

 icon-color-sampler

 icon-toggle

 icon-bucket

 icon-gradient

 icon-eyedropper

 icon-eyedropper2

 icon-eyedropper3

 icon-droplet

 icon-droplet2

 icon-color-clear

 icon-paint-format

 icon-stamp

 icon-image2

 icon-image-compare

 icon-images2

 icon-image3

 icon-images3

 icon-image4

 icon-image5

 icon-camera

 icon-shutter

 icon-headphones

 icon-headset

 icon-music

 icon-album

 icon-tape

 icon-piano

 icon-speakers

 icon-play

 icon-clapboard-play

 icon-clapboard

 icon-media

 icon-presentation

 icon-movie

 icon-film

 icon-film2

 icon-film3

 icon-film4

 icon-video-camera

 icon-video-camera2

 icon-video-camera-slash

 icon-video-camera3

 icon-dice

 icon-chess-king

 icon-chess-queen

 icon-chess

 icon-megaphone

 icon-new

 icon-connection

 icon-station

 icon-satellite-dish2

 icon-feed

 icon-mic2

 icon-mic-off2

 icon-book

 icon-book2

 icon-book-play

 icon-book3

 icon-bookmark

 icon-books

 icon-archive

 icon-reading

 icon-library2

 icon-graduation2

 icon-file-text

 icon-profile

 icon-file-empty

 icon-file-empty2

 icon-files-empty

 icon-files-empty2

 icon-file-plus

 icon-file-plus2

 icon-file-minus

 icon-file-minus2

 icon-file-download

 icon-file-download2

 icon-file-upload

 icon-file-upload2

 icon-file-check

 icon-file-check2

 icon-file-eye

 icon-file-eye2

 icon-file-text2

 icon-file-text3

 icon-file-picture

 icon-file-picture2

 icon-file-music

 icon-file-music2

 icon-file-play

 icon-file-play2

 icon-file-video

 icon-file-video2

 icon-copy

 icon-copy2

 icon-file-zip

 icon-file-zip2

 icon-file-xml

 icon-file-xml2

 icon-file-css

 icon-file-css2

 icon-file-presentation

 icon-file-presentation2

 icon-file-stats

 icon-file-stats2

 icon-file-locked

 icon-file-locked2

 icon-file-spreadsheet

 icon-file-spreadsheet2

 icon-copy3

 icon-copy4

 icon-paste

 icon-paste2

 icon-paste3

 icon-paste4

 icon-stack

 icon-stack2

 icon-stack3

 icon-folder

 icon-folder-search

 icon-folder-download

 icon-folder-upload

 icon-folder-plus

 icon-folder-plus2

 icon-folder-minus

 icon-folder-minus2

 icon-folder-check

 icon-folder-heart

 icon-folder-remove

 icon-folder2

 icon-folder-open

 icon-folder3

 icon-folder4

 icon-folder-plus3

 icon-folder-minus3

 icon-folder-plus4

 icon-folder-minus4

 icon-folder-download2

 icon-folder-upload2

 icon-folder-download3

 icon-folder-upload3

 icon-folder5

 icon-folder-open2

 icon-folder6

 icon-folder-open3

 icon-certificate

 icon-cc

 icon-price-tag

 icon-price-tag2

 icon-price-tags

 icon-price-tag3

 icon-price-tags2

 icon-barcode2

 icon-qrcode

 icon-ticket

 icon-theater

 icon-store

 icon-store2

 icon-cart

 icon-cart2

 icon-cart4

 icon-cart5

 icon-cart-add

 icon-cart-add2

 icon-cart-remove

 icon-basket

 icon-bag

 icon-percent

 icon-coins

 icon-coin-dollar

 icon-coin-euro

 icon-coin-pound

 icon-coin-yen

 icon-piggy-bank

 icon-wallet

 icon-cash

 icon-cash2

 icon-cash3

 icon-cash4

 icon-credit-card

 icon-credit-card2

 icon-calculator4

 icon-calculator2

 icon-calculator3

 icon-chip

 icon-lifebuoy

 icon-phone

 icon-phone2

 icon-phone-slash

 icon-phone-wave

 icon-phone-plus

 icon-phone-minus

 icon-phone-plus2

 icon-phone-minus2

 icon-phone-incoming

 icon-phone-outgoing

 icon-phone-hang-up

 icon-address-book

 icon-address-book2

 icon-address-book3

 icon-notebook

 icon-envelop

 icon-envelop2

 icon-envelop3

 icon-envelop4

 icon-envelop5

 icon-mailbox

 icon-pushpin

 icon-location3

 icon-location4

 icon-compass4

 icon-map

 icon-map4

 icon-map5

 icon-direction

 icon-reset

 icon-history

 icon-watch

 icon-watch2

 icon-alarm

 icon-alarm-add

 icon-alarm-check

 icon-alarm-cancel

 icon-bell2

 icon-bell3

 icon-bell-plus

 icon-bell-minus

 icon-bell-check

 icon-bell-cross

 icon-calendar

 icon-calendar2

 icon-calendar3

 icon-calendar52

 icon-printer

 icon-printer2

 icon-printer4

 icon-shredder

 icon-mouse

 icon-mouse-left

 icon-mouse-right

 icon-keyboard

 icon-typewriter

 icon-display

 icon-display4

 icon-laptop

 icon-mobile

 icon-mobile2

 icon-tablet

 icon-mobile3

 icon-tv

 icon-radio

 icon-cabinet

 icon-drawer

 icon-drawer2

 icon-drawer-out

 icon-drawer-in

 icon-drawer3

 icon-box

 icon-box-add

 icon-box-remove

 icon-download

 icon-upload

 icon-floppy-disk

 icon-floppy-disks

 icon-usb-stick

 icon-drive

 icon-server

 icon-database

 icon-database2

 icon-database4

 icon-database-menu

 icon-database-add

 icon-database-remove

 icon-database-insert

 icon-database-export

 icon-database-upload

 icon-database-refresh

 icon-database-diff

 icon-database-edit2

 icon-database-check

 icon-database-arrow

 icon-database-time2

 icon-undo

 icon-redo

 icon-rotate-ccw

 icon-rotate-cw

 icon-rotate-ccw2

 icon-rotate-cw2

 icon-rotate-ccw3

 icon-rotate-cw3

 icon-flip-vertical2

 icon-flip-horizontal2

 icon-flip-vertical3

 icon-flip-vertical4

 icon-angle

 icon-shear

 icon-align-left

 icon-align-center-horizontal

 icon-align-right

 icon-align-top

 icon-align-center-vertical

 icon-align-bottom

 icon-undo2

 icon-redo2

 icon-forward

 icon-reply

 icon-reply-all

 icon-bubble

 icon-bubbles

 icon-bubbles2

 icon-bubble2

 icon-bubbles3

 icon-bubbles4

 icon-bubble-notification

 icon-bubbles5

 icon-bubbles6

 icon-bubble6

 icon-bubbles7

 icon-bubble7

 icon-bubbles8

 icon-bubble8

 icon-bubble-dots3

 icon-bubble-lines3

 icon-bubble9

 icon-bubble-dots4

 icon-bubble-lines4

 icon-bubbles9

 icon-bubbles10

 icon-user

 icon-users

 icon-user-plus

 icon-user-minus

 icon-user-cancel

 icon-user-block

 icon-user-lock

 icon-user-check

 icon-users2

 icon-users4

 icon-user-tie

 icon-collaboration

 icon-vcard

 icon-hat

 icon-bowtie

 icon-quotes-left

 icon-quotes-right

 icon-quotes-left2

 icon-quotes-right2

 icon-hour-glass

 icon-hour-glass2

 icon-hour-glass3

 icon-spinner

 icon-spinner2

 icon-spinner3

 icon-spinner4

 icon-spinner6

 icon-spinner9

 icon-spinner10

 icon-spinner11

 icon-microscope

 icon-enlarge

 icon-shrink

 icon-enlarge3

 icon-shrink3

 icon-enlarge5

 icon-shrink5

 icon-enlarge6

 icon-shrink6

 icon-enlarge7

 icon-shrink7

 icon-key

 icon-lock

 icon-lock2

 icon-lock4

 icon-unlocked

 icon-lock5

 icon-unlocked2

 icon-safe

 icon-wrench

 icon-wrench2

 icon-wrench3

 icon-equalizer

 icon-equalizer2

 icon-equalizer3

 icon-equalizer4

 icon-cog

 icon-cogs

 icon-cog2

 icon-cog3

 icon-cog4

 icon-cog52

 icon-cog6

 icon-cog7

 icon-hammer

 icon-hammer-wrench

 icon-magic-wand

 icon-magic-wand2

 icon-pulse2

 icon-aid-kit

 icon-bug2

 icon-construction

 icon-traffic-cone

 icon-traffic-lights

 icon-pie-chart

 icon-pie-chart2

 icon-pie-chart3

 icon-pie-chart4

 icon-pie-chart5

 icon-pie-chart6

 icon-pie-chart7

 icon-stats-dots

 icon-stats-bars

 icon-pie-chart8

 icon-stats-bars2

 icon-stats-bars3

 icon-stats-bars4

 icon-chart

 icon-stats-growth

 icon-stats-decline

 icon-stats-growth2

 icon-stats-decline2

 icon-stairs-up

 icon-stairs-down

 icon-stairs

 icon-ladder

 icon-rating

 icon-rating2

 icon-rating3

 icon-podium

 icon-stars

 icon-medal-star

 icon-medal

 icon-medal2

 icon-medal-first

 icon-medal-second

 icon-medal-third

 icon-crown

 icon-trophy2

 icon-trophy3

 icon-diamond

 icon-trophy4

 icon-gift

 icon-pipe

 icon-mustache

 icon-cup2

 icon-coffee

 icon-paw

 icon-footprint

 icon-rocket

 icon-meter2

 icon-meter-slow

 icon-meter-fast

 icon-hammer2

 icon-balance

 icon-fire

 icon-fire2

 icon-lab

 icon-atom

 icon-atom2

 icon-bin

 icon-bin2

 icon-briefcase

 icon-briefcase3

 icon-airplane2

 icon-airplane3

 icon-airplane4

 icon-paperplane

 icon-car

 icon-steering-wheel

 icon-car2

 icon-gas

 icon-bus

 icon-truck

 icon-bike

 icon-road

 icon-train

 icon-train2

 icon-ship

 icon-boat

 icon-chopper

 icon-cube

 icon-cube2

 icon-cube3

 icon-cube4

 icon-pyramid

 icon-pyramid2

 icon-package

 icon-puzzle

 icon-puzzle2

 icon-puzzle3

 icon-puzzle4

 icon-glasses-3d2

 icon-brain

 icon-accessibility

 icon-accessibility2

 icon-strategy

 icon-target

 icon-target2

 icon-shield-check

 icon-shield-notice

 icon-shield2

 icon-racing

 icon-finish

 icon-power2

 icon-power3

 icon-switch

 icon-switch22

 icon-power-cord

 icon-clipboard

 icon-clipboard2

 icon-clipboard3

 icon-clipboard4

 icon-clipboard5

 icon-clipboard6

 icon-playlist

 icon-playlist-add

 icon-list-numbered

 icon-list

 icon-list2

 icon-more

 icon-more2

 icon-grid

 icon-grid2

 icon-grid3

 icon-grid4

 icon-grid52

 icon-grid6

 icon-grid7

 icon-tree5

 icon-tree6

 icon-tree7

 icon-lan

 icon-lan2

 icon-lan3

 icon-menu

 icon-circle-small

 icon-menu2

 icon-menu3

 icon-menu4

 icon-menu5

 icon-menu62

 icon-menu7

 icon-menu8

 icon-menu9

 icon-menu10

 icon-cloud

 icon-cloud-download

 icon-cloud-upload

 icon-cloud-check

 icon-cloud2

 icon-cloud-download2

 icon-cloud-upload2

 icon-cloud-check2

 icon-import

 icon-download4

 icon-upload4

 icon-download7

 icon-upload7

 icon-download10

 icon-upload10

 icon-sphere

 icon-sphere3

 icon-earth

 icon-link

 icon-unlink

 icon-link2

 icon-unlink2

 icon-anchor

 icon-flag3

 icon-flag4

 icon-flag7

 icon-flag8

 icon-attachment

 icon-attachment2

 icon-eye

 icon-eye-plus

 icon-eye-minus

 icon-eye-blocked

 icon-eye2

 icon-eye-blocked2

 icon-eye4

 icon-bookmark2

 icon-bookmark3

 icon-bookmarks

 icon-bookmark4

 icon-spotlight2

 icon-starburst

 icon-snowflake

 icon-weather-windy

 icon-fan

 icon-umbrella

 icon-sun3

 icon-contrast

 icon-bed2

 icon-furniture

 icon-chair

 icon-star-empty3

 icon-star-half

 icon-star-full2

 icon-heart5

 icon-heart6

 icon-heart-broken2

 icon-thumbs-up2

 icon-thumbs-down2

 icon-thumbs-up3

 icon-thumbs-down3

 icon-height

 icon-man

 icon-woman

 icon-man-woman

 icon-yin-yang

 icon-cursor

 icon-cursor2

 icon-lasso2

 icon-select2

 icon-point-up

 icon-point-right

 icon-point-down

 icon-point-left

 icon-pointer

 icon-reminder

 icon-drag-left-right

 icon-drag-left

 icon-drag-right

 icon-touch

 icon-multitouch

 icon-touch-zoom

 icon-touch-pinch

 icon-hand

 icon-grab

 icon-stack-empty

 icon-stack-plus

 icon-stack-minus

 icon-stack-star

 icon-stack-picture

 icon-stack-down

 icon-stack-up

 icon-stack-cancel

 icon-stack-check

 icon-stack-text

 icon-stack4

 icon-stack-music

 icon-stack-play

 icon-move

 icon-dots

 icon-warning

 icon-warning22

 icon-notification2

 icon-question3

 icon-question4

 icon-plus3

 icon-minus3

 icon-plus-circle2

 icon-minus-circle2

 icon-cancel-circle2

 icon-blocked

 icon-cancel-square

 icon-cancel-square2

 icon-spam

 icon-cross2

 icon-cross3

 icon-checkmark

 icon-checkmark3

 icon-checkmark2

 icon-checkmark4

 icon-spell-check

 icon-spell-check2

 icon-enter

 icon-exit

 icon-enter2

 icon-exit2

 icon-enter3

 icon-exit3

 icon-wall

 icon-fence

 icon-play3

 icon-pause

 icon-stop

 icon-previous

 icon-next

 icon-backward

 icon-forward2

 icon-play4

 icon-pause2

 icon-stop2

 icon-backward2

 icon-forward3

 icon-first

 icon-last

 icon-previous2

 icon-next2

 icon-eject

 icon-volume-high

 icon-volume-medium

 icon-volume-low

 icon-volume-mute

 icon-speaker-left

 icon-speaker-right

 icon-volume-mute2

 icon-volume-increase

 icon-volume-decrease

 icon-volume-mute5

 icon-loop

 icon-loop3

 icon-infinite-square

 icon-infinite

 icon-loop4

 icon-shuffle

 icon-wave

 icon-wave2

 icon-split

 icon-merge

 icon-arrow-up5

 icon-arrow-right5

 icon-arrow-down5

 icon-arrow-left5

 icon-arrow-up-left2

 icon-arrow-up7

 icon-arrow-up-right2

 icon-arrow-right7

 icon-arrow-down-right2

 icon-arrow-down7

 icon-arrow-down-left2

 icon-arrow-left7

 icon-arrow-up-left3

 icon-arrow-up8

 icon-arrow-up-right3

 icon-arrow-right8

 icon-arrow-down-right3

 icon-arrow-down8

 icon-arrow-down-left3

 icon-arrow-left8

 icon-circle-up2

 icon-circle-right2

 icon-circle-down2

 icon-circle-left2

 icon-arrow-resize7

 icon-arrow-resize8

 icon-square-up-left

 icon-square-up

 icon-square-up-right

 icon-square-right

 icon-square-down-right

 icon-square-down

 icon-square-down-left

 icon-square-left

 icon-arrow-up15

 icon-arrow-right15

 icon-arrow-down15

 icon-arrow-left15

 icon-arrow-up16

 icon-arrow-right16

 icon-arrow-down16

 icon-arrow-left16

 icon-menu-open

 icon-menu-open2

 icon-menu-close

 icon-menu-close2

 icon-enter5

 icon-esc

 icon-enter6

 icon-backspace

 icon-backspace2

 icon-tab

 icon-transmission

 icon-sort

 icon-move-up2

 icon-move-down2

 icon-sort-alpha-asc

 icon-sort-alpha-desc

 icon-sort-numeric-asc

 icon-sort-numberic-desc

 icon-sort-amount-asc

 icon-sort-amount-desc

 icon-sort-time-asc

 icon-sort-time-desc

 icon-battery-6

 icon-battery-0

 icon-battery-charging

 icon-command

 icon-shift

 icon-ctrl

 icon-opt

 icon-checkbox-checked

 icon-checkbox-unchecked

 icon-checkbox-partial

 icon-square

 icon-triangle

 icon-triangle2

 icon-diamond3

 icon-diamond4

 icon-checkbox-checked2

 icon-checkbox-unchecked2

 icon-checkbox-partial2

 icon-radio-checked

 icon-radio-checked2

 icon-radio-unchecked

 icon-checkmark-circle

 icon-circle

 icon-circle2

 icon-circles

 icon-circles2

 icon-crop

 icon-crop2

 icon-make-group

 icon-ungroup

 icon-vector

 icon-vector2

 icon-rulers

 icon-pencil-ruler

 icon-scissors

 icon-filter3

 icon-filter4

 icon-font

 icon-ampersand2

 icon-ligature

 icon-font-size

 icon-typography

 icon-text-height

 icon-text-width

 icon-height2

 icon-width

 icon-strikethrough2

 icon-font-size2

 icon-bold2

 icon-underline2

 icon-italic2

 icon-strikethrough3

 icon-omega

 icon-sigma

 icon-nbsp

 icon-page-break

 icon-page-break2

 icon-superscript

 icon-subscript

 icon-superscript2

 icon-subscript2

 icon-text-color

 icon-highlight

 icon-pagebreak

 icon-clear-formatting

 icon-table

 icon-table2

 icon-insert-template

 icon-pilcrow

 icon-ltr

 icon-rtl

 icon-ltr2

 icon-rtl2

 icon-section

 icon-paragraph-left2

 icon-paragraph-center2

 icon-paragraph-right2

 icon-paragraph-justify2

 icon-indent-increase

 icon-indent-decrease

 icon-paragraph-left3

 icon-paragraph-center3

 icon-paragraph-right3

 icon-paragraph-justify3

 icon-indent-increase2

 icon-indent-decrease2

 icon-share

 icon-share2

 icon-new-tab

 icon-new-tab2

 icon-popout

 icon-embed

 icon-embed2

 icon-markup

 icon-regexp

 icon-regexp2

 icon-code

 icon-circle-css

 icon-circle-code

 icon-terminal

 icon-unicode

 icon-seven-segment-0

 icon-seven-segment-1

 icon-seven-segment-2

 icon-seven-segment-3

 icon-seven-segment-4

 icon-seven-segment-5

 icon-seven-segment-6

 icon-seven-segment-7

 icon-seven-segment-8

 icon-seven-segment-9

 icon-share3

 icon-share4

 icon-google

 icon-google-plus

 icon-google-plus2

 icon-google-drive

 icon-facebook

 icon-facebook2

 icon-instagram

 icon-twitter

 icon-twitter2

 icon-feed2

 icon-feed3

 icon-youtube

 icon-youtube2

 icon-youtube3

 icon-vimeo

 icon-vimeo2

 icon-lanyrd

 icon-flickr

 icon-flickr2

 icon-flickr3

 icon-picassa

 icon-picassa2

 icon-dribbble

 icon-dribbble2

 icon-dribbble3

 icon-forrst

 icon-forrst2

 icon-deviantart

 icon-deviantart2

 icon-steam

 icon-steam2

 icon-dropbox

 icon-onedrive

 icon-github

 icon-github4

 icon-github5

 icon-wordpress

 icon-wordpress2

 icon-joomla

 icon-blogger

 icon-blogger2

 icon-tumblr

 icon-tumblr2

 icon-yahoo

 icon-tux

 icon-apple2

 icon-finder

 icon-android

 icon-windows

 icon-windows8

 icon-soundcloud

 icon-soundcloud2

 icon-skype

 icon-reddit

 icon-linkedin

 icon-linkedin2

 icon-lastfm

 icon-lastfm2

 icon-delicious

 icon-stumbleupon

 icon-stumbleupon2

 icon-stackoverflow

 icon-pinterest2

 icon-xing

 icon-flattr

 icon-foursquare

 icon-paypal

 icon-paypal2

 icon-yelp

 icon-file-pdf

 icon-file-openoffice

 icon-file-word

 icon-file-excel

 icon-libreoffice

 icon-html5

 icon-html52

 icon-css3

 icon-git

 icon-svg

 icon-codepen

 icon-chrome

 icon-firefox

 icon-IE

 icon-opera

 icon-safari

 icon-check2

 icon-home4

 icon-people

 icon-checkmark-circle2

 icon-arrow-up-left32

 icon-arrow-up52

 icon-arrow-up-right32

 icon-arrow-right6

 icon-arrow-down-right32

 icon-arrow-down52

 icon-arrow-down-left32

 icon-arrow-left52

 icon-calendar5

 icon-move-alt1

 icon-reload-alt

 icon-move-vertical

 icon-move-horizontal

 icon-hash

 icon-bars-alt

 icon-eye8

 icon-search4

 icon-zoomin3

 icon-zoomout3

 icon-add

 icon-subtract

 icon-exclamation

 icon-question6

 icon-close2

 icon-task

 icon-inbox

 icon-inbox-alt

 icon-envelope

 icon-compose

 icon-newspaper2

 icon-calendar22

 icon-hyperlink

 icon-trash

 icon-trash-alt

 icon-grid5

 icon-grid-alt

 icon-menu6

 icon-list3

 icon-gallery

 icon-calculator

 icon-windows2

 icon-browser

 icon-portfolio

 icon-comments

 icon-screen3

 icon-iphone

 icon-ipad

 icon-googleplus5

 icon-pin

 icon-pin-alt

 icon-cog5

 icon-graduation

 icon-air

 icon-droplets

 icon-statistics

 icon-pie5

 icon-cross

 icon-minus2

 icon-plus2

 icon-info3

 icon-info22

 icon-question7

 icon-help

 icon-warning2

 icon-add-to-list

 icon-arrow-left12

 icon-arrow-down12

 icon-arrow-up12

 icon-arrow-right13

 icon-arrow-left22

 icon-arrow-down22

 icon-arrow-up22

 icon-arrow-right22

 icon-arrow-left32

 icon-arrow-down32

 icon-arrow-up32

 icon-arrow-right32

 icon-switch2

 icon-checkmark5

 icon-ampersand

 icon-alert

 icon-alignment-align

 icon-alignment-aligned-to

 icon-alignment-unalign

 icon-arrow-down132

 icon-arrow-up13

 icon-arrow-left13

 icon-arrow-right14

 icon-arrow-small-down

 icon-arrow-small-left

 icon-arrow-small-right

 icon-arrow-small-up

 icon-check

 icon-chevron-down

 icon-chevron-left

 icon-chevron-right

 icon-chevron-up

 icon-clippy

 icon-comment

 icon-comment-discussion

 icon-dash

 icon-diff

 icon-diff-added

 icon-diff-ignored

 icon-diff-modified

 icon-diff-removed

 icon-diff-renamed

 icon-file-media

 icon-fold

 icon-gear

 icon-git-branch

 icon-git-commit

 icon-git-compare

 icon-git-merge

 icon-git-pull-request

 icon-graph

 icon-law

 icon-list-ordered

 icon-list-unordered

 icon-mail5

 icon-mail-read

 icon-mention

 icon-mirror

 icon-move-down

 icon-move-left

 icon-move-right

 icon-move-up

 icon-person

 icon-plus22

 icon-primitive-dot

 icon-primitive-square

 icon-repo-forked

 icon-screen-full

 icon-screen-normal

 icon-sync

 icon-three-bars

 icon-unfold

 icon-versions

 icon-x

						© 2015. Limitless Web App Kit by Eugene Kopyov


text:
@interface NSScanner (DTMarkdown)

// / /返回是的如果有一个超链接,然后是一个可选的标题
- (BOOL)scanMarkdownHyperlink:(NSString **)URLString title:(NSString **)title;

//返回是的如果当前行包含一个有效的减记超链接引用
- (BOOL)scanMarkdownHyperlinkReferenceLine:(NSString **)reference URLString:(NSString **)URLString title:(NSString **)title;

// 返回"是的"如果一个有效的前缀是扫描列表
- (BOOL)scanMarkdownLineListPrefix:(NSString **)prefix;

// 返回"是的"如果一个开始标记标记范围扫描
- (BOOL)scanMarkdownBeginMarker:(NSString **)beginMarker;

// 返回"是的"如果扫描图像,相当于一个IMG标记及其属性src,alt和标题。如果是引用,在引用的引用也使用。
- (BOOL)scanMarkdownImageAttributes:(NSDictionary **)attributes references:(NSDictionary *)references;

//返回"是的"如果扫描图像,相当于一个href和标题标记及其属性。如果是引用,在引用的引用也使用。
- (BOOL)scanMarkdownHyperlinkAttributes:(NSDictionary **)attributes enclosedString:(NSString **)encosedString references:(NSDictionary *)references;

// 返回"是的"如果文本外层格式标记
- (BOOL)scanMarkdownTextBetweenFormatMarkers:(NSString **)text outermostMarker:(NSString **)outermostMarker;

@end


text:
{% extends "stories/stories_base.html" %}
{% comment %}
{% load comments %}
{% block content %}
  {% get_comment_list for story as comment_list %}
  {% for comment in comment_list %}

    Link to this comment
      {{ comment }}
  {% endfor %}
{% endblock %}
{% endcomment %}


text:
module Maestrano
  module Generators
    module OrmHelpers

      def model_contents

        if model_type == 'user'
          buffer = <<-CONTENT
  # Enable Maestrano for this user
  maestrano_user_via :provider, :uid, :tenant do |user,maestrano|
    user.name = maestrano.first_name
    user.surname = maestrano.last_name
    user.email = maestrano.email

    # user.country_alpha2 = maestrano.country
    # user.some_required_field = 'some-appropriate-default-value'
  end

CONTENT
        else
          buffer = <<-CONTENT
  # Enable Maestrano for this group
  maestrano_group_via :provider, :uid, :tenant do |group, maestrano|
    group.name = (maestrano.company_name || "Default Group name")
    # group.principal_email = maestrano.email
    # group.city = maestrano.city
    # group.olson_tz = maestrano.timezone
    # group.country_alpha2 = maestrano.country
    # group.currency_code = maestrano.currency
    # group.some_required_field = 'some-appropriate-default-value'
  end

CONTENT
        end

        buffer += <<-CONTENT if needs_attr_accessible?
  # Setup protected attributes for your model
  attr_protected :provider, :uid

CONTENT
        buffer
      end

      def model_type
        self.class.name.split("::").last.gsub("Maestrano","").gsub("Generator","").downcase
      end

      def needs_attr_accessible?
        rails_3? && !strong_parameters_enabled?
      end

      def rails_3?
        ::Rails::VERSION::MAJOR == 3
      end

      def strong_parameters_enabled?
        defined?(ActionController::StrongParameters)
      end

      private
        def model_exists?
          File.exist?(File.join(destination_root, model_path))
        end

        def migration_exists?(table_name)
          Dir.glob("#{File.join(destination_root, migration_path)}/[0-9]*_*.rb").grep(/\d+_add_maestrano_to_#{table_name}.rb$/).first
        end

        def migration_path
          @migration_path ||= File.join("db", "migrate")
        end

        def model_path
          @model_path ||= File.join("app", "models", "#{file_path}.rb")
        end
    end
  end
end


text:
class Level < ApplicationRecord
  include SetPosition
  include CanDestroy

  belongs_to :modality
  has_many :student_levels

  validates :name, presence: true
end


text:
<?php

namespace Symfonian\Indonesia\AdminBundle\Generator;

use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Sensio\Bundle\GeneratorBundle\Generator\Generator;

/**
 * Generates a form class based on a Doctrine entity.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 * @author Hugo Hamon <hugo.hamon@sensio.com>
 * @author Muhammad Surya Ihsanuddin <surya.kejawen@gmail.com>
 */
class AbstractGenerator extends Generator
{
    /**
     * @var string
     */
    protected $className;

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

    /**
     * @return string
     */
    public function getClassName()
    {
        return $this->className;
    }

    /**
     * @return string
     */
    public function getClassPath()
    {
        return $this->classPath;
    }

    /**
     * Returns an array of fields. Fields can be both column fields and
     * association fields.
     *
     * @param ClassMetadataInfo $metadata
     *
     * @return array $fields
     */
    protected function getFieldsFromMetadata(ClassMetadataInfo $metadata)
    {
        $fields = (array) $metadata->fieldNames;

        $exclude = array(
            'createdAt', 'created_at', 'createdBy', 'created_by',
            'updatedAt', 'updated_at', 'updatedBy', 'updated_by',
        );

        // Remove the primary key field if it's not managed manually
        if (!$metadata->isIdentifierNatural()) {
            $fields = array_diff($fields, $metadata->identifier);
        }

        foreach ($metadata->associationMappings as $fieldName => $relation) {
            if ($relation['type'] !== ClassMetadataInfo::ONE_TO_MANY) {
                $fields[] = $fieldName;
            }
        }

        return array_values(array_diff($fields, $exclude));
    }

    /**
     * @param string $template
     * @param string $target
     * @param array  $parameters
     *
     * @return int
     */
    protected function renderFile($template, $target, $parameters)
    {
        if (!is_dir(dirname($target))) {
            mkdir(dirname($target), 0777, true);
        }

        return file_put_contents($target, $this->render($template, $parameters));
    }
}