text:
using NUnit.Framework;

namespace CsharpLibrary_Tests.Validation.Check
{
    [TestFixture]
    public class IsHexValueTests
    {
        [TestCase("#f2f2da", ExpectedResult = true)]
        [TestCase("#09fefd", ExpectedResult = true)]
        public bool ValidHexValue_FullWithHash(string hexValue)
        {
            return CsharpLibrary.Validation.Check.IsHexValue(hexValue);
        }

        [TestCase("#f2f", ExpectedResult = true)]
        [TestCase("#09f", ExpectedResult = true)]
        public bool ValidHexValue_PartialWithHash(string hexValue)
        {
            return CsharpLibrary.Validation.Check.IsHexValue(hexValue);
        }

        [TestCase("f2f2da", ExpectedResult = true)]
        [TestCase("09fefd", ExpectedResult = true)]
        public bool ValidHexValue_FullWithoutHash(string hexValue)
        {
            return CsharpLibrary.Validation.Check.IsHexValue(hexValue);
        }

        [TestCase("f2f", ExpectedResult = true)]
        [TestCase("09f", ExpectedResult = true)]
        public bool ValidHexValue_PartialWithoutHash(string hexValue)
        {
            return CsharpLibrary.Validation.Check.IsHexValue(hexValue);
        }

        [TestCase("##ffffff", ExpectedResult = false)]
        [TestCase(" #fff", ExpectedResult = false)]
        [TestCase("#fffffg", ExpectedResult = false)]
        [TestCase("#ff", ExpectedResult = false)]
        public bool InValidHexValue(string hexValue)
        {
            return CsharpLibrary.Validation.Check.IsHexValue(hexValue);
        }
    }
}


text:
'use strict';

angular.module('retrospectApp')
    .factory('retrospectives', [
        '$resource',
        'SERVICE_URL',
        function ($resource, SERVICE_URL) {
            return $resource(SERVICE_URL + '/retrospectives/:retroId', {
                'page': '@page',
                'limit': '@limit'
            }, {
                'update': {
                    method: 'PUT',
                    isArray: false
                }
            });
        }
    ]);

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.Scripting.Hosting
{
    using static ObjectFormatterHelpers;
    using TypeInfo = System.Reflection.TypeInfo;

    internal abstract partial class CommonObjectFormatter
    {
        private sealed partial class Visitor
        {
            private readonly CommonObjectFormatter _formatter;

            private readonly BuilderOptions _builderOptions;
            private CommonPrimitiveFormatterOptions _primitiveOptions;
            private CommonTypeNameFormatterOptions _typeNameOptions;
            private MemberDisplayFormat _memberDisplayFormat;

            private HashSet<object> _lazyVisitedObjects;

            private HashSet<object> VisitedObjects
            {
                get
                {
                    if (_lazyVisitedObjects == null)
                    {
                        _lazyVisitedObjects = new HashSet<object>(ReferenceEqualityComparer.Instance);
                    }

                    return _lazyVisitedObjects;
                }
            }

            public Visitor(
                CommonObjectFormatter formatter,
                BuilderOptions builderOptions,
                CommonPrimitiveFormatterOptions primitiveOptions,
                CommonTypeNameFormatterOptions typeNameOptions,
                MemberDisplayFormat memberDisplayFormat)
            {
                _formatter = formatter;
                _builderOptions = builderOptions;
                _primitiveOptions = primitiveOptions;
                _typeNameOptions = typeNameOptions;
                _memberDisplayFormat = memberDisplayFormat;
            }

            private Builder MakeMemberBuilder(int limit)
            {
                return new Builder(_builderOptions.WithMaximumOutputLength(Math.Min(_builderOptions.MaximumLineLength, limit)), suppressEllipsis: true);
            }

            public string FormatObject(object obj)
            {
                try
                {
                    var builder = new Builder(_builderOptions, suppressEllipsis: false);
                    string _;
                    return FormatObjectRecursive(builder, obj, isRoot: true, debuggerDisplayName: out _).ToString();
                }
                catch (InsufficientExecutionStackException)
                {
                    return ScriptingResources.StackOverflowWhileEvaluating;
                }
            }

            private Builder FormatObjectRecursive(Builder result, object obj, bool isRoot, out string debuggerDisplayName)
            {
                // TODO (https://github.com/dotnet/roslyn/issues/6689): remove this
                if (!isRoot && _memberDisplayFormat == MemberDisplayFormat.SeparateLines)
                {
                    _memberDisplayFormat = MemberDisplayFormat.SingleLine;
                }

                debuggerDisplayName = null;
                string primitive = _formatter.PrimitiveFormatter.FormatPrimitive(obj, _primitiveOptions);
                if (primitive != null)
                {
                    result.Append(primitive);
                    return result;
                }

                Type type = obj.GetType();
                TypeInfo typeInfo = type.GetTypeInfo();

                //
                // Override KeyValuePair<,>.ToString() to get better dictionary elements formatting:
                //
                // { { format(key), format(value) }, ... }
                // instead of
                // { [key.ToString(), value.ToString()], ... }
                //
                // This is more general than overriding Dictionary<,> debugger proxy attribute since it applies on all
                // types that return an array of KeyValuePair in their DebuggerDisplay to display items.
                //
                if (typeInfo.IsGenericType && typeInfo.GetGenericTypeDefinition() == typeof(KeyValuePair<,>))
                {
                    if (isRoot)
                    {
                        result.Append(_formatter.TypeNameFormatter.FormatTypeName(type, _typeNameOptions));
                        result.Append(' ');
                    }

                    FormatKeyValuePair(result, obj);
                    return result;
                }

                if (typeInfo.IsArray)
                {
                    if (VisitedObjects.Add(obj))
                    {
                        FormatArray(result, (Array)obj);

                        VisitedObjects.Remove(obj);
                    }
                    else
                    {
                        result.AppendInfiniteRecursionMarker();
                    }

                    return result;
                }

                DebuggerDisplayAttribute debuggerDisplay = GetApplicableDebuggerDisplayAttribute(typeInfo);
                if (debuggerDisplay != null)
                {
                    debuggerDisplayName = debuggerDisplay.Name;
                }

                // Suppresses members if inlineMembers is true,
                // does nothing otherwise.
                bool suppressInlineMembers = false;

                //
                // TypeName(count) for ICollection implementers
                // or
                // TypeName([[DebuggerDisplay.Value]])        // Inline
                // [[DebuggerDisplay.Value]]                  // Inline && !isRoot
                // or
                // [[ToString()]] if ToString overridden
                // or
                // TypeName
                //
                ICollection collection;
                if ((collection = obj as ICollection) != null)
                {
                    FormatCollectionHeader(result, collection);
                }
                else if (debuggerDisplay != null && !string.IsNullOrEmpty(debuggerDisplay.Value))
                {
                    if (isRoot)
                    {
                        result.Append(_formatter.TypeNameFormatter.FormatTypeName(type, _typeNameOptions));
                        result.Append('(');
                    }

                    FormatWithEmbeddedExpressions(result, debuggerDisplay.Value, obj);

                    if (isRoot)
                    {
                        result.Append(')');
                    }

                    suppressInlineMembers = true;
                }
                else if (HasOverriddenToString(typeInfo))
                {
                    ObjectToString(result, obj);
                    suppressInlineMembers = true;
                }
                else
                {
                    result.Append(_formatter.TypeNameFormatter.FormatTypeName(type, _typeNameOptions));
                }

                MemberDisplayFormat memberFormat = _memberDisplayFormat;

                if (memberFormat == MemberDisplayFormat.Hidden)
                {
                    if (collection != null)
                    {
                        // NB: Collections specifically ignore MemberDisplayFormat.Hidden.
                        memberFormat = MemberDisplayFormat.SingleLine;
                    }
                    else
                    {
                        return result;
                    }
                }

                bool includeNonPublic = memberFormat == MemberDisplayFormat.SeparateLines;
                bool inlineMembers = memberFormat == MemberDisplayFormat.SingleLine;

                object proxy = GetDebuggerTypeProxy(obj);
                if (proxy != null)
                {
                    includeNonPublic = false;
                    suppressInlineMembers = false;
                }

                if (!suppressInlineMembers || !inlineMembers)
                {
                    FormatMembers(result, obj, proxy, includeNonPublic, inlineMembers);
                }

                return result;
            }

            #region Members

            private void FormatMembers(Builder result, object obj, object proxy, bool includeNonPublic, bool inlineMembers)
            {
                // TODO (tomat): we should not use recursion
                RuntimeHelpers.EnsureSufficientExecutionStack();

                result.Append(' ');

                // Note: Even if we've seen it before, we show a header
                if (!VisitedObjects.Add(obj))
                {
                    result.AppendInfiniteRecursionMarker();
                    return;
                }

                bool membersFormatted = false;

                // handle special types only if a proxy isn't defined
                if (proxy == null)
                {
                    IDictionary dictionary;
                    IEnumerable enumerable;
                    if ((dictionary = obj as IDictionary) != null)
                    {
                        FormatDictionaryMembers(result, dictionary, inlineMembers);
                        membersFormatted = true;
                    }
                    else if ((enumerable = obj as IEnumerable) != null)
                    {
                        FormatSequenceMembers(result, enumerable, inlineMembers);
                        membersFormatted = true;
                    }
                }

                if (!membersFormatted)
                {
                    FormatObjectMembers(result, proxy ?? obj, obj.GetType().GetTypeInfo(), includeNonPublic, inlineMembers);
                }

                VisitedObjects.Remove(obj);
            }

            ///
            /// Formats object members to a list.
            ///
            /// Inline == false:
            ///
            /// { A=true, B=false, C=new int[3] { 1, 2, 3 } }
            ///
            ///
            /// Inline == true:
            ///
            /// {
            ///   A: true,
            ///   B: false,
            ///   C: new int[3] { 1, 2, 3 }
            /// }
            ///
            ///
            private void FormatObjectMembers(Builder result, object obj, TypeInfo preProxyTypeInfo, bool includeNonPublic, bool inline)
            {
                int lengthLimit = result.Remaining;
                if (lengthLimit < 0)
                {
                    return;
                }

                var members = new List<FormattedMember>();

                // Limits the number of members added into the result. Some more members may be added than it will fit into the result
                // and will be thrown away later but not many more.
                FormatObjectMembersRecursive(members, obj, includeNonPublic, ref lengthLimit);
                bool useCollectionFormat = UseCollectionFormat(members, preProxyTypeInfo);

                result.AppendGroupOpening();

                for (int i = 0; i < members.Count; i++)
                {
                    result.AppendCollectionItemSeparator(isFirst: i == 0, inline: inline);
                    if (useCollectionFormat)
                    {
                        members[i].AppendAsCollectionEntry(result);
                    }
                    else
                    {
                        members[i].Append(result, inline ? "=" : ": ");
                    }

                    if (result.Remaining <= 0)
                    {
                        break;
                    }
                }

                result.AppendGroupClosing(inline);
            }

            private static bool UseCollectionFormat(IEnumerable<FormattedMember> members, TypeInfo originalType)
            {
                return typeof(IEnumerable).GetTypeInfo().IsAssignableFrom(originalType) && members.All(member => member.Index >= 0);
            }

            ///
            /// Enumerates sorted object members to display.
            ///
            private void FormatObjectMembersRecursive(List<FormattedMember> result, object obj, bool includeNonPublic, ref int lengthLimit)
            {
                Debug.Assert(obj != null);

                var members = new List<MemberInfo>();

                var type = obj.GetType().GetTypeInfo();
                while (type != null)
                {
                    members.AddRange(type.DeclaredFields.Where(f => !f.IsStatic));
                    members.AddRange(type.DeclaredProperties.Where(f => f.GetMethod != null && !f.GetMethod.IsStatic));
                    type = type.BaseType?.GetTypeInfo();
                }

                members.Sort((x, y) =>
                {
                    // Need case-sensitive comparison here so that the order of members is
                    // always well-defined (members can differ by case only). And we don't want to
                    // depend on that order.
                    int comparisonResult = StringComparer.OrdinalIgnoreCase.Compare(x.Name, y.Name);
                    if (comparisonResult == 0)
                    {
                        comparisonResult = StringComparer.Ordinal.Compare(x.Name, y.Name);
                    }

                    return comparisonResult;
                });

                foreach (var member in members)
                {
                    if (!_formatter.Filter.Include(member))
                    {
                        continue;
                    }

                    bool rootHidden = false, ignoreVisibility = false;
                    var browsable = (DebuggerBrowsableAttribute)member.GetCustomAttributes(typeof(DebuggerBrowsableAttribute), false).FirstOrDefault();
                    if (browsable != null)
                    {
                        if (browsable.State == DebuggerBrowsableState.Never)
                        {
                            continue;
                        }

                        ignoreVisibility = true;
                        rootHidden = browsable.State == DebuggerBrowsableState.RootHidden;
                    }

                    if (member is FieldInfo field)
                    {
                        if (!(includeNonPublic || ignoreVisibility || field.IsPublic || field.IsFamily || field.IsFamilyOrAssembly))
                        {
                            continue;
                        }
                    }
                    else
                    {
                        PropertyInfo property = (PropertyInfo)member;

                        var getter = property.GetMethod;
                        if (getter == null)
                        {
                            continue;
                        }

                        var setter = property.SetMethod;

                        // If not ignoring visibility include properties that has a visible getter or setter.
                        if (!(includeNonPublic || ignoreVisibility ||
                            getter.IsPublic || getter.IsFamily || getter.IsFamilyOrAssembly ||
                            (setter != null && (setter.IsPublic || setter.IsFamily || setter.IsFamilyOrAssembly))))
                        {
                            continue;
                        }

                        if (getter.GetParameters().Length > 0)
                        {
                            continue;
                        }
                    }

                    var debuggerDisplay = GetApplicableDebuggerDisplayAttribute(member);
                    if (debuggerDisplay != null)
                    {
                        string k = FormatWithEmbeddedExpressions(lengthLimit, debuggerDisplay.Name, obj) ?? member.Name;
                        string v = FormatWithEmbeddedExpressions(lengthLimit, debuggerDisplay.Value, obj) ?? string.Empty; // TODO: ?
                        if (!AddMember(result, new FormattedMember(-1, k, v), ref lengthLimit))
                        {
                            return;
                        }

                        continue;
                    }

                    Exception exception;
                    object value = GetMemberValue(member, obj, out exception);
                    if (exception != null)
                    {
                        var memberValueBuilder = MakeMemberBuilder(lengthLimit);
                        FormatException(memberValueBuilder, exception);
                        if (!AddMember(result, new FormattedMember(-1, member.Name, memberValueBuilder.ToString()), ref lengthLimit))
                        {
                            return;
                        }

                        continue;
                    }

                    if (rootHidden)
                    {
                        if (value != null && !VisitedObjects.Contains(value))
                        {
                            Array array;
                            if ((array = value as Array) != null)  // TODO (tomat): n-dim arrays
                            {
                                int i = 0;
                                foreach (object item in array)
                                {
                                    string name;
                                    Builder valueBuilder = MakeMemberBuilder(lengthLimit);
                                    FormatObjectRecursive(valueBuilder, item, isRoot: false, debuggerDisplayName: out name);

                                    if (!string.IsNullOrEmpty(name))
                                    {
                                        name = FormatWithEmbeddedExpressions(MakeMemberBuilder(lengthLimit), name, item).ToString();
                                    }

                                    if (!AddMember(result, new FormattedMember(i, name, valueBuilder.ToString()), ref lengthLimit))
                                    {
                                        return;
                                    }

                                    i++;
                                }
                            }
                            else if (_formatter.PrimitiveFormatter.FormatPrimitive(value, _primitiveOptions) == null && VisitedObjects.Add(value))
                            {
                                FormatObjectMembersRecursive(result, value, includeNonPublic, ref lengthLimit);
                                VisitedObjects.Remove(value);
                            }
                        }
                    }
                    else
                    {
                        string name;
                        Builder valueBuilder = MakeMemberBuilder(lengthLimit);
                        FormatObjectRecursive(valueBuilder, value, isRoot: false, debuggerDisplayName: out name);

                        if (string.IsNullOrEmpty(name))
                        {
                            name = member.Name;
                        }
                        else
                        {
                            name = FormatWithEmbeddedExpressions(MakeMemberBuilder(lengthLimit), name, value).ToString();
                        }

                        if (!AddMember(result, new FormattedMember(-1, name, valueBuilder.ToString()), ref lengthLimit))
                        {
                            return;
                        }
                    }
                }
            }

            private bool AddMember(List<FormattedMember> members, FormattedMember member, ref int remainingLength)
            {
                // Add this item even if we exceed the limit - its prefix might be appended to the result.
                members.Add(member);

                // We don't need to calculate an exact length, just a lower bound on the size.
                // We can add more members to the result than it will eventually fit, we shouldn't add less.
                // Add 2 more, even if only one or half of it fit, so that the separator is included in edge cases.

                if (remainingLength == int.MinValue)
                {
                    return false;
                }

                remainingLength -= member.MinimalLength;
                if (remainingLength <= 0)
                {
                    remainingLength = int.MinValue;
                }

                return true;
            }

            private void FormatException(Builder result, Exception exception)
            {
                result.Append("!<");
                result.Append(_formatter.TypeNameFormatter.FormatTypeName(exception.GetType(), _typeNameOptions));
                result.Append('>');
            }

            #endregion

            #region Collections

            private void FormatKeyValuePair(Builder result, object obj)
            {
                TypeInfo type = obj.GetType().GetTypeInfo();
                object key = type.GetDeclaredProperty("Key").GetValue(obj, Array.Empty<object>());
                object value = type.GetDeclaredProperty("Value").GetValue(obj, Array.Empty<object>());
                string _;
                result.AppendGroupOpening();
                result.AppendCollectionItemSeparator(isFirst: true, inline: true);
                FormatObjectRecursive(result, key, isRoot: false, debuggerDisplayName: out _);
                result.AppendCollectionItemSeparator(isFirst: false, inline: true);
                FormatObjectRecursive(result, value, isRoot: false, debuggerDisplayName: out _);
                result.AppendGroupClosing(inline: true);
            }

            private void FormatCollectionHeader(Builder result, ICollection collection)
            {
                if (collection is Array array)
                {
                    result.Append(_formatter.TypeNameFormatter.FormatArrayTypeName(array.GetType(), array, _typeNameOptions));
                    return;
                }

                result.Append(_formatter.TypeNameFormatter.FormatTypeName(collection.GetType(), _typeNameOptions));
                try
                {
                    result.Append('(');
                    result.Append(collection.Count.ToString());
                    result.Append(')');
                }
                catch (Exception)
                {
                    // skip
                }
            }

            private void FormatArray(Builder result, Array array)
            {
                FormatCollectionHeader(result, array);

                // NB: Arrays specifically ignore MemberDisplayFormat.Hidden.

                if (array.Rank > 1)
                {
                    FormatMultidimensionalArrayElements(result, array, inline: _memberDisplayFormat != MemberDisplayFormat.SeparateLines);
                }
                else
                {
                    result.Append(' ');
                    FormatSequenceMembers(result, array, inline: _memberDisplayFormat != MemberDisplayFormat.SeparateLines);
                }
            }

            private void FormatDictionaryMembers(Builder result, IDictionary dict, bool inline)
            {
                result.AppendGroupOpening();

                int i = 0;
                try
                {
                    IDictionaryEnumerator enumerator = dict.GetEnumerator();
                    IDisposable disposable = enumerator as IDisposable;
                    try
                    {
                        while (enumerator.MoveNext())
                        {
                            var entry = enumerator.Entry;
                            string _;
                            result.AppendCollectionItemSeparator(isFirst: i == 0, inline: inline);
                            result.AppendGroupOpening();
                            result.AppendCollectionItemSeparator(isFirst: true, inline: true);
                            FormatObjectRecursive(result, entry.Key, isRoot: false, debuggerDisplayName: out _);
                            result.AppendCollectionItemSeparator(isFirst: false, inline: true);
                            FormatObjectRecursive(result, entry.Value, isRoot: false, debuggerDisplayName: out _);
                            result.AppendGroupClosing(inline: true);
                            i++;
                        }
                    }
                    finally
                    {
                        if (disposable != null)
                        {
                            disposable.Dispose();
                        }
                    }
                }
                catch (Exception e)
                {
                    result.AppendCollectionItemSeparator(isFirst: i == 0, inline: inline);
                    FormatException(result, e);
                    result.Append(' ');
                    result.Append(_builderOptions.Ellipsis);
                }

                result.AppendGroupClosing(inline);
            }

            private void FormatSequenceMembers(Builder result, IEnumerable sequence, bool inline)
            {
                result.AppendGroupOpening();
                int i = 0;

                try
                {
                    foreach (var item in sequence)
                    {
                        string _;
                        result.AppendCollectionItemSeparator(isFirst: i == 0, inline: inline);
                        FormatObjectRecursive(result, item, isRoot: false, debuggerDisplayName: out _);
                        i++;
                    }
                }
                catch (Exception e)
                {
                    result.AppendCollectionItemSeparator(isFirst: i == 0, inline: inline);
                    FormatException(result, e);
                    result.Append(" ...");
                }

                result.AppendGroupClosing(inline);
            }

            private void FormatMultidimensionalArrayElements(Builder result, Array array, bool inline)
            {
                Debug.Assert(array.Rank > 1);

                if (array.Length == 0)
                {
                    result.AppendCollectionItemSeparator(isFirst: true, inline: true);
                    result.AppendGroupOpening();
                    result.AppendGroupClosing(inline: true);
                    return;
                }

                int[] indices = new int[array.Rank];
                for (int i = array.Rank - 1; i >= 0; i--)
                {
                    indices[i] = array.GetLowerBound(i);
                }

                int nesting = 0;
                int flatIndex = 0;
                while (true)
                {
                    // increment indices (lower index overflows to higher):
                    int i = indices.Length - 1;
                    while (indices[i] > array.GetUpperBound(i))
                    {
                        indices[i] = array.GetLowerBound(i);
                        result.AppendGroupClosing(inline: inline || nesting != 1);
                        nesting--;

                        i--;
                        if (i < 0)
                        {
                            return;
                        }

                        indices[i]++;
                    }

                    result.AppendCollectionItemSeparator(isFirst: flatIndex == 0, inline: inline || nesting != 1);

                    i = indices.Length - 1;
                    while (i >= 0 && indices[i] == array.GetLowerBound(i))
                    {
                        result.AppendGroupOpening();
                        nesting++;

                        // array isn't empty, so there is always an element following this separator
                        result.AppendCollectionItemSeparator(isFirst: true, inline: inline || nesting != 1);

                        i--;
                    }

                    string _;
                    FormatObjectRecursive(result, array.GetValue(indices), isRoot: false, debuggerDisplayName: out _);

                    indices[indices.Length - 1]++;
                    flatIndex++;
                }
            }

            #endregion

            #region Scalars

            private void ObjectToString(Builder result, object obj)
            {
                try
                {
                    string str = obj.ToString();
                    result.Append('[');
                    result.Append(str);
                    result.Append(']');
                }
                catch (Exception e)
                {
                    FormatException(result, e);
                }
            }

            #endregion

            #region DebuggerDisplay Embedded Expressions

            ///
            /// Evaluate a format string with possible member references enclosed in braces.
            /// E.g. "goo = {GetGooString(),nq}, bar = {Bar}".
            ///
            /// <remarks>
            /// Although in theory any expression is allowed to be embedded in the string such behavior is in practice fundamentally broken.
            /// The attribute doesn't specify what language (VB, C#, F#, etc.) to use to parse these expressions. Even if it did all languages
            /// would need to be able to evaluate each other language's expressions, which is not viable and the Expression Evaluator doesn't
            /// work that way today. Instead it evaluates the embedded expressions in the language of the current method frame. When consuming
            /// VB objects from C#, for example, the evaluation might fail due to language mismatch (evaluating VB expression using C# parser).
            ///
            /// Therefore we limit the expressions to a simple language independent syntax: {clr-member-name} '(' ')' ',nq',
            /// where parentheses and ,nq suffix (no-quotes) are optional and the name is an arbitrary CLR field, property, or method name.
            /// We then resolve the member by name using case-sensitive lookup first with fallback to case insensitive and evaluate it.
            /// If parentheses are present we only look for methods.
            /// Only parameterless members are considered.
            /// </remarks>
            private string FormatWithEmbeddedExpressions(int lengthLimit, string format, object obj)
            {
                if (string.IsNullOrEmpty(format))
                {
                    return null;
                }

                var builder = new Builder(_builderOptions.WithMaximumOutputLength(lengthLimit), suppressEllipsis: true);
                return FormatWithEmbeddedExpressions(builder, format, obj).ToString();
            }

            private Builder FormatWithEmbeddedExpressions(Builder result, string format, object obj)
            {
                int i = 0;
                while (i < format.Length)
                {
                    char c = format[i++];
                    if (c == '{')
                    {
                        if (i >= 2 && format[i - 2] == '\\')
                        {
                            result.Append('{');
                        }
                        else
                        {
                            int expressionEnd = format.IndexOf('}', i);

                            bool noQuotes, callableOnly;
                            string memberName;
                            if (expressionEnd == -1 || (memberName = ParseSimpleMemberName(format, i, expressionEnd, out noQuotes, out callableOnly)) == null)
                            {
                                // the expression isn't properly formatted
                                result.Append(format, i - 1, format.Length - i + 1);
                                break;
                            }

                            MemberInfo member = ResolveMember(obj, memberName, callableOnly);
                            if (member == null)
                            {
                                result.AppendFormat(callableOnly ? "!<Method '{0}' not found>" : "!<Member '{0}' not found>", memberName);
                            }
                            else
                            {
                                Exception exception;
                                object value = GetMemberValue(member, obj, out exception);

                                if (exception != null)
                                {
                                    FormatException(result, exception);
                                }
                                else
                                {
                                    MemberDisplayFormat oldMemberDisplayFormat = _memberDisplayFormat;
                                    CommonPrimitiveFormatterOptions oldPrimitiveOptions = _primitiveOptions;

                                    _memberDisplayFormat = MemberDisplayFormat.Hidden;
                                    _primitiveOptions = new CommonPrimitiveFormatterOptions(
                                        _primitiveOptions.NumberRadix,
                                        _primitiveOptions.IncludeCharacterCodePoints,
                                        quoteStringsAndCharacters: !noQuotes,
                                        escapeNonPrintableCharacters: _primitiveOptions.EscapeNonPrintableCharacters,
                                        cultureInfo: _primitiveOptions.CultureInfo);

                                    string _;
                                    FormatObjectRecursive(result, value, isRoot: false, debuggerDisplayName: out _);

                                    _primitiveOptions = oldPrimitiveOptions;
                                    _memberDisplayFormat = oldMemberDisplayFormat;
                                }
                            }
                            i = expressionEnd + 1;
                        }
                    }
                    else
                    {
                        result.Append(c);
                    }
                }

                return result;
            }

            #endregion
        }
    }
}


text:
{% include {{ amsf_theme_base }}/includes/top.html %}
{% include {{ amsf_theme_base }}/includes/open-graph.html %}
{% include {{ amsf_theme_base }}/includes/css-variables.html %}
{% include {{ amsf_theme_base }}/includes/header.html %}
{% include {{ amsf_theme_base }}/includes/content.html %}
{% include {{ amsf_theme_base }}/includes/footer.html %}


text:
'use strict';

const {dirname} = require('path');
const mkdirp = require('./mkdirp');
const writeFile = require('./writeFile');
const writeTag = require('./writeTag');

module.exports = (config, head) => {
  let output = '';

  const createTag = (tag) => {
    output += writeTag(config, tag);
  };

  for (const platform in head) {
    if (head.hasOwnProperty(platform)) {
      head[platform].forEach(createTag);
    }
  }

  return mkdirp(dirname(config.output.html))
    .then(
      () => writeFile(config.output.html, output)
    );
};


text:
tf2pickup-chrome
================

A Chrome extension for TF2Pickup.net.


text:
.class public Lorg/apache/http/impl/conn/DefaultHttpRoutePlanner;
.super Ljava/lang/Object;
.source "DefaultHttpRoutePlanner.java"

# interfaces
.implements Lorg/apache/http/conn/routing/HttpRoutePlanner;

# instance fields
.field protected schemeRegistry:Lorg/apache/http/conn/scheme/SchemeRegistry;

# direct methods
.method public constructor <init>(Lorg/apache/http/conn/scheme/SchemeRegistry;)V
    .locals 2
    .param p1, "schreg"    # Lorg/apache/http/conn/scheme/SchemeRegistry;

    .prologue
    .line 68
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 69
    if-nez p1, :cond_0

    .line 70
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "SchemeRegistry must not be null."

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 73
    :cond_0
    iput-object p1, p0, Lorg/apache/http/impl/conn/DefaultHttpRoutePlanner;->schemeRegistry:Lorg/apache/http/conn/scheme/SchemeRegistry;

    .line 74
    return-void
.end method

# virtual methods
.method public determineRoute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/conn/routing/HttpRoute;
    .locals 8
    .param p1, "target"    # Lorg/apache/http/HttpHost;
    .param p2, "request"    # Lorg/apache/http/HttpRequest;
    .param p3, "context"    # Lorg/apache/http/protocol/HttpContext;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/apache/http/HttpException;
        }
    .end annotation

    .prologue
    .line 83
    if-nez p2, :cond_0

    .line 84
    new-instance v6, Ljava/lang/IllegalStateException;

    const-string v7, "Request must not be null."

    invoke-direct {v6, v7}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v6

    .line 89
    :cond_0
    invoke-interface {p2}, Lorg/apache/http/HttpRequest;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v6

    invoke-static {v6}, Lorg/apache/http/conn/params/ConnRouteParams;->getForcedRoute(Lorg/apache/http/params/HttpParams;)Lorg/apache/http/conn/routing/HttpRoute;

    move-result-object v2

    .line 91
    .local v2, "route":Lorg/apache/http/conn/routing/HttpRoute;
    if-eqz v2, :cond_1

    move-object v3, v2

    .line 117
    .end local v2    # "route":Lorg/apache/http/conn/routing/HttpRoute;
    .local v3, "route":Lorg/apache/http/conn/routing/HttpRoute;
    :goto_0
    return-object v3

    .line 97
    .end local v3    # "route":Lorg/apache/http/conn/routing/HttpRoute;
    .restart local v2    # "route":Lorg/apache/http/conn/routing/HttpRoute;
    :cond_1
    if-nez p1, :cond_2

    .line 98
    new-instance v6, Ljava/lang/IllegalStateException;

    const-string v7, "Target host must not be null."

    invoke-direct {v6, v7}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v6

    .line 102
    :cond_2
    invoke-interface {p2}, Lorg/apache/http/HttpRequest;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v6

    invoke-static {v6}, Lorg/apache/http/conn/params/ConnRouteParams;->getLocalAddress(Lorg/apache/http/params/HttpParams;)Ljava/net/InetAddress;

    move-result-object v0

    .line 104
    .local v0, "local":Ljava/net/InetAddress;
    invoke-interface {p2}, Lorg/apache/http/HttpRequest;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v6

    invoke-static {v6}, Lorg/apache/http/conn/params/ConnRouteParams;->getDefaultProxy(Lorg/apache/http/params/HttpParams;)Lorg/apache/http/HttpHost;

    move-result-object v1

    .line 107
    .local v1, "proxy":Lorg/apache/http/HttpHost;
    iget-object v6, p0, Lorg/apache/http/impl/conn/DefaultHttpRoutePlanner;->schemeRegistry:Lorg/apache/http/conn/scheme/SchemeRegistry;

    invoke-virtual {p1}, Lorg/apache/http/HttpHost;->getSchemeName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Lorg/apache/http/conn/scheme/SchemeRegistry;->getScheme(Ljava/lang/String;)Lorg/apache/http/conn/scheme/Scheme;

    move-result-object v4

    .line 110
    .local v4, "schm":Lorg/apache/http/conn/scheme/Scheme;
    invoke-virtual {v4}, Lorg/apache/http/conn/scheme/Scheme;->isLayered()Z

    move-result v5

    .line 112
    .local v5, "secure":Z
    if-nez v1, :cond_3

    .line 113
    new-instance v2, Lorg/apache/http/conn/routing/HttpRoute;

    .end local v2    # "route":Lorg/apache/http/conn/routing/HttpRoute;
    invoke-direct {v2, p1, v0, v5}, Lorg/apache/http/conn/routing/HttpRoute;-><init>(Lorg/apache/http/HttpHost;Ljava/net/InetAddress;Z)V

    .restart local v2    # "route":Lorg/apache/http/conn/routing/HttpRoute;
    :goto_1
    move-object v3, v2

    .line 117
    .end local v2    # "route":Lorg/apache/http/conn/routing/HttpRoute;
    .restart local v3    # "route":Lorg/apache/http/conn/routing/HttpRoute;
    goto :goto_0

    .line 115
    .end local v3    # "route":Lorg/apache/http/conn/routing/HttpRoute;
    .restart local v2    # "route":Lorg/apache/http/conn/routing/HttpRoute;
    :cond_3
    new-instance v2, Lorg/apache/http/conn/routing/HttpRoute;

    .end local v2    # "route":Lorg/apache/http/conn/routing/HttpRoute;
    invoke-direct {v2, p1, v0, v1, v5}, Lorg/apache/http/conn/routing/HttpRoute;-><init>(Lorg/apache/http/HttpHost;Ljava/net/InetAddress;Lorg/apache/http/HttpHost;Z)V

    .restart local v2    # "route":Lorg/apache/http/conn/routing/HttpRoute;
    goto :goto_1
.end method


text:
package com.pengyifan.leetcode;

/**
 * Given an array nums, write a function to move all 0's to the end of it while maintaining the
 * relative order of the non-zero elements.
 *

 * For example, given nums = [0, 1, 0, 3, 12], after calling your function, nums should be [1, 3,
 * 12, 0, 0].
 *

 * Note:
 *

 * You must do this in-place without making a copy of the array.
 * Minimize the total number of operations.
 */
public class MoveZeroes {
  public void moveZeroes(int[] nums) {
    int begin = 0;
    int i = 0;

    while (i < nums.length) {
      if (nums[i] == 0) {
        i++;
      } else {
        nums[begin] = nums[i];
        begin++;
        i++;
      }
    }

    while (begin < nums.length) {
      nums[begin] = 0;
      begin++;
    }
  }
}


text:
<?php namespace Softservlet\Notification\Notifier;

use Softservlet\Notification\Notification\NotificationInterface;
use Softservlet\Notification\NotificableInterface;
use Exception;
use DB;

class Notifier implements NotifierInterface
{
	public function __construct(NotificationRepositoryInterface $repository)
	{
		$this->repository = $repository;
	}

	public function notify($notificableArray, $notification)
	{
		foreach($notificableArray as $notificable)
		{
			if( !($notificable instanceof NotificableInterface) )
			{
				throw new Exception('Notifier exception - notificableArray should contain array of notificable');
			}
			$this->repository->attach($notificable, $notification);
		}
	}
}


text:
layout: post
title: Meine Oma Hedwig …
chapter: 7
---

Kindergarten Quedlinburg

Volker + Oma Hedwig

 Jetzt kam aber erst mal eine für mich sehr lange, wunderschöne
Kindergartenzeit im HO-Kindergarten, auch in der Leninstraße. Ein Katzensprung
von Rieneckers Fuhrbetrieb und Kohlenhandlung entfernt.

Oma war nun tagtäglich und jederzeit fühlbar …

Im HO- Kindergarten blieb ich bis zu meiner Einschulung 1957, danach war ich
weiterhin im gleichen Haus, aber dann im Obergeschoss, im Schulhort
untergebracht. Täglich ging ich nun nach meinem Kindergartentag vier Häuser
weiter zur Oma.

Alle freuten sich 1955 über meinen frisch eingeschleppten Rheinländer-Dialekt.
Allerdings kam es schon am ersten Tag zu einer Rauferei im Kindergarten.

Ich war schuld. War ich ab sofort immer, im Zweifel war nun immer Volker
schuld …

Wenn ich von Düsseldorf erzählte, glaubte mir niemand, dass sich Türen selbst
öffnen, und als ich erwähnte, dass auch noch die Kaufhaustreppe rollt, war die
Keilerei im Gange. Wer war schuld? Volker!

Doch jeden Nachmittag war ich bei Oma Hedwig, die tröstete sehr gut …

Ich erinnere mich, dass Oma Hedwig mir täglich ein Schälchen Haferflocken mit
Traubenzucker zubereitete. Zu besonderen Tagen hatte Oma noch ein paar Rosinen
und einen halben Löffel gutes Kakao-Pulver, das im Päckchen aus dem Westen
kam, untergemischt. (beim Wort Kakao sprach sie alt-mansfeldisch die beiden
letzten Vokale immer einzeln, betonte das A und das O, es war also kein
"Kakau", nein, es hieß "Kaka-O". Schon dadurch bekam das Pulver für mich etwas
Besonderes übergestreift, etwas ehrfürchtig Wertvolles)

Das Pfund Haferflocken, zu 49 Pfennigen, leistete sich meine Oma nur für mich.
Den Traubenzucker verschrieb ihr der Hausarzt Dr. Sodtke damals auf Rezept.
Wäre für sie sonst auch unerschwinglich gewesen. Eine gute Tasse heißen Kakao
zu trinken, war ihr nur durch Onkel Ottos Pakete möglich.

Um ihre Armut zu verdeutlichen:

Sie trocknete gebrauchte Lorbeerblätter, um sie ein zweites Mal zu benutzen.
Wer es nicht glauben kann, soll es bleiben lassen. Ich aber weiß, dass es
stimmt!

Pflaumenkerne wurden nach ihrer Trocknung geknackt, um die Blausäure
enthaltenden Samenkerne als jämmerlichen Mandelersatz später dem Kuchen
beizumischen. Beides lag zum Trocknen in einem der zwei armseligen Fenster,
deren Kitt keinen Winter überstand und kaum die Scheiben halten konnte.

Lediglich im Winter waren die Fenster mit den riesigen, schönen vom Frost
gemalten Eisblumen eine kindliche Augenweide. Sonst aber ein Bild bitterster
Armut!

Oma bewohnte einen einzigen Wohnraum. 2 Seiten waren halbsteinige
Fachwerk-Außenwände ohne jede Dämmung. Der Raum diente ihr auch zum Schlafen
und Kochen. Als "Herd" besaß sie nur einen 2-flammigen emaillierten kleinen
Tisch-Gaskocher.

Sonst standen noch ein Bett mit einem Wust an Federkissen, ein Vertiko, ein
Kleiderschrank und ein Chaiselongue in braunem Samt-Plüsch mit
hochherrschaftlicher Rückenlehne und angehefteten Spitzendeckchen im Raum.
Davor ein Stubentisch und 4 hochlehnige Stühle. Hier durfte ich mir fast
täglich mittels Decken eine Stuhl-Höhle bauen. Wunderbar!

Gleiches tun heute meine beiden 3-jährigen Enkelinnen in unserem Wohnzimmer.
Wir sind zwar nicht mehr so arm wie die Oma, aber Höhlen stehen immer noch
hoch im Kurs. ;)

Als besonderes Spielzeug hegte die Oma eine Kaffee-Blechdose mit Knöpfen jeder
Art, Farbe und Größe. Meine Schatzkiste! Damit habe ich wohl hunderte Male
gespielt. Ebenso existierte ein damals schon uraltes Bilderbuch mit
gezeichneten Tieren der fremdesten Länder. Das gibt es immer noch.

Im Treppenhaus roch es immer "hochherrschaftlich" wohlig. Mich umgab ein
Duftgemisch aus Bohnerwachs und Rinderbraten oder leckersten Bratkartoffeln.
Die Wohlgerüche aber stammten leider ausnahmslos aus Rieneckers Küche und
steckten stets als Dauerleihgabe in allen Dielenritzen.

Meine Oma muss es so manches Mal als Pein empfunden haben, wenn ihre Rente
nicht mal recht zum Sattwerden reichte. Da roch der Flur nach leckersten
Speisen und sie aß einsam und verlassen Eingeflocktes, also Malzkaffee mit
eingebrocktem trockenen Brot. Oft gar 3 Mal am Tag. Sonst nichts.

Dieses Bild habe ich noch im Kopf, zu oft habe ich das erlebt …

Das ist auch ein Grund, warum niemals jemand erleben wird, dass ich ein Stück
Brot wegwerfe.

Der hohe Wert all unserer Lebensmittel wurde mir hier ganz unbewusst
vermittelt.

Brikett

Die Toilette war eine halbe Treppe tiefer als Gemeinschaftsörtchen auf dem
Treppenabsatz eingebaut.

Im Keller bewahrte Oma noch als ihre eiserne Reserve ein paar Zentner lange
Krupp-Briketts auf. Die sollten erst in absoluten Notzeiten verbrannt werden,
weil sie noch "Friedensware" waren.

Da hätten die Läuse an den glitzernden Außenwänden Schlittschuh laufen können,
die Kohlen wären nie verbrannt worden! Die stammten also noch aus
Vorkriegszeiten und somit aus Eisleben. Die hatten demnach bereits mindestens
2 Umzüge hinter sich.

Abends nach der Arbeit trafen sich in der Regel meine Eltern bei Oma Hedwig.
Einer brachte dann meine Schwester aus der Kinderkrippe mit und dann ging es
nach einer Weile des Verschnaufens weiter nach Hause.

So verlief nun Tag für Tag und Woche für Woche.

An den Wochenenden sind wir etliche Male zur Bornholzweg-Siedlung gestiefelt,
gut 5 km weit, um die andere Oma und meinen Opa zu besuchen.

Strapaziös waren besonders die Rückwege, da war ich dann übermüdet und habe
oft auf einem Brett, welches quer über den Korbkinderwagen gelegt war,
dämmernd gesessen und konnte kaum das Gleichgewicht halten. Zu den Eltern
meiner Mutter später mehr.

Volker + Faun

 Ebenso liefen wir zum Eichelberg oder wanderten durch den Brühl zur
Altenburg. Dann war sommers immer mein Faun-LKW dabei. Das machte riesigen
Spaß. Rückzu wurden beispielsweise Tannenzapfen geladen, zur späteren
Beschickung unseres Badeofens. So "half" ich schon recht früh, die Heizkosten
im Rahmen zu halten …

Gegenüber Rieneckers Haus stand an gleicher Stelle wie die heutige
ARAL-Tankstelle, eine alte MINOL-Tankstelle. Rechts daneben bewohnte eine
Familie Keune das verwitterte, holzverkleidete Eckhaus. Direkt am heutigen
Kreisverkehr im Harzweg, Einfahrt "Mette-Hof". Ich weiß nicht, wer Herr Keune
war, und womit er seine Brötchen verdiente. Auf jeden Fall schien er aber gern
Eier zu essen, denn er nannte einiges Federvieh sein Eigen.

Eines Morgens, das erzählten meine Eltern uns nur allzu gern, betrat Keune
seinen Hühnerstall und erschrak : Im Käfig saß lediglich sein Gockelhahn. Die
Hühner waren allesamt geklaut. Dann erblickte Keune eine Zettelnachricht des
Diebes, in gereimter Form, die an ihn gerichtet war (perfekt wäre gewesen,
wenn die der Hahn vorgetragen hätte):

> Guten Morgen Herr Keune,
> gestern war'n wir noch Neune,
> heute bin ich alleune!

Ihm wurden also über Nacht acht Hühner gestibitzt … Und dennoch fand er über
all seinem Ärger die Idee mit dem Reim so originell, dass er darüber
schmunzelnd die Lokalzeitung informierte.

Fast an gleicher Stelle, nämlich an der MINOL-Tankstelle wollte ich die Straße
in Richtung Oma Hedwig oder zum Schulhort wechseln. Es trug sich während
meines ersten Schulwinters, also 1957/58, zu. Die Leninstraße hatte damals
noch grobes Kopfsteinpflaster und war sehr vereist. Ich trat zwischen
abgestellten Autos direkt und wohl ohne den obligatorischen Seitenblick aufs
Pflaster. Ich rutschte aus und lag sofort, schlitterte dann auf dem Bauch in
Richtung gegenüber liegende Gosse. Zeitgleich kam ein PKW (wahrscheinlich ein
"DKW F 8") vom Bahnhof her gefahren und schob mich einige Meter weiter. Das
war ein Schreck, wohl erst recht für den Fahrer und die Passanten. Ich wurde
nun halb vorgezogen, halb tat ich das selbst und stand wieder. Ehe die
Umstehenden das alles begriffen, hatte ich schon meine Beine unter die Arme
genommen und bin unverletzt so schnell es ging getürmt. Nicht den kleinsten
Kratzer habe ich abbekommen.

Komischerweise wussten meine Eltern abends schon ohne mein Zutun von meiner
jüngsten Kapriole … Ich muss da schon sehr bekannt gewesen sein. :)

So glücklich endete meine erste und einzige Unfallflucht!


text:
require_relative 'spec_helper'

describe 'default' do
  let(:default_ruby_version) { '2.0.0-p353' }
  let(:bundler_version)      { '1.5.2' }

  describe 'ruby-build' do
    describe file('/usr/local/bin/ruby-build') do
      it { should be_file }
      it { should be_executable }
    end
  end

  describe 'chruby' do
    describe file('/usr/local/chruby') do
      it { should be_directory }
    end

    describe file('/usr/local/bin/chruby-exec') do
      it { should be_file }
      it { should be_executable }
    end

    describe file('/etc/profile.d/chruby.sh') do
      it { should be_file }
      # Apparently this doesn't need to be executable to get loaded
      # it { should be_executable }
    end

    describe 'chruby-exec switching' do
      subject { command("/usr/local/bin/chruby-exec #{default_ruby_version} -- ruby --version") }
      it { should return_stdout(/ruby #{default_ruby_version}/) }
    end

    # Ensure chruby.sh was loaded
    describe 'chruby.sh should be loaded' do
      subject { command("/bin/bash --login -c 'chruby #{default_ruby_version} && ruby --version'") }
      it { should return_stdout(/ruby #{default_ruby_version}/) }
    end

  end

  describe 'installed ruby' do
    describe 'ruby-executable' do
      subject { file("/opt/rubies/#{default_ruby_version}/bin/ruby") }
      it { should be_file }
      it { should be_executable }
    end
    describe 'ruby-version' do
      subject { command("/opt/rubies/#{default_ruby_version}/bin/ruby --version") }
      it { should return_stdout(/ruby #{default_ruby_version}/) }
    end
  end

  describe 'bundler' do
    describe 'bundler-executable' do
      subject { file("/opt/rubies/#{default_ruby_version}/bin/bundle") }
      it { should be_file }
      it { should be_executable }
    end
    describe 'bundler-version' do
      subject { command("/opt/rubies/#{default_ruby_version}/bin/bundle --version") }
      it { should return_stdout("Bundler version #{bundler_version}") }
    end
  end

end


text:
declare class FormData {
  static LINE_BREAK: string;
  static DEFAULT_CONTENT_TYPE: string;

  append (key: string, value: any, options?: string | FormData.Options): FormData;
  getHeaders <T> (userHeaders?: T): T & FormData.Headers;
  getCustomHeaders (contentType?: string): FormData.CustomHeaders;
  getBoundary (): string;
  getLengthSync (): number;
  getLength (cb: (error: Error, length?: number) => any): void;
  submit (params: string | Object, cb: (error: Error, response?: any) => any): any;
  pipe <T> (to: T): T;
}

declare module FormData {
  export interface Options {
    filename?: string;
    knownLength?: number;
    header?: string;
    contentType?: string;
  }

  export interface Headers {
    'content-type': string;
  }

  export interface CustomHeaders extends Headers {
    'content-length': string;
  }
}

export = FormData;


text:
'use strict';

const StripeResource = require('../../../StripeResource');
const stripeMethod = StripeResource.method;

module.exports = StripeResource.extend({
  fail: stripeMethod({
    method: 'POST',
    fullPath:
      '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail',
  }),

  post: stripeMethod({
    method: 'POST',
    fullPath:
      '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post',
  }),

  returnOutboundTransfer: stripeMethod({
    method: 'POST',
    fullPath:
      '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return',
  }),
});


text:
@import YapDatabase;

// Automatically included with: @import YapDatabase;
// May be explicitly @import'ed if only utility classes are needed.
//
//@import YapDatabase.Utilities;

@import YapDatabase.YapDatabaseView;
@import YapDatabase.YapDatabaseFilteredView;
@import YapDatabase.YapDatabaseRelationship;
@import YapDatabase.YapDatabaseSecondaryIndex;
@import YapDatabase.YapDatabaseFullTextSearch;
@import YapDatabase.YapDatabaseSearchResultsView;
@import YapDatabase.YapDatabaseHooks;
@import YapDatabase.YapDatabaseCloudKit;
@import YapDatabase.YapDatabaseRTreeIndex;

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused"

	YapDatabase *database;

	YapCache *cache;
	YapCollectionKey *collectionKey;
	YapDatabaseQuery *query;
	YapWhitelistBlacklist *whitelist;

	YapDatabaseView *view;
//	YapDatabaseViewPageMetadata *_should_NOT_compile; // private header

	YapDatabaseFilteredView *filteredView;
	YapDatabaseRelationship *relationship;
	YapDatabaseSecondaryIndex *secondaryIndex;
	YapDatabaseFullTextSearch *fullTextSearch;
	YapDatabaseSearchResultsView *searchResultsView;
	YapDatabaseHooks *hooks;
	YapDatabaseCloudKit *cloudKit;
	YapDatabaseRTreeIndex *rTreeIndex;

#pragma clang diagnostic pop
	return YES;
}

@end


text:
import React from "react";
import { ToggleControl } from "./toggle-control";

import css from "../../../css/portal-dashboard/anonymize-students.less";

interface IProps {
  anonymous: boolean;
  setAnonymous: (value: boolean) => void;
}

export const AnonymizeStudents: React.FC<IProps> = (props) => {
  return (

      <ToggleControl toggleState={props.anonymous} onToggle={props.setAnonymous}/>

        Anonymize students

  );
};


text:
from . import description
from .base import ItemCollector


text:
package de.nstrelow.subscriber_count_tile;

import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;

import org.json.JSONException;
import org.json.JSONObject;

public class MainActivity extends AppCompatActivity {

    private String LOG_TAG = MainActivity.class.getSimpleName();

    public static final String API_KEY_PREF = "apiKey";
    public static final String CHANNEL_ID_PREF = "channelId";
    public static final String USERNAME_PREF = "username";
    public static final String PREFERENCES_KEY = MainActivity.class.getPackage().getName();

    private TextInputLayout inputLayoutKey, inputLayoutChannel;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        setupUI();
    }

    private void setupUI() {
        inputLayoutKey = (TextInputLayout) findViewById(R.id.input_layout_api_key);
        inputLayoutChannel = (TextInputLayout) findViewById(R.id.input_layout_channel);
        Button saveKeyButton = (Button) findViewById(R.id.bt_save_api_key);
        final EditText apiKeyEditText = (EditText) findViewById(R.id.editText);
        apiKeyEditText.setText(getApiKey());
        saveKeyButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String apiKey = apiKeyEditText.getText().toString();
                if (apiKey.isEmpty()) {
                    inputLayoutKey.setError(getString(R.string.err_msg_api_key));
                    return;
                }
                inputLayoutKey.setErrorEnabled(false);
                SharedPreferences prefs = getApplicationContext()
                        .getSharedPreferences(PREFERENCES_KEY, MODE_PRIVATE);

                prefs.edit().putString(API_KEY_PREF, apiKey).apply();
                Snackbar.make(findViewById(R.id.mainLayout),
                        R.string.snack_api_key_saved, Snackbar.LENGTH_SHORT).show();
            }
        });

        Button apiInfoButton = (Button) findViewById(R.id.bt_info_api_key);
        apiInfoButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                showApiInfoDialog();
            }
        });

        Button saveChannelButton = (Button) findViewById(R.id.bt_save_channel);
        final EditText channelEditText = (EditText) findViewById(R.id.editText2);
        channelEditText.setText(getUsername());
        saveChannelButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String username = channelEditText.getText().toString();
                if (username.isEmpty()) {
                    inputLayoutChannel.setError(getString(R.string.err_msg_channel_name));
                    return;
                }
                inputLayoutChannel.setErrorEnabled(false);
                getChannelId(username);
            }
        });
    }

    private void showApiInfoDialog() {
        final String youtubeDataUrl = "https://developers.google.com/youtube/v3/getting-started";
        AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
        alertBuilder
                .setTitle(R.string.api_info_dialog_title)
                .setIcon(R.drawable.ic_info_outline)
                .setMessage(R.string.api_info_dialog_msg)
                .setPositiveButton(R.string.api_info_dialog_open_button, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                        Intent i = new Intent(Intent.ACTION_VIEW);
                        i.setData(Uri.parse(youtubeDataUrl));
                        startActivity(i);
                    }
                })
                .setNeutralButton(R.string.api_info_dialog_send_button, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
                        sharingIntent.setType("text/plain");
                        sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, youtubeDataUrl);
                        startActivity(Intent.createChooser(sharingIntent, getString(R.string.api_info_dialog_send_button)));
                    }
                });
        AlertDialog alertDialog = alertBuilder.create();
        alertDialog.show();
    }

    private String getApiKey() {
        SharedPreferences prefs = getApplicationContext()
                .getSharedPreferences(MainActivity.PREFERENCES_KEY, MODE_PRIVATE);
        return prefs.getString(MainActivity.API_KEY_PREF, "");
    }

    private String getUsername() {
        SharedPreferences prefs = getApplicationContext()
                .getSharedPreferences(MainActivity.PREFERENCES_KEY, MODE_PRIVATE);
        return prefs.getString(MainActivity.USERNAME_PREF, "");
    }

    private void getChannelId(final String username) {
        String apiKey = getApiKey();
        if (apiKey.isEmpty()) {
            inputLayoutChannel.setError(getString(R.string.err_api_key_first));
            return;
        }
        inputLayoutChannel.setErrorEnabled(false);
        RequestQueue queue = Volley.newRequestQueue(this);
        String url = "https://www.googleapis.com/youtube/v3/channels?part=id" +
                "&forUsername=" + username +
                "&key=" + apiKey;

        JsonObjectRequest stringRequest = new JsonObjectRequest(url, null,
                new Response.Listener<JSONObject>() {
                    @Override
                    public void onResponse(JSONObject response) {
                        try {
                            String id = response
                                    .getJSONArray("items")
                                    .getJSONObject(0)
                                    .getString("id");

                            saveChannel(id, username);
                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                    }
                }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                Snackbar.make(findViewById(R.id.mainLayout),
                        "Something went wrong while requesting the channel id",
                        Snackbar.LENGTH_LONG).show();
            }
        });
        queue.add(stringRequest);
    }

    private void saveChannel(String channelId, String username) {
        SharedPreferences prefs = getApplicationContext()
                .getSharedPreferences(PREFERENCES_KEY, MODE_PRIVATE);

        prefs.edit().putString(CHANNEL_ID_PREF, channelId).apply();
        prefs.edit().putString(USERNAME_PREF, username).apply();
        Snackbar.make(findViewById(R.id.mainLayout),
                "Channel saved!", Snackbar.LENGTH_SHORT).show();
    }
}


text:
QString THQt_LatexShowMatrix (QStringList *VHQt_Matrix, int VHQt_N, QString TitleMatrix, QString NameMatrix);
QString THQt_LatexShowMatrix (QStringList *VHQt_Matrix, int VHQt_N, QString NameMatrix);
QString THQt_LatexShowMatrix (QStringList *VHQt_Matrix, int VHQt_N);


text:
package org.apache.pinot.spi.config.instance;

public enum InstanceType {
  CONTROLLER, BROKER, SERVER, MINION
}


text:
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010.  */
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */

/* Test @synthesize with protocols of protocols.  */

#include <stdlib.h>
#include <objc/objc.h>
#include <objc/runtime.h>

@protocol ProtocolA
@property int countA;
@end

@protocol ProtocolB <ProtocolA>
@property int countB;
@end

@protocol ProtocolC <ProtocolB>
@property int countC;
@end

@protocol ProtocolD
@property int countD;
@end

@interface MyRootClass <ProtocolC>
{
  Class isa;
  int countA;
  int countB;
  int countC;
}
+ (id) initialize;
+ (id) alloc;
- (id) init;
@end

@implementation MyRootClass
+ (id) initialize { return self; }
+ (id) alloc { return class_createInstance (self, 0); }
- (id) init { return self; }
@synthesize countA;
@synthesize countB;
@synthesize countC;
@end

@interface MySubClass : MyRootClass <ProtocolD>
{
  int countD;
}
@end

@implementation MySubClass
@synthesize countD;
@end

int main (void)
{
  MySubClass *object = [[MySubClass alloc] init];
  int i;

  for (i = 0; i < 10; i++)
    {
      object.countA += i;
      object.countB += i + 1;
      object.countC += i + 2;
      object.countD += i + 3;
    }

  if (object.countA != 45)
    abort ();

  if (object.countB != 55)
    abort ();

  if (object.countC != 65)
    abort ();

  if (object.countD != 75)
    abort ();

  return 0;
}


text:
package net.sourceforge.marathon.javafxrecorder.component;

import java.util.ArrayList;
import java.util.List;

import org.testng.AssertJUnit;
import org.testng.annotations.Test;

import ensemble.samples.controls.list.SimpleListViewSample;
import javafx.application.Platform;
import javafx.scene.control.ListView;
import javafx.scene.control.MultipleSelectionModel;
import javafx.scene.control.SelectionMode;
import javafx.scene.layout.Pane;
import net.sourceforge.marathon.javafxagent.Wait;
import net.sourceforge.marathon.javafxrecorder.component.LoggingRecorder.Recording;

public class RFXListViewTest extends RFXComponentTest {

	@Test
	public void selectNoSelection() {
		ListView<?> listView = (ListView<?>) getPrimaryStage().getScene().getRoot().lookup(".list-view");
		LoggingRecorder lr = new LoggingRecorder();
		Platform.runLater(new Runnable() {
			@Override
			public void run() {
				RFXListView rfxListView = new RFXListView(listView, null, null, lr);
				rfxListView.focusLost(null);
			}
		});
		List<Recording> recordings = lr.waitAndGetRecordings(0);
		AssertJUnit.assertEquals(0, recordings.size());
	}

	@Test
	public void selectSingleItemSelection() {
		ListView<?> listView = (ListView<?>) getPrimaryStage().getScene().getRoot().lookup(".list-view");
		List<String> text = new ArrayList<>();
		LoggingRecorder lr = new LoggingRecorder();
		Platform.runLater(new Runnable() {
			@Override
			public void run() {
				listView.getSelectionModel().select(2);
				RFXListView rfxListView = new RFXListView(listView, null, null, lr);
				rfxListView.focusLost(null);
				text.add(rfxListView.getAttribute("text"));
			}
		});
		new Wait("Waiting for list text.") {
			@Override
			public boolean until() {
				return text.size() > 0;
			}
		};
		AssertJUnit.assertEquals("Long Row 3", text.get(0));
	}

	@Test
	public void getText() {
		ListView<?> listView = (ListView<?>) getPrimaryStage().getScene().getRoot().lookup(".list-view");
		LoggingRecorder lr = new LoggingRecorder();
		List<String> text = new ArrayList<>();
		Platform.runLater(new Runnable() {
			@Override
			public void run() {
				listView.getSelectionModel().select(2);
				RFXListView rfxListView = new RFXListView(listView, null, null, lr);
				rfxListView.focusLost(null);
				text.add(rfxListView.getAttribute("text"));
			}
		});
		new Wait("Waiting for list text.") {
			@Override
			public boolean until() {
				return text.size() > 0;
			}
		};
		AssertJUnit.assertEquals("Long Row 3", text.get(0));
	}

	@Test
	public void getTextForMultipleSelection() {
		ListView<?> listView = (ListView<?>) getPrimaryStage().getScene().getRoot().lookup(".list-view");
		LoggingRecorder lr = new LoggingRecorder();
		List<String> text = new ArrayList<>();
		Platform.runLater(new Runnable() {
			@Override
			public void run() {
				MultipleSelectionModel<?> selectionModel = listView.getSelectionModel();
				selectionModel.setSelectionMode(SelectionMode.MULTIPLE);
				RFXListView rfxListView = new RFXListView(listView, null, null, lr);
				selectionModel.selectIndices(2, 8);
				rfxListView.focusLost(null);
				text.add(rfxListView.getAttribute("text"));
			}
		});
		new Wait("Waiting for list text.") {
			@Override
			public boolean until() {
				return text.size() > 0;
			}
		};
		AssertJUnit.assertEquals("[\"Long Row 3\",\"Row 9\"]", text.get(0));
	}

	@Test
	public void selectMultipleItemSelection() {
		ListView<?> listView = (ListView<?>) getPrimaryStage().getScene().getRoot().lookup(".list-view");
		LoggingRecorder lr = new LoggingRecorder();
		Platform.runLater(new Runnable() {
			@Override
			public void run() {
				MultipleSelectionModel<?> selectionModel = listView.getSelectionModel();
				selectionModel.setSelectionMode(SelectionMode.MULTIPLE);
				selectionModel.selectIndices(2, 6);
				RFXListView rfxListView = new RFXListView(listView, null, null, lr);
				rfxListView.focusLost(null);
			}
		});
		List<Recording> recordings = lr.waitAndGetRecordings(1);
		Recording recording = recordings.get(0);
		AssertJUnit.assertEquals("recordSelect", recording.getCall());
		AssertJUnit.assertEquals("[\"Long Row 3\",\"Row 7\"]", recording.getParameters()[0]);
	}

	@Test
	public void selectSpecialItemSelection() {
		@SuppressWarnings("unchecked")
		ListView<String> listView = (ListView<String>) getPrimaryStage().getScene().getRoot().lookup(".list-view");
		List<String> text = new ArrayList<>();
		LoggingRecorder lr = new LoggingRecorder();
		Platform.runLater(new Runnable() {
			@Override
			public void run() {
				listView.getItems().add(7, " Special Characters ([],)");
				listView.getSelectionModel().select(7);
				RFXListView rfxListView = new RFXListView(listView, null, null, lr);
				rfxListView.focusLost(null);
				text.add(rfxListView.getText());
			}
		});

		new Wait("Waiting for list text.") {
			@Override
			public boolean until() {
				return text.size() > 0;
			}
		};

		AssertJUnit.assertEquals(" Special Characters ([],)", text.get(0));
	}

	@Test
	public void selectDuplicate() {
		@SuppressWarnings("unchecked")
		ListView<String> listView = (ListView<String>) getPrimaryStage().getScene().getRoot().lookup(".list-view");
		LoggingRecorder lr = new LoggingRecorder();
		List<String> text = new ArrayList<>();
		Platform.runLater(new Runnable() {
			@Override
			public void run() {
				listView.getSelectionModel().select(8);
				RFXListView rfxListView = new RFXListView(listView, null, null, lr);
				rfxListView.focusLost(null);
				text.add(rfxListView.getText());
			}
		});

		new Wait("Waiting for list text.") {
			@Override
			public boolean until() {
				return text.size() > 0;
			}
		};

		AssertJUnit.assertEquals("Row 9", text.get(0));

		Platform.runLater(new Runnable() {
			@Override
			public void run() {
				text.clear();
				listView.getItems().add(9, "Row 9");
				listView.getSelectionModel().clearAndSelect(9);
				RFXListView rfxListView = new RFXListView(listView, null, null, lr);
				rfxListView.focusLost(null);
				text.add(rfxListView.getText());
			}
		});
		new Wait("Waiting for list text.") {
			@Override
			public boolean until() {
				return text.size() > 0;
			}
		};

		AssertJUnit.assertEquals("Row 9(1)", text.get(0));
	}

	@Test
	public void listMultipleDuplicates() {
		@SuppressWarnings("unchecked")
		ListView<String> listView = (ListView<String>) getPrimaryStage().getScene().getRoot().lookup(".list-view");
		List<String> text = new ArrayList<>();
		LoggingRecorder lr = new LoggingRecorder();
		Platform.runLater(new Runnable() {
			@Override
			public void run() {
				listView.getSelectionModel().select(8);
				RFXListView rfxListView = new RFXListView(listView, null, null, lr);
				rfxListView.focusLost(null);
				text.add(rfxListView.getText());
			}
		});

		new Wait("Waiting for list text.") {
			@Override
			public boolean until() {
				return text.size() > 0;
			}
		};

		AssertJUnit.assertEquals("Row 9", text.get(0));

		Platform.runLater(new Runnable() {
			@Override
			public void run() {
				text.clear();
				listView.getItems().add(9, "Row 9");
				listView.getItems().add(10, "Row 9");
				listView.getSelectionModel().clearAndSelect(10);
				RFXListView rfxListView = new RFXListView(listView, null, null, lr);
				rfxListView.focusLost(null);
				text.add(rfxListView.getText());
			}
		});
		new Wait("Waiting for list text.") {
			@Override
			public boolean until() {
				return text.size() > 0;
			}
		};

		AssertJUnit.assertEquals("Row 9(2)", text.get(0));
	}

	@Override
	protected Pane getMainPane() {
		return new SimpleListViewSample();
	}
}


text:
/**
 *
 * @file sg_wc__merge.c
 *
 * @details MERGE a changeset with the current changeset
 * reflected in the WC.
 *
 */

//////////////////////////////////////////////////////////////////

#include <sg.h>

#include "sg_wc__public_typedefs.h"
#include "sg_wc__public_prototypes.h"
#include "sg_wc__private.h"

//////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////

/**
 * ***TRY** to do a REGULAR MERGE -- alter the contents of
 * the WC to relect the merger of the baseline changeset
 * and the requested changeset.
 *
 * We completely manage the TX.  If successful, we return
 * all the results that the API caller expects.  (I say this
 * because if we detect that a ff-merge is required, we just
 * throw an error and discard the TX because the caller will
 * need to set up a different one with different args.)
 *
 * The guts-proper of a REGULAR MERGE is now in layer-6 in
 * wc6merge and can be completely contained within this TX.
 * However, I've removed the layer-7 API for MERGE because
 * a ff-merge cannot be done in layer-7 and we don't want
 * to force every caller to have to deal with this.
 *
 */
void _try_regular_merge(SG_context * pCtx,
						const SG_pathname* pPathWc, // a disk path inside the working copy or NULL to use cwd
						const SG_wc_merge_args * pMergeArgs,
						SG_bool bTest,		// --test is a layer-8-only flag.
						SG_varray ** ppvaJournal,
						SG_vhash ** ppvhStats,
						char ** ppszHidTarget,
						SG_varray ** ppvaStatus)
{
	// ppvaJournal is optional
	// ppvhStats is optional
	// ppszHidTarget is optional
	// ppvaStatus is optional

	SG_wc_tx * pWcTx = NULL;
	SG_varray * pvaJournalAllocated = NULL;
	SG_vhash * pvhStatsAllocated = NULL;
	SG_varray * pvaStatusAllocated = NULL;
	char * pszHidTarget = NULL;

	SG_ERR_CHECK(  SG_WC_TX__ALLOC__BEGIN(pCtx, &pWcTx, pPathWc, SG_FALSE)  );

	SG_ERR_CHECK(  sg_wc_tx__merge__main(pCtx, pWcTx, pMergeArgs, &pvhStatsAllocated,
										 ((ppszHidTarget) ? &pszHidTarget : NULL))  );

	if (ppvaJournal)
		SG_ERR_CHECK(  SG_WC_TX__JOURNAL__ALLOC_COPY(pCtx, pWcTx, &pvaJournalAllocated)  );

	if (ppvaStatus)
		SG_ERR_CHECK(  SG_wc_tx__status(pCtx, pWcTx,
										NULL, SG_INT32_MAX,
										SG_FALSE, SG_FALSE, SG_FALSE, SG_FALSE, SG_FALSE, SG_FALSE,
										&pvaStatusAllocated,
										NULL)  );	// TODO 2012/06/26 what about legend?

	if (bTest)
		SG_ERR_CHECK(  SG_wc_tx__cancel(pCtx, pWcTx)  );
	else
		SG_ERR_CHECK(  SG_wc_tx__apply(pCtx, pWcTx)  );

	SG_ERR_CHECK(  SG_wc_tx__free(pCtx, pWcTx)  );

	if (ppvaJournal)
	{
		*ppvaJournal = pvaJournalAllocated;
		pvaJournalAllocated = NULL;
	}

	if (ppvhStats)
	{
		*ppvhStats = pvhStatsAllocated;
		pvhStatsAllocated = NULL;
	}

	if (ppszHidTarget)
	{
		*ppszHidTarget = pszHidTarget;
		pszHidTarget = NULL;
	}

	if (ppvaStatus)
	{
		*ppvaStatus = pvaStatusAllocated;
		pvaStatusAllocated = NULL;
	}

	return;

fail:
	if (pWcTx)
	{
		SG_ERR_IGNORE(  SG_wc_tx__cancel(pCtx, pWcTx)  );
		SG_WC_TX__NULLFREE(pCtx, pWcTx);
	}
	SG_VARRAY_NULLFREE(pCtx, pvaJournalAllocated);
	SG_VHASH_NULLFREE(pCtx, pvhStatsAllocated);
	SG_NULLFREE(pCtx, pszHidTarget);
	SG_VARRAY_NULLFREE(pCtx, pvaStatusAllocated);
}

//////////////////////////////////////////////////////////////////

/**
 * Try to do a REGULAR and optionally fall-back to a FAST-FORWARD merge.
 *
 */
void SG_wc__merge(SG_context * pCtx,
				  const SG_pathname* pPathWc, // a disk path inside the working copy or NULL to use cwd
				  const SG_wc_merge_args * pMergeArgs,
				  SG_bool bTest,		// --test is a layer-8-only flag.
				  SG_varray ** ppvaJournal,
				  SG_vhash ** ppvhStats,
				  char ** ppszHidTarget,
				  SG_varray ** ppvaStatus)
{
	// ppvaJournal is optional
	// ppvhStats is optional
	// ppszHidTarget is optional
	// ppvaStatus is optional

	_try_regular_merge(pCtx, pPathWc, pMergeArgs, bTest,
					   ppvaJournal, ppvhStats, ppszHidTarget, ppvaStatus);

	if (SG_CONTEXT__HAS_ERR(pCtx))
	{
		if (SG_context__err_equals(pCtx, SG_ERR_MERGE_TARGET_IS_DESCENDANT_OF_BASELINE))
		{
			if (!pMergeArgs->bNoFFMerge)
			{
				SG_context__err_reset(pCtx);
				SG_ERR_CHECK_RETURN(  sg_wc_tx__ffmerge__main(pCtx, pPathWc, pMergeArgs, bTest,
															  ppvaJournal, ppvhStats, ppszHidTarget, ppvaStatus)  );
			}
			else
			{
				SG_ERR_RETHROW_RETURN;
			}
		}
		else
		{
			SG_ERR_RETHROW_RETURN;
		}
	}
}

/**
 * Use this routine to compute the goal/target/peer cset
 * should be for a merge using the given WD state and the
 * set of selector args in pMergeArgs IN THOSE CASES WHERE
 * you don't actually want any of the test/stats/status/journal
 * info.
 *
 */
void SG_wc__merge__compute_preview_target(SG_context * pCtx,
										  const SG_pathname* pPathWc, // a disk path inside the working copy or NULL to use cwd
										  const SG_wc_merge_args * pMergeArgs,
										  char ** ppszHidTarget)
{
	SG_WC__WRAPPER_TEMPLATE__ro(
		pPathWc,
		SG_ERR_CHECK(  sg_wc_tx__merge__compute_preview_target(pCtx, pWcTx, pMergeArgs, ppszHidTarget)  )  );
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycotaxon 99: 35 (2007)

#### Original name
Tilletia melicae Vánky

### Remarks
null


text:
package org.pentaho.di.shared;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemException;
import org.pentaho.di.cluster.ClusterSchema;
import org.pentaho.di.cluster.SlaveServer;
import org.pentaho.di.core.Const;
import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.core.exception.KettleDatabaseException;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.exception.KettleFileException;
import org.pentaho.di.core.exception.KettleXMLException;
import org.pentaho.di.core.logging.LogChannel;
import org.pentaho.di.core.variables.Variables;
import org.pentaho.di.core.vfs.KettleVFS;
import org.pentaho.di.core.xml.XMLHandler;
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.partition.PartitionSchema;
import org.pentaho.di.trans.step.StepMeta;
import org.pentaho.metastore.api.IMetaStore;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import com.google.common.annotations.VisibleForTesting;

/**
 * Based on a piece of XML, this factory will give back a list of objects. In other words, it does XML de-serialisation
 *
 * @author Matt
 */
public class SharedObjects {
  private static Class<?> PKG = SharedObjects.class; // for i18n purposes, needed by Translator2!!

  private static final String XML_TAG = "sharedobjects";

  private String filename;

  private Map<SharedEntry, SharedObjectInterface> objectsMap;

  private class SharedEntry {
    public String className;
    public String objectName;

    /**
     * @param className
     * @param objectName
     */
    public SharedEntry( String className, String objectName ) {
      this.className = className;
      this.objectName = objectName;
    }

    public boolean equals( Object obj ) {
      SharedEntry sharedEntry = (SharedEntry) obj;
      return className.equals( sharedEntry.className ) && objectName.equalsIgnoreCase( objectName );
    }

    public int hashCode() {
      return className.hashCode() ^ objectName.hashCode();
    }

  }

  public SharedObjects( String sharedObjectsFile ) throws KettleXMLException {
    try {
      this.filename = createFilename( sharedObjectsFile );
      this.objectsMap = new Hashtable<SharedEntry, SharedObjectInterface>();

      LogChannel log = new LogChannel( this );

      // Extra information
      FileObject file = getFileObjectFromKettleVFS( filename );

      // If we have a shared file, load the content, otherwise, just keep this one empty
      if ( file.exists() ) {
        Document document = XMLHandler.loadXMLFile( file );
        Node sharedObjectsNode = XMLHandler.getSubNode( document, XML_TAG );
        if ( sharedObjectsNode != null ) {
          List<SlaveServer> privateSlaveServers = new ArrayList<SlaveServer>();
          List<DatabaseMeta> privateDatabases = new ArrayList<DatabaseMeta>();

          NodeList childNodes = sharedObjectsNode.getChildNodes();
          // First load databases & slaves
          //
          for ( int i = 0; i < childNodes.getLength(); i++ ) {
            Node node = childNodes.item( i );
            String nodeName = node.getNodeName();

            SharedObjectInterface isShared = null;

            if ( nodeName.equals( DatabaseMeta.XML_TAG ) ) {
              try {
                DatabaseMeta sharedDatabaseMeta = new DatabaseMeta( node );
                isShared = sharedDatabaseMeta;
                privateDatabases.add( sharedDatabaseMeta );
              } catch ( KettleXMLException kxe ) {
                // If this is caused because we can't find the database plugin, just log and keep going.
                // The KettleDatabaseException is doubly-wrapped in KettleXMLExceptions, so try to unravel
                Throwable firstCause = kxe.getCause();
                if ( firstCause != null ) {
                  Throwable secondCause = firstCause.getCause();

                  if ( secondCause == null || !( secondCause instanceof KettleDatabaseException ) ) {
                    throw kxe;
                  } else {
                    log.logBasic( kxe.getLocalizedMessage() );
                  }
                } else {
                  throw kxe;
                }
              }
            } else if ( nodeName.equals( SlaveServer.XML_TAG ) ) {
              SlaveServer sharedSlaveServer = new SlaveServer( node );
              isShared = sharedSlaveServer;
              privateSlaveServers.add( sharedSlaveServer );
            }

            if ( isShared != null ) {
              isShared.setShared( true );
              storeObject( isShared );
            }
          }

          // Then load the other objects that might reference databases & slaves
          //
          for ( int i = 0; i < childNodes.getLength(); i++ ) {
            Node node = childNodes.item( i );
            String nodeName = node.getNodeName();

            SharedObjectInterface isShared = null;

            if ( nodeName.equals( StepMeta.XML_TAG ) ) {
              StepMeta stepMeta = new StepMeta( node, privateDatabases, (IMetaStore) null );
              stepMeta.setDraw( false ); // don't draw it, keep it in the tree.
              isShared = stepMeta;
            } else if ( nodeName.equals( PartitionSchema.XML_TAG ) ) {
              isShared = new PartitionSchema( node );
            } else if ( nodeName.equals( ClusterSchema.XML_TAG ) ) {
              isShared = new ClusterSchema( node, privateSlaveServers );
            }

            if ( isShared != null ) {
              isShared.setShared( true );
              storeObject( isShared );
            }
          }
        }
      }
    } catch ( Exception e ) {
      throw new KettleXMLException( BaseMessages.getString( PKG, "SharedOjects.Readingfile.UnexpectedError",
        sharedObjectsFile ), e );
    }
  }

  public static final String createFilename( String sharedObjectsFile ) {
    String filename;
    if ( Const.isEmpty( sharedObjectsFile ) ) {
      // First fallback is the environment/kettle variable ${KETTLE_SHARED_OBJECTS}
      // This points to the file
      filename = Variables.getADefaultVariableSpace().getVariable( Const.KETTLE_SHARED_OBJECTS );

      // Last line of defence...
      if ( Const.isEmpty( filename ) ) {
        filename = Const.getSharedObjectsFile();
      }
    } else {
      filename = sharedObjectsFile;
    }
    return filename;
  }

  public SharedObjects() throws KettleXMLException {
    this( null );
  }

  public Map<SharedEntry, SharedObjectInterface> getObjectsMap() {
    return objectsMap;
  }

  public void setObjectsMap( Map<SharedEntry, SharedObjectInterface> objects ) {
    this.objectsMap = objects;
  }

  /**
   * Store the sharedObject in the object map. It is possible to have 2 different types of shared object with the same
   * name. They will be stored separately.
   *
   * @param sharedObject
   */
  public void storeObject( SharedObjectInterface sharedObject ) {
    SharedEntry key = new SharedEntry( sharedObject.getClass().getName(), sharedObject.getName() );
    objectsMap.put( key, sharedObject );
  }

  /**
   * Remove the sharedObject from the object map.
   *
   * @param sharedObject
   */
  public void removeObject( SharedObjectInterface sharedObject ) {
    SharedEntry key = new SharedEntry( sharedObject.getClass().getName(), sharedObject.getName() );
    objectsMap.remove( key );
  }

  public void saveToFile() throws IOException, KettleException {
    FileObject fileObject = getFileObjectFromKettleVFS( filename );
    String backupFileName = createOrGetFileBackup( fileObject );
    writeToFile( fileObject, backupFileName );
  }

  /**
   * Return the shared object with the given class and name
   *
   * @param clazz      The class of the shared object
   * @param objectName the name of the object
   * @return The shared object or null if none was found.
   */
  public SharedObjectInterface getSharedObject( Class<SharedObjectInterface> clazz, String objectName ) {
    return getSharedObject( clazz.getName(), objectName );
  }

  /**
   * Return the shared object with the given class name and object name
   *
   * @param className  The class name of the shared object
   * @param objectName the name of the object
   * @return The shared object or null if none was found.
   */
  public SharedObjectInterface getSharedObject( String className, String objectName ) {
    SharedEntry entry = new SharedEntry( className, objectName );
    return objectsMap.get( entry );
  }

  /**
   * Get the shared database with the specified name
   *
   * @param name The name of the shared database
   * @return The database or null if nothing was found.
   */
  public DatabaseMeta getSharedDatabase( String name ) {
    return (DatabaseMeta) getSharedObject( DatabaseMeta.class.getName(), name );
  }

  /**
   * @return the filename
   */
  public String getFilename() {
    return filename;
  }

  /**
   * @param filename the filename to set
   */
  public void setFilename( String filename ) {
    this.filename = filename;
  }

  /**
   * Write sharedObjects to file. In case of an exception are caught save backup file instead of new one.
   *
   * @param fileObject     is file for writing
   * @param backupFileName is backup file name
   * @throws IOException
   * @throws KettleException
   */
  @VisibleForTesting
  protected void writeToFile( FileObject fileObject, String backupFileName ) throws IOException, KettleException {
    OutputStream outputStream = null;
    PrintStream out = null;
    try {
      outputStream = initOutputStreamUsingKettleVFS( fileObject );

      out = new PrintStream( outputStream );

      out.print( XMLHandler.getXMLHeader( Const.XML_ENCODING ) );
      out.println( "<" + XML_TAG + ">" );

      Collection<SharedObjectInterface> collection = objectsMap.values();
      for ( SharedObjectInterface sharedObject : collection ) {
        String xmlContent = sharedObject.getXML();
        out.println( xmlContent );
      }
      out.println( "</" + XML_TAG + ">" );
    } catch ( Exception e ) {
      // restore file if something wrong
      boolean isRestored = false;
      if ( backupFileName != null ) {
        restoreFileFromBackup( backupFileName );
        isRestored = true;
      }
      throw new KettleException(
        BaseMessages.getString( PKG, "SharedOjects.WriteToFile.ErrorWritingFile", isRestored ), e );
    } finally {
      if ( out != null ) {
        out.flush();
      }
      if ( out != null ) {
        out.close();
      }
      if ( out != null ) {
        outputStream.close();
      }
    }
  }

  private FileObject getFileObjectFromKettleVFS( String filename ) throws KettleFileException {
    return KettleVFS.getFileObject( filename );
  }

  @VisibleForTesting
  protected OutputStream initOutputStreamUsingKettleVFS( FileObject fileObject ) throws IOException {
    return KettleVFS.getOutputStream( fileObject, false );
  }

  /**
   * Call {@link #copyFile(String, String)} method to restore file from backup
   *
   * @param backupFileName
   * @throws IOException
   */
  @VisibleForTesting
  protected void restoreFileFromBackup( String backupFileName ) throws IOException {
    copyFile( backupFileName, filename );
  }

  /**
   * Call {@link #copyFile(String, String)} method to create file backup
   *
   * @param fileObject
   * @throws IOException
   */
  private String createOrGetFileBackup( FileObject fileObject ) throws IOException, KettleException {
    String backupFileName = filename + ".backup";
    boolean isBackupFileExist = false;
    if ( fileObject.exists() ) {
      isBackupFileExist = createFileBackup( backupFileName );
    } else {
      isBackupFileExist = getBackupFileFromFileSystem( backupFileName );
    }
    return isBackupFileExist ? backupFileName : null;
  }

  private boolean getBackupFileFromFileSystem( String backupFileName ) throws KettleException {
    FileObject fileObject = getFileObjectFromKettleVFS( backupFileName );
    boolean isFileCreated = false;
    try {
      fileObject.exists();
      isFileCreated = true;
    } catch ( FileSystemException e ) {
      // NOP
    }
    return isFileCreated;
  }

  private boolean createFileBackup( String backupFileName ) throws IOException {
    return copyFile( filename, backupFileName );
  }

  /**
   * Copy src file to dest file
   *
   * @param src
   * @param dist
   * @throws IOException
   */
  private boolean copyFile( String src, String dist ) throws IOException {
    boolean isFileCopied = false;
    FileChannel sourceChannel = null;
    FileChannel destChannel = null;
    try {
      sourceChannel = new FileInputStream( src ).getChannel();
      destChannel = new FileOutputStream( dist ).getChannel();
      destChannel.transferFrom( sourceChannel, 0, sourceChannel.size() );
      isFileCopied = true;
    } finally {
      sourceChannel.close();
      destChannel.close();
    }

    return isFileCopied;
  }

  @Override
  public String toString() {
    return getClass().getSimpleName() + ( !Const.isEmpty( getFilename() ) ? " (" + getFilename() + ")" : "" );
  }
}


text:
layout: post
date: 2015-12-08
title: "Nicole Spose Aurora of : MODEL AUAB16928 2016 Sleeveless Chapel Train Ballgown"
category: Nicole Spose
tags: [Nicole Spose,Ballgown,Strapless,Chapel Train,Sleeveless,2016]
---
### Nicole Spose Aurora of : MODEL AUAB16928
Just **$329.99**
### 2016  Sleeveless Chapel Train Ballgown

BRANDS	Nicole Spose

Silhouette	Ballgown

Neckline	Strapless

Hemline/Train	Chapel Train

Sleeve	Sleeveless

Years	2016

Buy it: [https://www.readybrides.com/en/nicole-spose/3531-nicole-spose-auab16928.html](https://www.readybrides.com/en/nicole-spose/3531-nicole-spose-auab16928.html)


text:
title: Cookies Ganz Einfach per Javascript Verwalten
date: 2013-03-01 23:16
lang: de
---

Da PHP die Funktionen, die mit Cookies zutun haben, bekannter Weise ja nur aktiviert, wenn die jeweilige Datei neu geladen wird, dachte ich mir, dass ich mal einen kleinen Artikel darüber schreibe, wie man Cookies über Javascript setzt, ausliest und wieder entfernt. All diese Funktionen können verwenden werden, auch ohne, dass die aufgerufene Datei neu geladen werden muss.

Ich habe ein paar kleine Funktionen dafür vorbereitet, welche das jeweilige Cookie setzen, auslesen und sogar aus dem Speicher löschen können.

Hier die Funktion für das Setzen eines neuen Cookies mit einem Wert:

{% highlight js %}
function set_cookie( my_cookie, value, days ) {

	if(days) {
		var date = new Date();
		date.setTime( date.getTime() + ( days*24*60*60*1000 ) );
		var expires = "; expires=" + date.toGMTString();
	} else {
		expires = ""
	}

	document.cookie = my_cookie + "=" + value + expires + "; path=/";

}
{% endhighlight %}

Hiermit lässt sich das gesetzte Cookie ganz einfach auslesen:

{% highlight js %}
function read_cookie( my_cookie ) {

	var my_cookie_eq = my_cookie + "=";
	var ca = document.cookie.split( ';' );

	for( var i=0; i < ca.length; i++ ) {
		var c = ca[i];

		while ( c.charAt(0) == ' ' ) {
			c = c.substring( 1, c.length );
		}

		if ( c.indexOf( my_cookie_eq ) == 0 ) {
			return c.substring( my_cookie_eq.length, c.length );
		}

	}

	return null;

}
{% endhighlight %}

Diese Funktion setzt die offizielle Haltbarkeit des Cookies ins Negative, wodurch dieses logischer Weiße aus dem Browser-Cache entfernt wird:

{% highlight js %}
function delete_cookie( my_cookie ) {
	set_cookie( my_cookie, "", -1 );
}
{% endhighlight %}

Setze die obigen Codes einfach auf deiner Homepage ein und beginne damit, von den Vorteilen der Flexibilität von Javascript gegenüber PHP zu profitieren.


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 Cake.Common.Tests.Fixtures.Build;
using Xunit;

namespace Cake.Common.Tests.Unit.Build.Jenkins.Data
{
    public sealed class JenkinsBuildInfoTests
    {
        public sealed class TheBuildNumberProperty
        {
             [Fact]
             public void Should_Return_Correct_Value()
             {
                 // Given
                 var info = new JenkinsInfoFixture().CreateBuildInfo();

                // When
                 var result = info.BuildNumber;

                // Then
                 Assert.Equal(456, result);
             }
        }

        public sealed class TheBuildDisplayNameProperty
        {
            [Fact]
            public void Should_Return_Correct_Value()
            {
                // Given
                var info = new JenkinsInfoFixture().CreateBuildInfo();

                // When
                var result = info.BuildDisplayName;

                // Then
                Assert.Equal("#456", result);
            }
        }

        public sealed class TheBuildIdProperty
        {
            [Fact]
            public void Should_Return_Correct_Value()
            {
                // Given
                var info = new JenkinsInfoFixture().CreateBuildInfo();

                // When
                var result = info.BuildId;

                // Then
                Assert.Equal("456", result);
            }
        }

        public sealed class TheBuildTagProperty
        {
            [Fact]
            public void Should_Return_Correct_Value()
            {
                // Given
                var info = new JenkinsInfoFixture().CreateBuildInfo();

                // When
                var result = info.BuildTag;

                // Then
                Assert.Equal("jenkins-JOB1-456", result);
            }
        }

        public sealed class TheBuildUrlProperty
        {
            [Fact]
            public void Should_Return_Correct_Value()
            {
                // Given
                var info = new JenkinsInfoFixture().CreateBuildInfo();

                // When
                var result = info.BuildUrl;

                // Then
                Assert.Equal("http://localhost:8080/jenkins/job/cake/456/", result);
            }
        }
    }
}


text:
author: robmyers
comments: true
date: 2014-09-29 05:58:56+00:00
layout: post
slug: streaming-aesthetics-cli-2
title: Streaming Aesthetics CLI 2
wordpress_id: 2627
categories:
- Aesthetics
- Art Computing
- Projects
---

[![streeaming-22](/assets/2014/09/streeaming-22-1024x647.png)](/assets/2014/09/streeaming-22.png)

Running counts of art-related terms and names from Twitter's firehose Streaming API displayed in an (oversized) command-line console.

Code here (in the streaming_aesthetics_cli directory)):

[https://gitorious.org/robmyers/streaming-aesthetics/](https://gitorious.org/robmyers/streaming-aesthetics/)

[https://github.com/robmyers/streaming-aesthetics/](https://github.com/robmyers/streaming-aesthetics/)