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

using Microsoft.Azure.Commands.Sql.Security.Model;
using System.Management.Automation;
using Microsoft.Azure.Commands.Sql.Security.Services;

namespace Microsoft.Azure.Commands.Sql.Security.Cmdlet.DataMasking
{
    /// <summary>
    /// Sets the data masking policy properties for a specific database.
    /// </summary>
    [Cmdlet(VerbsCommon.Set, "AzureSqlDatabaseDataMaskingPolicy"), OutputType(typeof(DatabaseDataMaskingPolicyModel))]
    public class SetAzureSqlDatabaseDataMaskingPolicy : SqlDatabaseDataMaskingPolicyCmdletBase
    {
        /// <summary>
        ///  Defines whether the cmdlets will output the model object at the end of its execution
        /// </summary>
        [Parameter(Mandatory = false)]
        public SwitchParameter PassThru { get; set; }

        /// <summary>
        /// Gets or sets the privileged login names
        /// </summary>
        [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "A semicolon separated list of privileged user ids login name")]
        public string PrivilegedLogins { get; set; }

        /// <summary>
        /// Gets or sets the name of the data masking state
        /// </summary>
        [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Defines if data masking is enabled or disabled for this database")]
        [ValidateSet(SecurityConstants.Enabled, SecurityConstants.Disabled, IgnoreCase = false)]
        [ValidateNotNullOrEmpty]
        public string DataMaskingState  { get; set; }

        /// <summary>
        /// Returns true if the model object that was constructed by this cmdlet should be written out
        /// </summary>
        /// <returns>True if the model object should be written out, False otherwise</returns>
        protected override bool WriteResult() { return PassThru; }

        /// <summary>
        /// Updates the given model element with the cmdlet specific operation
        /// </summary>
        /// <param name="model">A model object</param>
        protected override DatabaseDataMaskingPolicyModel ApplyUserInputToModel(DatabaseDataMaskingPolicyModel model)
        {
            base.ApplyUserInputToModel(model);

            if (PrivilegedLogins != null) // empty string here means that the user clears the logins list
            {
                model.PrivilegedLogins = PrivilegedLogins;
            }

            if (!string.IsNullOrEmpty(DataMaskingState))
            {
                model.DataMaskingState = (DataMaskingState == SecurityConstants.Enabled) ? DataMaskingStateType.Enabled : DataMaskingStateType.Disabled;
            }

            return model;
        }
    }
}


text:
#include "mem_private.h"
#include "sys_calls.h"
#include "mem_pool.h"
#include "memmap.h"
#include "irq.h"
#include "dbg.h"
#include "mutex.h"
#include "kernel_config.h"
#include "thread_private.h"
#include "error.h"
#if (KERNEL_PROFILING)
#include "string.h"
#endif //KERNEL_PROFILING

//dynamic memory pool in system RAM for fast memory objects
MEM_POOL _sys_pool __attribute__ ((section (".sys_bss")));
//dynamic memory pool for thread stacks
MEM_POOL _stack_pool __attribute__ ((section (".sys_bss")));
//generic dynamic memory pool
MEM_POOL _data_pool __attribute__ ((section (".sys_bss")));

void mem_init()
{
	_sys_pool.base = SYSTEM_POOL_BASE;
	_sys_pool.size = SYSTEM_POOL_SIZE;
	_sys_pool.name = "sys mem pool";
	mem_pool_init(&_sys_pool);

	_stack_pool.base = THREAD_STACK_BASE;
	_stack_pool.size = THREAD_STACK_SIZE;
	_stack_pool.name = "thread stack pool";
	mem_pool_init(&_stack_pool);

	_data_pool.base = DATA_POOL_BASE;
	_data_pool.size = DATA_POOL_SIZE;
	_data_pool.name = "data pool";
	mem_pool_init(&_data_pool);
}

/** \addtogroup memory dynamic memory management
	\{
 */

/**
	\brief allocate memory in system pool with specific align
	\details cannot be called from USER context
	\param size: data size in bytes
	\param align: align in bytes
	\retval pointer on success, NULL on out of memory conditiion
*/
void* sys_alloc_aligned(int size, int align)
{
	CHECK_CONTEXT(IRQ_CONTEXT | SUPERVISOR_CONTEXT | SYSTEM_CONTEXT);
	void* ptr = NULL;
	CRITICAL_ENTER;
	ptr = mem_pool_alloc(&_sys_pool, size, align);
	CRITICAL_LEAVE;
	return ptr;
}

/**
	\brief allocate memory in system pool
	\details cannot be called from USER context
	\param size: data size in bytes
	\retval pointer on success, NULL on out of memory conditiion
*/
void* sys_alloc(int size)
{
	CHECK_CONTEXT(IRQ_CONTEXT | SUPERVISOR_CONTEXT | SYSTEM_CONTEXT);
	void* ptr = NULL;
	CRITICAL_ENTER;
	ptr = mem_pool_alloc(&_sys_pool, size, WORD_SIZE);
	CRITICAL_LEAVE;
	return ptr;
}

/**
	\brief free memory in system pool
	\details cannot be called from USER context
	\param ptr: pointer to allocated data
	\retval none
*/
void sys_free(void *ptr)
{
	CHECK_CONTEXT(IRQ_CONTEXT | SUPERVISOR_CONTEXT | SYSTEM_CONTEXT);
	CRITICAL_ENTER;
	mem_pool_free(&_sys_pool, ptr);
	CRITICAL_LEAVE;
}

/** \} */ // end of event group

void* stack_alloc(int size)
{
	CHECK_CONTEXT(IRQ_CONTEXT | SUPERVISOR_CONTEXT);
	return mem_pool_alloc(&_stack_pool, size, THREAD_STACK_ALIGN);
}

void stack_free(void* ptr)
{
	CHECK_CONTEXT(IRQ_CONTEXT | SUPERVISOR_CONTEXT);
	mem_pool_free(&_stack_pool, ptr);
}

static inline void* svc_malloc(int size, int align)
{
	void* ptr;
	CRITICAL_ENTER;
	if (svc_thread_get_current()->pool)
		ptr = mem_pool_alloc(svc_thread_get_current()->pool, size, align);
	else
		ptr = mem_pool_alloc(&_data_pool, size, align);
	CRITICAL_LEAVE;
	return ptr;
}

static inline void svc_free(void* ptr)
{
	CRITICAL_ENTER;
	if (svc_thread_get_current()->pool)
		mem_pool_free(svc_thread_get_current()->pool, ptr);
	else
		mem_pool_free(&_data_pool, ptr);
	CRITICAL_LEAVE;
}

static inline MEM_POOL* svc_allocate_pool(char* name, int size)
{
	MEM_POOL* pool = svc_malloc(sizeof(MEM_POOL) + size, WORD_SIZE);
	pool->name = name;
	pool->base = (unsigned int)pool + sizeof(MEM_POOL);
	pool->size = size;
	mem_pool_init(pool);
	return pool;
}

static inline void svc_free_pool(MEM_POOL* pool)
{
	svc_free(pool);
}

static inline void svc_select_pool(MEM_POOL* pool)
{
	svc_thread_get_current()->pool = pool;
}

static inline void svc_select_global_pool()
{
	svc_thread_get_current()->pool = NULL;
}

#if (KERNEL_PROFILING)
void print_value(unsigned int value)
{
	if (value < 1024)
		printf(" %3d", value);
	else if (value / 1024 < 1024)
		printf("%3dK", value / 1024);
	else
		printf("%3dM", value / 1024 / 1024);
}

void print_pool_stat(MEM_POOL* pool)
{
	int i;
	MEM_POOL_STAT stat;
	mem_pool_stat(pool, &stat);
	printf("%s ", pool->name);
	for (i = strlen(pool->name); i <= 16; ++i)
		printf(" ");
	print_value(pool->size);
	printf("   ");
	print_value(stat.total_used);
	printf("(%d)   ", stat.used_blocks_count);
	print_value(stat.total_free);
	printf("(%d)\n\r", stat.free_blocks_count);
}

static inline void svc_mem_stat()
{
	//just to see all text right
	CRITICAL_ENTER;
	printf("name              size     used     free  \n\r");
	printf("---------------------------------------------\n\r");
	print_pool_stat(&_sys_pool);
	print_pool_stat(&_stack_pool);
	print_pool_stat(&_data_pool);
	CRITICAL_LEAVE;
}

#endif //KERNEL_PROFILING

unsigned int svc_mem_handler(unsigned int num, unsigned int param1, unsigned int param2)
{
	unsigned int res = 0;
	switch (num)
	{
	case MEM_ALLOCATE:
		res = (unsigned int)svc_malloc((int)param1, (int)param2);
		break;
	case MEM_FREE:
		svc_free((void*)param1);
		break;
	case POOL_ALLOCATE:
		res = (unsigned int)svc_allocate_pool((char*)param1, (int)param2);
		break;
	case POOL_FREE:
		svc_free_pool((MEM_POOL*)param1);
		break;
	case POOL_SELECT:
		svc_select_pool((MEM_POOL*)param1);
		break;
	case POOL_SELECT_GLOBAL:
		svc_select_global_pool((MEM_POOL*)param1);
		break;
#if (KERNEL_PROFILING)
	case MEM_STAT:
		svc_mem_stat();
		break;
#endif //KERNEL_PROFILING
	default:
		error_value(ERROR_GENERAL_INVALID_SYS_CALL, num);
	}
	return res;
}

redpajama_set_name: RedPajamaGithub


text:
require "column_hider/version"

module ColumnHider
  #
  # Overrides the Rails ActiveRecord Attributes "columns" method.
  # This allows the logical removal of a column prior to its physical removal.
  # To use, add two lines to your model:
  # `  extend ColumnHider::ActiveRecordAttributes`
  # `  column_hider_columns :column_one, :column_two, ...`
  # If you want to deprecate the columns, call:
  # `  column_hider_deprecate_columns :column_one, :column_two, ...`
  #    This will also hide the columns
  #
  module ActiveRecordAttributes
    def column_hider_columns(*cols)
      @column_hider_columns = {}
      cols.each do |col|
        @column_hider_columns[col] = true
      end
    end

    def columns
      @column_hider_columns ||= {} # just in case the model has "extend ColumnHider::ActiveRecordAttributes", but doesn't call column_hider_columns
      super.reject { |col| @column_hider_columns.has_key?(col.name.to_sym) }
    end

    def column_hider_deprecate_columns(*cols)
      cols.each do |c|
        define_method("#{c}".to_sym) do
          raise NoMethodError.new("column '#{c}' deprecated", c.to_sym)
        end
        define_method("#{c}=".to_sym) do |arg|
          raise NoMethodError.new("column '#{c}' deprecated", c.to_sym)
        end
      end
      column_hider_columns(*cols)
    end

  end

end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Medallion.OData;
using Medallion.OData.Trees;
using MemberPath = System.Collections.Generic.IReadOnlyList<System.Reflection.MemberInfo>;

namespace Medallion.OData.Client
{
    internal partial class LinqToODataTranslator
    {
        ///
        /// Helper class for dealing with translating members across projections. This is difficult because OData has no notion of projection except
        /// for a final column selection
        ///
        private class MemberAndParameterTranslator
        {
            private static readonly IEqualityComparer<MemberPath> MemberPathComparer = EqualityComparers.Create<MemberPath>(
                (l1, l2) => l1.SequenceEqual(l2, Helpers.MemberComparer),
                l => l.Aggregate(0, (s, m) => s ^ Helpers.MemberComparer.GetHashCode(m))
            );

            ///
            /// Tracks all projections which have been applied via SELECTs. This is needed to allow for a client-side projection delegate to be generated
            /// (OData doesn't support projection except for column selection and inclusion)
            ///
            private readonly List<LambdaExpression> _projectionList = new List<LambdaExpression>();
            ///
            /// This keeps track of the current set of mappings between member paths (e. g. a.b.c) and translations.
            /// The reason we need this is that we can't actually translate every projection directly. For example, if we have
            /// q.Select(a => new { x = new { a.Foo } ... }).Select(t => t.x), we can't translate t.x directly into OData.
            /// We can, however, remember all translations that could derive from t.x (in this case x.Foo), so that any time a property
            /// of x is referenced we can provide the correct translation.
            ///
            /// Note that this could just be a variable to hold the most current value, but keeping the entire stack aids in debugging
            ///
            private readonly Stack<Dictionary<MemberPath, ODataExpression>> _pathStack = new Stack<Dictionary<MemberPath, ODataExpression>>();
            private readonly LinqToODataTranslator _translator;

            public MemberAndParameterTranslator(LinqToODataTranslator translator)
            {
                this._translator = translator;
            }

            #region ---- Public API ----
            public ODataExpression TranslateParameter(ParameterExpression parameterExpression)
            {
                if (this._pathStack.Count == 0)
                {
                    // we represent the root parameter, as in q.Where(a => a.Flag) as null
                    return null;
                }

                // otherwise, we can only evaluate a parameter if we have a (empty) path for it in the mapping
                // this will happen in cases like q.Select(a => a.Text).Where(t => t.Length > 0)
                if (!this._pathStack.Peek().TryGetValue(Empty<MemberInfo>.Array, out var result))
                {
                    throw new ODataCompileException("Could not translate parameter of type " + parameterExpression.Type + " to OData in this context!");
                }
                return result;
            }

            public ODataExpression TranslateMemberAccess(MemberExpression memberAccess)
            {
                // translate special properties
                if (this.TryTranslateMemberAccessAsSpecialMember(memberAccess, out var result))
                {
                    return result;
                }

                // otherwise, try to translate as a member access chain going back to a parameter. Since the only special members
                // we support return types with no members (primitive types), this is a safe assertion
                var memberAccessChain = Traverse.Along(memberAccess, me => me.Expression as MemberExpression)
                    .Reverse()
                    .ToArray();
                if (memberAccessChain[0].Expression.NodeType != ExpressionType.Parameter)
                {
                    throw new ODataCompileException("Cannot compile member access path '" + memberAccessChain.Select(me => me.Member.Name).ToDelimitedString(".") + "' to OData: must start with a lambda parameter");
                }

                // attempt to translate the full path by referencing the mapping in the path stack
                if (this._pathStack.Count > 0 && this._pathStack.Peek().TryGetValue(memberAccessChain.Select(me => me.Member).ToArray(), out result))
                {
                    return result;
                }

                // translate the sub path, and then attempt to apply the current member
                // for example, if the path was param.A.B, then we'd translate param.A and then try to translate B as a property of A
                var instance = this._translator.TranslateInternal(memberAccess.Expression);
                var property = memberAccess.Member as PropertyInfo;
                if (property == null)
                {
                    throw new ODataCompileException("Only properties are supported. Found: " + memberAccess.Member);
                }
                if ((property.GetMethod ?? property.SetMethod).IsStatic)
                {
                    // we don't really expect to hit this case in practice, because static properties should be evaluated in memory
                    // rather than translated
                    throw new ODataCompileException("Static properties are not supported. Found: " + property);
                }
                if (instance == null || instance.Kind == ODataExpressionKind.MemberAccess)
                {
                    return ODataExpression.MemberAccess((ODataMemberAccessExpression)instance, property);
                }

                throw new ODataCompileException("Property " + property + " is not supported in OData");
            }

            ///
            /// Registers a lambda projection so that it can be used to inform further translations
            ///
            public void RegisterProjection(LambdaExpression projection)
            {
                this._pathStack.Push(this.ParseProjection(projection));
                this._projectionList.Add(projection);
            }

            ///
            /// Returns a <see cref="LambdaExpression"/> representing the final client-side projection to be applied to the returned result
            ///
            public LambdaExpression GetFinalProjection()
            {
                var result = this._projectionList.Count > 0
                    ? ClientSideProjectionBuilder.CreateProjection(this._projectionList)
                    : null;
                return result;
            }

            ///
            /// Determines which properties of the root parameter were actually referenced in the final projection so that
            /// we can create a $select filter
            ///
            public ISet<MemberPath> GetReferencedMemberPathsInFinalProjection()
            {
                if (this._pathStack.Count == 0)
                {
                    return null; // select everything
                }

                var visitor = new MemberPathFinder();
                var referencedPaths = this._pathStack.Peek()
                    .Values
                    .SelectMany(visitor.FindPaths)
                    .ToSet(MemberPathComparer);
                return referencedPaths;
            }
            #endregion

            ///
            /// Attempts to translate the given <see cref="MemberExpression"/> as a special OData member, like <see cref="Nullable{T}.Value"/> or
            /// <see cref="string.Length"/>.
            ///
            private bool TryTranslateMemberAccessAsSpecialMember(MemberExpression memberAccess, out ODataExpression result)
            {
                // TODO FUTURE null handling?
                Func<IEnumerable<ODataExpression>> translateInstance = () => this._translator.TranslateInternal(memberAccess.Expression).Enumerate();
                if (memberAccess.Member.DeclaringType == typeof(string) && memberAccess.Member.Name == "Length")
                {
                    result = ODataExpression.Call(ODataFunction.Length, translateInstance());
                }
                else if (memberAccess.Member.DeclaringType == typeof(DateTime) && memberAccess.Member.Name == "Year")
                {
                    result = ODataExpression.Call(ODataFunction.Year, translateInstance());
                }
                else if (memberAccess.Member.DeclaringType == typeof(DateTime) && memberAccess.Member.Name == "Month")
                {
                    result = ODataExpression.Call(ODataFunction.Month, translateInstance());
                }
                else if (memberAccess.Member.DeclaringType == typeof(DateTime) && memberAccess.Member.Name == "Day")
                {
                    result = ODataExpression.Call(ODataFunction.Day, translateInstance());
                }
                else if (memberAccess.Member.DeclaringType == typeof(DateTime) && memberAccess.Member.Name == "Hour")
                {
                    result = ODataExpression.Call(ODataFunction.Hour, translateInstance());
                }
                else if (memberAccess.Member.DeclaringType == typeof(DateTime) && memberAccess.Member.Name == "Minute")
                {
                    result = ODataExpression.Call(ODataFunction.Minute, translateInstance());
                }
                else if (memberAccess.Member.DeclaringType == typeof(DateTime) && memberAccess.Member.Name == "Second")
                {
                    result = ODataExpression.Call(ODataFunction.Second, translateInstance());
                }
                // nullable properties
                else if (memberAccess.Member.Name == "HasValue" && memberAccess.Member.DeclaringType.IsGenericOfType(typeof(Nullable<>)))
                {
                    // for HasValue we just re-translate expr != null
                    result = this._translator.TranslateInternal(Expression.NotEqual(memberAccess.Expression, Expression.Constant(null, memberAccess.Expression.Type)));
                }
                else if (memberAccess.Member.Name == "Value" && memberAccess.Member.DeclaringType.IsGenericOfType(typeof(Nullable<>)))
                {
                    // .Value calls can just be ignored, since OData doesn't have the notion of nullable types
                    result = this._translator.TranslateInternal(memberAccess.Expression);
                }
                else
                {
                    result = null;
                    return false;
                }

                return true;
            }

            private Dictionary<IReadOnlyList<MemberInfo>, ODataExpression> ParseProjection(LambdaExpression projection)
            {
                Throw.If(projection.Parameters.Count != 1, "projection: must have 1 parameter");

                var result = this.ParseProjectionBody(projection.Body);
                return result;
            }

            private Dictionary<MemberPath, ODataExpression> ParseProjectionBody(Expression body)
            {
                var isAnonymousTypeProjection = body.NodeType == ExpressionType.New && body.Type.IsAnonymous();
                var isObjectInitializerProjection = body.NodeType == ExpressionType.MemberInit;
                if (isAnonymousTypeProjection || isObjectInitializerProjection)
                {
                    Dictionary<MemberPath, Expression> pathToLinqMapping;
                    if (isAnonymousTypeProjection) // anonymous, like a => new { x = a.B }
                    {
                        // anonymous type creation is actually a new using a constructor whose arguments match the anonymous properties
                        var @new = (NewExpression)body;
                        pathToLinqMapping = @new.Constructor.GetParameters()
                            .Select((v, i) => new { Value = v, Index = i })
                            .ToDictionary(
                                t => @new.Type.GetMember(t.Value.Name).As<MemberPath>(),
                                t => @new.Arguments[t.Index]
                            );
                    }
                    else
                    {
                        // initializer, like a => new X { Foo = a.B }
                        var memberInit = (MemberInitExpression)body;
                        if (memberInit.NewExpression.Arguments.Count > 0)
                        {
                            throw new ODataCompileException("Only parameterless constructors are supported with object initializers in OData. Found: " + memberInit);
                        }
                        if (memberInit.Bindings.Any(mb => mb.BindingType != MemberBindingType.Assignment))
                        {
                            throw new ODataCompileException("Only member assignment initializers are supported in OData. Found: " + memberInit);
                        }

                        pathToLinqMapping = memberInit.Bindings.Cast<MemberAssignment>()
                            .ToDictionary(
                                mb => new[] { mb.Member }.As<MemberPath>(),
                                mb => mb.Expression
                        );
                    }

                    // for anonymous and initializer projections, we support nested projections such as
                    // a => new { b = new { c = a.x } } }
                    // To do this, for each property mapping (a.b in the example above), we simply recurse
                    // on the value expression and then add the property prefix to the resulting paths
                    var result = new Dictionary<MemberPath, ODataExpression>(MemberPathComparer);
                    foreach (var kvp in pathToLinqMapping)
                    {
                        var parsed = this.ParseProjectionBody(kvp.Value);
                        result.AddRange(parsed.Select(p => KeyValuePair.Create(kvp.Key.Concat(p.Key).ToArray().As<MemberPath>(), p.Value)));
                    }

                    return result;
                }

                // if we have a path stack and we find a parameter, then we can just copy over all paths from
                // that parameters mapping to the new mapping
                if (this._pathStack.Count > 0 && body.NodeType == ExpressionType.Parameter)
                {
                    // add all paths for the last parameter
                    var result = new Dictionary<MemberPath, ODataExpression>(this._pathStack.Peek(), MemberPathComparer);
                    return result;
                }

                // a member path, where the path stack is non-empty and thus the path won't translate directly
                // for example: a => a.b.x, where a is not the root query parameter
                if (this._pathStack.Count > 0 && body.NodeType == ExpressionType.MemberAccess)
                {
                    // pull out the member path as going back to a parameter (similar to what we do when translating a member)
                    var reverseMemberPath = Traverse.Along((MemberExpression)body, me => me.Expression as MemberExpression)
                        .ToArray();
                    if (reverseMemberPath[reverseMemberPath.Length - 1].Expression.NodeType != ExpressionType.Parameter)
                    {
                        throw new ODataCompileException("Expression '" + reverseMemberPath.Last().Expression + "' could not be compiled to OData as part of a projection");
                    }

                    // find all paths for the current parameter which are prefixes of this path
                    var memberPath = reverseMemberPath.Reverse().Select(me => me.Member).ToArray();
                    var result = this._pathStack.Peek().Where(kvp => StartsWith(kvp.Key, prefix: memberPath))
                        .ToDictionary(
                            // the new mapping has the same path, but without the prefix of the current parameter
                            kvp => kvp.Key.Skip(memberPath.Length).ToArray(),
                            kvp => kvp.Value,
                            MemberPathComparer
                        );
                    // if we didn't find any such paths, then this should be directly translatable. For example:
                    // q.Select(a => a.B).Select(b => b.Id), then no path starts with b.Id. Thus, we fall through to
                    // just translating b.Id
                    if (result.Count > 0)
                    {
                        return result;
                    }
                }

                // finally, if the projection doesn't match any special patterns, then we simply try
                // to translate the projected value directly (e. g. a => a.Id + 2)
                var simpleResult = new Dictionary<MemberPath, ODataExpression>(MemberPathComparer)
                {
                    { Empty<MemberInfo>.Array, this._translator.TranslateInternal(body) },
                };
                return simpleResult;
            }

            private static bool StartsWith(MemberPath path, MemberPath prefix)
            {
                return prefix.Count <= path.Count
                        && path.Zip(prefix, (me1, me2) => Helpers.MemberComparer.Equals(me1, me2))
                                .All(b => b);
            }

            private class MemberPathFinder : ODataExpressionVisitor
            {
                private ISet<MemberPath> _paths;

                public ISet<MemberPath> FindPaths(ODataExpression node)
                {
                    this._paths = new HashSet<MemberPath>();
                    this.Visit(node);
                    return this._paths;
                }

                protected override void VisitMemberAccess(ODataMemberAccessExpression node)
                {
                    var path = Traverse.Along(node, e => e.Expression)
                        .Reverse()
                        .Select(e => e.Member)
                        .ToArray();
                    this._paths.Add(path);
                }
            }
        }
    }
}


text:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace TrussSigner.Test
{
    [TestClass]
    public class TrussSignerWorkerTest
    {
        [TestMethod]
        public void TrussSignerTest()
        {
            const string pathToKbs = @"C:\TrussSignerTest\SampleTrussJob\All trusses Building 1.pcl";

            TrussJob job = new TrussJob(pathToKbs, @"C:\TrussSignerTest\SampleTrussJob\CoverListTrusses.jobmeta", @"C:\TrussSignerTest\SampleTrussJob\TrussResult.pdf");

            TrussSignerWorker worker = new TrussSignerWorker(job);

            worker.GenerateTrussSignedPdf();
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
    <meta http-equiv="x-ua-compatible" content="ie=edge" />

    <title>Cashier Password | Champion-FX.com</title>
    <meta name="description" content="Access the world markets through one powerful all in one platform. The best choice for the modern trader where the client is king." />

    <meta property="og:title" content="Champion-FX.com" />
    <meta property="og:type"  content="website" />
    <meta property="og:image" content="/champion-static/images/cfx-animated-links.gif" />

    <link rel="icon" type="image/png" sizes="16x16" href="/champion-static/images/favicons/CFX_favicon16.png" />
    <link rel="icon" type="image/png" sizes="32x32" href="/champion-static/images/favicons/CFX_favicon32.png" />
     <link rel="stylesheet" href="https://style.champion-fx.com/binary.css?vyr5n3yj" />
     <link rel="stylesheet" href="/champion-static/css/style.min.css?vyr5n3yj" />

                            Contact Us

                            Log In

  English

  English

Indonesia

Deutsch

English

Español

Français

Italiano

Polski

Português

Русский

Tiếng Việt

简体中文

繁體中文

MetaTrader 5

Upgrade to
Real Account

MetaTrader 5

Sign out

                About Us

                MetaTrader 5

                About MT5

                Types of accounts

                Forex

                CFDs

                Metals

                Economic calendar

                Binary Options

                About binary options

                Types of accounts

                Trading platforms

                Partnerships

                Settings

                Settings

                Cashier

                About Us

                MetaTrader 5

                About MT5

                Types of accounts

                Forex

                CFDs

                Metals

                Economic calendar

                Binary Options

                About binary options

                Types of accounts

                Trading platform

                Trading platforms

                Academy

                Partnerships

                Sign out

                Sign Up</a

Cashier password

    <form id="form_lock_cashier" class="invisible">

Lock cashier

An additional password can be used to restrict access to the cashier.

    New password

                <input type="password" id="txt_lock_password" maxlength="25"  />

Minimum of six lower and uppercase letters with numbers

    Verify new password

                <input type="password" id="txt_re_password" maxlength="25"  />

    <button id="btn_submit" type="submit" >Update</button>

    </form>

    <form id="form_unlock_cashier" class="invisible">

Unlock cashier

Your cashier is locked as per your request - to unlock it, please enter the password.

    Cashier password

                <input type="password" id="txt_unlock_password" maxlength="25"  />

    <button id="btn_submit" type="submit" >Unlock cashier</button>

    </form>

ChampionFX

About Us

Contact Us

License

Terms and Conditions

Terms and Conditions

Payment Methods

Partnerships

Introducing Broker (IB)

Liquidity Solutions

Multiple Accounts Manager (MAM)

Affiliate Programme

Content Contributor

MetaTrader 5

Forex

CFDs

Metals

Types of accounts

MetaTrader 5 trading platforms

Binary options

About binary options

Types of accounts

Binary options trading platforms

Trading Times

                    High Risk Investment Warning: Trading foreign exchange and/or contracts for differences on margin carries a very high level of risk, and may not be suitable for all investors. There is a possibility that you could sustain a loss in excess of your deposited funds. Accordingly, you should not speculate with capital that you cannot afford to lose. Before deciding to trade the products offered via this website you should carefully consider your financial objectives, needs and level of trading experience. In particular, you should be aware of all the risks associated with trading on margin. Furthermore, Champion FX does not issue advice, recommendations or opinions in relation to acquiring, holding or disposing of any financial products, and all services are provided on an execution only basis.

                    ChampionFX is not available to residents of Australia, Bosnia and Herzegovina, Costa Rica, Democratic People's Republic of Korea (DPRK), any European Union country, Ethiopia, Guyana, Hong Kong, Iran, Iraq, Japan, Jersey, Malaysia, Syria, Uganda, USA, Vanuatu, and Yemen.

                    © 2017 Champion FX

Trade with us where the client is always the KING.

Tight spreads with no commission

Low latency & fast execution

Flexible leverage up to 1:1,000

Sign up now!

            <form id="verify-email-form" class="frm-verify-email">
    <input class="clean-input primary-input" autocomplete="off" name="email" id="email" maxlength="50" placeholder="Enter your email">

    <button class="button" id="btn-verify-email" type="submit">Submit</button>

or

        Sign up with Google

</form>

Already have an account? Log In

            <button class="btn-login button-secondary hidden-sm-up" type="submit">Log In</button>

Thank you for signing up!

Please check your email to complete the registration process.


text:
@class AddressBookFriend, AttributeLabel, MMHeadImageView, NSArray, NSString, SearchMatchTip, UIButton;

@interface FTSAddressBookFriendCell : MMTableViewCell
{
    AddressBookFriend *_addressBookFriend;
    NSString *_searchText;
    id <FTSAddressBookFriendCellDelegate> _delegate;
    MMHeadImageView *_headImageView;
    AttributeLabel *_displayNameLabel;
    AttributeLabel *_detailLabel;
    UIButton *_opButton;
    SearchMatchTip *_matchTip;
    NSArray *_arrKeyword;
}

@property(retain, nonatomic) NSArray *arrKeyword; // @synthesize arrKeyword=_arrKeyword;
@property(retain, nonatomic) SearchMatchTip *matchTip; // @synthesize matchTip=_matchTip;
@property(retain, nonatomic) NSString *searchText; // @synthesize searchText=_searchText;
@property(nonatomic) __weak id <FTSAddressBookFriendCellDelegate> delegate; // @synthesize delegate=_delegate;
- (void).cxx_destruct;
- (void)updateAddressBookFriend:(id)arg1 searchText:(id)arg2 matchTip:(id)arg3 keywords:(id)arg4;
- (void)updateStatus:(_Bool)arg1;
- (void)dealloc;
- (void)initView;
- (void)onOpButtonClicked;
- (id)initWithStyle:(long long)arg1 reuseIdentifier:(id)arg2;

@end


text:
<ul class="nav navbar-nav" role="tablist"<?= $this-> tagPlay('ul') ?>>

<?= $this-> block('nav') ?>


text:
package org.agorava.xing.jackson;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.agorava.xing.model.Comment;

@JsonIgnoreProperties(ignoreUnknown = true)
abstract class MetaCommentMixin {

	@JsonCreator
	public MetaCommentMixin() {
	}

	@JsonProperty("type")
	String type;

	@JsonProperty("amount")
	int amount;

	@JsonProperty("current_user_commented")
	boolean currentUserCommented;

	@JsonProperty("latest_comments")
	List<Comment> latestComments;
}


text:
import { devilryParseDomString } from './webcomponent_utils.js';
import { getCookie } from './cookie.js';
import './latex_math.js';

const TOOLBAR_KEYBOARD_MAP = {
    'ctrl': false,      // CTRL (Windows)
    'Meta': false,      // CMD (macOS)
    'Enter': false,     // Enter
    'Shift': false,     // Shift
    'b': false,         // CTRL or CMD + b: bold
    'i': false,         // CTRL or CMD + i: italic
    'k': false,         // CTRL or CMD + k: link
    '7': false,         // CTRL or CMD + Shift + 7: Ordered list
    '8': false,         // CTRL or CMD + Shift + 8: Unordered list
};
const TOOLBAR_HEADING = 'heading';
const TOOLBAR_BOLD = 'bold';
const TOOLBAR_ITALIC = 'italic';
const TOOLBAR_LINK = 'link';
const TOOLBAR_CODE_INLINE = 'codeInline';
const TOOLBAR_CODE_BLOCK = 'codeBlock';
const TOOLBAR_UNORDERED_LIST = 'unorderedList';
const TOOLBAR_ORDERED_LIST = 'orderedList';
const ORDERED_LIST_REGEX = '^(\\s*)([0-9]*\\.\\s)';
const UNORDERED_LIST_REGEX = '^(\\s*)(\\*\\s)';

class DevilryCommentEditor extends HTMLElement {
    constructor () {
        super();

        this.attrLabelText = this.getAttribute('labelText');
        this.attrTextareaName = this.getAttribute('name');
        this.attrTextareaValue = this.getAttribute('value');
        this.attrTextareaPlaceholder = this.getAttribute('placeholder');
        this.attrHelpText = this.getAttribute('helpText');
        this.attrMarkdownGuideLinkUrl = this.getAttribute('markdownGuideLinkUrl');
        this.attrMarkdownGuideLinkText = this.getAttribute('markdownGuideLinkText');
        this.attrMarkdownPreviewConfig = JSON.parse(this.getAttribute('markdownPreviewConfig'));
        this.attrToolbarConfig = JSON.parse(this.getAttribute('toolbarConfig'));

        this.activeTab = 'write';
    }

    connectedCallback () {
        this.renderEditor();
        this.addToolbarOptionEventListeners();
        this.addToolbarKeyboardShortcutEvents();
        this.addTabEventListener();
    }

    get _elementId () {
        return `id_${this.attrTextareaName}`;
    }

    get _textArea () {
        return document.getElementById(`${this._elementId}`);
    }

    get _tooltipMetaKeyForPlatform () {
        return this._isMac ? 'Cmd' : 'Ctrl'
    }

    get _isMac () {
        return window.navigator.platform.toUpperCase().startsWith('MAC');
    }

    get _cursorLine () {
        const cursorStartIndex = this._textArea.value.substring(0, this._textArea.selectionStart).split('\n').length - 1;
        return this._textArea.value.split('\n')[cursorStartIndex];
    }

    get _newPreviewSection () {
        if (!this.attrMarkdownPreviewConfig.enabled) {
            return '';
        }
        return `

        `;
    }

    get _buttonTab () {
        if (!this.attrMarkdownPreviewConfig.enabled) {
            return '';
        }
        return `

            <button
                id="${this._elementId}_tab_button_write"
                class="tablinks active"
                type="button" disabled="true">
                    ${this.attrMarkdownPreviewConfig.editorActiveButtonText}
                </button>
            <button
                id="${this._elementId}_tab_button_preview"
                class="tablinks"
                type="button">
                ${this.attrMarkdownPreviewConfig.previewActiveButtonText}
                </button>

        `
    }

    renderEditor () {
        const commentEditor = devilryParseDomString(`

                ${this._buttonTab}

                            <button
                                id="${this._elementId}_toolbar_option_heading"
                                type="button"
                                title="${this.attrToolbarConfig.heading.tooltip}"
                                class="btn btn-default devilry-comment-editor-toolbar__option"
                            >

                            </button>
                            <button
                                id="${this._elementId}_toolbar_option_bold"
                                type="button"
                                title="${this.attrToolbarConfig.bold.tooltip}, ${this._tooltipMetaKeyForPlatform}+b"
                                class="btn btn-default devilry-comment-editor-toolbar__option"
                            >

                            </button>
                            <button
                                id="${this._elementId}_toolbar_option_italic"
                                type="button"
                                title="${this.attrToolbarConfig.italic.tooltip}, ${this._tooltipMetaKeyForPlatform}+i"
                                class="btn btn-default devilry-comment-editor-toolbar__option"
                            >

                            </button>
                            <button
                                id="${this._elementId}_toolbar_option_link"
                                type="button"
                                title="${this.attrToolbarConfig.link.tooltip}, ${this._tooltipMetaKeyForPlatform}+k"
                                class="btn btn-default devilry-comment-editor-toolbar__option"
                            >

                            </button>
                            <button
                                id="${this._elementId}_toolbar_option_unordered_list"
                                type="button"
                                title="${this.attrToolbarConfig.unorderedList.tooltip}, ${this._tooltipMetaKeyForPlatform}+Shift+8"
                                class="btn btn-default devilry-comment-editor-toolbar__option"
                            >

                            </button>
                            <button
                                id="${this._elementId}_toolbar_option_code_block"
                                type="button"
                                title="${this.attrToolbarConfig.codeBlock.tooltip}"
                                class="btn btn-default devilry-comment-editor-toolbar__option"
                            >

                            </button>

                        ${this.attrLabelText}

                            <textarea
                                id="${this._elementId}"
                                cols="40"
                                rows="10"
                                class="devilry-comment-editor-textarea devilry-comment-editor-textarea--real"
                                placeholder="${this.attrTextareaPlaceholder}"
                                name="${this.attrTextareaName}"
                                aria-describedby="${this._elementId}_help">${this.attrTextareaValue}</textarea>

                                ${this.attrHelpText}

                                    ${this.attrMarkdownGuideLinkText}

                    ${this._newPreviewSection}

        `);
        this.appendChild(commentEditor)
    }

    _fetchAndInjectRenderedMarkdown () {
        if (!this.attrMarkdownPreviewConfig.enabled) {
            return;
        }
        const previewArea = document.getElementById(`${this._elementId}_comment_editor_preview_section`);
        previewArea.innerHTML = `

                ${this.attrMarkdownPreviewConfig.previewApiFetchingMessage}

        `
        const textArea = this._textArea;
        fetch(this.attrMarkdownPreviewConfig.apiUrl, {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json',
                'X-CSRFToken': getCookie('csrftoken')
            },
            body: JSON.stringify({'markdown_text': textArea.value})
        })
        .then(response => response.json())
        .then((responseData) => {
            previewArea.innerHTML = responseData['markdown_result'];
        })
        .catch((error) => {
            previewArea.innerHTML = this.attrMarkdownPreviewConfig.previewApiErrorMessage
        });
    }

    /**
     * Add event-listeners for write/preview "tab" buttons.
     */
    addTabEventListener () {
        if (!this.attrMarkdownPreviewConfig.enabled) {
            return;
        }
        const writeTabButton = document.getElementById(`${this._elementId}_tab_button_write`);
        const previewTabButton = document.getElementById(`${this._elementId}_tab_button_preview`);
        const writeTabContent = document.getElementById(`${this._elementId}_tab_content_write`);
        const previewTabContent = document.getElementById(`${this._elementId}_tab_content_preview`);

        // Active write tab content, deactive preview tab content.
        writeTabButton.addEventListener('click', () => {
            previewTabContent.style.display = 'none';
            previewTabButton.className = previewTabButton.className.replace(' active', '');
            previewTabButton.disabled = false;

            writeTabContent.style.display = 'block';
            writeTabButton.className += ' active';
            writeTabButton.disabled = true;

            this.activeTab = 'write';
            this._textArea.focus();
        });

        // Active preview tab content, deactive write tab content.
        previewTabButton.addEventListener('click', () => {
            writeTabContent.style.display = 'none';
            writeTabButton.className = previewTabButton.className.replace(' active', '');
            writeTabButton.disabled = false;

            previewTabContent.style.display = 'block';
            previewTabButton.className += ' active';
            previewTabButton.disabled = true;

            this.activeTab = 'preview';
            this._fetchAndInjectRenderedMarkdown();
        });
    }

    /**
     * Add event-listeners to toolbar buttons.
     */
    addToolbarOptionEventListeners () {
        document.getElementById(`${this._elementId}_toolbar_option_heading`)
            .addEventListener('click', () => {
                this.markdownActionHeading();
            }, false);
        document.getElementById(`${this._elementId}_toolbar_option_bold`)
            .addEventListener('click', () => {
                this.markdownActionBold();
            }, false);
        document.getElementById(`${this._elementId}_toolbar_option_italic`)
            .addEventListener('click', () => {
                this.markdownActionItalic();
            }, false);
        document.getElementById(`${this._elementId}_toolbar_option_link`)
            .addEventListener('click', () => {
                this.markdownActionLink();
            }, false);
        document.getElementById(`${this._elementId}_toolbar_option_code_block`)
            .addEventListener('click', () => {
                this.markdownActionCodeBlock();
            }, false);
        document.getElementById(`${this._elementId}_toolbar_option_unordered_list`)
            .addEventListener('click', () => {
                this.markdownActionUnorderedList();
            }, false);
    }

    /**
     * Add keyboard-shortcuts for toolbar actions.
     */
    addToolbarKeyboardShortcutEvents () {
        // Add key down event listener.
        document.onkeydown = (keyDownEvent) => {
            if (document.activeElement.id === `${this._elementId}`) {
                TOOLBAR_KEYBOARD_MAP[keyDownEvent.key] = true;

                // Handle MacOS vs everything else.
                let controlKey = 'Control';
                if (this._isMac) {
                    controlKey = 'Meta';
                }

                if (TOOLBAR_KEYBOARD_MAP[controlKey] && TOOLBAR_KEYBOARD_MAP['b']) {
                    this.markdownActionBold(keyDownEvent);
                } else if (TOOLBAR_KEYBOARD_MAP[controlKey] && TOOLBAR_KEYBOARD_MAP['i']) {
                    this.markdownActionItalic(keyDownEvent);
                } else if (TOOLBAR_KEYBOARD_MAP[controlKey] && TOOLBAR_KEYBOARD_MAP['k']) {
                    this.markdownActionLink(keyDownEvent);
                } else if (TOOLBAR_KEYBOARD_MAP[controlKey] && TOOLBAR_KEYBOARD_MAP['e']) {
                    this.markdownActionCodeInline(keyDownEvent);
                } else if (TOOLBAR_KEYBOARD_MAP[controlKey] && TOOLBAR_KEYBOARD_MAP['Shift'] && TOOLBAR_KEYBOARD_MAP['7']) {
                    this.markdownActionOrderedList();
                } else if (TOOLBAR_KEYBOARD_MAP[controlKey] && TOOLBAR_KEYBOARD_MAP['Shift'] && TOOLBAR_KEYBOARD_MAP['8']) {
                    this.markdownActionUnorderedList();
                } else if (TOOLBAR_KEYBOARD_MAP['Enter']) {
                    const cursorStartLine = this._cursorLine;
                    if (cursorStartLine.match(UNORDERED_LIST_REGEX)) {
                        this.markdownActionUnorderedList(keyDownEvent, false);
                    } else if (cursorStartLine.match(ORDERED_LIST_REGEX)) {
                        this.markdownActionOrderedList(keyDownEvent, false);
                    }
                }
            }
        };

        // Add key up event listener.
        document.onkeyup = (keyUpEvent) => {
            if (document.activeElement.id === `${this._elementId}`) {
                this.dispatchEvent(new CustomEvent('devilryCommentEditorHasContent', {detail: this._textArea.value ? true : false}));

                const textAreaContentCopy = document.getElementById(`${this._elementId}_textarea_content_copy`);
                textAreaContentCopy.innerHTML = `${this._textArea.value}X`;
                Object.keys(TOOLBAR_KEYBOARD_MAP).forEach(key => {
                    TOOLBAR_KEYBOARD_MAP[key] = false;
                });
            }
        };
    }

    _handleEventBehaviour (event = null, preventDefault = true) {
        if (event === null) {
            return;
        }
        if (preventDefault) {
            event.preventDefault();
        }
        event.stopPropagation();
    }

    markdownActionHeading (event = null) {
        this._handleEventBehaviour(event, true);
        this.insertBasicMarkdownAtCursor(TOOLBAR_HEADING, '### ', '', this.attrToolbarConfig.heading.placeholderText);
    }

    markdownActionBold (event = null) {
        this._handleEventBehaviour(event, true);
        this.insertBasicMarkdownAtCursor(TOOLBAR_BOLD, '**', '**', this.attrToolbarConfig.bold.placeholderText);
    }

    markdownActionItalic (event = null) {
        this._handleEventBehaviour(event, true);
        this.insertBasicMarkdownAtCursor(TOOLBAR_ITALIC, '_', '_', this.attrToolbarConfig.italic.placeholderText);
    }

    markdownActionLink (event = null) {
        this._handleEventBehaviour(event, true);
        this.insertBasicMarkdownAtCursor(TOOLBAR_LINK, '[', '](url)', this.attrToolbarConfig.link.placeholderText);
    }

    markdownActionCodeInline (event = null) {
        this._handleEventBehaviour(event, true);
        this.insertBasicMarkdownAtCursor(TOOLBAR_CODE_INLINE, '`', '`', this.attrToolbarConfig.codeInline.placeholderText);
    }

    markdownActionCodeBlock (event = null) {
        this._handleEventBehaviour(event, true);
        this.insertBasicMarkdownAtCursor(TOOLBAR_CODE_BLOCK, '```', '\n\n```', this.attrToolbarConfig.codeBlock.placeholderText);
    }

    markdownActionUnorderedList (event = null, preventDefault = true) {
        this._handleEventBehaviour(event, preventDefault);
        this.insertMarkdownListAtCursor(TOOLBAR_UNORDERED_LIST, event);
    }

    markdownActionOrderedList (event = null, preventDefault = true) {
        this._handleEventBehaviour(event, preventDefault);
        this.insertMarkdownListAtCursor(TOOLBAR_ORDERED_LIST, event);
    }

    /**
     * Inserts markdown-tag at cursor-position.
     *
     * Inserts markdown-tag at cursor-position, by adding a opening and closing
     * markdown-tag around the selected text (if any). When the markdown-tag is inserted,
     * and the value for the text-area is updated, the cursor is placed at the end of the
     * tagged text (including the closing markdown-tag).
     *
     * @param {String} type         Type of markdown-tag.
     * @param {String} openingTag   The opening markdown-tag. E.g. for links where the full markdown tag is "[]()", the opening-tag whould be "(".
     * @param {String} closingTag   The closing markdown-tag. E.g. for links where the full markdown tag is "[]()", the closing-tag whould be "]()".
     * @param {String} placeholder  This is the placeholder text inserted between the opening and closing markdown tags if no text is selected.
     */
    insertBasicMarkdownAtCursor (type, openingTag, closingTag, placeholder) {
        if (![TOOLBAR_HEADING, TOOLBAR_BOLD, TOOLBAR_ITALIC, TOOLBAR_LINK, TOOLBAR_CODE_INLINE, TOOLBAR_CODE_BLOCK].includes(type)) {
            throw Error(`Type "${type}" not supported.`);
        }

        const textArea = this._textArea;
        const initialSelectionStart = textArea.selectionStart;
        const initialSelectionEnd = textArea.selectionEnd;

        let selectedText = textArea.value.substring(textArea.selectionStart, textArea.selectionEnd);

        if (!selectedText) {
            selectedText = placeholder || '';
        }
        const taggedText = openingTag + selectedText + closingTag
        textArea.value = textArea.value.substring(0, initialSelectionStart) + taggedText + textArea.value.substring(textArea.selectionEnd, textArea.value.length)

        // Places focus to the marked text as the selected range.
        textArea.focus()
        textArea.selectionStart = initialSelectionStart + openingTag.length;
        textArea.selectionEnd = initialSelectionEnd + openingTag.length;
    }

    /**
     * Insert ordered/unorderd list for selected text.
     *
     * @param {String} type                 Type of markdown-tag.
     * @param {Object} enterKeyPressEvent   Enter key pressed event. Defaults to null.
     *                                      If this is not null, then keypress is handled
     *                                      by continuing the list on the current line.
     */
    insertMarkdownListAtCursor (type, enterKeyPressEvent = null) {
        if (![TOOLBAR_UNORDERED_LIST, TOOLBAR_ORDERED_LIST].includes(type)) {
            throw Error(`Type list-type "${type}" not supported.`);
        }

        const textArea = this._textArea;
        const cursorStartIndex = textArea.value.substring(0, textArea.selectionStart).split('\n').length - 1;
        const cursorEndIndex = textArea.value.substring(0, textArea.selectionEnd).split('\n').length - 1;
        const cursorStartEndIndexDiff = cursorEndIndex - cursorStartIndex;

        let textAreaLineArray = textArea.value.split('\n');
        let newTextAreaValue = '';
        let newSelectionStart = null;
        let newSelectionEnd = null;

        if (enterKeyPressEvent) {
            // Continue list on "Enter"-keypress.
            //
            // Continue the list by parsing the current line to find out
            // if the current line is a numbered or a bulleted list. The
            // next line will then be continued with the appropriate tag,
            // where a numbered tag will be incremented based on the value
            // of the current line. The array is then updated with the new
            // numbered/bulleted line. If the cursor is in between text on
            // the current line, the remainder of the text (from cursor position
            // to the end of the line) will be cut, and added to the next line.
            //
            // The list will NOT be continued if the current line is an empty
            // numbered or bulleted line. In this case, the will be "reset", and
            // cursor is moved to the start of the line.
            //
            // The list will NOT be continued if a range of text is selected. In
            // this case the default "Enter"-keypress behaviour will be applied
            // instead.
            if (textArea.selectionStart !== textArea.selectionEnd) {
                return;
            }
            enterKeyPressEvent.preventDefault();

            const cursorLine = this._cursorLine;
            let listTag = '';

            // Set the tag to be used.
            // If the tag is empty, i.e has not been set, this means that
            // the current list has no content after the tag. This will
            // result in the line being reset.
            if (type === TOOLBAR_ORDERED_LIST) {
                const match = cursorLine.match(`${ORDERED_LIST_REGEX}(.+)`);
                if (match) {
                    listTag = match[1] + (parseInt(match[2]) + 1) + '. ';
                }
            } else {
                const match = cursorLine.match(`${UNORDERED_LIST_REGEX}(.+)`);
                if (match) {
                    listTag = match[1] + match[2];
                }
            }

            // This is the cursor position after the new line has been inserted with offset
            // relative to where the cursor is currently at, and will be used set the cursor
            // to the correct position when the new list-line has been added.
            let cursorPositionWithOffset = null;

            // Build the line array based on whether the new line to be inserted should continue
            // the list or "reset" it.
            if (listTag) {

                // Cuts remainder of current line and adds it to
                // the next line (if any).
                let totalLengthUntilCursorLine = 0;
                for (let i = 0; i < cursorStartIndex; i++) {
                    totalLengthUntilCursorLine += textAreaLineArray[i].length;
                }
                const indexWithinCursorLine = textArea.selectionStart - totalLengthUntilCursorLine - cursorStartIndex;

                // Build text area content with list item.
                textAreaLineArray = [
                    ...textAreaLineArray.slice(0, cursorStartIndex),
                    cursorLine.substring(0, indexWithinCursorLine),
                    `${listTag}${cursorLine.substring(indexWithinCursorLine)}`,
                    ...textAreaLineArray.slice(cursorStartIndex + 1)
                ];
                cursorPositionWithOffset = textArea.selectionStart + listTag.length + 1;
            } else {
                // Current list-line has no content, remove content and set
                // cursor to line start.
                textAreaLineArray = [
                    ...textAreaLineArray.slice(0, cursorStartIndex),
                    listTag,
                    ...textAreaLineArray.slice(cursorStartIndex + 1)
                ];
                cursorPositionWithOffset = textArea.selectionStart - cursorLine.length;
            }

            // Set new cursor position.
            newSelectionStart = cursorPositionWithOffset;
            newSelectionEnd = cursorPositionWithOffset;
        } else {
            // Convert selected lines to list.
            //
            // The line(s) of the selected range of text will be converted to
            // a list, where each line receives the appropriate list-tag (OL/UL).
            let markdownListTag = type === TOOLBAR_UNORDERED_LIST ? '* ' : '1. ';
            let orderedListCounter = 1;

            // Isolate the selected area, and add tags.
            const selectedAreaChunk = [];
            for (let i = cursorStartIndex; i <= cursorEndIndex; i++) {
                if (type === TOOLBAR_ORDERED_LIST) {
                    markdownListTag = `${orderedListCounter}. `;
                    orderedListCounter++;
                }
                selectedAreaChunk.push(
                    `${markdownListTag}${textAreaLineArray[i]}`
                );
            }

            // Update the array where the selected range has been tagged, and set cursor positions.
            textAreaLineArray = [
                ...textAreaLineArray.slice(0, cursorStartIndex),
                ...cursorStartIndex > 0 && textAreaLineArray[cursorStartIndex - 1].match('\.') ? [''] : [],
                ...selectedAreaChunk,
                ...cursorEndIndex < textAreaLineArray.length - 1 && textAreaLineArray[cursorEndIndex + 1].match('\.') ? [''] : [],
                ...textAreaLineArray.slice(cursorEndIndex + 1)
            ];
            if (cursorStartEndIndexDiff === 0) {
                newSelectionStart = textArea.selectionStart + markdownListTag.length;
                newSelectionEnd = textArea.selectionEnd + markdownListTag.length;
            } else {
                newSelectionStart = textArea.selectionStart + markdownListTag.length;
                newSelectionEnd = textArea.selectionEnd + (cursorStartEndIndexDiff * markdownListTag.length) + markdownListTag.length;
            }
        }

        // Rebuild the textarea value from the textAreaLineArray.
        // Append a newline character to each line except the last.
        const arrayLength = textAreaLineArray.length - 1;
        for (let i = 0; i < arrayLength; i++) {
            newTextAreaValue += textAreaLineArray[i] + '\n';
        }
        newTextAreaValue += textAreaLineArray[arrayLength];

        // Update textarea.
        textArea.value = newTextAreaValue;
        textArea.focus();
        if (newSelectionStart) {
            textArea.selectionStart = newSelectionStart;
        }
        if (newSelectionEnd) {
            textArea.selectionEnd = newSelectionEnd;
        }
    }
}

window.customElements.define('devilry-comment-editor', DevilryCommentEditor);


text:
from __future__ import unicode_literals

import imp
import os
import shutil
import subprocess
import sys
import tempfile
from os.path import abspath, basename, dirname, isdir, join

ROOT_DIR = abspath(join(dirname(__file__), '..'))

SOURCE_DIR_NAME = 'src'
MODULE_PREFIX = 'test_'

MAIN_PY = 'main.py'
MAIN_PYE = 'main.pye'
VALIDATOR_PY = 'validator.py'

class ImportedTestCaseError(Exception):
    def __init__(self, output_lines, return_code, validate_errors, *args, **kwargs):
        self.output_lines = output_lines
        self.return_code = return_code
        self.validate_errors = validate_errors

class ImportedTestCase(object):
    def __init__(self, pyconcrete_exe, module_path):
        self.pyconcrete_exe = pyconcrete_exe
        self.module_path = module_path
        self.tmp_dir = tempfile.mkdtemp(prefix='pyconcrete_testcase_')

    def close(self):
        shutil.rmtree(self.tmp_dir)

    @property
    def module_name(self):
        return basename(self.module_path)

    @property
    def module_src_path(self):
        return join(self.module_path, SOURCE_DIR_NAME)

    def is_available_test_case(self):
        if not isdir(self.module_path):
            return False
        if not self.module_name.startswith(MODULE_PREFIX):
            return False

        module_files = os.listdir(self.module_path)
        if VALIDATOR_PY not in module_files:
            return False
        if SOURCE_DIR_NAME not in module_files:
            return False

        module_code_files = os.listdir(self.module_src_path)
        if MAIN_PY not in module_code_files:
            return False

        return True

    def run(self):
        main_pye_path = self.build_pye()
        ret_data = self.execute(main_pye_path)
        return self.validate(ret_data, main_pye_path)

    def build_pye(self):
        dest_dir = join(self.tmp_dir, self.module_name)
        shutil.copytree(self.module_src_path, dest_dir)

        lib_compile_pye(dest_dir, remove_py=True, remove_pyc=True)
        return join(dest_dir, 'main.pye')

    def execute(self, main_pye_path):
        p = subprocess.Popen(
            [self.pyconcrete_exe, main_pye_path],
            stdin=subprocess.DEVNULL,
            stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT,
        )
        output, error = p.communicate()
        output = output.decode('utf8')
        output = output.replace('\r\n', '\n')
        return {
            'output_lines': output.strip().split('\n'),
            'return_code': p.returncode,
        }

    def validate(self, ret_data, main_pye_path):
        validator_py = join(self.module_path, VALIDATOR_PY)
        validator = imp.load_source('', validator_py)
        try:
            return validator.validate(
                ret_data['output_lines'],
                main_pye_path=main_pye_path,
                return_code=ret_data['return_code'],
            )
        except Exception as e:
            raise ImportedTestCaseError(ret_data['output_lines'], ret_data['return_code'], str(e))

def lib_compile_pyc(folder, remove_py=False):
    from test.base import get_pyconcrete_env_path

    admin_path = join(ROOT_DIR, 'pyconcrete-admin.py')
    arg_remove_py = '--remove-py' if remove_py else ''
    subprocess.check_call(
        '%s %s compile --source=%s --pyc %s' % (sys.executable, admin_path, folder, arg_remove_py),
        env=get_pyconcrete_env_path(),
        shell=True,
    )

def lib_compile_pye(folder, remove_py=False, remove_pyc=False):
    from test.base import get_pyconcrete_env_path

    admin_path = join(ROOT_DIR, 'pyconcrete-admin.py')
    arg_remove_py = '--remove-py' if remove_py else ''
    arg_remove_pyc = '--remove-pyc' if remove_pyc else ''
    subprocess.check_call(
        '%s %s compile --source=%s --pye %s %s' % (sys.executable, admin_path, folder, arg_remove_py, arg_remove_pyc),
        env=get_pyconcrete_env_path(),
        shell=True,
    )


text:
<!doctype html>

  <link href="images/favicon.gif" rel="shortcut icon" type="image/gif"/>
  <meta charset="utf-8">
  <meta name="HONK HONK HONK" content="HONK">
  <meta name="mashallpotatoes" content="HONKS">
  <link rel="stylesheet" href="css/stylesheet.css">

  <title>HONK</title>

    <audio src="music/sanic.mp3" autoplay="true" loop></audio>


text:
#ifndef ASYLO_IDENTITY_ATTESTATION_SGX_SGX_INTEL_ECDSA_QE_REMOTE_ASSERTION_GENERATOR_H_
#define ASYLO_IDENTITY_ATTESTATION_SGX_SGX_INTEL_ECDSA_QE_REMOTE_ASSERTION_GENERATOR_H_

#include <memory>
#include <string>

#include "asylo/crypto/certificate_util.h"
#include "asylo/identity/additional_authenticated_data_generator.h"
#include "asylo/identity/attestation/enclave_assertion_generator.h"
#include "asylo/identity/attestation/sgx/internal/dcap_library_interface.h"
#include "asylo/identity/attestation/sgx/internal/intel_architectural_enclave_interface.h"
#include "asylo/identity/attestation/sgx/sgx_intel_ecdsa_qe_remote_assertion_authority_config.pb.h"
#include "asylo/identity/identity.pb.h"
#include "asylo/identity/platform/sgx/internal/hardware_interface.h"
#include "asylo/util/mutex_guarded.h"
#include "asylo/util/status.h"
#include "asylo/util/statusor.h"

namespace asylo {

/// Implementation of `EnclaveAssertionGenerator` that generates assertions
/// using the Intel ECDSA quoting enclave. These assertions attest, to a remote
/// party, properties about both an enclave's code as well as the Intel platform
/// properties.
class SgxIntelEcdsaQeRemoteAssertionGenerator
    : public EnclaveAssertionGenerator {
 public:
  // Constructs a new `SgxIntelEcdsaQeAssertionGenerator` that internally uses
  // the `EnclaveDcapLibraryInterface`, which uses ocalls to invoke all
  // Intel DCAP APIs. Default-constructed objects generate assertions suitable
  // for use with EKEP. `HardwareInterface` is used to invoke SGX-specific
  // hardware routines.
  //
  // The generator MUST be initialized via a call to Initialize().
  SgxIntelEcdsaQeRemoteAssertionGenerator();

  // Constructs a new `SgxIntelEcdsaQeAssertionGenerator` that uses
  // |intel_enclaves| for invoking the Intel quoting software stack, and
  // generates authenticated data to include in the quote using |aad_generator|.
  // |hardware_interface| is used to invoke SGX-specific hardware routines.
  //
  // The generator MUST be initialized via a call to Initialize().
  SgxIntelEcdsaQeRemoteAssertionGenerator(
      std::unique_ptr<AdditionalAuthenticatedDataGenerator> aad_generator,
      std::unique_ptr<asylo::sgx::IntelArchitecturalEnclaveInterface>
          intel_enclaves,
      std::unique_ptr<sgx::HardwareInterface> hardware_interface);

  ~SgxIntelEcdsaQeRemoteAssertionGenerator() override = default;

  Status Initialize(const std::string &config) override;

  bool IsInitialized() const override;

  EnclaveIdentityType IdentityType() const override;

  std::string AuthorityType() const override;

  Status CreateAssertionOffer(AssertionOffer *offer) const override;

  StatusOr<bool> CanGenerate(const AssertionRequest &request) const override;

  Status Generate(const std::string &user_data, const AssertionRequest &request,
                  Assertion *assertion) const override;

 private:
  struct Members {
    bool is_initialized = false;
  };

  Status ReadCertificationData(
      const SgxIntelEcdsaQeRemoteAssertionAuthorityConfig &config) const;

  MutexGuarded<Members> members_;
  std::unique_ptr<AdditionalAuthenticatedDataGenerator> aad_generator_;
  std::unique_ptr<asylo::sgx::IntelArchitecturalEnclaveInterface>
      intel_enclaves_;
  std::unique_ptr<sgx::HardwareInterface> hardware_interface_;
};

}  // namespace asylo

#endif  // ASYLO_IDENTITY_ATTESTATION_SGX_SGX_INTEL_ECDSA_QE_REMOTE_ASSERTION_GENERATOR_H_


text:
// ==========================================================================
// Project:   Lebowski Framework - The SproutCore Test Automation Framework
// License:   Licensed under MIT license (see License.txt)
// ==========================================================================
/*globals TestApp Core */

TestApp.selectFieldControlsController = SC.Object.create({

  largeItemsList: null,

  init: function() {
    sc_super();
    this.set('largeItemsList', this._generateLargeItemList());
  },

  reset: function() {
    var page = TestApp.selectFieldViewsPage;

    page.setPath('basicSelectField1.value', 'square');
    page.setPath('basicSelectField2.value', 2000);
    page.setPath('emptyOptionSelectField.value', null);
    page.setPath('sortedSelectField.value', 'apple');
    page.setPath('disabledSelectField.value', 'square');

    var items = this.get('largeItemsList');
    page.setPath('largeSelectField.value', items[0]);
  },

  _generateLargeItemList: function() {
    var items = [];

    for (var i = 0; i < 100; i += 1) {
      items.push("item " + i);
    }

    return items;
  }

});


text:
module PS
  module Util
    ##
    # objects contained within PS::Response.ps_object have a '__type' attribute
    # that signals the subclass of PS::Object they represent. This constant
    # provides access to what class needs to be instantiated relative to what
    # paysimple return.
    PS_OBJECTS = {
      "PsCustomer" => PS::Customer,
      "PsCustomerAccount" => PS::CustomerAccount,
      "PsCreditCardAccount" => PS::CreditCardAccount,
      "PsAchAccount" => PS::AchAccount,
      "PsPayment" => PS::Payment,
      "PsDefaultCustomerAccount" => PS::CustomerAccount,
      "PsRecurringPayment" => PS::RecurringPayment
    }

    def self.instantiate_ps_objects(ps_objects)
      case ps_objects
      when Array
        ps_objects.map { |obj| instantiate_ps_objects(obj) }
      when Hash
        klass_name = ps_objects.delete("__type").scan(/[a-zA-Z]+:/)[0].delete(":")
        PS_OBJECTS[klass_name].new(ps_objects.symbolize_keys)
      end
    end
  end
end


text:
require 'jekyll/date_logic'
require 'minitest/autorun'
require 'mocha/mini_test'

describe Jekyll::DateLogic::Before do
  let(:now) { Time.now }
  let(:five_hours) { 5 * 60 * 60}
  let(:five_hours_ago) { now - five_hours}
  let(:five_hours_from_now) { now + five_hours }
  before(:each) { Jekyll::DateLogic::Clock.stubs(:now).returns(now) }

  let(:before) { Jekyll::DateLogic::Before }

  describe 'shows content' do
    it 'if time is not found' do
      assert before.qualifies?(nil)
    end

    it 'if time is in the future' do
      assert before.qualifies?(five_hours_from_now)
    end

    it 'if time - for_hours is in the past' do
      assert before.qualifies?(five_hours_from_now, 6)
    end
  end

  describe 'does not show content' do
    it 'if time is now' do
      refute before.qualifies?(now)
    end

    it 'if time is in the past' do
      refute before.qualifies?(five_hours_ago)
    end

    it 'if time - for_hours is in the future' do
      refute before.qualifies?(five_hours_from_now, 4)
    end
  end
end


text:
/*

    Name:       Base16 Atelier Seaside Light
    Author:     Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside/)

    CodeMirror template adapted for IPython Notebook by Nikhil Sonnad (https://github.com/nsonnad/base16-ipython-notebook)
    CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools)
    Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)

*/

/* Uncomment to use a custom font
div#notebook, div.CodeMirror, div.output_area pre, div.output_wrapper, div.prompt {
  font-family: 'Custom Font Name', monospace !important;
}
*/

/* GLOBALS */
body {background-color: #f4fbf4;}
a {color: #3d62f5;}

/* INTRO PAGE */
.toolbar_info, .list-container {color: #242924;}

/* NOTEBOOK */

/* comment out this line to bring the toolbar back */
div#maintoolbar, div#header {display: none !important;}

div#notebook {border-top: none;}

div.input_prompt {color: #ad2bee;}
div.output_prompt {color: #e619c3;}
div.input_area {
  border-radius: 0px;
  border: 1px solid #8ca68c;
}
div.output_area pre {font-weight: normal; color: #5e6e5e;}

.rendered_html table, .rendered_html th, .rendered_html tr, .rendered_html td {
  border: 1px  #687d68 solid;
  color: #687d68;
}
div.output_html { font-family: sans-serif; }
table.dataframe tr {border: 1px #5e6e5e;}

div.cell.selected {border-radius: 0px;}
div.cell.edit_mode {border-radius: 0px; border: thin solid #e619c3;}
div.text_cell_render, div.output_html {color: #5e6e5e;}

span.ansiblack {color: #242924;}
span.ansiblue {color: #1999b3;}
span.ansigray {color: #809980;}
span.ansigreen {color: #29a329;}
span.ansipurple {color: #ad2bee;}
span.ansired {color: #e6193c;}
span.ansiyellow {color: #98981b;}

div.output_stderr {background-color: #e6193c;}
div.output_stderr pre {color: #cfe8cf;}

.cm-s-ipython.CodeMirror {background: #f4fbf4; color: #242924;}
.cm-s-ipython div.CodeMirror-selected {background: #cfe8cf !important;}
.cm-s-ipython .CodeMirror-gutters {background: #f4fbf4; border-right: 0px;}
.cm-s-ipython .CodeMirror-linenumber {color: #809980;}
.cm-s-ipython .CodeMirror-cursor {border-left: 1px solid #687d68 !important;}

.cm-s-ipython span.cm-comment {color: #e619c3;}
.cm-s-ipython span.cm-atom {color: #ad2bee;}
.cm-s-ipython span.cm-number {color: #ad2bee;}

.cm-s-ipython span.cm-property, .cm-s-ipython span.cm-attribute {color: #29a329;}
.cm-s-ipython span.cm-keyword {color: #e6193c;}
.cm-s-ipython span.cm-string {color: #98981b;}
.cm-s-ipython span.cm-operator {color: #e619c3;}
.cm-s-ipython span.cm-builtin {color: #ad2bee;}

.cm-s-ipython span.cm-variable {color: #29a329;}
.cm-s-ipython span.cm-variable-2 {color: #3d62f5;}
.cm-s-ipython span.cm-def {color: #87711d;}
.cm-s-ipython span.cm-error {background: #e6193c; color: #687d68;}
.cm-s-ipython span.cm-bracket {color: #5e6e5e;}
.cm-s-ipython span.cm-tag {color: #e6193c;}
.cm-s-ipython span.cm-link {color: #ad2bee;}

.cm-s-ipython .CodeMirror-matchingbracket { text-decoration: underline; color: #242924 !important;}


text:
package insertionsort;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Insertionsort {
    public static void main(String[] args) throws FileNotFoundException {
       File input = new File(args[0]);
        Scanner scanner = new Scanner(input);
        ArrayList<Integer> list = new ArrayList<>();

        while (scanner.hasNextInt())
        {
            list.add(scanner.nextInt());
        }
        insertionSort(list);

        list.stream().forEach((s) -> {
            System.out.print(s + " ");
        });
        System.out.println();
    }

    private static void insertionSort(ArrayList<Integer> list)
    {
        for (int i = 1; i < list.size(); i++)
        {
            int j = i;
            while (j > 0 && list.get(j) < list.get(j-1))
            {
                Collections.swap(list, j, j - 1);
                j--;
            }
        }
    }
}


text:
FROM grpc/base

RUN curl -sL https://deb.nodesource.com/setup | bash -

RUN apt-get update && apt-get install -y nodejs nodejs-legacy

RUN npm install -g node-gyp

# Get the source from GitHub, this gets the protobuf library as well
RUN git clone git@github.com:grpc/grpc.git /var/local/git/grpc
RUN cd /var/local/git/grpc && \
  git pull --recurse-submodules && \
  git submodule update --init --recursive

# TODO: pre-building seems unnecessary, because we need to run make clean
# anyway to prevent build from crashing if header files are added/removed.
# Build the C core
RUN make static_c shared_c -j12 -C /var/local/git/grpc

# Define the default command.
CMD ["bash"]


text:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.EventSystems;

namespace GDGeek{
	public class LoadingWindow : Singleton<LoadingWindow> {
		public CanvasGroup _cg = null;

		public float _wait = 0.3f;
		public void Awake(){

		}
		private Task packTask(Task task){
			Task pack = new Task();
			float allTime = 0.0f;
			bool isOver = false;
			bool isLoading = false;
			bool isLoaded = false;
			pack.init = delegate{
				allTime = 0;
				isOver = false;
				isLoading = false;
				isLoaded = false;
				TaskManager.PushBack (task, delegate{
					isOver = true;

				});
				TaskManager.Run (task);
			};
			pack.update = delegate(float d) {
				allTime += d;
				if(allTime>_wait && !isLoading){

					isLoading = true;
					Task show = this.show ();
					TaskManager.PushBack (show, delegate{
						//Debug.LogError("???");
						isLoaded = true;
					});
					TaskManager.Run (show);
				}
			};

			pack.isOver = delegate {
				if (isOver) {
					if(!isLoading){//Debug.LogError("error");
						return true;
					}
					if(isLoaded){//Debug.LogError("erro2r");
						return true;
					}

				}
				return false;

			};
			return pack;
		}
		public Task run(Task task){

			TaskList tl = new TaskList ();

			tl.push (packTask(task));
			tl.push (hide ());

			TaskManager.PushFront (tl, delegate {
				_cg.alpha = 0f;
				this.gameObject.SetActive(true);
			});
			return tl;
		}
		private Task show(){
			TweenTask task = new TweenTask (
				delegate{
					this.gameObject.SetActive(true);
					TweenGroupAlpha alpha = TweenGroupAlpha.Begin(this.gameObject,0.3f, 1.0f);
					alpha.cachedGroup = _cg;
					return alpha;
				}
			);
			TaskManager.PushBack (task, delegate {
				_cg.alpha = 1.0f;
			});
			return task;
		}
		private Task hide(){
			TweenTask task = new TweenTask
				(
				delegate{
				TweenGroupAlpha alpha = TweenGroupAlpha.Begin(this.gameObject,0.15f, 0.0f);
				return alpha;
			}
			);

			TaskManager.PushBack (task, delegate {
				if(_cg != null) _cg.alpha = 0.0f;
				if(this != null && this.gameObject != null) this.gameObject.SetActive(false);
			});
			return task;
		}
	}

}


text:
package com.github.jnthnclt.os.lab.io.filer;

import java.io.IOException;

/**
 *
 * @author jonathan.colt
 */
public interface IAppendBytesOnly extends ICloseable, IFilePointer {

    void write(byte b) throws IOException;

    /**
     *
     * @param b
     * @param _offset
     * @param _len
     * @throws java.io.IOException
     */
     void write(byte b[], int _offset, int _len) throws IOException;

    /**
     *
     * @throws java.io.IOException
     */
     void flush(boolean fsync) throws IOException;
}


text:
from reparse.config import pattern_max_recursion_depth
from reparse.expression import Group, AlternatesGroup, Expression
from reparse.util import separate_string

class ExpressionGroupNotFound(Exception):
    pass

class Function_Builder(object):
    """
    Function Builder is an on-the-fly builder of functions for expressions

    >>> def t(_):
    ...     return _
    >>> fb = Function_Builder({"hey":t})
    >>> fb.get_function("hey", "") is t
    True
    """

    def __init__(self, functions_dict):
        self._functions = functions_dict

    def get_function(self, name, function_type, group_names=None):
        if name in self._functions:
            if function_type is "type":
                def func(_):
                    if not any(_):
                        return None
                    return self._functions[name](_)
            elif function_type is "group":
                def func(_):
                    return self._functions[name](_[0])
            elif function_type is "expression" and group_names is not None:
                def func(_):
                    groups = dict(zip(group_names, _))
                    return self._functions[name](**groups)
            elif function_type is "pattern":
                def func(_):
                    return self._functions[name](*_)
            else:
                func = self._functions[name]

        # DEFAULT FUNCTIONS
        elif function_type is "group":
            def func(_):
                if _:
                    return _[0]
        elif function_type is "type":
            def func(_):
                for i in _:
                    if i is not None:
                        return i
        else:
            def func(_):
                if any(_):
                    return _
        func.__name__ = name
        return func

    def add_function(self, name, function):
        self._functions[name] = function

class Expression_Builder(object):
    """ Expression builder is useful for building
    regex bits with Groups that cascade down::

                 from  GROUP      (group).?,?(group)|(group) (group)
                   to  EXPRESSION        (group)    |   (group)
                   to  TYPE                      (group)

    >>> dummy = lambda input: input
    >>> get_function = lambda *_, **__: dummy
    >>> function_builder = lambda: None
    >>> function_builder.get_function = get_function
    >>> expression = {'greeting':{'greeting':{'Expression': '(hey)|(cool)', 'Groups' : ['greeting', 'cooly']}}}
    >>> eb = Expression_Builder(expression, function_builder)
    >>> eb.get_type("greeting").findall("hey, cool!")
    [[('hey',), ('',)], [('',), ('cool',)]]
    """

    def __init__(self, expressions_dict, function_builder):
        self.type_db = {}

        for expression_type, expressions in expressions_dict.items():
            type_expressions = []
            for name, expression in expressions.items():
                groups = expression['Groups']
                regex = expression['Expression']
                lengths = [1] * len(groups)
                group_functions = [function_builder.get_function(g, "group") for g in groups]
                expression_final_function = \
                    function_builder.get_function(name, function_type="expression", group_names=groups)
                e = Expression(regex, group_functions, lengths, expression_final_function)
                type_expressions.append(e)
            type_final_function = function_builder.get_function(expression_type, function_type="type")
            self.type_db[expression_type] = AlternatesGroup(type_expressions, type_final_function)

    def get_type(self, type_string):
        if type_string in self.type_db:
            return self.type_db[type_string]

    def add_type(self, expression, type_string):
        self.type_db[type_string] = expression

def build_pattern(pattern_name, pattern_regex, expression_builder, function_builder):
    final_function = function_builder.get_function(pattern_name, "pattern")
    inbetweens, expression_names = separate_string(pattern_regex)
    expressions = []
    for name in expression_names:
        expression = expression_builder.get_type(name)
        if expression is None:
            raise ExpressionGroupNotFound("Expression Group ({}) not Found!".format(name))
        expressions.append(expression)
    return Group(expressions, final_function, inbetweens, pattern_name)

def _build(output_patterns, patterns_dict, expression_builder, function_builder, depth=0):
    extra = {}
    for name, pattern in patterns_dict.items():
        try:
            pat = build_pattern(name, pattern['Pattern'], expression_builder, function_builder)
            pat.order = int(pattern.get('Order', 0))
            output_patterns.append(pat)
            expression_builder.add_type(pat, name)
        except ExpressionGroupNotFound:
            extra[name] = pattern
    if len(extra) > 0 and depth < pattern_max_recursion_depth:
        # Recursive building for patterns inside of patterns
        return _build(output_patterns, extra, expression_builder, function_builder, depth + 1)
    elif depth >= pattern_max_recursion_depth:
        raise ExpressionGroupNotFound()
    return output_patterns

def build_all(patterns, expressions, functions):
    function_builder = Function_Builder(functions)
    return _build([], patterns, Expression_Builder(expressions, function_builder), function_builder)


text:
@interface ServiceViewController ()<UITableViewDelegate,UITableViewDataSource>

@property(nonatomic,strong)UITableView *tableView;
@end

@implementation ServiceViewController
static NSString *identifierBig = @"identifier";
static NSString *identifierList = @"identifier1";

- (void)viewDidLoad {
    [super viewDidLoad];
 self.title = @"每日聚焦";

    self.view.backgroundColor = [UIColor brownColor];
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.475 green:0.718 blue:1.000 alpha:1.000];
    UIButton *btu =[UIButton buttonWithType:UIButtonTypeCustom];
    btu.frame = CGRectMake(20 ,6 ,50 , 30);
    [btu setBackgroundImage:[UIImage imageNamed:@"title_more"] forState:UIControlStateNormal];
    [btu addTarget:self action:@selector(leftDrawerButtonPress:) forControlEvents:UIControlEventTouchUpInside];
    //    btu.backgroundColor=[UIColor redColor];
    MMDrawerBarButtonItem *back = [[MMDrawerBarButtonItem alloc]initWithCustomView:btu];
    //    self.navigationItem.leftBarButtonItem=back;

    [self.navigationItem setLeftBarButtonItem:back animated:YES];
    [self initTableView];
    [self.tableView registerClass:[bigViewCell class] forCellReuseIdentifier:identifierBig];
    [self.tableView registerClass:[ListViewCell class] forCellReuseIdentifier:identifierList];

}

//抽屉按钮动作
-(void)leftDrawerButtonPress:(id)sender
{
    //开关左抽屉
    [self.mm_drawerController toggleDrawerSide:MMDrawerSideLeft animated:YES completion:nil];
}

// 添加tablView
-(void)initTableView{

    UITableView* tableView =[[UITableView alloc]initWithFrame: CGRectMake(0, 0, kScreenWidth, kScreenHeight-49) style:UITableViewStylePlain];
    tableView.backgroundColor = [UIColor orangeColor];
    tableView.bounces = NO;
    // 设置tableView的代理
    tableView.delegate = self;
    tableView.dataSource = self;
    [self.view addSubview:tableView];
    _tableView = tableView;

}

// 实现tableView的代理方法
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 20;

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = nil;

    if (indexPath.row == 0) {
        cell =[tableView dequeueReusableCellWithIdentifier:identifierBig];

    }else{
        cell =[tableView dequeueReusableCellWithIdentifier:identifierList];

    }
    //cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;

}
// 设置cell的高度
- (CGFloat)tableView:(UITableView *)atableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{

    if (indexPath.row == 0) {
        return 150;
    }else{
        return 100;
    }

}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    JuJiaoViewController *juJiaoVC =[JuJiaoViewController new];
        [self.navigationController pushViewController:juJiaoVC animated:YES];
        self.tabBarController.tabBar.hidden = YES;

}

@end


text:
{% assign header = site.data.header %}
{% include components/header.html %}