text:
package ec2

import (
	"context"
	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
	"github.com/aws/aws-sdk-go-v2/service/ec2/types"
	"github.com/aws/smithy-go/middleware"
	smithyhttp "github.com/aws/smithy-go/transport/http"
)

// Enables the specified attachment to propagate routes to the specified
// propagation route table.
func (c *Client) EnableTransitGatewayRouteTablePropagation(ctx context.Context, params *EnableTransitGatewayRouteTablePropagationInput, optFns ...func(*Options)) (*EnableTransitGatewayRouteTablePropagationOutput, error) {
	if params == nil {
		params = &EnableTransitGatewayRouteTablePropagationInput{}
	}

	result, metadata, err := c.invokeOperation(ctx, "EnableTransitGatewayRouteTablePropagation", params, optFns, addOperationEnableTransitGatewayRouteTablePropagationMiddlewares)
	if err != nil {
		return nil, err
	}

	out := result.(*EnableTransitGatewayRouteTablePropagationOutput)
	out.ResultMetadata = metadata
	return out, nil
}

type EnableTransitGatewayRouteTablePropagationInput struct {

	// The ID of the attachment.
	//
	// This member is required.
	TransitGatewayAttachmentId *string

	// The ID of the propagation route table.
	//
	// This member is required.
	TransitGatewayRouteTableId *string

	// Checks whether you have the required permissions for the action, without
	// actually making the request, and provides an error response. If you have the
	// required permissions, the error response is DryRunOperation. Otherwise, it is
	// UnauthorizedOperation.
	DryRun bool
}

type EnableTransitGatewayRouteTablePropagationOutput struct {

	// Information about route propagation.
	Propagation *types.TransitGatewayPropagation

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

func addOperationEnableTransitGatewayRouteTablePropagationMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsEc2query_serializeOpEnableTransitGatewayRouteTablePropagation{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation{}, middleware.After)
	if err != nil {
		return err
	}
	if err = addSetLoggerMiddleware(stack, options); err != nil {
		return err
	}
	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
		return err
	}
	if err = addResolveEndpointMiddleware(stack, options); err != nil {
		return err
	}
	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
		return err
	}
	if err = addRetryMiddlewares(stack, options); err != nil {
		return err
	}
	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
		return err
	}
	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
		return err
	}
	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
		return err
	}
	if err = addClientUserAgent(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = addOpEnableTransitGatewayRouteTablePropagationValidationMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableTransitGatewayRouteTablePropagation(options.Region), middleware.Before); err != nil {
		return err
	}
	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
		return err
	}
	if err = addResponseErrorMiddleware(stack); err != nil {
		return err
	}
	if err = addRequestResponseLogging(stack, options); err != nil {
		return err
	}
	return nil
}

func newServiceMetadataMiddleware_opEnableTransitGatewayRouteTablePropagation(region string) *awsmiddleware.RegisterServiceMetadata {
	return &awsmiddleware.RegisterServiceMetadata{
		Region:        region,
		ServiceID:     ServiceID,
		SigningName:   "ec2",
		OperationName: "EnableTransitGatewayRouteTablePropagation",
	}
}


text:
IF EXISTS(SELECT * FROM [dbo].[sysobjects] WHERE ID=object_id(N'[Data].[MetaData_Update]') AND OBJECTPROPERTY(id, N'IsProcedure')=1) DROP PROC [Data].[MetaData_Update]
GO--
CREATE PROCEDURE [Data].[MetaData_Update]
			@MetaDataId int,
			@ContentInspectionId int,
			@MetaDataName varchar(150),
			@IsRequired bit,
			@AppliesAtAllLevels bit,
			@AppliesToCandidates bit,
			@AppliesToOrganizations bit
AS --Generated--
BEGIN

	UPDATE	[Data].[MetaData] SET
			[ContentInspectionId] = @ContentInspectionId,
			[MetaDataName] = @MetaDataName,
			[IsRequired] = @IsRequired,
			[AppliesAtAllLevels] = @AppliesAtAllLevels,
			[AppliesToCandidates] = @AppliesToCandidates,
			[AppliesToOrganizations] = @AppliesToOrganizations
	WHERE	[MetaDataId] = @MetaDataId

END

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>EmberReddit</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    {{content-for 'head'}}
    <link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="assets/vendor.css">
    <link rel="stylesheet" href="assets/ember-reddit.css">

    {{content-for 'head-footer'}}
  </head>
  <body>
    {{content-for 'body'}}

    <script src="assets/vendor.js"></script>
    <script src="assets/ember-reddit.js"></script>

    {{content-for 'body-footer'}}
  </body>
</html>


text:
package com.sun.tools.javac.code;

import java.lang.annotation.Annotation;
import java.lang.annotation.Inherited;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import javax.lang.model.AnnotatedConstruct;

import com.sun.tools.javac.model.AnnotationProxyMaker;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.ListBuffer;

/**
 * Common super type for annotated constructs such as Types and Symbols.
 *
 * This class should *not* contain any fields since it would have a significant
 * impact on the javac memory footprint.
 *
 *
This is NOT part of any supported API.
 * If you write code that depends on this, you do so at your own
 * risk.  This code and its internal interfaces are subject to change
 * or deletion without notice.

 */
public abstract class AnnoConstruct implements AnnotatedConstruct {

    // Override to enforce a narrower return type.
    @Override
    public abstract List<? extends Attribute.Compound> getAnnotationMirrors();

    // This method is part of the javax.lang.model API, do not use this in javac code.
    protected  Attribute.Compound getAttribute(Class annoType) {
        String name = annoType.getName();

        for (Attribute.Compound anno : getAnnotationMirrors()) {
            if (name.equals(anno.type.tsym.flatName().toString()))
                return anno;
        }

        return null;
    }

    @SuppressWarnings("unchecked")
    protected  A[] getInheritedAnnotations(Class annoType) {
        return (A[]) java.lang.reflect.Array.newInstance(annoType, 0);  // annoType is the Class for A
    }

    // This method is part of the javax.lang.model API, do not use this in javac code.
    public  A[] getAnnotationsByType(Class annoType) {

        if (!annoType.isAnnotation())
            throw new IllegalArgumentException("Not an annotation type: "
                                               + annoType);
        // If annoType does not declare a container this is equivalent to wrapping
        // getAnnotation(...) in an array.
        Class <? extends Annotation> containerType = getContainer(annoType);
        if (containerType == null) {
            A res = getAnnotation(annoType);
            int size = res == null ? 0 : 1;

            @SuppressWarnings("unchecked") // annoType is the Class for A
            A[] arr = (A[])java.lang.reflect.Array.newInstance(annoType, size);
            if (res != null)
                arr[0] = res;
            return arr;
        }

        // So we have a containing type
        String annoTypeName = annoType.getName();
        String containerTypeName = containerType.getName();
        int directIndex = -1, containerIndex = -1;
        Attribute.Compound direct = null, container = null;
        // Find directly (explicit or implicit) present annotations
        int index = -1;
        for (Attribute.Compound attribute : getAnnotationMirrors()) {
            index++;
            if (attribute.type.tsym.flatName().contentEquals(annoTypeName)) {
                directIndex = index;
                direct = attribute;
            } else if(containerTypeName != null &&
                      attribute.type.tsym.flatName().contentEquals(containerTypeName)) {
                containerIndex = index;
                container = attribute;
            }
        }

        // Deal with inherited annotations
        if (direct == null && container == null &&
                annoType.isAnnotationPresent(Inherited.class))
            return getInheritedAnnotations(annoType);

        Attribute.Compound[] contained = unpackContained(container);

        // In case of an empty legacy container we might need to look for
        // inherited annos as well
        if (direct == null && contained.length == 0 &&
                annoType.isAnnotationPresent(Inherited.class))
            return getInheritedAnnotations(annoType);

        int size = (direct == null ? 0 : 1) + contained.length;
        @SuppressWarnings("unchecked") // annoType is the Class for A
        A[] arr = (A[])java.lang.reflect.Array.newInstance(annoType, size);

        // if direct && container, which is first?
        int insert = -1;
        int length = arr.length;
        if (directIndex >= 0 && containerIndex >= 0) {
            if (directIndex < containerIndex) {
                arr[0] = AnnotationProxyMaker.generateAnnotation(direct, annoType);
                insert = 1;
            } else {
                arr[arr.length - 1] = AnnotationProxyMaker.generateAnnotation(direct, annoType);
                insert = 0;
                length--;
            }
        } else if (directIndex >= 0) {
            arr[0] = AnnotationProxyMaker.generateAnnotation(direct, annoType);
            return arr;
        } else {
            // Only container
            insert = 0;
        }

        for (int i = 0; i + insert < length; i++)
            arr[insert + i] = AnnotationProxyMaker.generateAnnotation(contained[i], annoType);

        return arr;
    }

    private Attribute.Compound[] unpackContained(Attribute.Compound container) {
        // Pack them in an array
        Attribute[] contained0 = null;
        if (container != null)
            contained0 = unpackAttributes(container);
        ListBuffer<Attribute.Compound> compounds = new ListBuffer<>();
        if (contained0 != null) {
            for (Attribute a : contained0)
                if (a instanceof Attribute.Compound)
                    compounds = compounds.append((Attribute.Compound)a);
        }
        return compounds.toArray(new Attribute.Compound[compounds.size()]);
    }

    // This method is part of the javax.lang.model API, do not use this in javac code.
    public  A getAnnotation(Class annoType) {

        if (!annoType.isAnnotation())
            throw new IllegalArgumentException("Not an annotation type: " + annoType);

        Attribute.Compound c = getAttribute(annoType);
        return c == null ? null : AnnotationProxyMaker.generateAnnotation(c, annoType);
    }

    // Needed to unpack the runtime view of containing annotations
    private static final Class<? extends Annotation> REPEATABLE_CLASS = initRepeatable();
    private static final Method VALUE_ELEMENT_METHOD = initValueElementMethod();

    private static Class<? extends Annotation> initRepeatable() {
        try {
            // Repeatable will not be available when bootstrapping on
            // JDK 7 so use a reflective lookup instead of a class
            // literal for Repeatable.class.
            return Class.forName("java.lang.annotation.Repeatable").asSubclass(Annotation.class);
        } catch (ClassNotFoundException | SecurityException e) {
            return null;
        }
    }

    private static Method initValueElementMethod() {
        if (REPEATABLE_CLASS == null)
            return null;

        Method m = null;
        try {
            m = REPEATABLE_CLASS.getMethod("value");
            if (m != null)
                m.setAccessible(true);
            return m;
        } catch (NoSuchMethodException e) {
            return null;
        }
    }

    // Helper to getAnnotationsByType
    private static Class<? extends Annotation> getContainer(Class<? extends Annotation> annoType) {
        // Since we can not refer to java.lang.annotation.Repeatable until we are
        // bootstrapping with java 8 we need to get the Repeatable annotation using
        // reflective invocations instead of just using its type and element method.
        if (REPEATABLE_CLASS != null &&
            VALUE_ELEMENT_METHOD != null) {
            // Get the Repeatable instance on the annotations declaration
            Annotation repeatable = (Annotation)annoType.getAnnotation(REPEATABLE_CLASS);
            if (repeatable != null) {
                try {
                    // Get the value element, it should be a class
                    // indicating the containing annotation type
                    @SuppressWarnings("unchecked")
                    Class<? extends Annotation> containerType = (Class)VALUE_ELEMENT_METHOD.invoke(repeatable);
                    if (containerType == null)
                        return null;

                    return containerType;
                } catch (ClassCastException | IllegalAccessException | InvocationTargetException e) {
                    return null;
                }
            }
        }
        return null;
    }

    // Helper to getAnnotationsByType
    private static Attribute[] unpackAttributes(Attribute.Compound container) {
        // We now have an instance of the container,
        // unpack it returning an instance of the
        // contained type or null
        return ((Attribute.Array)container.member(container.type.tsym.name.table.names.value)).values;
    }

}


text:
package comalexpolyanskyi.github.foodandhealth.utils.auth;

import android.os.AsyncTask;

import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.android.gms.auth.api.signin.GoogleSignInResult;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;

import java.io.UnsupportedEncodingException;
import java.lang.reflect.Type;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.util.List;

import comalexpolyanskyi.github.foodandhealth.utils.AppHttpClient;

public class GoogleAuthHelper implements AuthHelper<GoogleSignInResult, AuthData> {

    private static final String UTF_8 = "UTF-8";
    private static final String EMAIL = "&email=";
    private static final String LOGIN = "&login=";
    private AuthHelper.AuthHelperCallback<AuthData> helperCallback;

    @Override
    public void registerOnServer(final GoogleSignInResult result, final AuthHelperCallback<AuthData> helperCallback) {
        this.helperCallback = helperCallback;
        final GoogleSignInAccount account = result.getSignInAccount();
        if (account != null) {
            final String email = account.getEmail();
            final String login = account.getDisplayName();
            toSend(email, login);
        } else {
            helperCallback.onError(null);
        }
    }

    private AuthData processRequest(final String requestString) {
        final Type type = new TypeToken<List<AuthData>>() {

        }.getType();
        final Gson gson = new GsonBuilder().create();
        List<AuthData> authDatas = gson.fromJson(requestString, type);

        return authDatas.get(0);
    }

    private void toSend(final String email, final String login) {
        new AsyncTask<String, Void, AuthData>() {

            @Override
            protected AuthData doInBackground(final String... params) {
                try {
                    final String urlParameters = EMAIL + URLEncoder.encode(params[0], UTF_8) +
                            LOGIN + URLEncoder.encode(params[1], UTF_8);
                    final AppHttpClient appHttpClient = AppHttpClient.getAppHttpClient();
                    final byte[] requestBytes = appHttpClient.loadDataFromHttp(AuthConstant.AUTH_API, urlParameters);
                    if (requestBytes != null) {
                        final String requestString = new String(requestBytes, Charset.forName(UTF_8));
                        return processRequest(requestString);
                    }
                } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();
                    helperCallback.onError(null);
                }
                return null;
            }

            @Override
            protected void onPostExecute(final AuthData response) {
                super.onPostExecute(response);
                if (response != null) {
                    helperCallback.authSuccess(response);
                } else {
                    helperCallback.onError(null);
                }
            }
        }.execute(email, login);
    }
}


text:
package org.cloudfoundry.client.v3.packages;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.immutables.value.Value;

/**
 * The request payload for the Delete Package operation
 */
@Value.Immutable
abstract class _DeletePackageRequest {

    /**
     * The package id
     */
    @JsonIgnore
    abstract String getPackageId();

}


text:
#include "NtLoader.h"
#include "../../Process/Process.h"
#include "../../Patterns/PatternSearch.h"
#include "../../Misc/Utils.h"
#include "../../Include/Macro.h"
#include "../../Misc/DynImport.h"
#include "../../Misc/trace.hpp"

#include "../contrib/VersionHelpers.h"

namespace blackbone
{

NtLdr::NtLdr( Process& proc )
    : _process( proc )
{
}

NtLdr::~NtLdr(void)
{
}

/// <summary>
/// Initialize some loader stuff
/// </summary>
/// <returns></returns>
bool NtLdr::Init()
{
    FindLdrpHashTable();
    FindLdrHeap();

    if (IsWindows8OrGreater())
        FindLdrpModuleIndexBase();

    ScanPatterns();
    _nodeMap.clear();
    return true;
}

/// <summary>
/// Add module to some loader structures
/// (LdrpHashTable, LdrpModuleIndex( win8+ only ), InMemoryOrderModuleList( win7 only ))
/// </summary>
/// <param name="hMod">Module base address</param>
/// <param name="ImageSize">Size of image</param>
/// <param name="DllBasePath">Full-qualified image path</param>
/// <param name="entryPoint">Entry point RVA</param>
/// <param name="flags">Type of references to create</param>
/// <returns>true on success</returns>
bool NtLdr::CreateNTReference(
    HMODULE hMod,
    size_t ImageSize,
    const std::wstring& DllBasePath,
    uintptr_t entryPoint,
    LdrRefFlags flags /*= Ldr_All*/
    )
{
    // Skip
    if (flags == Ldr_None)
        return true;

    // Win 8 and higher
    if (IsWindows8OrGreater())
    {
        ULONG hash = 0;
        _LDR_DATA_TABLE_ENTRY_W8 *pEntry = InitW8Node( reinterpret_cast<void*>(hMod), ImageSize, DllBasePath, entryPoint, hash );
        _nodeMap.emplace( std::make_pair( hMod, pEntry ) );

        // Insert into LdrpHashTable
        if (flags & Ldr_HashTable)
            InsertHashNode( GET_FIELD_PTR( pEntry, HashLinks ), hash );

        // Insert into module graph
        if (flags & Ldr_ModList)
            InsertTreeNode( pEntry, reinterpret_cast<uintptr_t>(hMod) );

        if (flags & Ldr_ThdCall)
        {
            _process.memory().Write( GET_FIELD_PTR( pEntry, Flags ), 0x80004 );
            InsertMemModuleNode( 0, GET_FIELD_PTR( pEntry, InLoadOrderLinks ),
                                 GET_FIELD_PTR( pEntry, InInitializationOrderLinks ) );
        }
    }
    // Windows 7 and earlier
    else
    {
        ULONG hash = 0;
        _LDR_DATA_TABLE_ENTRY_W7 *pEntry = InitW7Node( reinterpret_cast<void*>(hMod), ImageSize, DllBasePath, entryPoint, hash );
        _nodeMap.emplace( std::make_pair( hMod, pEntry ) );

        // Insert into LdrpHashTable
        if (flags & Ldr_HashTable)
            InsertHashNode( GET_FIELD_PTR( pEntry, HashLinks ), hash );

        // Insert into LDR list
        if (flags & (Ldr_ModList | Ldr_ThdCall))
        {
            _process.memory().Write( GET_FIELD_PTR( pEntry, Flags ), 0x80004 );
            InsertMemModuleNode( 0, GET_FIELD_PTR( pEntry, InLoadOrderLinks ), 0 );
        }
	}

    return true;
}

/// <summary>
/// Get module native node ptr or create new
/// </summary>
/// <param name="ptr">node pointer (if nullptr - new dummy node is allocated)</param>
/// <param name="pModule">Module base address</param>
/// <returns>Node address</returns>
template<typename T>
T* NtLdr::SetNode( T* ptr, void* pModule )
{
    if(ptr == nullptr)
    {
        /*
        AsmJitHelper a

        a.GenPrologue();
        a.GenCall(&GetProcessHeap, {  });
        a.GenCall(&HeapAlloc, { asmjit::host::zax, HEAP_ZERO_MEMORY, sizeof(T) });
        a->SaveRetValAndSignalEvent();
        a.GenEpilogue();

        m_memory.ExecInWorkerThread(a->make(), a->getCodeSize(), (size_t&)ptr);*/

        auto rgn = _process.memory().Allocate( sizeof(T), PAGE_READWRITE );
        if (rgn.valid())
        {
            rgn.Release();

            ptr = rgn.ptr<T*>();
            rgn.Write( FIELD_OFFSET2( T*, DllBase ), pModule );
        }
    }

    return ptr;
}

/// <summary>
/// Create thread static TLS array
/// </summary>
/// <param name="pModule">Module base address</param>
/// <param name="pTls">TLS directory of target image</param>
/// <returns>true on success</returns>
bool NtLdr::AddStaticTLSEntry( void* pModule, IMAGE_TLS_DIRECTORY *pTls )
{
    bool wxp = IsWindowsXPOrGreater() && !IsWindowsVistaOrGreater();

    void* pNode = _nodeMap.count( reinterpret_cast<HMODULE>(pModule) ) ?
        _nodeMap[reinterpret_cast<HMODULE>(pModule)] : nullptr;

    // Allocate appropriate structure
    if ((pNode = SetNode( reinterpret_cast<PLDR_DATA_TABLE_ENTRY>(pNode), pModule )) == nullptr)
        return false;

    // Manually add TLS table
    if ((wxp || _process.core().native()->GetWow64Barrier().type == wow_64_32) && pTls != nullptr)
    {
        ptr_t pTeb = 0;
        if (wxp)
            pTeb = _process.remote().getWorker()->teb( static_cast<_TEB32*>(nullptr) );
        else
            pTeb = _process.remote().getWorker()->teb( static_cast<_TEB64*>(nullptr) );

        auto tlsStore = _process.memory().Allocate( 0x1000, PAGE_READWRITE );
        tlsStore.Release();

        IMAGE_TLS_DIRECTORY remoteTls = { 0 };
        _process.memory().Read( reinterpret_cast<ptr_t>(pTls), sizeof( remoteTls ), &remoteTls );

        auto size = remoteTls.EndAddressOfRawData - remoteTls.StartAddressOfRawData;
        std::unique_ptr<uint8_t[]> buf( new uint8_t[size]() );

        _process.memory().Read( remoteTls.StartAddressOfRawData, size, buf.get() );

        tlsStore.Write( 0, tlsStore.ptr<uintptr_t>() + 0x800 );
        tlsStore.Write( 0x800, size, buf.get() );

        if (wxp)
            _process.memory().Write( pTeb + FIELD_OFFSET( _TEB32, ThreadLocalStoragePointer ), tlsStore.ptr<DWORD32>() );
        else
            _process.memory().Write( pTeb + FIELD_OFFSET( _TEB64, ThreadLocalStoragePointer ), tlsStore.ptr<DWORD64>() );

        return true;
    }

    // Use native method
    if(_LdrpHandleTlsData)
    {
        AsmJitHelper a;
        uint64_t result = 0;

        a.GenPrologue();
        a.GenCall( _LdrpHandleTlsData, { reinterpret_cast<uintptr_t>(pNode) }, IsWindows8Point1OrGreater() ? cc_thiscall : cc_stdcall );
        _process.remote().AddReturnWithEvent( a );
        a.GenEpilogue();

        _process.remote().ExecInWorkerThread( a->make(), a->getCodeSize(), result );
    }
    else
        return false;

    return true;
}

/// <summary>
/// Create module record in LdrpInvertedFunctionTable
/// Used to create fake SAFESEH entries
/// </summary>
/// <param name="ModuleBase">Module base address</param>
/// <param name="ImageSize">Size of image</param>
/// <param name="safeseh">Is set into true, if image has SAFESEH handlers</param>
/// <returns>true on success</returns>
bool NtLdr::InsertInvertedFunctionTable( void* ModuleBase, size_t ImageSize, bool& safeseh )
{
    RTL_INVERTED_FUNCTION_TABLE7 table = { 0 };
    PRTL_INVERTED_FUNCTION_TABLE_ENTRY Entries = nullptr;

    AsmJitHelper a;
    uint64_t result = 0;
    auto& memory = _process.memory();

    // Invalid addresses. Probably pattern scan has failed
    if (_RtlInsertInvertedFunctionTable == 0 || _LdrpInvertedFunctionTable == 0)
        return false;

    if (IsWindows8OrGreater())
        Entries = reinterpret_cast<decltype(Entries)>(GET_FIELD_PTR( reinterpret_cast<PRTL_INVERTED_FUNCTION_TABLE8>(&table), Entries ));
    else
        Entries = reinterpret_cast<decltype(Entries)>(GET_FIELD_PTR( &table, Entries ));

    //
    // Try to find module address in table.
    // If found - no additional work is required.
    //
    memory.Read( _LdrpInvertedFunctionTable, sizeof( table ), &table );
    for (DWORD i = 0; i < table.Count; i++)
        if(Entries[i].ImageBase == ModuleBase)
            return true;

    a.GenPrologue();

    if (IsWindows8Point1OrGreater())
        a.GenCall( _RtlInsertInvertedFunctionTable, { reinterpret_cast<uintptr_t>(ModuleBase), ImageSize }, cc_fastcall );
    else if (IsWindows8OrGreater())
        a.GenCall( _RtlInsertInvertedFunctionTable, { reinterpret_cast<uintptr_t>(ModuleBase), ImageSize } );
    else
        a.GenCall( _RtlInsertInvertedFunctionTable, { _LdrpInvertedFunctionTable, reinterpret_cast<uintptr_t>(ModuleBase), ImageSize } );

    _process.remote().AddReturnWithEvent( a );
    a.GenEpilogue();

    _process.remote().ExecInWorkerThread( a->make(), a->getCodeSize(), result );
    memory.Read( _LdrpInvertedFunctionTable, sizeof( table ), &table );

    for(DWORD i = 0; i < table.Count; i++)
    {
        if(Entries[i].ImageBase != ModuleBase)
            continue;

        // If Image has SAFESEH, RtlInsertInvertedFunctionTable is enough
        if (Entries[i].SizeOfTable != 0)
            return safeseh = true;

        //
        // Create fake Exception directory
        // Directory will be filled later, during exception handling
        //
        PIMAGE_RUNTIME_FUNCTION_ENTRY pImgEntry = nullptr;

        // Allocate memory for 512 possible handlers
        auto block = memory.Allocate( sizeof( DWORD ) * 0x200, PAGE_READWRITE );
        block.Release();
        pImgEntry = block.ptr<decltype(pImgEntry)>();

        auto pEncoded = EncodeSystemPointer( pImgEntry );

        // m_LdrpInvertedFunctionTable->Entries[i].ExceptionDirectory
        uintptr_t field_ofst = reinterpret_cast<uintptr_t>(&Entries[i].ExceptionDirectory)
            - reinterpret_cast<uintptr_t>(&table);

        // In Win10 _LdrpInvertedFunctionTable is located in mrdata section
        // mrdata is read-only by default
        // LdrProtectMrdata is used to make it writable when needed
        DWORD flOld = 0;
        memory.Protect( _LdrpInvertedFunctionTable + field_ofst, sizeof( uintptr_t ), PAGE_EXECUTE_READWRITE, &flOld );
        auto status = memory.Write( _LdrpInvertedFunctionTable + field_ofst, pEncoded );
        memory.Protect( _LdrpInvertedFunctionTable + field_ofst, sizeof( uintptr_t ), flOld, &flOld );

        return NT_SUCCESS( status );
    }

    return false;
}

/// <summary>
/// Initialize OS-specific module entry
/// </summary>
/// <param name="ModuleBase">Module base address.</param>
/// <param name="ImageSize">Size of image.</param>
/// <param name="dllpath">Full-qualified image path</param>
/// <param name="entryPoint">Entry point RVA</param>
/// <param name="outHash">Iamge name hash</param>
/// <returns>Pointer to created entry</returns>
_LDR_DATA_TABLE_ENTRY_W8* NtLdr::InitW8Node(
    void* ModuleBase,
    size_t ImageSize,
    const std::wstring& dllpath,
    uintptr_t entryPoint,
    ULONG& outHash
    )
{
    std::wstring dllname = Utils::StripPath( dllpath );
    UNICODE_STRING strLocal = { 0 };
    uint64_t result = 0;

    _LDR_DATA_TABLE_ENTRY_W8 *pEntry = nullptr;
    _LDR_DDAG_NODE *pDdagNode = nullptr;

    AsmJitHelper a;

    // Allocate space for Unicode string
    auto StringBuf = _process.memory().Allocate( 0x1000, PAGE_READWRITE );
    StringBuf.Release();

    eModType mt = _process.core().native()->GetWow64Barrier().sourceWow64 ? mt_mod32 : mt_mod64;

    auto RtlAllocateHeap = _process.modules().GetExport(
        _process.modules().GetModule( L"ntdll.dll", LdrList, mt ), "RtlAllocateHeap" ).procAddress;

    if (_LdrHeapBase)
    {
        //
        // HeapAlloc(LdrHeap, HEAP_ZERO_MEMORY, sizeof(_LDR_DATA_TABLE_ENTRY_W8));
        //
        a.GenPrologue();

        a.GenCall( static_cast<uintptr_t>(RtlAllocateHeap), { _LdrHeapBase, HEAP_ZERO_MEMORY, sizeof( _LDR_DATA_TABLE_ENTRY_W8 ) } );
        _process.remote().AddReturnWithEvent( a, mt );
        a.GenEpilogue();

        _process.remote().ExecInWorkerThread( a->make(), a->getCodeSize(), result );

        pEntry = reinterpret_cast<decltype(pEntry)>(result);
    }
    else
    {
        auto block = _process.memory().Allocate( sizeof( _LDR_DATA_TABLE_ENTRY_W8 ), PAGE_READWRITE );
        pEntry = block.ptr<_LDR_DATA_TABLE_ENTRY_W8*>();
        block.Release();
    }

    if(pEntry)
    {
        if (_LdrHeapBase)
        {
            a->reset();

            //
            // HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(_LDR_DDAG_NODE));
            //
            a.GenPrologue();

            a.GenCall( static_cast<uintptr_t>(RtlAllocateHeap), { _LdrHeapBase, HEAP_ZERO_MEMORY, sizeof( _LDR_DDAG_NODE ) } );

            _process.remote().AddReturnWithEvent( a, mt );
            a.GenEpilogue();

            _process.remote().ExecInWorkerThread( a->make(), a->getCodeSize(), result );
            pDdagNode = reinterpret_cast<decltype(pDdagNode)>(result);
        }
        else
        {
            auto block = _process.memory().Allocate( sizeof( _LDR_DATA_TABLE_ENTRY_W8 ), PAGE_READWRITE );
            pDdagNode = block.ptr<_LDR_DDAG_NODE*>();
            block.Release();
        }

        if(pDdagNode)
        {
            // pEntry->DllBase = ModuleBase;
            _process.memory().Write( GET_FIELD_PTR( pEntry, DllBase ), ModuleBase );

            // pEntry->SizeOfImage = ImageSize;
            _process.memory().Write( GET_FIELD_PTR( pEntry, SizeOfImage ), static_cast<ULONG>(ImageSize) );

            // pEntry->EntryPoint = entryPoint;
            _process.memory().Write( GET_FIELD_PTR( pEntry, EntryPoint ), entryPoint );

            // Dll name and name hash
            SAFE_CALL( RtlInitUnicodeString, &strLocal, dllname.c_str() );
            outHash = HashString( dllname );

            // Write into buffer
            strLocal.Buffer = StringBuf.ptr<PWSTR>();
            StringBuf.Write( 0, dllname.length() * sizeof(wchar_t) + 2, dllname.c_str() );

            // pEntry->BaseDllName = strLocal;
            _process.memory().Write( GET_FIELD_PTR( pEntry, BaseDllName ), strLocal );

            // Dll full path
            SAFE_CALL( RtlInitUnicodeString, &strLocal, dllpath.c_str() );
            strLocal.Buffer = reinterpret_cast<PWSTR>(StringBuf.ptr<uint8_t*>( ) + 0x800);
            StringBuf.Write( 0x800, dllpath.length() * sizeof(wchar_t) + 2, dllpath.c_str() );

            // pEntry->FullDllName = strLocal;
            _process.memory().Write( GET_FIELD_PTR( pEntry, FullDllName ), strLocal );

            // pEntry->BaseNameHashValue = hash;
            _process.memory().Write( GET_FIELD_PTR( pEntry, BaseNameHashValue ), outHash );

            //
            // Ddag node
            //

            // pEntry->DdagNode = pDdagNode;
            _process.memory().Write( GET_FIELD_PTR( pEntry, DdagNode ), pDdagNode );

            // pDdagNode->State = LdrModulesReadyToRun;
            _process.memory().Write( GET_FIELD_PTR( pDdagNode, State ), LdrModulesReadyToRun );

            // pDdagNode->ReferenceCount = 1;
            _process.memory().Write( GET_FIELD_PTR( pDdagNode, ReferenceCount ), 1 );

            // pDdagNode->LoadCount = -1;
            _process.memory().Write( GET_FIELD_PTR( pDdagNode, LoadCount ), -1 );

            return pEntry;
        }

        return nullptr;
    }

    return nullptr;
}

/// <summary>
///  Initialize OS-specific module entry
/// </summary>
/// <param name="ModuleBase">Module base address.</param>
/// <param name="ImageSize">Size of image.</param>
/// <param name="dllpath">Full-qualified image path</param>
/// <param name="entryPoint">Entry point RVA</param>
/// <param name="outHash">Iamge name hash</param>
/// <returns>Pointer to created entry</returns>
_LDR_DATA_TABLE_ENTRY_W7* NtLdr::InitW7Node(
    void* ModuleBase,
    size_t ImageSize,
    const std::wstring& dllpath,
    uintptr_t entryPoint,
    ULONG& outHash
    )
{
    std::wstring dllname = Utils::StripPath( dllpath );
    UNICODE_STRING strLocal = { 0 };
    uint64_t result = 0;

    _LDR_DATA_TABLE_ENTRY_W7 *pEntry = nullptr;

    AsmJitHelper a;

    // Allocate space for Unicode string
    auto StringBuf = _process.memory().Allocate( MAX_PATH, PAGE_READWRITE );
    StringBuf.Release();

    if (_LdrHeapBase)
    {
        eModType mt = _process.core().native()->GetWow64Barrier().sourceWow64 ? mt_mod32 : mt_mod64;

        auto RtlAllocateHeap = _process.modules().GetExport(
            _process.modules().GetModule( L"ntdll.dll", LdrList, mt ), "RtlAllocateHeap" ).procAddress;

        //
        // HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(_LDR_DATA_TABLE_ENTRY_W8));
        //
        a.GenPrologue();

        a.GenCall( static_cast<uintptr_t>(RtlAllocateHeap), { _LdrHeapBase, HEAP_ZERO_MEMORY, sizeof( _LDR_DATA_TABLE_ENTRY_W7 ) } );

        _process.remote().AddReturnWithEvent( a, mt );
        a.GenEpilogue();

        _process.remote().ExecInWorkerThread( a->make(), a->getCodeSize(), result );
        pEntry = reinterpret_cast<decltype(pEntry)>(result);
    }
    else
    {
        auto block = _process.memory().Allocate( sizeof( _LDR_DATA_TABLE_ENTRY_W8 ), PAGE_READWRITE );
        pEntry = block.ptr<_LDR_DATA_TABLE_ENTRY_W7*>();
        block.Release();
    }

    if(pEntry)
    {
        // pEntry->DllBase = ModuleBase;
        _process.memory().Write( GET_FIELD_PTR( pEntry, DllBase ), ModuleBase );

        // pEntry->SizeOfImage = ImageSize;
        _process.memory().Write( GET_FIELD_PTR( pEntry, SizeOfImage ), static_cast<ULONG>(ImageSize) );

        // pEntry->EntryPoint = entryPoint;
        _process.memory().Write( GET_FIELD_PTR( pEntry, EntryPoint ), entryPoint );

        // pEntry->LoadCount = -1;
        _process.memory().Write( GET_FIELD_PTR( pEntry, LoadCount ), -1 );

        // Dll name
        SAFE_CALL( RtlInitUnicodeString, &strLocal, dllname.c_str() );

        // Name hash
        outHash = HashString( dllname );

        // Write into buffer
        strLocal.Buffer = StringBuf.ptr<PWSTR>();
        StringBuf.Write( 0, dllname.length() * sizeof(wchar_t)+2, dllname.c_str() );

        // pEntry->BaseDllName = strLocal;
        _process.memory().Write( GET_FIELD_PTR( pEntry, BaseDllName ), strLocal );

        // Dll full path
        SAFE_CALL( RtlInitUnicodeString, &strLocal, dllpath.c_str() );
        strLocal.Buffer = reinterpret_cast<PWSTR>(StringBuf.ptr<uint8_t*>() + 0x800);
        StringBuf.Write( 0x800, dllpath.length() * sizeof(wchar_t) + 2, dllpath.c_str() );

        // pEntry->FullDllName = strLocal;
        _process.memory().Write( GET_FIELD_PTR( pEntry, FullDllName ), strLocal );

        // Forward Links
        _process.memory().Write( GET_FIELD_PTR( pEntry, ForwarderLinks ), GET_FIELD_PTR( pEntry, ForwarderLinks ) );
        _process.memory().Write( GET_FIELD_PTR( pEntry, ForwarderLinks ) + WordSize, GET_FIELD_PTR( pEntry, ForwarderLinks ) );

        return pEntry;
    }

    return nullptr;
}

/// <summary>
/// Insert entry into win8 module graph
/// </summary>
/// <param name="pNode">Node to insert</param>
void NtLdr::InsertTreeNode( _LDR_DATA_TABLE_ENTRY_W8* pNode, uintptr_t modBase )
{
    //
    // Win8 module tree
    //
    uintptr_t root = _process.memory().Read<uintptr_t>( _LdrpModuleIndexBase );

    _LDR_DATA_TABLE_ENTRY_W8 *pLdrNode = CONTAINING_RECORD( root, _LDR_DATA_TABLE_ENTRY_W8, BaseAddressIndexNode );
    _LDR_DATA_TABLE_ENTRY_W8 LdrNode = _process.memory().Read<_LDR_DATA_TABLE_ENTRY_W8>( reinterpret_cast<ptr_t>(pLdrNode) );

    bool bRight = false;

    // Walk tree
    for (;;)
    {
        if (modBase < LdrNode.DllBase)
        {
            if (LdrNode.BaseAddressIndexNode.Left)
            {
                pLdrNode = CONTAINING_RECORD( LdrNode.BaseAddressIndexNode.Left, _LDR_DATA_TABLE_ENTRY_W8, BaseAddressIndexNode );
                _process.memory().Read( reinterpret_cast<ptr_t>(pLdrNode), sizeof(LdrNode), &LdrNode );
            }
            else
                break;
        }
        else if (modBase  > LdrNode.DllBase)
        {
            if (LdrNode.BaseAddressIndexNode.Right)
            {
                pLdrNode = CONTAINING_RECORD( LdrNode.BaseAddressIndexNode.Right, _LDR_DATA_TABLE_ENTRY_W8, BaseAddressIndexNode );
                _process.memory().Read( reinterpret_cast<ptr_t>(pLdrNode), sizeof(LdrNode), &LdrNode );
            }
            else
            {
                bRight = true;
                break;
            }
        }
        // Already in tree (increase ref counter)
        else
        {
            // pLdrNode->DdagNode->ReferenceCount++;
            _LDR_DDAG_NODE Ddag = _process.memory().Read<_LDR_DDAG_NODE>( reinterpret_cast<ptr_t>(LdrNode.DdagNode) );

            Ddag.ReferenceCount++;

            _process.memory().Write( reinterpret_cast<ptr_t>(LdrNode.DdagNode), Ddag );

            return;
        }
    }

    // Insert using RtlRbInsertNodeEx

    AsmJitHelper a;
    uint64_t result = 0;

    eModType mt = _process.core().native()->GetWow64Barrier().sourceWow64 ? mt_mod32 : mt_mod64;

    auto RtlRbInsertNodeEx = _process.modules().GetExport(
        _process.modules().GetModule( L"ntdll.dll", LdrList, mt ), "RtlRbInsertNodeEx" ).procAddress;

    a.GenPrologue( );
    a.GenCall( static_cast<uintptr_t>(RtlRbInsertNodeEx), { _LdrpModuleIndexBase,
                                                           GET_FIELD_PTR( pLdrNode, BaseAddressIndexNode ),
                                                           static_cast<uintptr_t>(bRight), GET_FIELD_PTR( pNode, BaseAddressIndexNode ) } );
    _process.remote().AddReturnWithEvent( a, mt );
    a.GenEpilogue();

    _process.remote().ExecInWorkerThread( a->make(), a->getCodeSize(), result );
}

/// <summary>
/// Insert entry into InLoadOrderModuleList and InMemoryOrderModuleList
/// </summary>
/// <param name="pNodeMemoryOrderLink">InMemoryOrderModuleList link of entry to be inserted</param>
/// <param name="pNodeLoadOrderLink">InLoadOrderModuleList link of entry to be inserted</param>
void NtLdr::InsertMemModuleNode( uintptr_t pNodeMemoryOrderLink, uintptr_t pNodeLoadOrderLink, uintptr_t pNodeInitOrderLink )
{
    PEB_T* pPeb = reinterpret_cast<PEB_T*>(_process.core().peb());
    PEB_LDR_DATA_T* pLdr = nullptr;

    if(pPeb)
        pLdr = _process.memory().Read<PEB_LDR_DATA_T*>( GET_FIELD_PTR( pPeb, Ldr ) );

    if (pLdr)
    {
        // pLdr->InMemoryOrderModuleList
        if (pNodeMemoryOrderLink)
            InsertTailList( GET_FIELD_PTR( pLdr, InMemoryOrderModuleList ), pNodeMemoryOrderLink );

        // pLdr->InLoadOrderModuleList
        if (pNodeLoadOrderLink)
            InsertTailList( GET_FIELD_PTR( pLdr, InLoadOrderModuleList ), pNodeLoadOrderLink );

        // pLdr->InInitializationOrderModuleList
        if (pNodeInitOrderLink)
            InsertTailList( GET_FIELD_PTR( pLdr, InInitializationOrderModuleList ), pNodeInitOrderLink );
    }
}

/// <summary>
/// Insert entry into LdrpHashTable[]
/// </summary>
/// <param name="pNodeLink">Link of entry to be inserted</param>
/// <param name="hash">Module hash</param>
void NtLdr::InsertHashNode( uintptr_t pNodeLink, ULONG hash )
{
    if(pNodeLink)
    {
        // LrpHashTable record
        auto pHashList = _process.memory().Read<uintptr_t>( _LdrpHashTable + sizeof(LIST_ENTRY)*(hash & 0x1F) );
        InsertTailList( pHashList, pNodeLink );
    }
}

/// <summary>
/// Insert entry into standard double linked list
/// </summary>
/// <param name="ListHead">List head pointer</param>
/// <param name="Entry">Entry list link to be inserted</param>
void NtLdr::InsertTailList( uintptr_t ListHead, uintptr_t Entry )
{
    // PrevEntry = ListHead->Blink;
    auto PrevEntry = _process.memory().Read<uintptr_t>( GET_FIELD_PTR( reinterpret_cast<PLIST_ENTRY>(ListHead), Blink) );

    // Entry->Flink = ListHead;
    // Entry->Blink = PrevEntry;
    _process.memory().Write( GET_FIELD_PTR( reinterpret_cast<PLIST_ENTRY>(Entry), Flink ), ListHead );
    _process.memory().Write( GET_FIELD_PTR( reinterpret_cast<PLIST_ENTRY>(Entry), Blink ), PrevEntry );

    // PrevEntry->Flink = Entry;
    // ListHead->Blink  = Entry;
    _process.memory().Write( GET_FIELD_PTR( reinterpret_cast<PLIST_ENTRY>(PrevEntry), Flink ), Entry );
    _process.memory().Write( GET_FIELD_PTR( reinterpret_cast<PLIST_ENTRY>(ListHead), Blink ), Entry );
}

/// <summary>
/// Hash image name
/// </summary>
/// <param name="str">Iamge name</param>
/// <returns>Hash</returns>
ULONG NtLdr::HashString( const std::wstring& str )
{
    ULONG hash = 0;

    if (IsWindows8OrGreater())
    {
        UNICODE_STRING ustr;
        SAFE_CALL( RtlInitUnicodeString, &ustr, str.c_str() );
        SAFE_NATIVE_CALL( RtlHashUnicodeString, &ustr, (BOOLEAN)TRUE, 0, &hash );
    }
    else
    {
        for (auto& ch : str)
            hash += 0x1003F * static_cast<unsigned short>(SAFE_CALL( RtlUpcaseUnicodeChar, ch ));
    }

    return hash;
}

/// <summary>
/// Find LdrpHashTable[] variable
/// </summary>
/// <returns>true on success</returns>
bool NtLdr::FindLdrpHashTable( )
{
    PEB_LDR_DATA_T *Ldr =
        reinterpret_cast<PEB_LDR_DATA_T*>(
        reinterpret_cast<PEB_T*>(
        reinterpret_cast<TEB_T*>(NtCurrentTeb())->ProcessEnvironmentBlock)->Ldr);

    LDR_DATA_TABLE_ENTRY_BASE_T *Ntdll = CONTAINING_RECORD( Ldr->InInitializationOrderModuleList.Flink,
                                                            LDR_DATA_TABLE_ENTRY_BASE_T, InInitializationOrderLinks );

    ULONG NtdllHashIndex = HashString( reinterpret_cast<wchar_t*>(Ntdll->BaseDllName.Buffer) ) & 0x1F;

    ULONG_PTR NtdllBase = static_cast<ULONG_PTR>(Ntdll->DllBase);
    ULONG_PTR NtdllEndAddress = NtdllBase + Ntdll->SizeOfImage - 1;

    // scan hash list to the head (head is located within ntdll)
    bool bHeadFound = false;
    PLIST_ENTRY pNtdllHashHead = NULL;

    for (PLIST_ENTRY e = reinterpret_cast<PLIST_ENTRY>(Ntdll->HashLinks.Flink);
          e != reinterpret_cast<PLIST_ENTRY>(&Ntdll->HashLinks);
          e = e->Flink)
    {
        if (reinterpret_cast<ULONG_PTR>(e) >= NtdllBase &&
            reinterpret_cast<ULONG_PTR>(e) < NtdllEndAddress)
        {
            bHeadFound = true;
            pNtdllHashHead = e;
            break;
        }
    }

    if (bHeadFound)
        _LdrpHashTable = reinterpret_cast<uintptr_t>(pNtdllHashHead - NtdllHashIndex);

   return bHeadFound;
}

/// <summary>
/// Find LdrpModuleIndex variable under win8
/// </summary>
/// <returns>true on success</returns>
bool NtLdr::FindLdrpModuleIndexBase( )
{
    PEB_T* pPeb = reinterpret_cast<PEB_T*>(reinterpret_cast<TEB_T*>(NtCurrentTeb())->ProcessEnvironmentBlock);

    if(pPeb)
    {
        PRTL_BALANCED_NODE lastNode = 0;
        PEB_LDR_DATA_T* Ldr = reinterpret_cast<PEB_LDR_DATA_T*>(pPeb->Ldr);
        _LDR_DATA_TABLE_ENTRY_W8 *Ntdll = CONTAINING_RECORD( Ldr->InInitializationOrderModuleList.Flink,
                                                             _LDR_DATA_TABLE_ENTRY_W8, InInitializationOrderLinks );

        PRTL_BALANCED_NODE pNode = &Ntdll->BaseAddressIndexNode;

        // Get root node
        for(; pNode->ParentValue; )
        {
            // Ignore last few bits
            lastNode = reinterpret_cast<PRTL_BALANCED_NODE>(pNode->ParentValue & uintptr_t( -8 ));
            pNode = lastNode;
        }

        // Get pointer to root
        pe::PEImage ntdll;
        uintptr_t* pStart = nullptr;
        uintptr_t* pEnd = nullptr;

        ntdll.Parse( reinterpret_cast<void*>(Ntdll->DllBase) );

        for (auto& section : ntdll.sections())
            if (_stricmp( reinterpret_cast<LPCSTR>(section.Name), ".data") == 0 )
            {
                pStart = reinterpret_cast<uintptr_t*>(Ntdll->DllBase + section.VirtualAddress);
                pEnd   = reinterpret_cast<uintptr_t*>(Ntdll->DllBase + section.VirtualAddress + section.Misc.VirtualSize);

                break;
            }

        auto iter = std::find( pStart, pEnd, reinterpret_cast<uintptr_t>(lastNode) );

        if (iter != pEnd)
        {
            _LdrpModuleIndexBase = reinterpret_cast<uintptr_t>(iter);
            return true;
        }
    }

    return false;
}

/// <summary>
/// Search for RtlInsertInvertedFunctionTable, LdrpInvertedFunctionTable, LdrpHandleTlsData.
/// </summary>
/// <returns>true on success</returns>
bool NtLdr::ScanPatterns( )
{
    std::vector<ptr_t> foundData;
    pe::PEImage ntdll;
    void* pStart  = nullptr;
    size_t scanSize = 0;

    HMODULE hNtdll = GetModuleHandleW( L"ntdll.dll" );
    ntdll.Parse( hNtdll );

    // Find ntdll code section
    for (auto& section : ntdll.sections())
    {
        if (_stricmp( reinterpret_cast<LPCSTR>(section.Name), ".text" ) == 0)
        {
            pStart = reinterpret_cast<void*>(reinterpret_cast<size_t>(hNtdll) + section.VirtualAddress);
            scanSize = section.Misc.VirtualSize;

            break;
        }
    }

    // Code section not found
    if(pStart == nullptr)
        return false;

    // Win 8.1 and later
    if (IsWindows8Point1OrGreater())
    {
    #ifdef USE64
        // LdrpHandleTlsData
        // 44 8D 43 09 4C 8D 4C 24 38
        PatternSearch ps( "\x44\x8d\x43\x09\x4c\x8d\x4c\x24\x38" );
        ps.Search( pStart, scanSize, foundData );

        if (!foundData.empty())
        {
            _LdrpHandleTlsData = static_cast<uintptr_t>(foundData.front() - 0x43);
            foundData.clear();
        }

        // RtlInsertInvertedFunctionTable
        // 8B C3 2B D3 48 8D 48 01
        PatternSearch ps2( "\x8B\xC3\x2B\xD3\x48\x8D\x48\x01" );
        ps2.Search( pStart, scanSize, foundData );

        if (!foundData.empty())
        {
            _RtlInsertInvertedFunctionTable = static_cast<uintptr_t>(foundData.front() - 0x84);
            if (IsWindows10OrGreater())
                _LdrpInvertedFunctionTable = *reinterpret_cast<int32_t*>(foundData.front() - 0x27 + 3) + (foundData.front() - 0x27 + 7);
        }
    #else
        // RtlInsertInvertedFunctionTable
        // 53 56 57 8B DA 8B F9 50
        PatternSearch ps1( "\x53\x56\x57\x8b\xda\x8b\xf9\x50" );
        ps1.Search( pStart, scanSize, foundData );

        if (!foundData.empty())
        {
            _RtlInsertInvertedFunctionTable = static_cast<size_t>(foundData.front() - 0xB);

            if (IsWindows10OrGreater())
                _LdrpInvertedFunctionTable = *reinterpret_cast<uintptr_t*>(foundData.front() + 0x22);
            else
                _LdrpInvertedFunctionTable = *reinterpret_cast<uintptr_t*>(foundData.front() + 0x23);

            foundData.clear();
        }
        // Rescan using old pattern
        else
        {
            // RtlInsertInvertedFunctionTable
            // 8D 45 F4 89 55 F8 50 8D 55 FC
            PatternSearch ps12( "\x8d\x45\xf4\x89\x55\xf8\x50\x8d\x55\xfc" );
            ps12.Search( pStart, scanSize, foundData );

            if (!foundData.empty())
            {
                _RtlInsertInvertedFunctionTable = static_cast<uintptr_t>(foundData.front() - 0xB);
                _LdrpInvertedFunctionTable = *reinterpret_cast<uintptr_t*>(foundData.front() + 0x1D);
                foundData.clear();
            }
        }

        // LdrpHandleTlsData
        // 8D 45 ?? 50 6A 09 6A 01 8B C1
        PatternSearch ps2( "\x8d\x45\xcc\x50\x6a\x09\x6a\x01\x8b\xc1" );
        ps2.Search( 0xCC, pStart, scanSize, foundData );

        if (!foundData.empty())
        {
            _LdrpHandleTlsData = static_cast<uintptr_t>(foundData.front() - 0x18);
            foundData.clear();
        }

        // LdrProtectMrdata
        // 83 7D 08 00 8B 35
        PatternSearch ps3( "\x83\x7d\x08\x00\x8b\x35", 6 );
        ps3.Search( pStart, scanSize, foundData );

        if (!foundData.empty())
            _LdrProtectMrdata = static_cast<uintptr_t>(foundData.front() - 0x12);
    #endif
    }
    // Win 8
    else if (IsWindows8OrGreater())
    {
    #ifdef USE64
        // LdrpHandleTlsData
        // 48 8B 79 30 45 8D 66 01
        PatternSearch ps( "\x48\x8b\x79\x30\x45\x8d\x66\x01" );
        ps.Search( pStart, scanSize, foundData );

        if (!foundData.empty())
            _LdrpHandleTlsData = static_cast<uintptr_t>(foundData.front() - 0x49);
    #else
        // RtlInsertInvertedFunctionTable
        // 8B FF 55 8B EC 51 51 53 57 8B 7D 08 8D
        PatternSearch ps1( "\x8b\xff\x55\x8b\xec\x51\x51\x53\x57\x8b\x7d\x08\x8d" );
        ps1.Search( pStart, scanSize, foundData );

        if(!foundData.empty())
        {
            _RtlInsertInvertedFunctionTable = static_cast<uintptr_t>(foundData.front());
            _LdrpInvertedFunctionTable = *reinterpret_cast<uintptr_t*>(_RtlInsertInvertedFunctionTable + 0x26);
            foundData.clear();
        }

        // LdrpHandleTlsData
        // 8B 45 08 89 45 A0
        PatternSearch ps2( "\x8b\x45\x08\x89\x45\xa0" );
        ps2.Search( pStart, scanSize, foundData );

        if (!foundData.empty())
            _LdrpHandleTlsData = static_cast<uintptr_t>(foundData.front() - 0xC);
    #endif
    }
    // Win 7
    else if(IsWindows7OrGreater())
    {
    #ifdef USE64
        // LdrpHandleTlsData
        // 41 B8 09 00 00 00 48 8D 44 24 38
        PatternSearch ps1( "\x41\xb8\x09\x00\x00\x00\x48\x8d\x44\x24\x38", 11 );
        ps1.Search( pStart, scanSize, foundData );

        if (!foundData.empty())
        {
            _LdrpHandleTlsData = static_cast<uintptr_t>(foundData.front() - 0x27);
            foundData.clear();
        }

        // LdrpFindOrMapDll patch address
        // 48 8D 8C 24 98 00 00 00 41 b0 01
        PatternSearch ps2( "\x48\x8D\x8C\x24\x98\x00\x00\x00\x41\xb0\x01", 11 );
        ps2.Search( pStart, scanSize, foundData );

        if (!foundData.empty())
        {
            _LdrKernel32PatchAddress = static_cast<uintptr_t>(foundData.front() + 0x12);
            foundData.clear();
        }

        // KiUserApcDispatcher patch address
        // 48 8B 4C 24 18 48 8B C1 4C
        PatternSearch ps3( "\x48\x8b\x4c\x24\x18\x48\x8b\xc1\x4c");
        ps3.Search( pStart, scanSize, foundData );

        if (!foundData.empty())
        {
            _APC64PatchAddress = static_cast<uintptr_t>(foundData.front());
            foundData.clear();
        }
    #else
        // RtlInsertInvertedFunctionTable
        // 8B FF 55 8B EC 56 68
        PatternSearch ps1( "\x8b\xff\x55\x8b\xec\x56\x68" );
        ps1.Search( pStart, scanSize, foundData);

        if(!foundData.empty())
        {
            _RtlInsertInvertedFunctionTable = static_cast<size_t>(foundData.front( ));
            foundData.clear();
        }

        // RtlLookupFunctionTable + 0x11
        // 89 5D E0 38
        PatternSearch ps2( "\x89\x5D\xE0\x38" );
        ps2.Search( pStart, scanSize, foundData );

        if(!foundData.empty())
        {
            _LdrpInvertedFunctionTable = *reinterpret_cast<uintptr_t*>(foundData.front() + 0x1B);
            foundData.clear();
        }

        // LdrpHandleTlsData
        // 74 20 8D 45 D4 50 6A 09
        PatternSearch ps3( "\x74\x20\x8d\x45\xd4\x50\x6a\x09" );
        ps3.Search( pStart, scanSize, foundData );

        if(!foundData.empty())
            _LdrpHandleTlsData = static_cast<uintptr_t>(foundData.front() - 0x14);

    #endif
    }

    //
    // Report errors
    //
#ifndef BLACBONE_NO_TRACE
    if (_LdrpHashTable == 0)
        BLACKBONE_TRACE( "NativeLdr: LdrpHashTable not found" );
    if (IsWindows8OrGreater() && _LdrpModuleIndexBase == 0)
        BLACKBONE_TRACE( "NativeLdr: LdrpModuleIndexBase not found" );
    if (_LdrHeapBase == 0)
        BLACKBONE_TRACE( "NativeLdr: LdrHeapBase not found" );
    if (_LdrpHandleTlsData == 0)
        BLACKBONE_TRACE( "NativeLdr: LdrpHandleTlsData not found" );
#ifdef USE64
    if (IsWindows7OrGreater() && !IsWindows8OrGreater())
    {
        if (_LdrKernel32PatchAddress == 0)
            BLACKBONE_TRACE( "NativeLdr: LdrKernel32PatchAddress not found" );
        if (_APC64PatchAddress == 0)
            BLACKBONE_TRACE( "NativeLdr: APC64PatchAddress not found" );
    }
#else
    if (_LdrpInvertedFunctionTable == 0)
        BLACKBONE_TRACE( "NativeLdr: LdrpInvertedFunctionTable not found" );
    if (_RtlInsertInvertedFunctionTable == 0)
        BLACKBONE_TRACE( "NativeLdr: RtlInsertInvertedFunctionTable not found" );
    if (IsWindows8Point1OrGreater() && _LdrProtectMrdata == 0)
        BLACKBONE_TRACE( "NativeLdr: LdrProtectMrdata not found" );
#endif
#endif
    return true;
}

/// <summary>
/// Find Loader heap base
/// </summary>
/// <returns>true on success</returns>
bool NtLdr::FindLdrHeap()
{
    int32_t retries = 10;
    PEB_T Peb = { 0 };
    MEMORY_BASIC_INFORMATION64 mbi = { 0 };

    _process.core().peb( &Peb );
    for (; Peb.Ldr == 0 && retries > 0; retries--, Sleep( 10 ))
        _process.core().peb( &Peb );

    if (Peb.Ldr)
    {
        auto Ldr = _process.memory().Read<PEB_LDR_DATA_T>( Peb.Ldr );
        auto NtdllEntry = CONTAINING_RECORD( Ldr.InMemoryOrderModuleList.Flink, LDR_DATA_TABLE_ENTRY_BASE_T, InMemoryOrderLinks );
        if (_process.core().native()->VirtualQueryExT( reinterpret_cast<ptr_t>(NtdllEntry), &mbi ) == STATUS_SUCCESS)
        {
            _LdrHeapBase = static_cast<uintptr_t>(mbi.AllocationBase);
            return true;
        }
    }

    return false;
}

/// <summary>
/// Unlink module from Ntdll loader
/// </summary>
/// <param name="baseAddress">Module base address</param>
/// <param name="type">32 or 64 bit.</param>
/// <returns>true on success</returns>
bool NtLdr::Unlink( ptr_t baseAddress, const std::wstring& name, eModType type )
{
    ptr_t ldrEntry = 0;

    // Unlink from linked lists
    if (type == mt_mod32)
        ldrEntry = UnlinkFromLdr<DWORD>( baseAddress, name );
    else
        ldrEntry = UnlinkFromLdr<DWORD64>( baseAddress, name );

    auto barrier = _process.core().native()->GetWow64Barrier();

    // Unlink from graph
    // TODO: Unlink from _LdrpMappingInfoIndex. Still can't decide if it is required.
    if ((barrier.type == wow_32_32 || barrier.type == wow_64_64) && ldrEntry && IsWindows8OrGreater())
        UnlinkTreeNode( ldrEntry );

    return ldrEntry != 0;
}

/// <summary>
/// Unlink module from PEB_LDR_DATA
/// </summary>
/// <param name="baseAddress">Module base address.</param>
/// <returns>Address of removed record</returns>
template<typename T>
ptr_t NtLdr::UnlinkFromLdr( ptr_t baseAddress, const std::wstring& name )
{
    typename _PEB_T2<T>::type peb = { { { 0 } } };
    _PEB_LDR_DATA2<T> ldr = { 0 };

    auto native = _process.core().native();

    if (native->getPEB( &peb ) != 0 && native->ReadProcessMemoryT( peb.Ldr, &ldr, sizeof(ldr), 0 ) == STATUS_SUCCESS)
    {
        ptr_t ldrEntry = 0;

        // InLoadOrderModuleList
        ldrEntry |= UnlinkListEntry(
            ldr.InLoadOrderModuleList,
            peb.Ldr + FIELD_OFFSET( _PEB_LDR_DATA2<T>, InLoadOrderModuleList ),
            FIELD_OFFSET( _LDR_DATA_TABLE_ENTRY_BASE<T>, InLoadOrderLinks ),
            baseAddress
            );

        // InMemoryOrderModuleList
        ldrEntry |= UnlinkListEntry(
            ldr.InMemoryOrderModuleList,
            peb.Ldr + FIELD_OFFSET( _PEB_LDR_DATA2<T>, InMemoryOrderModuleList ),
            FIELD_OFFSET( _LDR_DATA_TABLE_ENTRY_BASE<T>, InMemoryOrderLinks ),
            baseAddress
            );

        // InInitializationOrderModuleList
        ldrEntry |= UnlinkListEntry(
            ldr.InInitializationOrderModuleList,
            peb.Ldr + FIELD_OFFSET( _PEB_LDR_DATA2<T>, InInitializationOrderModuleList ),
            FIELD_OFFSET( _LDR_DATA_TABLE_ENTRY_BASE<T>, InInitializationOrderLinks ),
            baseAddress
            );

        // Hash table
        if (ldrEntry == 0)
        {
            //
            // Search module in hash list
            //
            auto pHashList = _LdrpHashTable + sizeof( _LIST_ENTRY_T<T> )*(HashString( name ) & 0x1F);
            auto hashList = _process.memory().Read<_LIST_ENTRY_T<T>>( pHashList );

            UnlinkListEntry( hashList, pHashList,FIELD_OFFSET( _LDR_DATA_TABLE_ENTRY_BASE<T>, HashLinks ), baseAddress );
        }
        else
            UnlinkListEntry<T>( ldrEntry + FIELD_OFFSET( _LDR_DATA_TABLE_ENTRY_BASE<T>, HashLinks ) );

        return ldrEntry;
    }

    return 0;
}

/// <summary>
/// Search and remove record from LIST_ENTRY structure
/// </summary>
/// <param name="pListEntry">List to remove from</param>
/// <param name="head">List head address</param>
/// <param name="ofst">Offset of link in _LDR_DATA_TABLE_ENTRY_BASE struct</param>
/// <param name="baseAddress">Record to remove.</param>
/// <returns>Address of removed record</returns>
template<typename T>
ptr_t NtLdr::UnlinkListEntry( _LIST_ENTRY_T<T> pListEntry, ptr_t head, uintptr_t ofst, ptr_t baseAddress )
{
    auto native = _process.core().native();

    for (T entry = pListEntry.Flink; entry != 0 && entry != head; native->ReadProcessMemoryT( entry, &entry, sizeof( entry ) ))
    {
        _LDR_DATA_TABLE_ENTRY_BASE<T> modData = { { 0 } };

        native->ReadProcessMemoryT( entry - ofst, &modData, sizeof(modData), 0 );

        // Unlink if found
        if (modData.DllBase == (T)baseAddress)
        {
            T OldFlink = _process.memory().Read<T>( entry + FIELD_OFFSET( _LIST_ENTRY_T<T>, Flink ) );
            T OldBlink = _process.memory().Read<T>( entry + FIELD_OFFSET( _LIST_ENTRY_T<T>, Blink ) );

            // OldFlink->Blink = OldBlink;
            _process.memory().Write(OldFlink + FIELD_OFFSET( _LIST_ENTRY_T<T>, Blink ), OldBlink);

            // OldBlink->Flink = OldFlink;
            _process.memory().Write(OldBlink + FIELD_OFFSET( _LIST_ENTRY_T<T>, Flink ), OldFlink);

            return entry - ofst;
        }
    }

    return 0;
}

/// <summary>
///  Remove record from LIST_ENTRY structure
/// </summary>
/// <param name="pListLink">Entry link</param>
template<typename T>
void NtLdr::UnlinkListEntry( ptr_t pListLink )
{
    T OldFlink = _process.memory().Read<T>( pListLink + FIELD_OFFSET( _LIST_ENTRY_T<T>, Flink ) );
    T OldBlink = _process.memory().Read<T>( pListLink + FIELD_OFFSET( _LIST_ENTRY_T<T>, Blink ) );

    // List is empty
    if (OldBlink == 0 || OldFlink == 0 || OldBlink == OldFlink)
        return;

    // OldFlink->Blink = OldBlink;
    _process.memory().Write( OldFlink + FIELD_OFFSET( _LIST_ENTRY_T<T>, Blink ), OldBlink );

    // OldBlink->Flink = OldFlink;
    _process.memory().Write( OldBlink + FIELD_OFFSET( _LIST_ENTRY_T<T>, Flink ), OldFlink );
}

/// <summary>
/// Unlink from module graph
/// </summary>
/// <param name="ldrEntry">Module LDR entry</param>
/// <returns>Address of removed record</returns>
ptr_t NtLdr::UnlinkTreeNode( ptr_t ldrEntry )
{

    AsmJitHelper a;
    uint64_t result = 0;

    auto RtlRbRemoveNode = _process.modules().GetExport(
        _process.modules().GetModule( L"ntdll.dll" ), "RtlRbRemoveNode" ).procAddress;

    a.GenPrologue();
    a.GenCall( static_cast<uintptr_t>(RtlRbRemoveNode),
    {
        _LdrpModuleIndexBase,
        static_cast<uintptr_t>(ldrEntry)
        + FIELD_OFFSET( _LDR_DATA_TABLE_ENTRY_W8, BaseAddressIndexNode )
    } );

    _process.remote().AddReturnWithEvent( a );
    a.GenEpilogue();

    _process.remote().ExecInWorkerThread( a->make(), a->getCodeSize(), result );

    return ldrEntry;
}

}


text:
use super::merge_iter::MergeIterInner;
use super::node::{self, Root};
use core::iter::FusedIterator;

impl<K, V> Root<K, V> {
    /// Appends all key-value pairs from the union of two ascending iterators,
    /// incrementing a `length` variable along the way. The latter makes it
    /// easier for the caller to avoid a leak when a drop handler panicks.
    ///
    /// If both iterators produce the same key, this method drops the pair from
    /// the left iterator and appends the pair from the right iterator.
    ///
    /// If you want the tree to end up in a strictly ascending order, like for
    /// a `BTreeMap`, both iterators should produce keys in strictly ascending
    /// order, each greater than all keys in the tree, including any keys
    /// already in the tree upon entry.
    pub fn append_from_sorted_iters<I>(&mut self, left: I, right: I, length: &mut usize)
    where
        K: Ord,
        I: Iterator<Item = (K, V)> + FusedIterator,
    {
        // We prepare to merge `left` and `right` into a sorted sequence in linear time.
        let iter = MergeIter(MergeIterInner::new(left, right));

        // Meanwhile, we build a tree from the sorted sequence in linear time.
        self.bulk_push(iter, length)
    }

    /// Pushes all key-value pairs to the end of the tree, incrementing a
    /// `length` variable along the way. The latter makes it easier for the
    /// caller to avoid a leak when the iterator panicks.
    pub fn bulk_push<I>(&mut self, iter: I, length: &mut usize)
    where
        I: Iterator<Item = (K, V)>,
    {
        let mut cur_node = self.borrow_mut().last_leaf_edge().into_node();
        // Iterate through all key-value pairs, pushing them into nodes at the right level.
        for (key, value) in iter {
            // Try to push key-value pair into the current leaf node.
            if cur_node.len() < node::CAPACITY {
                cur_node.push(key, value);
            } else {
                // No space left, go up and push there.
                let mut open_node;
                let mut test_node = cur_node.forget_type();
                loop {
                    match test_node.ascend() {
                        Ok(parent) => {
                            let parent = parent.into_node();
                            if parent.len() < node::CAPACITY {
                                // Found a node with space left, push here.
                                open_node = parent;
                                break;
                            } else {
                                // Go up again.
                                test_node = parent.forget_type();
                            }
                        }
                        Err(_) => {
                            // We are at the top, create a new root node and push there.
                            open_node = self.push_internal_level();
                            break;
                        }
                    }
                }

                // Push key-value pair and new right subtree.
                let tree_height = open_node.height() - 1;
                let mut right_tree = Root::new();
                for _ in 0..tree_height {
                    right_tree.push_internal_level();
                }
                open_node.push(key, value, right_tree);

                // Go down to the right-most leaf again.
                cur_node = open_node.forget_type().last_leaf_edge().into_node();
            }

            // Increment length every iteration, to make sure the map drops
            // the appended elements even if advancing the iterator panicks.
            *length += 1;
        }
        self.fix_right_border_of_plentiful();
    }
}

// An iterator for merging two sorted sequences into one
struct MergeIter<K, V, I: Iterator<Item = (K, V)>>(MergeIterInner<I>);

impl<K: Ord, V, I> Iterator for MergeIter<K, V, I>
where
    I: Iterator<Item = (K, V)> + FusedIterator,
{
    type Item = (K, V);

    /// If two keys are equal, returns the key-value pair from the right source.
    fn next(&mut self) -> Option<(K, V)> {
        let (a_next, b_next) = self.0.nexts(|a: &(K, V), b: &(K, V)| K::cmp(&a.0, &b.0));
        b_next.or(a_next)
    }
}


text:
diff between today and yesterday

#### python
* [hoveeman/music-cards](https://github.com/hoveeman/music-cards): Use RFID to call a curl command to homeassistant to play a Google Play playlist
* [FutunnOpen/futuquant](https://github.com/FutunnOpen/futuquant):  API
* [bennorth/pyawssfn](https://github.com/bennorth/pyawssfn): Tools for converting Python code to AWS Step Function json
* [hindupuravinash/the-gan-zoo](https://github.com/hindupuravinash/the-gan-zoo): A list of all named GANs!
* [toddmotto/public-apis](https://github.com/toddmotto/public-apis): A collective list of public JSON APIs for use in web development.
* [ansible/ansible](https://github.com/ansible/ansible): Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.
* [taehoonlee/tensornets](https://github.com/taehoonlee/tensornets): High level network definitions with pre-trained weights in TensorFlow
* [pallets/flask](https://github.com/pallets/flask): The Python micro framework for building web applications.
* [django/django](https://github.com/django/django): The Web framework for perfectionists with deadlines.

#### go
* [jessfraz/tdash](https://github.com/jessfraz/tdash): A terminal dashboard with stats from Google Analytics, GitHub, Travis CI, and Jenkins. Very much built specific to me.
* [ribice/gorsk](https://github.com/ribice/gorsk):  Idiomatic Golang Restful Starter Kit
* [gizak/termui](https://github.com/gizak/termui): Golang terminal dashboard
* [oxequa/grace](https://github.com/oxequa/grace): Handle recover, panic, and errors in a graceful way. Multiple errors support, basic filters and custom handlers.
* [moby/moby](https://github.com/moby/moby): Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
* [openfaas/faas](https://github.com/openfaas/faas): OpenFaaS - Serverless Functions Made Simple for Docker & Kubernetes
* [prometheus/prometheus](https://github.com/prometheus/prometheus): The Prometheus monitoring system and time series database.
* [ipfs/go-ipfs](https://github.com/ipfs/go-ipfs): IPFS implementation in go

#### cpp
* [Microsoft/WSL-DistroLauncher](https://github.com/Microsoft/WSL-DistroLauncher): Sample/reference launcher app for WSL distro Microsoft Store packages.
* [zig-lang/zig](https://github.com/zig-lang/zig): robust, optimal, and clear programming language
* [brpc/brpc](https://github.com/brpc/brpc): Industrial-grade RPC framework used throughout Baidu, with 1,000,000+ instances and thousands kinds of services, called "baidu-rpc" inside Baidu.
* [Lallassu/voxelengine_urho3d](https://github.com/Lallassu/voxelengine_urho3d): Voxel engine in C++ using Urho3D
* [RPCS3/rpcs3](https://github.com/RPCS3/rpcs3): PS3 emulator/debugger
* [Microsoft/CNTK](https://github.com/Microsoft/CNTK): Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
* [ocornut/imgui](https://github.com/ocornut/imgui): Dear ImGui: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies
* [cmderdev/cmder](https://github.com/cmderdev/cmder): Lovely console emulator package for Windows
* [rttrorg/rttr](https://github.com/rttrorg/rttr): C++ Reflection Library

#### javascript
* [onivim/oni](https://github.com/onivim/oni): Oni: Modern Modal Editing - powered by Neovim
* [drcmda/react-spring](https://github.com/drcmda/react-spring):  Helping react-motion and animated to become best friends
* [hugomd/parrot.live](https://github.com/hugomd/parrot.live):  Bringing animated parrots to terminals everywhere
* [BrainJS/brain.js](https://github.com/BrainJS/brain.js):  Neural networks in JavaScript
* [vuejs/vue](https://github.com/vuejs/vue):  A progressive, incrementally-adoptable JavaScript framework for building UI on the web.
* [appbaseio/dejavu](https://github.com/appbaseio/dejavu): The Missing Web UI for Elasticsearch
* [i5ting/How-to-learn-node-correctly](https://github.com/i5ting/How-to-learn-node-correctly): []Node.js
* [facebook/react](https://github.com/facebook/react): A declarative, efficient, and flexible JavaScript library for building user interfaces.
* [kamranahmedse/driver.js](https://github.com/kamranahmedse/driver.js): A light-weight, no-dependency, vanilla JavaScript engine to drive the user's focus across the page
* [facebook/create-react-app](https://github.com/facebook/create-react-app): Create React apps with no build configuration.
* [youzan/vant](https://github.com/youzan/vant): A Vue.js 2.0 Mobile UI at YouZan
* [Tencent/wepy](https://github.com/Tencent/wepy):
* [quickappdev/awesome-quickapp](https://github.com/quickappdev/awesome-quickapp):
* [GoogleChrome/puppeteer](https://github.com/GoogleChrome/puppeteer): Headless Chrome Node API
* [Meituan-Dianping/mpvue](https://github.com/Meituan-Dianping/mpvue):  Vue.js  Vue.js
* [youzan/zanui-weapp](https://github.com/youzan/zanui-weapp):  UI Powered by
* [axios/axios](https://github.com/axios/axios): Promise based HTTP client for the browser and node.js
* [justjavac/free-programming-books-zh_CN](https://github.com/justjavac/free-programming-books-zh_CN):
* [Kenshin/simpread](https://github.com/Kenshin/simpread):  ( SimpRead ) -  Chrome extension
* [CompuIves/codesandbox-client](https://github.com/CompuIves/codesandbox-client): An online code editor tailored for web application development
* [pshihn/rough](https://github.com/pshihn/rough): Create graphics with a hand-drawn, sketchy, appearance
* [sindresorhus/fkill-cli](https://github.com/sindresorhus/fkill-cli): Fabulously kill processes. Cross-platform.
* [d3/d3](https://github.com/d3/d3): Bring data to life with SVG, Canvas and HTML.
* [airbnb/javascript](https://github.com/airbnb/javascript): JavaScript Style Guide
* [reactjs/redux](https://github.com/reactjs/redux): Predictable state container for JavaScript apps

#### coffeescript
* [genieacs/genieacs](https://github.com/genieacs/genieacs): A fast and lightweight TR-069 Auto Configuration Server (ACS)
* [slackapi/hubot-slack](https://github.com/slackapi/hubot-slack): Slack Developer Kit for Hubot
* [turbolinks/turbolinks-classic](https://github.com/turbolinks/turbolinks-classic): Classic version of Turbolinks. Now deprecated in favor of Turbolinks 5.
* [NarrativeScience/Log.io](https://github.com/NarrativeScience/Log.io): Real-time log monitoring in your browser


text:
# Hanami::Assets

Assets management for Ruby web projects

## Status

[![Gem Version](https://badge.fury.io/rb/hanami-assets.svg)](https://badge.fury.io/rb/hanami-assets)
[![CI](https://github.com/hanami/assets/workflows/ci/badge.svg?branch=master)](https://github.com/hanami/assets/actions?query=workflow%3Aci+branch%3Amaster)
[![Test Coverage](https://codecov.io/gh/hanami/assets/branch/master/graph/badge.svg)](https://codecov.io/gh/hanami/assets)
[![Depfu](https://badges.depfu.com/badges/4b37347bd74042ff96477495cc16531d/overview.svg)](https://depfu.com/github/hanami/assets?project=Bundler)
[![Inline Docs](http://inch-ci.org/github/hanami/assets.svg)](http://inch-ci.org/github/hanami/assets)

## Contact

* Home page: http://hanamirb.org
* Community: http://hanamirb.org/community
* Guides: https://guides.hanamirb.org
* Mailing List: http://hanamirb.org/mailing-list
* API Doc: http://rdoc.info/gems/hanami-assets
* Bugs/Issues: https://github.com/hanami/assets/issues
* Support: http://stackoverflow.com/questions/tagged/hanami
* Forum: https://discuss.hanamirb.org
* Chat: http://chat.hanamirb.org

## Rubies

__Hanami::Assets__ supports Ruby (MRI) 2.3+ and JRuby 9.1.5.0+

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'hanami-assets'
```

And then execute:

```shell
$ bundle
```

Or install it yourself as:

```shell
$ gem install hanami-assets
```

## Usage

### Helpers

`Hanami::Assets` provides asset-specific helpers to be used in templates.
They resolve one or multiple sources into corresponding HTML tags.
Those sources can be either a name of a local asset or an absolute URL.

Given the following template:

```erb
<!doctype HTML>
<html>
  <head>
    <title>Assets example</title>
    <%= stylesheet 'reset', 'grid', 'main' %>
  </head>

  <body>
  <!-- ... -->
  <%= javascript 'https://code.jquery.com/jquery-2.1.1.min.js', 'application' %>
  <%= javascript 'modals' %>
  </body>
</html>
```

It will output this markup:

```html
<!doctype HTML>
<html>
  <head>
    <title>Assets example</title>
    <link href="/assets/reset.css" type="text/css" rel="stylesheet">
    <link href="/assets/grid.css" type="text/css" rel="stylesheet">
    <link href="/assets/main.css" type="text/css" rel="stylesheet">
  </head>

  <body>
  <!-- ... -->
  <script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script>
  <script src="/assets/application.js" type="text/javascript"></script>
  <script src="/assets/modals.js" type="text/javascript"></script>
  </body>
</html>
```

Let's have a look at the corresponding Ruby code.
In this example we use ERb, but remember that `Hanami::Assets` is compatible with
all the rendering engines such as HAML, Slim, Mustache, etc..

```ruby
require 'erb'
require 'hanami/assets'
require 'hanami/assets/helpers'

class View
  include Hanami::Assets::Helpers

  def initialize
    @template = File.read('template.erb')
    @engine   = ERB.new(@template)
  end

  def render
    @engine.result(binding)
  end
end

View.new.render # => HTML markup
```

For advanced configurations, please have a look at
[`Hanami::Assets::Configuration`](https://github.com/hanami/assets/blob/master/lib/hanami/assets/configuration.rb).

### Available Helpers

This gem ships with the following helpers:

  * `javascript`
  * `stylesheet`
  * `favicon`
  * `image`
  * `video`
  * `audio`
  * `asset_path`
  * `asset_url`

### Development mode

`Hanami::Assets` can help you during the development process of your application.
It can manage multiple source directories for each asset type or run a
preprocessor for you.

#### Sources

Imagine to have your application's javascripts under `app/assets/javascripts` and that
those assets depends on a vendored version of jQuery.

```ruby
require 'hanami/assets'

Hanami::Assets.configure do
  compile true

  sources << [
    'app/assets',
    'vendor/jquery'
  ]
end
```

When from a template you do:

```erb
<%= javascript 'jquery', 'jquery-ui', 'login' %>
```

`Hanami::Assets` looks at the defined sources and **lazily copies** those files
under `public/assets` (by default), before the markup is generated.

Your public directory will have the following structure.

```shell
% tree public
public/
└── assets
    ├── jquery.js
    ├── jquery-ui.js
    └── login.js

```

**Please remember that sources are recursively looked up in order of declaration.**

If in the example above we had a `jquery.js` under `app/assets/javascripts/**/*.js`
that file would be copied into the public directory instead of the one under
`vendor/jquery`. The reason is because we declared `app/assets/javascripts` first.

#### Preprocessors

`Hanami::Assets` is able to run assets preprocessors and **lazily compile** them
under `public/assets` (by default), before the markup is generated.

Imagine you have `main.css.scss` under `app/assets/stylesheets` and `reset.css` under
`vendor/stylesheets`.

**The two extensions are important.**
The first one is mandatory and it's used to understand which asset type we are
handling: `.css` for stylesheets.
The second one is optional and it's for a preprocessor: `.scss` for Sass.

```ruby
require 'sassc'
require 'hanami/assets'

Hanami::Assets.configure do
  compile true

  sources << [
    'assets',
    'vendor/assets'
  ]
end
```

And in a template you can use the `stylesheet` helper:

```erb
<%= stylesheet 'reset', 'main' %>
```

Your public directory will look like this:

```shell
% tree public
public/
└── assets
    ├── reset.css
    └── main.css
```

### Preprocessors engines

`Hanami::Assets` uses [Tilt](https://github.com/rtomayko/tilt) to provide support for the most common preprocessors, such as [Sass](http://sass-lang.com/) (including `sassc-ruby`), [Less](http://lesscss.org/), [ES6](https://babeljs.io/), [JSX](https://jsx.github.io/), [CoffeScript](http://coffeescript.org), [Opal](http://opalrb.com), [Handlebars](http://handlebarsjs.com), [JBuilder](https://github.com/rails/jbuilder).

In order to use one or more of them, be sure to add the corresponding gem to your `Gemfile` and require the library.

#### EcmaScript 6

We strongly suggest you use [EcmaScript 6](http://es6-features.org/) for your next project.
It isn't fully [supported](https://kangax.github.io/compat-table/es6/) yet by browsers, but it's the future of JavaScript.

As of today, you need to 'transpile' ES6 code into ES5, which current browsers understand.
The most popular tool for this is [Babel](https://babeljs.io), which we support.

### Deployment

`Hanami::Assets` ships with an executable (`hanami-assets`), which can be used to precompile assets and make them cacheable by browsers (via checksum suffix).

__NOTE__: If you're using `Hanami::Assets` with the full `Hanami` framework, you should use `bundle exec hanami assets precompile` instead of `hanami-assets`.

Let's say we have an application that has a main file that requires the entire codebase (`config/environment.rb`), a gem that brings in Ember.js code, and the following sources:

```shell
% tree .
├── apps
│   ├── admin
│   │   ├── assets
│   │   │   └── js
│   │   │       ├── application.js
│   │   │       └── zepto.js
# ...
│   ├── metrics
│   │   ├── assets
│   │   │   └── javascripts
│   │   │       └── dashboard.js
# ...
│   └── web
│       ├── assets
│       │   ├── images
│       │   │   └── bookshelf.jpg
│       │   └── javascripts
│       │       └── application.js
# ...
│       └── vendor
│           └── assets
│               └── javascripts
│                   └── jquery.js
└── config
    └── environment.rb
```

In order to deploy, we can run:

```shell
bundle exec hanami-assets --config=config/environment.rb
```

It will output:

```shell
tree public
public
├── assets
│   ├── admin
│   │   ├── application-28a6b886de2372ee3922fcaf3f78f2d8.js
│   │   ├── application.js
│   │   ├── ember-b2d6de1e99c79a0e52cf5c205aa2e07a.js
│   │   ├── ember-source-e74117fc6ba74418b2601ffff9eb1568.js
│   │   ├── ember-source.js
│   │   ├── ember.js
│   │   ├── zepto-ca736a378613d484138dec4e69be99b6.js
│   │   └── zepto.js
│   ├── application-d1829dc353b734e3adc24855693b70f9.js
│   ├── application.js
│   ├── bookshelf-237ecbedf745af5a477e380f0232039a.jpg
│   ├── bookshelf.jpg
│   ├── ember-b2d6de1e99c79a0e52cf5c205aa2e07a.js
│   ├── ember-source-e74117fc6ba74418b2601ffff9eb1568.js
│   ├── ember-source.js
│   ├── ember.js
│   ├── jquery-05277a4edea56b7f82a4c1442159e183.js
│   ├── jquery.js
│   └── metrics
│       ├── dashboard-7766a63ececc63a7a629bfb0666e9c62.js
│       ├── dashboard.js
│       ├── ember-b2d6de1e99c79a0e52cf5c205aa2e07a.js
│       ├── ember-source-e74117fc6ba74418b2601ffff9eb1568.js
│       ├── ember-source.js
│       └── ember.js
└── assets.json
```

#### Compressors

Minification is a process that shrinks file size in production, by removing unnecessary spaces and characters.
The goal of this step is to have lighter assets, which will be served faster to browsers.

Hanami supports JavaScript and stylesheet minifiers.

Because this framework relies on external gems for minification, this feature is **turned off by default**.

To use minification, we need to specify which gem we want to use and add it to our `Gemfile`.

##### JavaScript Compressors

Hanami can use the following compressors (aka minifiers) for JavaScript.

  * `:builtin` - Ruby based implementation of jsmin. It doesn't require any external gem.
  * `:yui` - [YUI Compressor](http://yui.github.io/yuicompressor), it depends on [`yui-compressor`](https://rubygems.org/gems/yui-compressor) gem and it requires Java 1.4+
  * `:uglifier` - [UglifyJS](http://lisperator.net/uglifyjs), it depends on [`uglifier`](https://rubygems.org/gems/uglifier) gem and it requires Node.js
  * `:closure` - [Google Closure Compiler](https://developers.google.com/closure/compiler), it depends on [`closure-compiler`](https://rubygems.org/gems/closure-compiler) gem and it requires Java

```ruby
Hanami::Assets.configure do
  javascript_compressor :uglifier
end
```

##### Stylesheet Compressors

Hanami can use the following compressors (aka minifiers) for stylesheets.

  * `:builtin` - Ruby based compressor. It doesn't require any external gem. It's fast, but not an efficient compressor.
  * `:yui` - [YUI Compressor](http://yui.github.io/yuicompressor), it depends on [`yui-compressor`](https://rubygems.org/gems/yui-compressor) gem and it requires Java 1.4+
  * `:sass` - [Sass](http://sass-lang.com/), it depends on [`sassc`](https://rubygems.org/gems/sassc) gem

```ruby
Hanami::Assets.configure do
  stylesheet_compressor :sass
end
```

##### Custom Compressors

We can specify our own minifiers:

```ruby
Hanami::Assets.configure do
  javascript_compressor MyJavascriptCompressor.new
  stylesheet_compressor MyStylesheetCompressor.new
end
```

### Fingerprint Mode

This is a mode that can be activated via configuration and it's suitable for production environments.
When generating files, it adds a string to the end of each file name, which is a [checksum](https://en.wikipedia.org/wiki/Checksum) of its contents.
This lets you leverage caching while still ensuring that clients get the most up-to-date assets (this is known as *cache busting*).

```ruby
Hanami::Assets.configure do
  fingerprint true
end
```

Once turned on, it will look at `/public/assets.json`, and helpers such as `javascript` will return a relative URL that includes the fingerprint of the asset.

```erb
<%= javascript 'application' %>
```

```html
<script src="/assets/application-d1829dc353b734e3adc24855693b70f9.js" type="text/javascript"></script>
```

### Subresource Integrity (SRI) Mode

This is a mode that can be activated via the configuration and it's suitable for production environments.

```ruby
Hanami::Assets.configure do
  subresource_integrity true
end
```

Once turned on, it will look at `/public/assets.json`, and helpers such as `javascript` will include an `integrity` and `crossorigin` attribute.

```erb
<%= javascript 'application' %>
```

```html
<script src="/assets/application-d1829dc353b734e3adc24855693b70f9.js" type="text/javascript" integrity="sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC" crossorigin="anonymous"></script>
```

### CDN Mode

A Hanami project can serve assets via a Content Delivery Network (CDN).

```ruby
Hanami::Assets.configure do
  scheme 'https'
  host   '123.cloudfront.net'
  port   443
  cdn    true
end
```

From now on, helpers will return the absolute URL for the asset, hosted on the CDN specified.

```erb
<%= javascript 'application' %>
```

```html
<script src="https://123.cloudfront.net/assets/application-d1829dc353b734e3adc24855693b70f9.js" type="text/javascript"></script>
```

## Standalone mode

If you're using `hanami-assets` without `hanami`, you must explicitly boot the framework with:

```ruby
Hanami::Assets.configure do
  # ...
end.load!
```

or

```ruby
Hanami::Assets.configure do
  # ...
end

# ...

Hanami::Assets.load!
```

## Third party gems

Developers can maintain gems that distribute assets for Hanami. For instance `hanami-ember` or `hanami-jquery`.

To do this, inside your gem you have tell `Hanami::Assets` where to look for assets:

```ruby
# lib/hanami/jquery.rb
Hanami::Assets.sources << '/path/to/jquery'
```

## Running tests

  * Make sure you have one of [ExecJS](https://github.com/rails/execjs)
supported runtime on your machine.
  * Java 1.4+ (for YUI Compressor and Google Closure Compiler)

```sh
bundle exec rake test
```

## Versioning

__Hanami::Assets__ uses [Semantic Versioning 2.0.0](http://semver.org)

## Contributing

1. Fork it ( https://github.com/hanami/assets/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## Copyright

Copyright © 2014-2021 Luca Guidi – Released under MIT License

This project was formerly known as Lotus (`lotus-assets`).


text:
<?php

	/*
  		Защита от прямой загрузки
	*/
	defined('ACCESS') or die();

	header('Content-type: text/json; charset='.Manager::$conf['general.char_set']);

	$fileArray = array();
	foreach ($_POST as $key => $value) {
		if ($key != 'folder' && !empty($value)) {
			$f = FileManager::clear_path(Manager::$conf['filesystem.files_abs_path'].$_POST['folder'].$value);
			if (file_exists(FileManager::convertToFileSystem($f))){
				$fileArray [] = $key;
			}
		}
	}
	echo json_encode($fileArray);
?>


text:
{% extends "base.html" %}

{% block css %}

{% endblock %}

{% block content %}

{{ title }}

        {% for paragraphs in content %}

{{ paragraphs|join:" " }}

        {% endfor %}

{% endblock %}

{% block javascript %}

{% endblock %}


text:
<?php
/**
 * User: zach
 * Date: 06/04/2013
 * Time: 13:33:19 pm
 */

namespace Elasticsearch\Endpoints\Indices;

use Elasticsearch\Endpoints\AbstractEndpoint;
use Elasticsearch\Common\Exceptions;

/**
 * Class Refresh
 * @package Elasticsearch\Endpoints\Indices
 */
class Refresh extends AbstractEndpoint
{

    /**
     * @return string
     */
    protected function getURI()
    {

        $index = $this->index;
        $uri   = "/_refresh";

        if (isset($index) === true) {
            $uri = "/$index/_refresh";
        }

        return $uri;
    }

    /**
     * @return string[]
     */
    protected function getParamWhitelist()
    {
        return array(
            'ignore_indices',
            'operation_threading',
        );
    }

    /**
     * @return string
     */
    protected function getMethod()
    {
        return 'POST';
    }
}


text:
import {Injectable} from "angular2/core";
import {IProduct} from "./product";
import {Http, Response} from "angular2/http";
import {Observable} from "rxjs/Observable";

@Injectable()
export class ProductService{
    private _productUrl = 'api/products/products.json';

    constructor(private _http: Http){}

    getProducts():Observable<IProduct[]>{
        // it is interesting that by default http deals with Observable objects
        return this._http.get(this._productUrl)
            .map((response: Response) => <IProduct[]>response.json())
            .do(data => console.log("All: " + JSON.stringify(data)))
            .catch(this.handleError);
    }

    private handleError(error: Response){
        console.error(error);
        return Observable.throw(error.json().error || 'Server error');
    }
}


text:
// Copyright 2007 Konrad Twardowski
//
// 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.

package org.makagiga.editors;

import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.util.List;
import javax.swing.JComponent;

/**
 * @since 2.0
 */
public interface EditorAnnotation {

	// public

	/**
	 * @since 3.8.7
	 */
	public static final int ANNOTATION_BAR_LAYOUT_WEST = 1;

	/**
	 * @since 4.0
	 */
	public static final int ANNOTATION_BAR_LAYOUT_SOUTH = 1 << 1;

	// public

	public void addAnnotation(final AnnotationInfo info);

	public void removeAnnotation(final AnnotationInfo info);

	public void editAnnotation(final AnnotationInfo info);

	public List<AnnotationInfo> getAnnotations();

	public int getAnnotationCapabilities();

	public AnnotationInfo newAnnotation();

	/**
	 * @since 3.0
	 */
	public void paintAnnotations(final JComponent c, final Graphics2D g, final Rectangle view);

	public void updateAnnotationBar();

}


text:
<?php

namespace SensioLabs\Insight\Cli\Descriptor;

use SensioLabs\Insight\Sdk\Model\Analysis;
use SensioLabs\Insight\Sdk\Model\Violation;

class PmdDescriptor extends AbstractDescriptor
{
    const PHPMD_PRIORITY_HIGH = 1;
    const PHPMD_PRIORITY_MEDIUM_HIGH = 2;
    const PHPMD_PRIORITY_MEDIUM = 3;
    const PHPMD_PRIORITY_MEDIUM_LOW = 4;
    const PHPMD_PRIORITY_LOW = 5;

    protected function describeAnalysis(Analysis $analysis, array $options = [])
    {
        $output = $options['output'];

        $xml = new \DOMDocument('1.0', 'UTF-8');
        $xpath = new \DOMXPath($xml);

        $xml->formatOutput = true;
        $xml->preserveWhiteSpace = true;

        $pmd = $xml->createElement('pmd');
        $pmd->setAttribute('timestamp', $analysis->getEndAt()->format('c'));

        $xml->appendChild($pmd);

        $violations = $analysis->getViolations();
        if ($violations) {
            foreach ($violations as $violation) {
                /*
                 * @var $violation \SensioLabs\Insight\Sdk\Model\Violation
                 */
                $filename = $violation->getResource();

                $nodes = $xpath->query(sprintf('//file[@name="%s"]', $filename));

                if ($nodes->length > 0) {
                    $node = $nodes->item(0);
                } else {
                    $node = $xml->createElement('file');
                    $node->setAttribute('name', $filename);

                    $pmd->appendChild($node);
                }

                $violationNode = $xml->createElement('violation', $violation->getMessage());
                $node->appendChild($violationNode);

                $violationNode->setAttribute('beginline', $violation->getLine());
                $violationNode->setAttribute('endline', $violation->getLine());
                $violationNode->setAttribute('rule', $violation->getTitle());
                $violationNode->setAttribute('ruleset', $violation->getCategory());
                $violationNode->setAttribute('priority', $this->getPriority($violation));
            }
        }

        $output->writeln($xml->saveXML());
    }

    private function getPriority(Violation $violation)
    {
        switch ($violation->getSeverity()) {
            case 'critical':
                return self::PHPMD_PRIORITY_HIGH;

            case 'major':
                return self::PHPMD_PRIORITY_MEDIUM;

            default:
                return self::PHPMD_PRIORITY_LOW;
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>flight</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width">
    <link rel="stylesheet" href="/bower_components/components-bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/bower_components/components-bootstrap/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="/css/main.css">

    <form class="js-add-task form-inline">
      Add a task

        <input type="text" placeholder="description" class="js-add-task-description" />
        <input type="submit" class="js-add-task-submit btn btn-primary" />

    </form>


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.google.android.work.emmnotifications</groupId>
  <artifactId>emm-notifications</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>emm-notifications</name>
  <url>http://maven.apache.org</url>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <version>0.5.0</version>
        <configuration>
          <protocExecutable>/usr/local/bin/protoc</protocExecutable>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>test-compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
	<artifactId>maven-assembly-plugin</artifactId>
	<configuration>
          <archive>
            <manifest>
              <mainClass>fully.qualified.MainClass</mainClass>
            </manifest>
          </archive>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
	</configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <version>2.6.1</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.apis</groupId>
      <artifactId>google-api-services-pubsub</artifactId>
      <version>LATEST</version>
    </dependency>
    <dependency>
      <groupId>com.google.api-client</groupId>
      <artifactId>google-api-client</artifactId>
      <version>1.18.0-rc</version>
    </dependency>
    <dependency>
      <groupId>com.google.oauth-client</groupId>
      <artifactId>google-oauth-client-java6</artifactId>
      <version>1.15.0-rc</version>
    </dependency>
    <dependency>
      <groupId>com.google.http-client</groupId>
      <artifactId>google-http-client-jackson2</artifactId>
      <version>1.19.0</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>18.0</version>
    </dependency>
    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
      <version>1.2</version>
    </dependency>
  </dependencies>
</project>


text: keyless door entry utilizing android phone and Google play secure content locker


text:
// Basic class for applying a mel-scale mapping to a power spectrum.

#ifndef THIRD_PARTY_TENSORFLOW_CORE_KERNELS_MFCC_MEL_FILTERBANK_H_
#define THIRD_PARTY_TENSORFLOW_CORE_KERNELS_MFCC_MEL_FILTERBANK_H_

#include <vector>
#include "tensorflow/core/framework/op_kernel.h"

namespace tensorflow {

class MfccMelFilterbank {
 public:
  MfccMelFilterbank();
  bool Initialize(int input_length,  // Number of unique FFT bins fftsize/2+1.
                  double input_sample_rate,
                  int output_channel_count,
                  double lower_frequency_limit,
                  double upper_frequency_limit);

  // Takes a squared-magnitude spectrogram slice as input, computes a
  // triangular-mel-weighted linear-magnitude filterbank, and places the result
  // in output.
  void Compute(const std::vector<double>& input,
               std::vector<double>* output) const;

 private:
  double FreqToMel(double freq) const;
  bool initialized_;
  int num_channels_;
  double sample_rate_;
  int input_length_;
  std::vector<double> center_frequencies_;  // In mel, for each mel channel.

  // Each FFT bin b contributes to two triangular mel channels, with
  // proportion weights_[b] going into mel channel band_mapper_[b], and
  // proportion (1 - weights_[b]) going into channel band_mapper_[b] + 1.
  // Thus, weights_ contains the weighting applied to each FFT bin for the
  // upper-half of the triangular band.
  std::vector<double> weights_;  // Right-side weight for this fft  bin.

  // FFT bin i contributes to the upper side of mel channel band_mapper_[i]
  std::vector<int> band_mapper_;
  int start_index_;  // Lowest FFT bin used to calculate mel spectrum.
  int end_index_;  // Highest FFT bin used to calculate mel spectrum.

  TF_DISALLOW_COPY_AND_ASSIGN(MfccMelFilterbank);
};

}  // namespace tensorflow

#endif  // THIRD_PARTY_TENSORFLOW_CORE_KERNELS_MFCC_MEL_FILTERBANK_H_