text:
#region Copyright (c) 2012 Roger O Knapp
//  Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
//  IN THE SOFTWARE.
#endregion
#pragma warning disable 1591, 3021

namespace NClassify.Library
{
    using Regex = global::System.Text.RegularExpressions.Regex;
    using Match = global::System.Text.RegularExpressions.Match;
    using Group = global::System.Text.RegularExpressions.Group;

    public partial class TypeConverter
    {
        private static TypeConverter _instance = new TypeConverter();

        public static TypeConverter Instance
        {
            get { return _instance; }
            set
            {
                if (value == null)
                    throw new global::System.ArgumentNullException("value");
                _instance = value;
            }
        }

        private readonly Regex _stdNumberFormat = new Regex(@"[a-zA-Z]\d*");
        private readonly Regex _formatString = new Regex(@"(?<!{){(?<field>\d+)(?<suffix>(?:,(?<width>-?\d+))?(?:\:(?<format>[^}{]+))?)}");

        #region Convert From Text

        protected virtual global::System.Globalization.NumberStyles NumberFormatToStyle(string format)
        {
            char stfmtId = _stdNumberFormat.IsMatch(format) ? char.ToUpper(format[0]) : '\0';
            switch (stfmtId)
            {
                case 'C':
                    return global::System.Globalization.NumberStyles.AllowLeadingSign |
                            global::System.Globalization.NumberStyles.AllowThousands |
                            global::System.Globalization.NumberStyles.AllowDecimalPoint |
                            global::System.Globalization.NumberStyles.AllowTrailingSign;
                case 'P':
                    return global::System.Globalization.NumberStyles.AllowLeadingSign |
                            global::System.Globalization.NumberStyles.AllowDecimalPoint |
                            global::System.Globalization.NumberStyles.AllowTrailingSign;
                case 'D':
                    return global::System.Globalization.NumberStyles.AllowLeadingSign;
                case 'E':
                    return global::System.Globalization.NumberStyles.AllowExponent |
                            global::System.Globalization.NumberStyles.AllowDecimalPoint |
                            global::System.Globalization.NumberStyles.AllowLeadingSign;
                case 'F':
                case 'R':
                    return global::System.Globalization.NumberStyles.AllowDecimalPoint |
                            global::System.Globalization.NumberStyles.AllowLeadingSign;
                case 'G':
                    return global::System.Globalization.NumberStyles.Any;
                case 'N':
                    return global::System.Globalization.NumberStyles.AllowDecimalPoint |
                            global::System.Globalization.NumberStyles.AllowLeadingSign |
                            global::System.Globalization.NumberStyles.AllowThousands |
                            global::System.Globalization.NumberStyles.AllowTrailingSign;
                case 'X':
                    return global::System.Globalization.NumberStyles.AllowHexSpecifier;
                default:
                    throw new global::System.FormatException(string.Format(ResourceMessages.InvalidFormat, format));
            }
        }

        public virtual bool ParseBoolean(string text, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
            {
                if (global::System.StringComparer.OrdinalIgnoreCase.Equals(bool.TrueString, text))
                    return true;
                if (global::System.StringComparer.OrdinalIgnoreCase.Equals(bool.FalseString, text))
                    return false;
                return global::System.Xml.XmlConvert.ToBoolean(text);
            }
            //allows: "1|0", "yes|no", "TRUE|FALSE", or combiniations "1|0;yes|no;true|false"
            if (format.IndexOf('|') > 0)
            {
                foreach (string pair in format.Split(';', ','))
                {
                    string[] values = pair.Split('|');
                    if (values.Length == 2 && global::System.StringComparer.OrdinalIgnoreCase.Equals(values[0], text))
                        return true;
                    if (values.Length == 2 && global::System.StringComparer.OrdinalIgnoreCase.Equals(values[1], text))
                        return false;
                }
                throw new global::System.FormatException(string.Format(ResourceMessages.InvalidFormat, text));
            }
            throw new global::System.FormatException(string.Format(ResourceMessages.InvalidFormat, format));
        }

        [global::System.CLSCompliant(false)]
        public virtual sbyte ParseInt8(string text, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
            {
                int value = global::System.Xml.XmlConvert.ToInt16(text);
                if (value < sbyte.MinValue || value > sbyte.MaxValue)
                    throw new global::System.FormatException(string.Format(ResourceMessages.InvalidFormat, format));
                return (sbyte) value;
            }
            return sbyte.Parse(text, NumberFormatToStyle(format), formatProvider);
        }

        public virtual byte ParseUInt8(string text, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
            {
                ushort value = global::System.Xml.XmlConvert.ToUInt16(text);
                if (value > byte.MaxValue)
                    throw new global::System.FormatException(string.Format(ResourceMessages.InvalidFormat, format));
                return (byte)value;
            }
            return byte.Parse(text, NumberFormatToStyle(format), formatProvider);
        }

        public virtual short ParseInt16(string text, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToInt16(text);
            return short.Parse(text, NumberFormatToStyle(format), formatProvider);
        }

        [global::System.CLSCompliant(false)]
        public virtual ushort ParseUInt16(string text, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToUInt16(text);
            return ushort.Parse(text, NumberFormatToStyle(format), formatProvider);
        }

        public virtual int ParseInt32(string text, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToInt32(text);
            return int.Parse(text, NumberFormatToStyle(format), formatProvider);
        }

        [global::System.CLSCompliant(false)]
        public virtual uint ParseUInt32(string text, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToUInt32(text);
            return uint.Parse(text, NumberFormatToStyle(format), formatProvider);
        }

        public virtual long ParseInt64(string text, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToInt64(text);
            return long.Parse(text, NumberFormatToStyle(format), formatProvider);
        }

        [global::System.CLSCompliant(false)]
        public virtual ulong ParseUInt64(string text, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToUInt64(text);
            return ulong.Parse(text, NumberFormatToStyle(format), formatProvider);
        }

        public virtual float ParseFloat(string text, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToSingle(text);
            return float.Parse(text, NumberFormatToStyle(format), formatProvider);
        }

        public virtual double ParseDouble(string text, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToDouble(text);
            return double.Parse(text, NumberFormatToStyle(format), formatProvider);
        }

        public virtual global::System.Guid ParseGuid(string text, string format, global::System.IFormatProvider formatProvider)
        {
            return new global::System.Guid(text);
        }

        public virtual global::System.DateTime ParseDateTime(string text, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToDateTime(text, global::System.Xml.XmlDateTimeSerializationMode.RoundtripKind);
            return global::System.DateTime.ParseExact(text, format, formatProvider, global::System.Globalization.DateTimeStyles.None);
        }

        #region ParseTimeSpan Implementation

        private readonly global::System.Collections.Generic.Dictionary<string, object[]> _parseTimeSpanCache =
            new global::System.Collections.Generic.Dictionary<string, object[]>(global::System.StringComparer.Ordinal);

        private object[] CreateExpression(out Regex exp, out int[] fieldsUsed, string format, global::System.IFormatProvider formatProvider)
        {
            global::System.Globalization.NumberFormatInfo nfi =
                global::System.Globalization.NumberFormatInfo.GetInstance(formatProvider);

            object[] numFormat;
            lock (_parseTimeSpanCache)
            {
                if (!_parseTimeSpanCache.TryGetValue(format, out numFormat))
                {
                    numFormat = new object[15];
                    global::System.Collections.Generic.List<int> fields = new global::System.Collections.Generic.List<int>();

                    int pos = 0;
                    global::System.Text.StringBuilder sb = new global::System.Text.StringBuilder();
                    sb.Append("^");
                    foreach (Match m in _formatString.Matches(format))
                    {
                        sb.Append(Regex.Escape(format.Substring(pos, m.Index - pos)));
                        pos = m.Index + m.Length;
                        int fld = int.Parse(m.Groups["field"].Value);
                        if (fld < 0 || fld > 12)
                            throw new global::System.FormatException(string.Format(ResourceMessages.InvalidFormat, format));
                        if (fld == 2) //neg sign
                            sb.AppendFormat("(?<f{0}>{1})?", fld, Regex.Escape(nfi.NegativeSign));
                        else if(pos+1 < format.Length)
                            sb.AppendFormat("(?<f{0}>[^{1}]+?)", fld, Regex.Escape(new string(format[pos + 1], 1)));
                        else
                            sb.AppendFormat("(?<f{0}>.+)", fld);
                        numFormat[fld] = m.Groups["format"].Success ? m.Groups["format"].Value : null;
                        fields.Add(fld);
                    }
                    sb.Append(Regex.Escape(format.Substring(pos, format.Length - pos)));
                    sb.Append("$");
                    numFormat[13] = new Regex(sb.ToString());
                    numFormat[14] = fields.ToArray();
                    _parseTimeSpanCache[format] = numFormat;
                }
            }
            exp = (Regex) numFormat[13];
            fieldsUsed = (int[]) numFormat[14];
            return numFormat;
        }

        public virtual global::System.TimeSpan ParseTimeSpan(string text, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToTimeSpan(text);

            Regex pattern;
            int[] fields;
            object[] numFormat = CreateExpression(out pattern, out fields, format, formatProvider);
            Match match = pattern.Match(text);
            if(!match.Success)
                throw new global::System.FormatException(string.Format(ResourceMessages.InvalidFormat, text));

            bool negate = false;
            global::System.TimeSpan value = global::System.TimeSpan.Zero;

            foreach(int ixfld in fields)
            {
                Group grp = match.Groups["f" + ixfld];
                if (!grp.Success) continue;
                switch (ixfld)
                {
                    case 0: //value,
                        value += global::System.TimeSpan.Parse(grp.Value);
                        break;
                    case 1: //value.Ticks,
                        value += new global::System.TimeSpan(ParseInt64(grp.Value, (string)numFormat[ixfld], formatProvider));
                        break;
                    case 2: //value.Ticks < 0 ? negSign : "",
                        negate = true;
                        break;
                    case 3: //global::System.Math.Abs(value.Days),
                    case 8: //value.TotalDays,
                        value += global::System.TimeSpan.FromDays(ParseDouble(grp.Value, (string)numFormat[ixfld], formatProvider));
                        break;
                    case 4: //global::System.Math.Abs(value.Hours),
                    case 9: //value.TotalHours,
                        value += global::System.TimeSpan.FromHours(ParseDouble(grp.Value, (string)numFormat[ixfld], formatProvider));
                        break;
                    case 5: //global::System.Math.Abs(value.Minutes),
                    case 10: //value.TotalMinutes,
                        value += global::System.TimeSpan.FromMinutes(ParseDouble(grp.Value, (string)numFormat[ixfld], formatProvider));
                        break;
                    case 6: //global::System.Math.Abs(value.Seconds),
                    case 11: //value.TotalSeconds,
                        value += global::System.TimeSpan.FromSeconds(ParseDouble(grp.Value, (string)numFormat[ixfld], formatProvider));
                        break;
                    case 7: //global::System.Math.Abs(value.Milliseconds),
                    case 12: //value.TotalMilliseconds
                        value += global::System.TimeSpan.FromMilliseconds(ParseDouble(grp.Value, (string)numFormat[ixfld], formatProvider));
                        break;
                }
            }
            return negate ? value.Negate() : value;
        }
        #endregion

        #endregion
        #region Convert To Text

        public virtual string ToString(bool value, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToString(value);
            //allows: "1|0", "yes|no", "TRUE|FALSE", or combiniations "1|0;yes|no;true|false"
            if (format.IndexOf('|') > 0)
                return format.Split('|', ';', ',')[value ? 0 : 1];
            throw new global::System.FormatException(string.Format(ResourceMessages.InvalidFormat, format));
        }

        [global::System.CLSCompliant(false)]
        public virtual string ToString(sbyte value, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToString(value);
            return value.ToString(format, formatProvider);
        }

        public virtual string ToString(byte value, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToString(value);
            return value.ToString(format, formatProvider);
        }

        public virtual string ToString(short value, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToString(value);
            return value.ToString(format, formatProvider);
        }

        [global::System.CLSCompliant(false)]
        public virtual string ToString(ushort value, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToString(value);
            return value.ToString(format, formatProvider);
        }

        public virtual string ToString(int value, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToString(value);
            return value.ToString(format, formatProvider);
        }

        [global::System.CLSCompliant(false)]
        public virtual string ToString(uint value, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToString(value);
            return value.ToString(format, formatProvider);
        }

        public virtual string ToString(long value, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToString(value);
            return value.ToString(format, formatProvider);
        }

        [global::System.CLSCompliant(false)]
        public virtual string ToString(ulong value, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToString(value);
            return value.ToString(format, formatProvider);
        }

        public virtual string ToString(float value, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToString(value);
            return value.ToString(format, formatProvider);
        }

        public virtual string ToString(double value, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToString(value);
            return value.ToString(format, formatProvider);
        }

        public virtual string ToString(global::System.Guid value, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToString(value);
            return value.ToString(format, formatProvider);
        }

        public virtual string ToString(global::System.DateTime value, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToString(value, global::System.Xml.XmlDateTimeSerializationMode.RoundtripKind);
            return value.ToString(format, formatProvider);
        }

        public virtual string ToString(global::System.TimeSpan value, string format, global::System.IFormatProvider formatProvider)
        {
            if (string.IsNullOrEmpty(format))
                return global::System.Xml.XmlConvert.ToString(value);
            //ex: "{2}{3} {4:d2}:{5:d2}:{6:d2}.{7:d3}ms" == "-1 20:13:49.100ms"
            //ex: "{11:n3} seconds" == "-98,983.542 seconds"
            string negSign = global::System.Globalization.NumberFormatInfo.GetInstance(formatProvider).NegativeSign;
            return string.Format(
                formatProvider, format,
                //{0}-{2}
                value, value.Ticks, value.Ticks < 0 ? negSign : "",
                //{3}-{7}
                global::System.Math.Abs(value.Days), global::System.Math.Abs(value.Hours),
                global::System.Math.Abs(value.Minutes), global::System.Math.Abs(value.Seconds),
                global::System.Math.Abs(value.Milliseconds),
                //{8}-{12}
                value.TotalDays, value.TotalHours,
                value.TotalMinutes, value.TotalSeconds,
                value.TotalMilliseconds
                );
        }

        #endregion
    }
}


text:
![freeCodeCamp Social Banner](https://s3.amazonaws.com/freecodecamp/wide-social-banner.png)

[![Throughput Graph](https://graphs.waffle.io/freecodecamp/freecodecamp/throughput.svg)](https://waffle.io/freecodecamp/freecodecamp/metrics)

[![Join the chat at https://gitter.im/freecodecamp/freecodecamp](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/freecodecamp/freecodecamp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Known Vulnerabilities](https://snyk.io/test/github/freecodecamp/freecodecamp/badge.svg)](https://snyk.io/test/github/freecodecamp/freecodecamp)
[![Build Status](https://travis-ci.org/freeCodeCamp/freeCodeCamp.svg?branch=staging)](https://travis-ci.org/freeCodeCamp/freeCodeCamp)
[![Pull Requests Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](http://makeapullrequest.com)
[![first-timers-only Friendly](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/)

Welcome to freeCodeCamp's open source codebase and curriculum!
=======================

freeCodeCamp is a friendly open source community where you learn to code and help nonprofits.

**We help our campers build job-worthy portfolios of real apps used by real people, while helping nonprofits.**

You start by working through our self-paced, browser-based full stack JavaScript curriculum.

### By working through our curriculum, you can earn four certifications:
##### 1. Front End Certification
The first section will teach you the basics of how webpages work and also introduce you to JavaScript programming.

Skills you'll practice include `HTML`, `CSS`, `JavaScript`, `jQuery` and `Bootstrap`.

To earn this certification, you'll build **10 front-end projects** and implement many **JavaScript algorithms**.

##### 2. Data Visualization Certification
The second section builds upon the first and introduces you to more advanced topics such as `Sass`, `React` and `D3`.

To earn this certification, you'll build **5 React-apps** and **5 Data visualization apps** using `D3.js`.

##### 3. Back End Certification
The third section introduces you to back end development using `Node.js`, `Express,` and `MongoDB`. It also teaches you about the important concept of source control using `Git`.

To earn this certification, you'll build **5 APIs** and **5 full stack apps**.

We will accept solutions implemented in _any_ programming language, as long as both a live demo and the source code are publicly accessible.

##### 4. Full Stack Certification
The fourth section is where you'll get **real-world experience** by working on projects for **nonprofits**.
We'll pair you with another camper, an agile project manager, and a stakeholder from a nonprofit organization. Together, you'll plan, build and maintain apps that help that nonprofit carry out its mission more effectively.

For this certification, you'll work on **two projects from scratch** and then **maintain/upgrade two existing projects**.

---

This code is running live at [freeCodeCamp.com](https://www.freecodecamp.com). We also have [Gitter chat rooms](https://gitter.im/FreeCodeCamp/FreeCodeCamp), a [Medium publication](https://medium.freecodecamp.com), an [interactive forum](https://forum.freecodecamp.com), a [wiki knowledgebase](https://forum.freecodecamp.com/c/wiki), and even a [YouTube channel](https://youtube.com/freecodecamp).

### [Join our community here](https://www.freecodecamp.com/signin).

Found a bug?
------------

Do not file an issue until you have followed these steps:

1. Read the [Help I've Found a Bug](http://forum.freecodecamp.com/t/how-to-report-a-bug/19543) article and follow its instructions.
2. Ask for confirmation in the appropriate [Help Room](http://forum.freecodecamp.com/t/free-code-camp-official-chat-rooms/19390/2).
3. Please *do not* open an issue without a 3rd party confirmation of your problem.

Contributing
------------

We welcome pull requests from freeCodeCamp campers (our students) and seasoned JavaScript developers alike! Please follow [these steps](CONTRIBUTING.md) to contribute.

License
-------

Copyright (c) 2017 freeCodeCamp.

The content of this repository bound by the following LICENSE(S)
- The computer software is licensed under the [BSD-3-Clause](./LICENSE.md).
- The curricular content as in the `./seed/challenges` or subdirectories and our wiki are licensed under the [CC-BY-SA-4.0](./LICENSE-freeCodeCamp-Curriculum.md)

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Antares\Twig\Extension;

use Twig_Extension;
use Twig_SimpleFunction;
use Illuminate\Support\Str;
use Antares\Support\Facades\Theme;
use Antares\Asset\Factory;

/**
 * Access Laravels asset class in your Twig templates.
 */
class AssetManager extends Twig_Extension
{

    /**
     * @var \Antares\Asset\Asset
     */
    protected $factory;

    /**
     * constructing
     * @param Factory $asset
     */
    public function __construct(Factory $asset)
    {
        $this->factory = $asset->container('antares.header');
    }

    /**
     * {@inheritDoc}
     */
    public function getName()
    {
        return 'Antares_Twig_Extension_AssetManager';
    }

    /**
     * {@inheritDoc}
     */
    public function getFunctions()
    {
        $assetm = new Twig_SimpleFunction(
                'assetm', function ($name) {
            $arguments = array_slice(func_get_args(), 1);
            $name      = Str::camel($name);
            return call_user_func_array([$this, $name], $arguments);
        });

        $assetshow = new Twig_SimpleFunction(
                'assetm_*', function ($name) {
            $arguments = array_slice(func_get_args(), 1);
            $name      = Str::camel($name);
            echo call_user_func_array([$this->factory, $name], $arguments);
        });

        return [
            $assetm, $assetshow
        ];
    }

    /**
     * @see Factory::style
     * @param String $name
     * @param String $path
     * @param array $dependencies
     */
    public function style($name = null, $path = null, array $dependencies = [])
    {
        $assetPath = $this->resolvePath($path);
        $this->factory->style($name, $assetPath, $dependencies);
    }

    /**
     * @see Factory::script
     * @param String $name
     * @param String $path
     * @param array $dependencies
     */
    public function script($name = null, $path = null, array $dependencies = [])
    {
        $assetPath = $this->resolvePath($path);
        $this->factory->script($name, $assetPath, $dependencies);
    }

    /**
     * path resolver
     * @param String $path
     * @return String
     */
    protected function resolvePath($path)
    {
        return starts_with($path, 'theme::') ? Theme::asset(str_replace('theme::', '', $path)) : $path;
    }

}


text:
import lighten from 'polished/lib/color/lighten';
export const itemSelectedColor = color => lighten(0.04, color);
//# sourceMappingURL=itemSelectedColor.js.map


text:
<?php

namespace OpenOrchestra\UserAdminBundle\Security;

use OpenOrchestra\UserAdminBundle\Exception\NoRolesException;
use Symfony\Component\Security\Core\User\UserChecker;
use Symfony\Component\Security\Core\User\UserInterface;
use OpenOrchestra\UserBundle\Model\UserInterface as OrchestraUserInterface;

/**
 * Class OrchestraUserChecker
 */
class OrchestraUserChecker extends UserChecker
{
    /**
     * {@inheritdoc}
     */
    public function checkPreAuth(UserInterface $user)
    {
        parent::checkPreAuth($user);

        if (!$user instanceof OrchestraUserInterface) {
            return;
        }

        $roles = $user->getRoles();
        if (
            empty($roles) ||
            (1 === count($roles) && $user->hasRole(OrchestraUserInterface::ROLE_DEFAULT))
        ) {
            $ex = new NoRolesException('Account has not access');
            $ex->setUser($user);
            throw $ex;
        }
    }
}


text: Helpers for UMI.CMS


text:
package com.github.cjm0000000.mmt.shared.message.process;

import org.apache.log4j.Logger;

import com.github.cjm0000000.mmt.core.access.AccessTokenServiceManager;
import com.github.cjm0000000.mmt.core.access.JSONResponse;
import com.github.cjm0000000.mmt.core.config.MmtConfig;
import com.github.cjm0000000.mmt.core.message.process.InitiativeMsgProcessor;
import com.github.cjm0000000.mmt.core.message.send.initiative.ImageMessage;
import com.github.cjm0000000.mmt.core.message.send.initiative.MusicMessage;
import com.github.cjm0000000.mmt.core.message.send.initiative.NewsMessage;
import com.github.cjm0000000.mmt.core.message.send.initiative.SimpleMessage;
import com.github.cjm0000000.mmt.core.message.send.initiative.TextMessage;
import com.github.cjm0000000.mmt.core.parser.MmtJSONParser;
import com.github.cjm0000000.mmt.shared.access.ReturnCode;
import com.github.cjm0000000.mmt.shared.toolkit.http.HttpConnector;

/**
 * abstract initiative message processor
 *
 * @author lemon
 * @version 2.0
 *
 */
public abstract class AbstractInitiativeMsgProcessor
    implements
      InitiativeMsgProcessor,
      AccessTokenServiceManager {
  private static final Logger logger = Logger.getLogger(AbstractInitiativeMsgProcessor.class);
  private static final String SEND_MSG_URL =
      "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=";

  /**
   * get send message URL
   *
   * @param cfg
   * @return
   */
  protected String getSendMsgUrl(MmtConfig cfg) {
    return SEND_MSG_URL + getAccessTokenService().getAccessToken(cfg);
  }

  /**
   * send message for bottom layer
   *
   * @param cfg
   * @param msg
   * @return
   */
  protected JSONResponse sendMsg(MmtConfig cfg, SimpleMessage msg) {
    String json = MmtJSONParser.toJSON(msg);
    if (logger.isDebugEnabled()) logger.debug("generate json message: " + json);
    String response = HttpConnector.post(getSendMsgUrl(cfg), json);
    if (logger.isDebugEnabled())
      logger.debug("send text message successfully. response= " + response);
    return (ReturnCode) MmtJSONParser.fromJSON(response, ReturnCode.class);
  }

  @Override
  public JSONResponse sendTextMsg(MmtConfig cfg, TextMessage msg) {
    return sendMsg(cfg, msg);
  }

  @Override
  public JSONResponse sendImageMsg(MmtConfig cfg, ImageMessage msg) {
    return sendMsg(cfg, msg);
  }

  @Override
  public JSONResponse sendMusicMsg(MmtConfig cfg, MusicMessage msg) {
    return sendMsg(cfg, msg);
  }

  @Override
  public JSONResponse sendNewsMsg(MmtConfig cfg, NewsMessage msg) {
    return sendMsg(cfg, msg);
  }

}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Composition;
using System.Linq;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.LanguageServer;

/// <summary>
/// Defines an attribute to export an instance of <see cref="ILspService"/> that is re-used across
/// all server instances in the same mef container.  Services using this export attribute should not
/// store any kind of server specific state in them.
///
/// MEF will dispose of these services when the container is disposed of.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false), MetadataAttribute]
internal class ExportStatelessLspServiceAttribute : ExportAttribute
{
    /// <summary>
    /// The type of the service being exported.  Used during retrieval to find the matching service.
    /// </summary>
    public Type Type { get; }

    /// <summary>
    /// The LSP server for which this service applies to.  If null, this service applies to any server
    /// with the matching contract name.
    /// </summary>
    public WellKnownLspServerKinds? ServerKind { get; }

    /// <summary>
    /// Services MEF exported as <see cref="ILspService"/> must by definition be stateless as they are
    /// shared amongst all LSP server instances through restarts.
    /// </summary>
    public bool IsStateless { get; } = true;

    public ExportStatelessLspServiceAttribute(Type type, string contractName, WellKnownLspServerKinds serverKind = WellKnownLspServerKinds.Any) : base(contractName, typeof(ILspService))
    {
        Contract.ThrowIfFalse(type.GetInterfaces().Contains(typeof(ILspService)), $"{type.Name} does not inherit from {nameof(ILspService)}");
        Type = type;
        ServerKind = serverKind;
    }
}


text:
published: true
title: Messe de funérailles à la mémoire de Louis XVI
---
**Lundi 21 janvier 2019, messe à 18h30**

![Affiche Louis XVI .jpg]({{site.baseurl}}/images/Affiche%20Louis%20XVI%20.jpg)

*Requiem aeternam dona eis Domine, et lux perpetua luceat eis.*
Donnez-lui, Seigneur, le repos éternel, et que brille pour lui la lumière qui jamais ne décline.

Kyriale chanté en alternance polyphonique selon la *Messe de Requiem à quatre voix* anonyme - Processionnel de Cambrai

**Introït : Requiem aeternam**
Alternance polyphonique de la *Messe de Cambrai*

**Graduel : Requiem aeternam**

**Trait : Absolve Domine**

**Dies irae**
Alternance polyphonique *Messe de Cambrai*

**Offertoire : De profundis**
Faux bourdon du 1er ton, issu de *Faux-bourdons pour les fêtes solemnelles* Paris 1771

**Consécration : O salutaris Hostia**
Anonyme XVIe *Occo codex*

**Communion : Lux aeterna**
Antoine Divitis 1475-1530

**Au dernier évangile : Alma redemptoris Mater**

**Sortie : Domine salvum fac Regem**
*Faux-bourdons pour les fêtes solemnelles* Paris 1771

Lireplus

![Domine salvam .jpg]({{site.baseurl}}/images/Domine%20salvam%20.jpg)
**Domine salvum fac Regem** faux-bourdon à 4 voix issu de *Faux-bourdons pour les fêtes solemnelles*  Paris 1771, bibliothèque Inguimbertine de Carpentras


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <string name="symbol_apostrophe">גרש</string>
  <string name="symbol_ampersand">אמפרסנד</string>
  <string name="symbol_angle_bracket_left">הסימן פחות מ-</string>
  <string name="symbol_angle_bracket_right">הסימן גדול מ-</string>
  <string name="symbol_asterisk">כוכבית</string>
  <string name="symbol_at_sign">שטרודל</string>
  <string name="symbol_backslash">קו נטוי הפוך</string>
  <string name="symbol_bullet">תבליט</string>
  <string name="symbol_caret">קארה</string>
  <string name="symbol_cent">סימן של סנט</string>
  <string name="symbol_colon">נקודתיים</string>
  <string name="symbol_comma">פסיק</string>
  <string name="symbol_copyright">זכויות יוצרים</string>
  <string name="symbol_curly_bracket_left">סוגר מסולסל שמאלי</string>
  <string name="symbol_curly_bracket_right">סוגר מסולסל ימני</string>
  <string name="symbol_degree">סימן המעלה</string>
  <string name="symbol_division">סימן חילוק</string>
  <string name="symbol_dollar_sign">סימן דולר</string>
  <string name="symbol_ellipsis">שלוש נקודות</string>
  <string name="symbol_em_dash">מקף ארוך</string>
  <string name="symbol_en_dash">מקף בינוני</string>
  <string name="symbol_euro">יורו</string>
  <string name="symbol_exclamation_mark">סימן קריאה</string>
  <string name="symbol_grave_accent">סימון הטעמה מסוג Grave</string>
  <string name="symbol_hyphen_minus">מקף</string>
  <string name="symbol_low_double_quote">מירכאות כפולות תחתונות</string>
  <string name="symbol_multiplication">סימן כפל</string>
  <string name="symbol_new_line">שורה חדשה</string>
  <string name="symbol_paragraph_mark">סימן פיסקה</string>
  <string name="symbol_parenthesis_left">סוגר שמאלי</string>
  <string name="symbol_parenthesis_right">סוגר ימני</string>
  <string name="symbol_percent">אחוז</string>
  <string name="symbol_period">נקודה</string>
  <string name="symbol_pi">פאי</string>
  <string name="symbol_pound">סולמית</string>
  <string name="symbol_pound_sterling">סימן המטבע פאונד</string>
  <string name="symbol_question_mark">סימן שאלה</string>
  <string name="symbol_quotation_mark">גרש</string>
  <string name="symbol_registered_trademark">סימן מסחרי רשום</string>
  <string name="symbol_semicolon">נקודה ופסיק</string>
  <string name="symbol_slash">קו נטוי</string>
  <string name="symbol_space">רווח</string>
  <string name="symbol_square_bracket_left">סוגר מרובע שמאלי</string>
  <string name="symbol_square_bracket_right">סוגר מרובע ימני</string>
  <string name="symbol_square_root">שורש ריבועי</string>
  <string name="symbol_trademark">סימן מסחרי</string>
  <string name="symbol_underscore">מקף תחתון</string>
  <string name="symbol_vertical_bar">קו אנכי</string>
  <string name="symbol_yen">ין</string>
  <string name="symbol_not_sign">סימן \'אינו\'</string>
  <string name="symbol_broken_bar">פס חצוי</string>
  <string name="symbol_micro_sign">סימן מיקרו</string>
  <string name="symbol_almost_equals">כמעט שווה ל-</string>
  <string name="symbol_not_equals">לא שווה</string>
  <string name="symbol_currency_sign">סימן מטבע</string>
  <string name="symbol_section_sign">סימן קטע</string>
  <string name="symbol_upwards_arrow">חץ למעלה</string>
  <string name="symbol_leftwards_arrow">חץ שמאלה</string>
  <string name="symbol_rupee">רופיות</string>
  <string name="symbol_black_heart">לב שחור</string>
  <string name="symbol_tilde">טילדה</string>
  <string name="symbol_equal">סימן שוויון</string>
  <string name="symbol_won">סימן המטבע של וון דרום קוריאני</string>
  <string name="symbol_reference">סימן ייחוס</string>
  <string name="symbol_white_star">כוכב לבן</string>
  <string name="symbol_black_star">כוכב שחור</string>
  <string name="symbol_white_heart">לב לבן</string>
  <string name="symbol_white_circle">מעגל לבן</string>
  <string name="symbol_black_circle">עיגול שחור</string>
  <string name="symbol_solar">סימן שמש</string>
  <string name="symbol_bullseye">מרכז המטרה</string>
  <string name="symbol_white_club_suit">סימן תלתן לבן</string>
  <string name="symbol_white_spade_suit">סימן עלה לבן</string>
  <string name="symbol_white_left_pointing_index">אצבע לבנה מצביעה שמאלה</string>
  <string name="symbol_white_right_pointing_index">אצבע לבנה מצביעה ימינה</string>
  <string name="symbol_circle_left_half_black">מעגל שחציו השמאלי שחור</string>
  <string name="symbol_circle_right_half_black">מעגל שחציו הימני שחור</string>
  <string name="symbol_white_square">ריבוע לבן</string>
  <string name="symbol_black_square">ריבוע שחור</string>
  <string name="symbol_white_up_pointing_triangle">משולש לבן מצביע למעלה</string>
  <string name="symbol_white_down_pointing_triangle">משולש לבן מצביע למטה</string>
  <string name="symbol_white_left_pointing_triangle">משולש לבן מצביע שמאלה</string>
  <string name="symbol_white_right_pointing_triangle">משולש לבן מצביע ימינה</string>
  <string name="symbol_white_diamond">יהלום לבן</string>
  <string name="symbol_quarter_note">תו רבע</string>
  <string name="symbol_eighth_note">תו שמינית</string>
  <string name="symbol_beamed_sixteenth_note">תווים במקצב חלקי שש עשרה</string>
  <string name="symbol_female">סמל נקבה</string>
  <string name="symbol_male">סמל זכר</string>
  <string name="symbol_left_black_lenticular_bracket">סוגר שמאלי שחור בצורת עדשה</string>
  <string name="symbol_right_black_lenticular_bracket">סוגר ימני שחור בצורת עדשה</string>
  <string name="symbol_left_corner_bracket">סוגר פינתי שמאלי</string>
  <string name="symbol_right_corner_bracket">סוגר פינתי ימני</string>
  <string name="symbol_rightwards_arrow">חץ ימינה</string>
  <string name="symbol_downwards_arrow">חץ למטה</string>
  <string name="symbol_plus_minus_sign">סימן פלוס מינוס</string>
  <string name="symbol_liter">ליטר</string>
  <string name="symbol_celsius_degree">מעלות צלזיוס</string>
  <string name="symbol_fahrenheit_degree">מעלות פרנהייט</string>
  <string name="symbol_approximately_equals">שווה בערך</string>
  <string name="symbol_integral">אינטגרל</string>
  <string name="symbol_mathematical_left_angle_bracket">סוגר זוויתי שמאלי מתמטי</string>
  <string name="symbol_mathematical_right_angle_bracket">סוגר זוויתי ימני מתמטי</string>
  <string name="symbol_postal_mark">סימן דואר</string>
  <string name="symbol_black_triangle_pointing_up">משולש שחור שמצביע למעלה</string>
  <string name="symbol_black_triangle_pointing_down">משולש שחור שמצביע למטה</string>
  <string name="symbol_black_suit_of_diamonds">סדרת יהלום בצבע שחור</string>
  <string name="symbol_halfwidth_katakana_middle_dot">נקודה אמצעית קטאקאנה בחצי רוחב</string>
  <string name="symbol_black_smallsquare">ריבוע שחור קטן</string>
  <string name="symbol_left_angle_bracket">סוגר שמאלי בעל זווית כפולה</string>
  <string name="symbol_right_angle_bracket">סוגר ימני בעל זווית כפולה</string>
  <string name="symbol_inverted_exclamation_mark">סימן קריאה הפוך</string>
  <string name="symbol_inverted_question_mark">סימן שאלה הפוך</string>
  <string name="symbol_won_sign">סימן המטבע של וון דרום קוריאני</string>
  <string name="symbol_full_width_comma">פסיק ברוחב מלא</string>
  <string name="symbol_full_width_exclamation_mark">סימן קריאה ברוחב מלא</string>
  <string name="symbol_full_width_ideographic_full_stop">נקודה אידאוגרפית</string>
  <string name="symbol_full_width_question_mark">סימן שאלה ברוחב מלא</string>
  <string name="symbol_middle_dot">נקודה אמצעית</string>
  <string name="symbol_right_double_quotation_mark">מירכאות כפולות ימניות</string>
  <string name="symbol_ideographic_comma">פסיק אידאוגרפי</string>
  <string name="symbol_full_width_colon">נקודתיים ברוחב מלא</string>
  <string name="symbol_full_width_semicolon">נקודה-פסיק ברוחב מלא</string>
  <string name="symbol_full_width_ampersand">אמפרסנד ברוחב מלא</string>
  <string name="symbol_full_width_circumflex">גג ברוחב מלא</string>
  <string name="symbol_full_width_tilde">טילדה ברוחב מלא</string>
  <string name="symbol_left_double_quotation_mark">מירכאות כפולות שמאליות</string>
  <string name="symbol_full_width_left_parenthesis">סוגר שמאלי ברוחב מלא</string>
  <string name="symbol_full_width_right_parenthesis">סוגר ימני ברוחב מלא</string>
  <string name="symbol_full_width_asterisk">כוכבית ברוחב מלא</string>
  <string name="symbol_full_width_underscore">קו תחתון ברוחב מלא</string>
  <string name="symbol_right_single_quotation_mark">סימן גרש ימני יחיד</string>
  <string name="symbol_full_width_left_curly_bracket">סוגר מסולסל שמאלי ברוחב מלא</string>
  <string name="symbol_full_width_right_curly_bracket">סוגר מסולסל ימני ברוחב מלא</string>
  <string name="symbol_full_width_less_than_sign">סימן \'קטן מ-\' ברוחב מלא</string>
  <string name="symbol_full_width_greater_than_sign">סימן \'גדול מ-\' ברוחב מלא</string>
  <string name="symbol_left_single_quotation_mark">סימן גרש שמאלי יחיד</string>
</resources>


text:
@implementation TCFakeLocationManagerDelegate

// Nothing to do, really ...

@end


text:
<?php
declare(strict_types=1);

// @link http://schemas.triniti.io/json-schema/triniti/news/mixin/article/1-0-4.json#
namespace Triniti\Schemas\News\Mixin\Article;

use Gdbots\Pbj\Schema;

/**
 * @method static Schema schema
 * @method mixed fget($fieldName, $default = null)
 */
trait ArticleV1Mixin
{
    public function getUriTemplateVars(): array
    {
        return [
            '_id' => $this->fget('_id'),
            'slug' => $this->fget('slug'),
        ];
    }
}


text:
namespace ui {

namespace {

struct PageFlipPayload {
  PageFlipPayload(const scoped_refptr<base::TaskRunner>& task_runner,
                  const DrmDevice::PageFlipCallback& callback)
      : task_runner(task_runner), callback(callback) {}

  // Task runner for the thread scheduling the page flip event. This is used to
  // run the callback on the same thread the callback was created on.
  scoped_refptr<base::TaskRunner> task_runner;
  DrmDevice::PageFlipCallback callback;
};

bool DrmCreateDumbBuffer(int fd,
                         const SkImageInfo& info,
                         uint32_t* handle,
                         uint32_t* stride) {
  struct drm_mode_create_dumb request;
  memset(&request, 0, sizeof(request));
  request.width = info.width();
  request.height = info.height();
  request.bpp = info.bytesPerPixel() << 3;
  request.flags = 0;

  if (drmIoctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &request) < 0) {
    VPLOG(2) << "Cannot create dumb buffer";
    return false;
  }

  // The driver may choose to align the last row as well. We don't care about
  // the last alignment bits since they aren't used for display purposes, so
  // just check that the expected size is <= to what the driver allocated.
  DCHECK_LE(info.getSafeSize(request.pitch), request.size);

  *handle = request.handle;
  *stride = request.pitch;
  return true;
}

void DrmDestroyDumbBuffer(int fd, uint32_t handle) {
  struct drm_mode_destroy_dumb destroy_request;
  memset(&destroy_request, 0, sizeof(destroy_request));
  destroy_request.handle = handle;
  drmIoctl(fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_request);
}

void HandlePageFlipEventOnIO(int fd,
                             unsigned int frame,
                             unsigned int seconds,
                             unsigned int useconds,
                             void* data) {
  scoped_ptr<PageFlipPayload> payload(static_cast<PageFlipPayload*>(data));
  payload->task_runner->PostTask(
      FROM_HERE, base::Bind(payload->callback, frame, seconds, useconds));
}

void HandlePageFlipEventOnUI(int fd,
                             unsigned int frame,
                             unsigned int seconds,
                             unsigned int useconds,
                             void* data) {
  scoped_ptr<PageFlipPayload> payload(static_cast<PageFlipPayload*>(data));
  payload->callback.Run(frame, seconds, useconds);
}

bool CanQueryForResources(int fd) {
  drm_mode_card_res resources;
  memset(&resources, 0, sizeof(resources));
  // If there is no error getting DRM resources then assume this is a
  // modesetting device.
  return !drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &resources);
}

}  // namespace

class DrmDevice::IOWatcher
    : public base::RefCountedThreadSafe<DrmDevice::IOWatcher>,
      public base::MessagePumpLibevent::Watcher {
 public:
  IOWatcher(int fd,
            const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner)
      : io_task_runner_(io_task_runner), paused_(true), fd_(fd) {}

  void SetPaused(bool paused) {
    if (paused_ == paused)
      return;

    paused_ = paused;
    base::WaitableEvent done(false, false);
    io_task_runner_->PostTask(
        FROM_HERE, base::Bind(&IOWatcher::SetPausedOnIO, this, &done));
  }

  void Shutdown() {
    if (!paused_)
      io_task_runner_->PostTask(FROM_HERE,
                                base::Bind(&IOWatcher::UnregisterOnIO, this));
  }

 private:
  friend class base::RefCountedThreadSafe<IOWatcher>;

  ~IOWatcher() override { SetPaused(true); }

  void RegisterOnIO() {
    DCHECK(base::MessageLoopForIO::IsCurrent());
    base::MessageLoopForIO::current()->WatchFileDescriptor(
        fd_, true, base::MessageLoopForIO::WATCH_READ, &controller_, this);
  }

  void UnregisterOnIO() {
    DCHECK(base::MessageLoopForIO::IsCurrent());
    controller_.StopWatchingFileDescriptor();
  }

  void SetPausedOnIO(base::WaitableEvent* done) {
    DCHECK(base::MessageLoopForIO::IsCurrent());
    if (paused_)
      UnregisterOnIO();
    else
      RegisterOnIO();
    done->Signal();
  }

  // base::MessagePumpLibevent::Watcher overrides:
  void OnFileCanReadWithoutBlocking(int fd) override {
    DCHECK(base::MessageLoopForIO::IsCurrent());
    TRACE_EVENT1("drm", "OnDrmEvent", "socket", fd);

    drmEventContext event;
    event.version = DRM_EVENT_CONTEXT_VERSION;
    event.page_flip_handler = HandlePageFlipEventOnIO;
    event.vblank_handler = nullptr;

    drmHandleEvent(fd, &event);
  }

  void OnFileCanWriteWithoutBlocking(int fd) override { NOTREACHED(); }

  scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;

  base::MessagePumpLibevent::FileDescriptorWatcher controller_;

  bool paused_;
  int fd_;

  DISALLOW_COPY_AND_ASSIGN(IOWatcher);
};

DrmDevice::DrmDevice(const base::FilePath& device_path)
    : device_path_(device_path),
      file_(device_path,
            base::File::FLAG_OPEN | base::File::FLAG_READ |
                base::File::FLAG_WRITE) {
  LOG_IF(FATAL, !file_.IsValid())
      << "Failed to open '" << device_path_.value()
      << "': " << base::File::ErrorToString(file_.error_details());
}

DrmDevice::DrmDevice(const base::FilePath& device_path, base::File file)
    : device_path_(device_path), file_(file.Pass()) {
}

DrmDevice::~DrmDevice() {
  if (watcher_)
    watcher_->Shutdown();
}

bool DrmDevice::Initialize() {
  // Ignore devices that cannot perform modesetting.
  if (!CanQueryForResources(file_.GetPlatformFile())) {
    VLOG(2) << "Cannot query for resources for '" << device_path_.value()
            << "'";
    return false;
  }

  plane_manager_.reset(new HardwareDisplayPlaneManagerLegacy());
  if (!plane_manager_->Initialize(this)) {
    LOG(ERROR) << "Failed to initialize the plane manager for "
               << device_path_.value();
    plane_manager_.reset();
    return false;
  }

  return true;
}

void DrmDevice::InitializeTaskRunner(
    const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
  DCHECK(!task_runner_);
  task_runner_ = task_runner;
  watcher_ = new IOWatcher(file_.GetPlatformFile(), task_runner_);
}

ScopedDrmCrtcPtr DrmDevice::GetCrtc(uint32_t crtc_id) {
  DCHECK(file_.IsValid());
  return ScopedDrmCrtcPtr(drmModeGetCrtc(file_.GetPlatformFile(), crtc_id));
}

bool DrmDevice::SetCrtc(uint32_t crtc_id,
                        uint32_t framebuffer,
                        std::vector<uint32_t> connectors,
                        drmModeModeInfo* mode) {
  DCHECK(file_.IsValid());
  DCHECK(!connectors.empty());
  DCHECK(mode);

  TRACE_EVENT2("drm", "DrmDevice::SetCrtc", "crtc", crtc_id, "size",
               gfx::Size(mode->hdisplay, mode->vdisplay).ToString());
  return !drmModeSetCrtc(file_.GetPlatformFile(), crtc_id, framebuffer, 0, 0,
                         vector_as_array(&connectors), connectors.size(), mode);
}

bool DrmDevice::SetCrtc(drmModeCrtc* crtc, std::vector<uint32_t> connectors) {
  DCHECK(file_.IsValid());
  // If there's no buffer then the CRTC was disabled.
  if (!crtc->buffer_id)
    return DisableCrtc(crtc->crtc_id);

  DCHECK(!connectors.empty());

  TRACE_EVENT1("drm", "DrmDevice::RestoreCrtc", "crtc", crtc->crtc_id);
  return !drmModeSetCrtc(file_.GetPlatformFile(), crtc->crtc_id,
                         crtc->buffer_id, crtc->x, crtc->y,
                         vector_as_array(&connectors), connectors.size(),
                         &crtc->mode);
}

bool DrmDevice::DisableCrtc(uint32_t crtc_id) {
  DCHECK(file_.IsValid());
  TRACE_EVENT1("drm", "DrmDevice::DisableCrtc", "crtc", crtc_id);
  return !drmModeSetCrtc(file_.GetPlatformFile(), crtc_id, 0, 0, 0, NULL, 0,
                         NULL);
}

ScopedDrmConnectorPtr DrmDevice::GetConnector(uint32_t connector_id) {
  DCHECK(file_.IsValid());
  TRACE_EVENT1("drm", "DrmDevice::GetConnector", "connector", connector_id);
  return ScopedDrmConnectorPtr(
      drmModeGetConnector(file_.GetPlatformFile(), connector_id));
}

bool DrmDevice::AddFramebuffer(uint32_t width,
                               uint32_t height,
                               uint8_t depth,
                               uint8_t bpp,
                               uint32_t stride,
                               uint32_t handle,
                               uint32_t* framebuffer) {
  DCHECK(file_.IsValid());
  TRACE_EVENT1("drm", "DrmDevice::AddFramebuffer", "handle", handle);
  return !drmModeAddFB(file_.GetPlatformFile(), width, height, depth, bpp,
                       stride, handle, framebuffer);
}

bool DrmDevice::RemoveFramebuffer(uint32_t framebuffer) {
  DCHECK(file_.IsValid());
  TRACE_EVENT1("drm", "DrmDevice::RemoveFramebuffer", "framebuffer",
               framebuffer);
  return !drmModeRmFB(file_.GetPlatformFile(), framebuffer);
}

bool DrmDevice::PageFlip(uint32_t crtc_id,
                         uint32_t framebuffer,
                         bool is_sync,
                         const PageFlipCallback& callback) {
  DCHECK(file_.IsValid());
  TRACE_EVENT2("drm", "DrmDevice::PageFlip", "crtc", crtc_id, "framebuffer",
               framebuffer);

  if (watcher_)
    watcher_->SetPaused(is_sync);

  // NOTE: Calling drmModeSetCrtc will immediately update the state, though
  // callbacks to already scheduled page flips will be honored by the kernel.
  scoped_ptr<PageFlipPayload> payload(
      new PageFlipPayload(base::ThreadTaskRunnerHandle::Get(), callback));
  if (!drmModePageFlip(file_.GetPlatformFile(), crtc_id, framebuffer,
                       DRM_MODE_PAGE_FLIP_EVENT, payload.get())) {
    // If successful the payload will be removed by a PageFlip event.
    ignore_result(payload.release());

    // If the flip was requested synchronous or if no watcher has been installed
    // yet, then synchronously handle the page flip events.
    if (is_sync || !watcher_) {
      TRACE_EVENT1("drm", "OnDrmEvent", "socket", file_.GetPlatformFile());

      drmEventContext event;
      event.version = DRM_EVENT_CONTEXT_VERSION;
      event.page_flip_handler = HandlePageFlipEventOnUI;
      event.vblank_handler = nullptr;

      drmHandleEvent(file_.GetPlatformFile(), &event);
    }

    return true;
  }

  return false;
}

bool DrmDevice::PageFlipOverlay(uint32_t crtc_id,
                                uint32_t framebuffer,
                                const gfx::Rect& location,
                                const gfx::Rect& source,
                                int overlay_plane) {
  DCHECK(file_.IsValid());
  TRACE_EVENT2("drm", "DrmDevice::PageFlipOverlay", "crtc", crtc_id,
               "framebuffer", framebuffer);
  return !drmModeSetPlane(file_.GetPlatformFile(), overlay_plane, crtc_id,
                          framebuffer, 0, location.x(), location.y(),
                          location.width(), location.height(), source.x(),
                          source.y(), source.width(), source.height());
}

ScopedDrmFramebufferPtr DrmDevice::GetFramebuffer(uint32_t framebuffer) {
  DCHECK(file_.IsValid());
  TRACE_EVENT1("drm", "DrmDevice::GetFramebuffer", "framebuffer", framebuffer);
  return ScopedDrmFramebufferPtr(
      drmModeGetFB(file_.GetPlatformFile(), framebuffer));
}

ScopedDrmPropertyPtr DrmDevice::GetProperty(drmModeConnector* connector,
                                            const char* name) {
  TRACE_EVENT2("drm", "DrmDevice::GetProperty", "connector",
               connector->connector_id, "name", name);
  for (int i = 0; i < connector->count_props; ++i) {
    ScopedDrmPropertyPtr property(
        drmModeGetProperty(file_.GetPlatformFile(), connector->props[i]));
    if (!property)
      continue;

    if (strcmp(property->name, name) == 0)
      return property.Pass();
  }

  return ScopedDrmPropertyPtr();
}

bool DrmDevice::SetProperty(uint32_t connector_id,
                            uint32_t property_id,
                            uint64_t value) {
  DCHECK(file_.IsValid());
  return !drmModeConnectorSetProperty(file_.GetPlatformFile(), connector_id,
                                      property_id, value);
}

bool DrmDevice::GetCapability(uint64_t capability, uint64_t* value) {
  DCHECK(file_.IsValid());
  return !drmGetCap(file_.GetPlatformFile(), capability, value);
}

ScopedDrmPropertyBlobPtr DrmDevice::GetPropertyBlob(drmModeConnector* connector,
                                                    const char* name) {
  DCHECK(file_.IsValid());
  TRACE_EVENT2("drm", "DrmDevice::GetPropertyBlob", "connector",
               connector->connector_id, "name", name);
  for (int i = 0; i < connector->count_props; ++i) {
    ScopedDrmPropertyPtr property(
        drmModeGetProperty(file_.GetPlatformFile(), connector->props[i]));
    if (!property)
      continue;

    if (strcmp(property->name, name) == 0 &&
        property->flags & DRM_MODE_PROP_BLOB)
      return ScopedDrmPropertyBlobPtr(drmModeGetPropertyBlob(
          file_.GetPlatformFile(), connector->prop_values[i]));
  }

  return ScopedDrmPropertyBlobPtr();
}

bool DrmDevice::SetCursor(uint32_t crtc_id,
                          uint32_t handle,
                          const gfx::Size& size) {
  DCHECK(file_.IsValid());
  TRACE_EVENT1("drm", "DrmDevice::SetCursor", "handle", handle);
  return !drmModeSetCursor(file_.GetPlatformFile(), crtc_id, handle,
                           size.width(), size.height());
}

bool DrmDevice::MoveCursor(uint32_t crtc_id, const gfx::Point& point) {
  DCHECK(file_.IsValid());
  return !drmModeMoveCursor(file_.GetPlatformFile(), crtc_id, point.x(),
                            point.y());
}

bool DrmDevice::CreateDumbBuffer(const SkImageInfo& info,
                                 uint32_t* handle,
                                 uint32_t* stride,
                                 void** pixels) {
  DCHECK(file_.IsValid());

  TRACE_EVENT0("drm", "DrmDevice::CreateDumbBuffer");
  if (!DrmCreateDumbBuffer(file_.GetPlatformFile(), info, handle, stride))
    return false;

  if (!MapDumbBuffer(file_.GetPlatformFile(), *handle,
                     info.getSafeSize(*stride), pixels)) {
    DrmDestroyDumbBuffer(file_.GetPlatformFile(), *handle);
    return false;
  }

  return true;
}

void DrmDevice::DestroyDumbBuffer(const SkImageInfo& info,
                                  uint32_t handle,
                                  uint32_t stride,
                                  void* pixels) {
  DCHECK(file_.IsValid());
  TRACE_EVENT1("drm", "DrmDevice::DestroyDumbBuffer", "handle", handle);
  munmap(pixels, info.getSafeSize(stride));
  DrmDestroyDumbBuffer(file_.GetPlatformFile(), handle);
}

bool DrmDevice::SetMaster() {
  DCHECK(file_.IsValid());
  return (drmSetMaster(file_.GetPlatformFile()) == 0);
}

bool DrmDevice::DropMaster() {
  DCHECK(file_.IsValid());
  return (drmDropMaster(file_.GetPlatformFile()) == 0);
}

}  // namespace ui


text:
package main

import (
	"errors"
	"flag"
	"fmt"

	"github.com/golang/protobuf/proto" //nolint:staticcheck
	"github.com/google/trillian/cmd/createtree/keys"
	"github.com/google/trillian/crypto/keys/der"
	"github.com/google/trillian/crypto/keys/pem"
	"github.com/google/trillian/crypto/keyspb"
)

var (
	pemKeyPath = flag.String("pem_key_path", "", "Path to the private key PEM file")
	pemKeyPass = flag.String("pem_key_password", "", "Password of the private key PEM file")
)

func init() {
	keys.RegisterType("PEMKeyFile", pemKeyFileProtoFromFlags)
	keys.RegisterType("PrivateKey", privateKeyProtoFromFlags)
}

func pemKeyFileProtoFromFlags() (proto.Message, error) {
	if *pemKeyPath == "" {
		return nil, errors.New("empty pem_key_path")
	}
	if *pemKeyPass == "" {
		return nil, fmt.Errorf("empty password for PEM key file %q", *pemKeyPath)
	}

	return &keyspb.PEMKeyFile{
		Path:     *pemKeyPath,
		Password: *pemKeyPass,
	}, nil
}

func privateKeyProtoFromFlags() (proto.Message, error) {
	if *pemKeyPath == "" {
		return nil, errors.New("empty pem_key_path")
	}

	key, err := pem.ReadPrivateKeyFile(*pemKeyPath, *pemKeyPass)
	if err != nil {
		return nil, fmt.Errorf("error reading reading private key file: %v", err)
	}

	keyDER, err := der.MarshalPrivateKey(key)
	if err != nil {
		return nil, fmt.Errorf("error marshaling private key as DER: %v", err)
	}

	return &keyspb.PrivateKey{Der: keyDER}, nil
}


text:
<?php

// autoload_psr4.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));

return array(
    'League\\Fractal\\' => array($vendorDir . '/league/fractal/src'),
);


text:
#include <aws/sagemaker-edge/model/ChecksumType.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace SagemakerEdgeManager
  {
    namespace Model
    {
      namespace ChecksumTypeMapper
      {

        static const int SHA1_HASH = HashingUtils::HashString("SHA1");

        ChecksumType GetChecksumTypeForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == SHA1_HASH)
          {
            return ChecksumType::SHA1;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<ChecksumType>(hashCode);
          }

          return ChecksumType::NOT_SET;
        }

        Aws::String GetNameForChecksumType(ChecksumType enumValue)
        {
          switch(enumValue)
          {
          case ChecksumType::SHA1:
            return "SHA1";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace ChecksumTypeMapper
    } // namespace Model
  } // namespace SagemakerEdgeManager
} // namespace Aws


text:
package net.teamfruit.autoinput.bnnwidget.font;

import java.awt.Font;
import java.util.List;
import java.util.ListIterator;

import javax.annotation.Nonnull;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;

/**
 * フォント集合
 * <p>
 * スタイルを保持し、優先度順に複数のフォントを指定することができます
 *
 * @author TeamFruit
 */
public class FontSet {
	/**
	 * フォントに該当の文字が含まれない際の最終的に使われるフォントです
	 */
	public final @Nonnull String defaultFontName;;
	/**
	 * 0番目から順番にフォントの文字を検索します
	 */
	public final @Nonnull ImmutableList<String> fontNames;
	/**
	 * フォントスタイル
	 */
	public final int style;

	FontSet(@Nonnull final String defaultFontName, @Nonnull final ImmutableList<String> fontNames, final int style) {
		this.defaultFontName = defaultFontName;
		this.fontNames = fontNames;
		this.style = style;
	}

	/**
	 * スタイルを変更して新しいインスタンスを作成します
	 * @param style スタイル
	 * @return スタイルを変更したインスタンス
	 */
	public @Nonnull FontSet deriveFontStyle(final int style) {
		return new FontSet(this.defaultFontName, this.fontNames, style);
	}

	/**
	 * サイズを指定して新しいサイズフォントインスタンスを作成します
	 * @param size サイズ
	 * @return サイズを変更したサイズフォントインスタンス
	 */
	public @Nonnull SizedFontSet getSizedFont(final int size) {
		final Font defaultFont = new Font(this.defaultFontName, this.style, size);
		final ImmutableList.Builder<Font> builder = ImmutableList.builder();
		for (final String fontName : this.fontNames)
			if (FontShape.isSupported(fontName))
				builder.add(new Font(fontName, this.style, size));
		return new SizedFontSet(defaultFont, builder.build(), this.style, size);
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime*result+this.defaultFontName.hashCode();
		result = prime*result+this.fontNames.hashCode();
		result = prime*result+this.style;
		return result;
	}

	@Override
	public boolean equals(final Object obj) {
		if (this==obj)
			return true;
		if (obj==null)
			return false;
		if (!(obj instanceof FontSet))
			return false;
		final FontSet other = (FontSet) obj;
		if (!this.defaultFontName.equals(other.defaultFontName))
			return false;
		if (!this.fontNames.equals(other.fontNames))
			return false;
		if (this.style!=other.style)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return String.format("FontSet [defaultFontName=%s, fontNames=%s, style=%s]", this.defaultFontName, this.fontNames, this.style);
	}

	/**
	 * サイズが指定されたフォント集合
	 *
	 * @author TeamFruit
	 */
	public static class SizedFontSet {
		/**
		 * フォントに該当の文字が含まれない際の最終的に使われるフォントです
		 */
		public final @Nonnull Font defaultFont;
		/**
		 * 0番目から順番にフォントの文字を検索します
		 */
		public final @Nonnull ImmutableList<Font> fonts;
		/**
		 * フォントスタイル
		 */
		public final int style;
		/**
		 * フォントサイズ
		 */
		public final int size;

		SizedFontSet(@Nonnull final Font defaultFont, @Nonnull final ImmutableList<Font> fonts, final int style, final int size) {
			this.defaultFont = defaultFont;
			this.fonts = fonts;
			this.style = style;
			this.size = size;
		}

		/**
		 * 指定した文字を含むフォントを検索します
		 * @param ch 文字
		 * @return フォント
		 */
		public @Nonnull Font getCharFont(final char ch) {
			for (final Font font : this.fonts)
				if (font.canDisplay(ch))
					return font;
			return this.defaultFont;
		}

		/**
		 * スタイルを変更して新しいインスタンスを作成します
		 * @param style スタイル
		 * @return スタイルを変更したインスタンス
		 */
		public @Nonnull SizedFontSet deriveFontStyle(final int style) {
			final ImmutableList.Builder<Font> builder = ImmutableList.builder();
			for (final Font font : this.fonts)
				builder.add(font.deriveFont(style));
			return new SizedFontSet(this.defaultFont.deriveFont(style), builder.build(), style, this.size);
		}

		/**
		 * サイズを変更して新しいインスタンスを作成します
		 * @param style サイズ
		 * @return サイズを変更したインスタンス
		 */
		public @Nonnull SizedFontSet deriveFontSize(final int size) {
			final ImmutableList.Builder<Font> builder = ImmutableList.builder();
			for (final Font font : this.fonts)
				builder.add(font.deriveFont((float) size));
			return new SizedFontSet(this.defaultFont.deriveFont((float) size), builder.build(), this.style, size);
		}

		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime*result+this.defaultFont.hashCode();
			result = prime*result+this.fonts.hashCode();
			result = prime*result+this.size;
			result = prime*result+this.style;
			return result;
		}

		@Override
		public boolean equals(final Object obj) {
			if (this==obj)
				return true;
			if (obj==null)
				return false;
			if (!(obj instanceof SizedFontSet))
				return false;
			final SizedFontSet other = (SizedFontSet) obj;
			if (!this.defaultFont.equals(other.defaultFont))
				return false;
			if (!this.fonts.equals(other.fonts))
				return false;
			if (this.size!=other.size)
				return false;
			if (this.style!=other.style)
				return false;
			return true;
		}

		@Override
		public String toString() {
			return String.format("SizedFontSet [defaultFont=%s, fonts=%s, style=%s, size=%s]", this.defaultFont, this.fonts, this.style, this.size);
		}
	}

	/**
	 * フォント集合を作成します
	 *
	 * @author TeamFruit
	 */
	public static class Builder {
		/**
		 * 2番目のデフォルトのフォントです
		 */
		public static final @Nonnull String defaultFontName = "YuGothic";

		/**
		 * 0番目から順番にフォントの文字を検索します
		 */
		private final @Nonnull List<String> fontnames = Lists.newArrayList(defaultFontName);
		/**
		 * フォントスタイル
		 */
		private int style = Font.PLAIN;

		public Builder() {
		}

		public Builder(final @Nonnull FontSet fontSet) {
		}

		/**
		 * フォントの候補を追加します。後から追加したものが優先されます
		 * @param name フォント名
		 * @return this
		 */
		public @Nonnull Builder addName(@Nonnull final String name) {
			this.fontnames.add(name);
			return this;
		}

		/**
		 * フォントスタイルを設定します
		 * @param style フォントスタイル
		 * @return this
		 */
		public @Nonnull Builder setStyle(final int style) {
			this.style = style;
			return this;
		}

		/**
		 * フォント集合を作成します
		 * @return フォント集合
		 */
		public @Nonnull FontSet build() {
			final ImmutableList.Builder<String> builder = ImmutableList.builder();
			for (final ListIterator<String> itr = this.fontnames.listIterator(this.fontnames.size()); itr.hasPrevious();) {
				final String fontname = itr.previous();
				if (FontShape.isSupported(fontname))
					builder.add(fontname);
			}
			return new FontSet(Font.DIALOG, builder.build(), this.style);
		}
	}
}


text:
layout: post
title: Blocmarks
feature-img: "img/sample_feature_img_2.png"
thumbnail-path: "img/blocmarks.png"
short-description: Blocmarks is a bookmarking app that allows users to email, manage and share bookmarks and URLs.
permalink: blocmarks/

---
[Visit Blocmarks](https://bgohman-blocmarks.herokuapp.com/) \| [View Source](https://github.com/bgohman/blocmarks)

## Overview

I created Blocmarks as part of my Rails Development course at Bloc.  Blocmarks lets a user bookmark URLs via email, view other people's bookmarks and keep a personal collection of bookmarks grouped by topic.  While I never grasped the practicality of an app like this, it was a fun project to work on.  This project would be another opportunity to practice creating a user authentication, and and to make good design decisions.  The exercise of receiving incoming emails will be another exposure to a third party API, in this case Mailgun.

## User Stories

* As a user, I want to:
  * Sign up for a free account by providing a username, password and email
  * Sign in and out of Blocmarks
  * Email a URL to Blockarks and have it saved in the Blocmarks database
  * See an index of all topics and their bookmarks
  * Create, read, update, and delete bookmarks
  * Be the only one allowed to delete and update my bookmarks
  * Like and unlike bookmarks created by others
  * See a list of bookmarks on my personal profile that I've added or liked
  * See URL previews for each bookmark
* As a developer, I want to:
  * Write views using HAML instead of ERB
  * Make readable URLs

## Conclusion

As a web developer, it is important to be comfortable learning new technologies.  This project provided me the opportunity to work with Mailgun for the first time, and also to explore the Embed.ly API.  I enjoyed working on this project, especially working on the URL previews and using the friendly_id gem to add readable URLs.


text:
PVRTexTool.exe: PVRTexTool.cs
	mcs PVRTexTool.cs

.DEFAULT_GOAL := PVRTexTool.exe


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <base href="/" />
    <title>Interview assistant</title>

Interview assistant


text:
<?php
	#
	# $Id: freshports_page.php,v 1.2 2006-12-17 11:55:53 dan Exp $
	#
	# Copyright (c) 2005-2006 DVL Software Limited
	#

	set_include_path('/usr/local/share/pear');
	require_once("HTML/Page2.php");
	require_once('constants.php');

class freshports_page extends HTML_Page2 {

	var $_ShowAds           = 0;
	var $_BannerAd          = 1;
	var $_ShowAnnouncements = 0;
	var $_ShowLogo          = 1;

	var $_db;
	var $_debug             = 0;

	function __construct($attributes = array()) {

		GLOBAL $ShowAds;

		$this->_ShowAds = $ShowAds;
		$this->assignDefaultAttributes($attributes);

		$this->HTML_Page2($attributes);

		$this->setMetaData('author',           COPYRIGHTHOLDER);
		$this->setMetaData('description',      'FreshPorts - new ports, applications');
		$this->setMetaData('keywords',         'FreeBSD, index, applications, ports');

		$this->setMetaData('robots', 'noarchive');
		$this->setMetaData('robots', 'noindex');

		$version = substr(hash_file('sha1', $_SERVER['DOCUMENT_ROOT'] . '/css/freshports.css'), 0, 8);
		$this->addStyleSheet('/css/freshports.css?v=' . $version);

		$this->addFavicon('/favicon.ico');
	}

	function setDB($db) {
		$this->_db = $db;
	}

	function toHTML() {
		$HTML = '';

		if ($this->_ShowLogo) {
			$HTML .= freshports_Logo();
		}

		if ($this->_ShowAnnouncements) {

			$Announcement = new Announcement($this->$_db);

			$NumRows = $Announcement->FetchAllActive();
			if ($NumRows > 0) {
				$HTML .= DisplayAnnouncements($Announcement);
			}
		}

		$HTML .= freshports_MainTable() . "\n
\n" .
		         freshports_MainContentTable() . "\n
\n" .
		         freshports_PageBannerText($this->getTitle());

		$this->prependBodyContent($HTML);

		$this->addBodyContent("\n
" . freshports_SideBar() . "

\n" . freshports_ShowFooter());

		return parent::toHTML();
	}

	function assignDefaultAttributes(&$attributes) {
		# if no value, give it a default value
		if (!$attributes || !is_array($attributes)) {

			$attributes['doctype'] = 'HTML 4.01 Transitional';
		}

		if (!IsSet($attributes['doctype'])) {
			$attributes['doctype'] = 'HTML 4.01 Transitional';
		}

		if (!IsSet($attributes['cache'])) {
			$attributes['cache'] = 'false';
		}

		if (!IsSet($attributes['prolog'])) {
			$attributes['prolog'] = 'false';
		}
	}

	function getDebug() {
		return $this->_debug;
	}

	function setDebug($Debug) {
		$this->_debug = $Debug;
	}

	function _getDoctype() {
		// HTML_Page2 generates inconsistent doctype with the rest of the site
		// Since we're in quirks mode this breaks the styles for some pages
		return HTML_DOCTYPE;
	}
}


text:
<!doctype html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    @if($__env->yieldContent('title'))
        <title>@yield('title') — Bewerbungscoaching</title>
    @else
        <title>Bewerbungscoaching</title>
    @endif

    <link rel="stylesheet" type="text/css" href="{{ theme('css/frontend.css') }}">

Seminars

Individual Coaching

                Application Documents

Application Packages

Application Layouts

Blog

            @include('partials.staticpagesnavigation')

Intern

            @if($loggedInUser)

                    Hello, {{ $loggedInUser->firstname }}

My Information

Logout

            @else

Login

            @endif

            @if($__env->yieldContent('title') != 'Welcome' && $__env->yieldContent('title') != 'My Information' && $__env->yieldContent('title') != 'Blog Post')

@yield('title')

            @endif

            @if(isset($errors))
                @if($errors->any())

                            @foreach($errors->all() as $error)

{{ $error }}

                            @endforeach

                @endif
            @endif
            @if($status)

                    {{ $status }}

            @endif

            @yield('content')

                ©2017 Bewerbungscoaching | Designed by Marcel Lechler


text:
using CoreEngine;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using System.Reflection;
using System.Collections.Generic;
using System.Linq;

namespace CoreEditor
{
	[ExtendedInspectorDrawer(typeof(ReorderableAttribute))]
	public sealed class ReorderAttributeDrawer : IDrawer
	{
		static int[] selectedIDs = new int[]{};
		static ReorderAttributeDrawer()
		{
			EditorApplication.update += ()=> {
				if ( mUsedLists.Count == 0 )
					return;
				if ( Selection.instanceIDs.Length == 0 )
				{
					selectedIDs = new int[]{};
					mUsedLists.Clear();
				}
				else if ( Selection.instanceIDs.SequenceEqual( selectedIDs ) == false )
				{
					selectedIDs = Selection.instanceIDs;
					mUsedLists.Clear();
				}
			};

		}
		public ReorderAttributeDrawer( ReorderableAttribute attribute )
		{
		}
		static Dictionary<string,ReorderableList> mUsedLists = new Dictionary<string, ReorderableList>();
		public bool DisplayProperty( SerializedProperty property, FieldInfo field, GUIContent label )
		{
			var list = GetList( property );
			float height = 0;
			for(var i = 0; i < property.arraySize; i++)
			{
				height = Mathf.Max(height, EditorGUI.GetPropertyHeight(property.GetArrayElementAtIndex(i)));
			}
			height+=2;
			list.elementHeight = height;
			list.drawElementCallback =
			(Rect rect, int index, bool isActive, bool isFocused) => {

				var element = list.serializedProperty.GetArrayElementAtIndex(index);

				rect.y += 2;
				EditorGUI.LabelField(
                     new Rect(rect.x, rect.y, 64, EditorGUIUtility.singleLineHeight),
				                     element.displayName );

				EditorGUI.PropertyField(
					new Rect(rect.x+64, rect.y, rect.width-64, height ),
					element, GUIContent.none, true);
				rect.height = height;
			};

			list.drawHeaderCallback = (rect)=> EditorGUI.LabelField( rect, label );
			list.DoLayoutList();

			return false;
		}

		static ReorderableList GetList( SerializedProperty property )
		{
			var key = property.serializedObject.targetObject.GetInstanceID() + property.propertyPath;

			ReorderableList list;

			if ( mUsedLists.TryGetValue(key, out list ) == false )
			{
				list = mUsedLists[key] = new ReorderableList(property.serializedObject,
				                                             property,
				                                             true, true, true, true);
			}
			list.serializedProperty = property;
			list.serializedProperty.GetType().GetField( "m_SerializedObject", BindingFlags.Instance|BindingFlags.NonPublic ).SetValue( list.serializedProperty, property.serializedObject );
			return list;
		}

		public bool IsValid( object value )
		{
			return true;
		}
		public string GetError( object value )
		{
			return string.Empty;
		}

		public string Tooltip
		{
			get {
				return string.Empty;
			}
		}
	}
}


text:
'use strict';

/**
 * Module dependencies.
 */
var applicationConfiguration = require('./config/config');

// Karma configuration
module.exports = function(config) {
	config.set({
        preprocessors: {
            'public/modules/campaigns/views/*.html': ['ng-html2js']
        },

        ngHtml2JsPreprocessor: {
            stripPrefix: 'public/'
        },

		// Frameworks to use
		frameworks: ['jasmine'],

		// List of files / patterns to load in the browser
		files: applicationConfiguration.assets.lib.js.concat(applicationConfiguration.assets.js, applicationConfiguration.assets.tests, ['public/modules/campaigns/views/*.html']),

		// Test results reporter to use
		// Possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
		//reporters: ['progress'],
		reporters: ['progress'],

		// Web server port
		port: 9876,

		// Enable / disable colors in the output (reporters and logs)
		colors: true,

		// Level of logging
		// Possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
		logLevel: config.LOG_INFO,

		// Enable / disable watching file and executing tests whenever any file changes
		autoWatch: true,

		// Start these browsers, currently available:
		// - Chrome
		// - ChromeCanary
		// - Firefox
		// - Opera
		// - Safari (only Mac)
		// - PhantomJS
		// - IE (only Windows)
		browsers: ['PhantomJS'],

		// If browser does not capture in given timeout [ms], kill it
		captureTimeout: 60000,

		// Continuous Integration mode
		// If true, it capture browsers, run tests and exit
		singleRun: true
	});
};


text:
import requests
import logging
import base64

class Toggl(object):
    """ Class to access Toggl API

    API docs can be found at:
    https://github.com/toggl/toggl_api_docs/blob/master/reports.md
    """
    baseURL = 'https://toggl.com/'
    date_format = '%Y-%m-%d'  # YYYY-MM-DD

    def __init__(self, api_token):
        self.logger = logging.getLogger(__name__)
        self.api_token = base64.b64encode((api_token + ':api_token').encode()).decode('utf-8')

    def get_workspaces(self):
        """ Get workspaces list
        :returns 2-tuple list of workspaces: [(<name>, <id>), ...].
        """
        request = requests.get('https://toggl.com/api/v8/workspaces',
                               headers={'Authorization': 'Basic ' + self.api_token})

        # filter out personal workspaces:
        json_data = request.json()
        return [(data['name'], data['id']) for data in json_data]

    def get_workspace_users_emails(self, workspace_id):
        """ Get list of workspace user emails.
        :param workspace_id: toggle workspace id, obtained from get_workspaces
        :return: list of emails, e.g. ['john@acme.com', 'harry@acme.com', ...]

        More information on API call output:
        https://github.com/toggl/toggl_api_docs/blob/master/chapters/workspaces.md#get-workspace-users
        """
        request = requests.get('https://toggl.com/api/v8/workspaces/' + workspace_id + '/users',
                               headers={'Authorization': 'Basic ' + self.api_token})
        json_data = request.json()
        return [user['email'] for user in json_data]

    def get_projects(self, workspace_id):
        """ Get projects information
        :param workspace_id: toggle workspace id, obtained from get_workspaces
        :return: list of active project names for a given workspace

        More information on API call output:
        https://github.com/toggl/toggl_api_docs/blob/master/chapters/workspaces.md#get-workspace-projects
        """
        result_list = list()
        reply = requests.get('https://toggl.com/api/v8/workspaces/' + workspace_id + '/projects',
                             headers={'Authorization': 'Basic ' + self.api_token}
                             )
        for project in reply.json():
            if project['active']:
                result_list.append(project['name'])
        return result_list

    def weekly_report(self, workspace_id, since, until):
        """ Toggl weekly report for a given team """
        report = requests.get("https://toggl.com/reports/api/v2/weekly?\
            workspace_id=" + workspace_id + "&\
            since=" + since.strftime(self.date_format) + "&\
            until=" + until.strftime(self.date_format) + "&\
            user_agent=github.com/user2589/Toggl.py&\
            order_field=title&\
            display_hours=decimal",  # decimal/minutes
                              headers={'Authorization': 'Basic ' + self.api_token}
                              )
        return report.json()

    def detailed_report(self, workspace_id, since, until):
        """ Toggl detailed report for a given team

        More information on API call output:
        https://github.com/toggl/toggl_api_docs/blob/master/reports/detailed.md#example
        """
        page = 1
        records_read = 0
        records = []
        while True:
            report = requests.get(
                "https://toggl.com/reports/api/v2/details?workspace_id=" + str(workspace_id)
                + "&since=" + since.strftime(self.date_format)
                + "&until=" + until.strftime(self.date_format) + "&user_agent=github.com/user2589/Toggl.py"
                                                                 "&order_field=date&order_desc=off"
                                                                 "&display_hours=decimal&page=" + str(page),
                headers={'Authorization': 'Basic ' + self.api_token}
            )
            report_page = report.json()
            records.extend(report_page['data'])

            records_read += report_page['per_page']
            page += 1

            if records_read >= report_page['total_count']:
                return records


text:
dql.monitor module
==================

.. automodule:: dql.monitor
    :members:
    :undoc-members:
    :show-inheritance:


text:
require 'thor'
require 'fleck'

module Fleck
  # Command-line interface
  class CLI < Thor
    include Thor::Actions

    desc "search [TERM]", "Search files"
    method_option :search_tool, aliases: '-t', default: 'grep'
    method_option :inflectors, aliases: '-i', kind: Array
    method_option :exclude, aliases: '-e', kind: Array
    def search(term)
      search = Search.for term, options

      if search.results.any?
        search.results.each do |inflection|
          say ">> #{inflection.name}:"
          inflection.results.each { |result| say result }
        end
      else
        say "No results found"
      end
    end

    desc :replace, "Replace files"
    def replace(search_object, replace_term, inflections)
      Replace.perform \
        search: search_object,
        term: replace_term,
        inflections: inflections
    end

    protected
    # Show the usage and command help.
    def usage
      %(
        Fleck v#{Fleck.version}

        Usage: fleck [SEARCH_TERM] -r [REPLACE_TERM] -t [SEARCH_TOOL]
      )
    end

    private
    def replace?
      options[:replace_with].present? &&
      ask?("Replace #{search.results.count} results? (y/n)") == 'y'
    end
  end
end


text:
package model

trait Comment {
  val commentedUserName: String
  val registeredDate: java.util.Date
}

trait IssueCommentComponent extends TemplateComponent { self: Profile =>
  import profile.simple._
  import self._

  lazy val IssueComments = new TableQuery(tag => new IssueComments(tag)){
    def autoInc = this returning this.map(_.commentId)
  }

  class IssueComments(tag: Tag) extends Table[IssueComment](tag, "ISSUE_COMMENT") with IssueTemplate {
    val commentId = column[Int]("COMMENT_ID", O AutoInc)
    val action = column[String]("ACTION")
    val commentedUserName = column[String]("COMMENTED_USER_NAME")
    val content = column[String]("CONTENT")
    val registeredDate = column[java.util.Date]("REGISTERED_DATE")
    val updatedDate = column[java.util.Date]("UPDATED_DATE")
    def * = (userName, repositoryName, issueId, commentId, action, commentedUserName, content, registeredDate, updatedDate) <> (IssueComment.tupled, IssueComment.unapply)

    def byPrimaryKey(commentId: Int) = this.commentId === commentId.bind
  }
}

case class IssueComment (
  userName: String,
  repositoryName: String,
  issueId: Int,
  commentId: Int = 0,
  action: String,
  commentedUserName: String,
  content: String,
  registeredDate: java.util.Date,
  updatedDate: java.util.Date
) extends Comment

trait CommitCommentComponent extends TemplateComponent { self: Profile =>
  import profile.simple._
  import self._

  lazy val CommitComments = new TableQuery(tag => new CommitComments(tag)){
    def autoInc = this returning this.map(_.commentId)
  }

  class CommitComments(tag: Tag) extends Table[CommitComment](tag, "COMMIT_COMMENT") with CommitTemplate {
    val commentId = column[Int]("COMMENT_ID", O AutoInc)
    val commentedUserName = column[String]("COMMENTED_USER_NAME")
    val content = column[String]("CONTENT")
    val fileName = column[Option[String]]("FILE_NAME")
    val oldLine = column[Option[Int]]("OLD_LINE_NUMBER")
    val newLine = column[Option[Int]]("NEW_LINE_NUMBER")
    val registeredDate = column[java.util.Date]("REGISTERED_DATE")
    val updatedDate = column[java.util.Date]("UPDATED_DATE")
    val pullRequest = column[Boolean]("PULL_REQUEST")
    def * = (userName, repositoryName, commitId, commentId, commentedUserName, content, fileName, oldLine, newLine, registeredDate, updatedDate, pullRequest) <> (CommitComment.tupled, CommitComment.unapply)

    def byPrimaryKey(commentId: Int) = this.commentId === commentId.bind
  }
}

case class CommitComment(
  userName: String,
  repositoryName: String,
  commitId: String,
  commentId: Int = 0,
  commentedUserName: String,
  content: String,
  fileName: Option[String],
  oldLine: Option[Int],
  newLine: Option[Int],
  registeredDate: java.util.Date,
  updatedDate: java.util.Date,
  pullRequest: Boolean
 ) extends Comment