text:
require 'base64'
require 'uri'
require 'json'
require 'omniauth'
require 'omniauth/auth0/errors'

module OmniAuth
  module Auth0
    # JWT Validator class
    class JWTValidator
      attr_accessor :issuer, :domain

      # Initializer
      # @param options object
      #   options.domain - Application domain.
      #   options.issuer - Application issuer (optional).
      #   options.client_id - Application Client ID.
      #   options.client_secret - Application Client Secret.

      def initialize(options, authorize_params = {})
        @domain = uri_string(options.domain)

        # Use custom issuer if provided, otherwise use domain
        @issuer = @domain
        @issuer = uri_string(options.issuer) if options.respond_to?(:issuer)

        @client_id = options.client_id
        @client_secret = options.client_secret
      end

      # Verify a token's signature. Only tokens signed with the RS256 or HS256 signatures are supported.
      # Deprecated: Please use `decode` instead
      # @return array - The token's key and signing algorithm
      def verify_signature(jwt)
        head = token_head(jwt)
        key, alg = extract_key(head)

        # Call decode to verify the signature
        JWT.decode(jwt, key, true, decode_opts(alg))
        return key, alg
      end

      # Decodes a JWT and verifies it's signature. Only tokens signed with the RS256 or HS256 signatures are supported.
      # @param jwt string - JWT to verify.
      # @return hash - The decoded token, if there were no exceptions.
      # @see https://github.com/jwt/ruby-jwt
      def decode(jwt)
        head = token_head(jwt)
        key, alg = extract_key(head)

        # Call decode to verify the signature
        JWT.decode(jwt, key, true, decode_opts(alg))
      end

      # Verify a JWT.
      # @param jwt string - JWT to verify.
      # @param authorize_params hash - Authorization params to verify on the JWT
      # @return hash - The verified token payload, if there were no exceptions.
      def verify(jwt, authorize_params = {})
        if !jwt
          raise OmniAuth::Auth0::TokenValidationError.new('ID token is required but missing')
        end

        parts = jwt.split('.')
        if parts.length != 3
          raise OmniAuth::Auth0::TokenValidationError.new('ID token could not be decoded')
        end

        id_token, header = decode(jwt)
        verify_claims(id_token, authorize_params)

        return id_token
      end

      # Get the decoded head segment from a JWT.
      # @return hash - The parsed head of the JWT passed, empty hash if not.
      def token_head(jwt)
        jwt_parts = jwt.split('.')
        return {} if blank?(jwt_parts) || blank?(jwt_parts[0])

        json_parse(Base64.decode64(jwt_parts[0]))
      end

      # Get the JWKS from the issuer and return a public key.
      # @param x5c string - X.509 certificate chain from a JWKS.
      # @return key - The X.509 certificate public key.
      def jwks_public_cert(x5c)
        x5c = Base64.decode64(x5c)

        # https://docs.ruby-lang.org/en/2.4.0/OpenSSL/X509/Certificate.html
        OpenSSL::X509::Certificate.new(x5c).public_key
      end

      # Return a specific key from a JWKS object.
      # @param key string - Key to find in the JWKS.
      # @param kid string - Key ID to identify the right JWK.
      # @return nil|string
      def jwks_key(key, kid)
        return nil if blank?(jwks[:keys])

        matching_jwk = jwks[:keys].find { |jwk| jwk[:kid] == kid }
        matching_jwk[key] if matching_jwk
      end

      private
      # Get the JWT decode options. We disable the claim checks since we perform our claim validation logic
      # Docs: https://github.com/jwt/ruby-jwt
      # @return hash
      def decode_opts(alg)
        {
          algorithm: alg,
          verify_expiration: false,
          verify_iat: false,
          verify_iss: false,
          verify_aud: false,
          verify_jti: false,
          verify_subj: false,
          verify_not_before: false
        }
      end

      def extract_key(head)
        if head[:alg] == 'RS256'
          key, alg = [rs256_decode_key(head[:kid]), head[:alg]]
        elsif head[:alg] == 'HS256'
          key, alg = [@client_secret, head[:alg]]
        else
          raise OmniAuth::Auth0::TokenValidationError.new("Signature algorithm of #{head[:alg]} is not supported. Expected the ID token to be signed with RS256 or HS256")
        end
      end

      def rs256_decode_key(kid)
        jwks_x5c = jwks_key(:x5c, kid)

        if jwks_x5c.nil?
          raise OmniAuth::Auth0::TokenValidationError.new("Could not find a public key for Key ID (kid) '#{kid}'")
        end

        jwks_public_cert(jwks_x5c.first)
      end

      # Get a JWKS from the domain
      # @return void
      def jwks
        jwks_uri = URI(@domain + '.well-known/jwks.json')
        @jwks ||= json_parse(Net::HTTP.get(jwks_uri))
      end

      # Rails Active Support blank method.
      # @param obj object - Object to check for blankness.
      # @return boolean
      def blank?(obj)
        obj.respond_to?(:empty?) ? obj.empty? : !obj
      end

      # Parse JSON with symbolized names.
      # @param json string - JSON to parse.
      # @return hash
      def json_parse(json)
        JSON.parse(json, symbolize_names: true)
      end

      # Parse a URI into the desired string format
      # @param uri - the URI to parse
      # @return string
      def uri_string(uri)
        temp_domain = URI(uri)
        temp_domain = URI("https://#{uri}") unless temp_domain.scheme
        temp_domain = temp_domain.to_s
        temp_domain.end_with?('/') ? temp_domain : "#{temp_domain}/"
      end

      def verify_claims(id_token, authorize_params)
        leeway = authorize_params[:leeway] || 60
        max_age = authorize_params[:max_age]
        nonce = authorize_params[:nonce]
        organization = authorize_params[:organization]

        verify_iss(id_token)
        verify_sub(id_token)
        verify_aud(id_token)
        verify_expiration(id_token, leeway)
        verify_iat(id_token)
        verify_nonce(id_token, nonce)
        verify_azp(id_token)
        verify_auth_time(id_token, leeway, max_age)
        verify_org(id_token, organization)
      end

      def verify_iss(id_token)
        issuer = id_token['iss']
        if !issuer
          raise OmniAuth::Auth0::TokenValidationError.new("Issuer (iss) claim must be a string present in the ID token")
        elsif @issuer != issuer
          raise OmniAuth::Auth0::TokenValidationError.new("Issuer (iss) claim mismatch in the ID token, expected (#{@issuer}), found (#{id_token['iss']})")
        end
      end

      def verify_sub(id_token)
        subject = id_token['sub']
        if !subject || !subject.is_a?(String) || subject.empty?
          raise OmniAuth::Auth0::TokenValidationError.new('Subject (sub) claim must be a string present in the ID token')
        end
      end

      def verify_aud(id_token)
        audience = id_token['aud']
        if !audience || !(audience.is_a?(String) || audience.is_a?(Array))
          raise OmniAuth::Auth0::TokenValidationError.new("Audience (aud) claim must be a string or array of strings present in the ID token")
        elsif audience.is_a?(Array) && !audience.include?(@client_id)
          raise OmniAuth::Auth0::TokenValidationError.new("Audience (aud) claim mismatch in the ID token; expected #{@client_id} but was not one of #{audience.join(', ')}")
        elsif audience.is_a?(String) && audience != @client_id
          raise OmniAuth::Auth0::TokenValidationError.new("Audience (aud) claim mismatch in the ID token; expected #{@client_id} but found #{audience}")
        end
      end

      def verify_expiration(id_token, leeway)
        expiration = id_token['exp']
        if !expiration || !expiration.is_a?(Integer)
          raise OmniAuth::Auth0::TokenValidationError.new("Expiration time (exp) claim must be a number present in the ID token")
        elsif expiration <= Time.now.to_i - leeway
          raise OmniAuth::Auth0::TokenValidationError.new("Expiration time (exp) claim error in the ID token; current time (#{Time.now}) is after expiration time (#{Time.at(expiration + leeway)})")
        end
      end

      def verify_iat(id_token)
        if !id_token['iat']
          raise OmniAuth::Auth0::TokenValidationError.new("Issued At (iat) claim must be a number present in the ID token")
        end
      end

      def verify_nonce(id_token, nonce)
        if nonce
          received_nonce = id_token['nonce']
          if !received_nonce
            raise OmniAuth::Auth0::TokenValidationError.new("Nonce (nonce) claim must be a string present in the ID token")
          elsif nonce != received_nonce
            raise OmniAuth::Auth0::TokenValidationError.new("Nonce (nonce) claim value mismatch in the ID token; expected (#{nonce}), found (#{received_nonce})")
          end
        end
      end

      def verify_azp(id_token)
        audience = id_token['aud']
        if audience.is_a?(Array) && audience.length > 1
          azp = id_token['azp']
          if !azp || !azp.is_a?(String)
            raise OmniAuth::Auth0::TokenValidationError.new("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values")
          elsif azp != @client_id
            raise OmniAuth::Auth0::TokenValidationError.new("Authorized Party (azp) claim mismatch in the ID token; expected (#{@client_id}), found (#{azp})")
          end
        end
      end

      def verify_auth_time(id_token, leeway, max_age)
        if max_age
          auth_time = id_token['auth_time']
          if !auth_time || !auth_time.is_a?(Integer)
            raise OmniAuth::Auth0::TokenValidationError.new("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified")
          elsif Time.now.to_i >  auth_time + max_age + leeway;
            raise OmniAuth::Auth0::TokenValidationError.new("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (#{Time.now}) is after last auth time (#{Time.at(auth_time + max_age + leeway)})")
          end
        end
      end

      def verify_org(id_token, organization)
        if organization
          org_id = id_token['org_id']
          if !org_id || !org_id.is_a?(String)
            raise OmniAuth::Auth0::TokenValidationError.new("Organization Id (org_id) claim must be a string present in the ID token")
          elsif org_id != organization
            raise OmniAuth::Auth0::TokenValidationError.new("Organization Id (org_id) claim value mismatch in the ID token; expected '#{organization}', found '#{org_id}'")
          end
        end
      end
    end
  end
end


text:
package io.lindstrom.mpd.support;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import io.lindstrom.mpd.data.FrameRate;

import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class FrameRateDeserializer extends JsonDeserializer<FrameRate> {
    private static final Pattern FRAME_RATE_PATTERN = Pattern.compile("^([0-9]+)(/[0-9]+)?$");

    @Override
    public FrameRate deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
        String text = p.getText();
        Matcher matcher = FRAME_RATE_PATTERN.matcher(text);
        if (matcher.matches()) {
            String a = matcher.group(1);
            String b = matcher.group(2);
            return new FrameRate(Long.parseLong(a),
                    b == null ? null : Long.parseLong(b.substring(1)));
        } else {
            ctxt.reportWrongTokenException(this, p.currentToken(), "Invalid ratio");
            return null;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
#include <dlfcn.h>
#include <elf.h>
#include <ldsodefs.h>

/* This is the map for the shared object we profile.  It is defined here
   only because we test for this value being NULL or not.  */

void
_dl_mcount_wrapper (void *selfpc)
{
  GLRO(dl_mcount) ((ElfW(Addr)) RETURN_ADDRESS (0), (ElfW(Addr)) selfpc);
}

void
_dl_mcount_wrapper_check (void *selfpc)
{
  if (GL(dl_profile_map) != NULL)
    GLRO(dl_mcount) ((ElfW(Addr)) RETURN_ADDRESS (0), (ElfW(Addr)) selfpc);
}
libc_hidden_def (_dl_mcount_wrapper_check)


text:
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>or-tools/src/graph/: Class Members - Doxy</title>
    <link rel="shortcut icon" href="../../../favicon.ico">

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

          Generated on: Thu Mar 29 07:46:58 PDT 2012
            for custom file set

        <tt>//
            doxy/
            or-tools/
            src/
            graph/
            </tt>

Main Page

Related Pages

Namespaces

Classes

Files

Class List

Class Hierarchy

Class Members

All

Functions

Variables

Typedefs

Enumerations

Enumerator

Related Functions

a

b

c

d

e

f

g

h

i

k

l

m

n

o

p

r

s

t

u

v

~

Here is a list of all class members with links to the classes they belong to:

- n -

Next()
: operations_research::EbertGraphCore< NodeIndexType, ArcIndexType, DerivedGraph >::NodeIterator
, operations_research::EbertGraphCore< NodeIndexType, ArcIndexType, DerivedGraph >::ArcIterator
, operations_research::EbertGraph< NodeIndexType, ArcIndexType >::IncomingArcIterator
, operations_research::EbertGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator
, operations_research::EbertGraph< NodeIndexType, ArcIndexType >::IncidentArcIterator
, operations_research::ForwardEbertGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator
, operations_research::LinearSumAssignment< GraphType >::BipartiteLeftNodeIterator

next_adjacent_arc_
: operations_research::EbertGraphCore< NodeIndexType, ArcIndexType, DerivedGraph >

NextAdjacentArc()
: operations_research::EbertGraphCore< NodeIndexType, ArcIndexType, DerivedGraph >

NextArc()
: operations_research::EbertGraphCore< NodeIndexType, ArcIndexType, DerivedGraph >

NextNode()
: operations_research::EbertGraphCore< NodeIndexType, ArcIndexType, DerivedGraph >

node_excess_
: operations_research::MaxFlow

node_potential_
: operations_research::MaxFlow

NodeDebugString()
: operations_research::EbertGraphCore< NodeIndexType, ArcIndexType, DerivedGraph >

NodeIndex
: operations_research::ForwardEbertGraph< NodeIndexType, ArcIndexType >
, operations_research::EbertGraph< NodeIndexType, ArcIndexType >

NodeIterator()
: operations_research::EbertGraphCore< NodeIndexType, ArcIndexType, DerivedGraph >::NodeIterator

NodeSet
: operations_research::HamiltonianPathSolver< T >

NOT_SOLVED
: operations_research::MaxFlow
, operations_research::MinCostFlow

num_arcs()
: operations_research::EbertGraphCore< NodeIndexType, ArcIndexType, DerivedGraph >

num_arcs_
: operations_research::EbertGraphCore< NodeIndexType, ArcIndexType, DerivedGraph >

num_nodes()
: operations_research::EbertGraphCore< NodeIndexType, ArcIndexType, DerivedGraph >

num_nodes_
: operations_research::EbertGraphCore< NodeIndexType, ArcIndexType, DerivedGraph >

NumLeftNodes()
: operations_research::LinearSumAssignment< GraphType >

NumNodes()
: operations_research::LinearSumAssignment< GraphType >


text:
It is a script to help developers to batch upload svgs to fontello.com

# Purpose of this script
This script is used under two conditions:
First, the script helps you to upload all the svgs to http://fontello.com via API when you initiate a new project.
Second, the script helps you to add new svgs to the existing font collection.

# How to use this script
Place your svg files in the folder called 'svgs' and run 'node script.js' in the terminal. Then you will get a zip file downloaded for you. Please remember to remove all the svgs in the './svgs' folder and the zip file after you check everything is fine.

A file called 'config.json' would be generated to keep track of your font info. Next time if you want to update your font collection, just drop the new svg files to the './svgs' and run 'node script.js' again. Don't remove the config.json file.

# Dependencies
This script is based on node.js. Make sure you have installed node.js and NPM.


text:
namespace Valcon.HelloWorld.Configuration.Actions
{
    public class ActionMarker
    {
    }
}


text:
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>UsbEject</name>
    </assembly>
    <members>
        <member name="T:UsbEject.Device">
            <summary>
            A generic base class for physical devices.
            </summary>
        </member>
        <member name="P:UsbEject.Device.Index">
            <summary>
            Gets the device's index.
            </summary>
        </member>
        <member name="P:UsbEject.Device.DeviceClass">
            <summary>
            Gets the device's class instance.
            </summary>
        </member>
        <member name="P:UsbEject.Device.Path">
            <summary>
            Gets the device's path.
            </summary>
        </member>
        <member name="P:UsbEject.Device.InstanceHandle">
            <summary>
            Gets the device's instance handle.
            </summary>
        </member>
        <member name="P:UsbEject.Device.Class">
            <summary>
            Gets the device's class name.
            </summary>
        </member>
        <member name="P:UsbEject.Device.ClassGuid">
            <summary>
            Gets the device's class Guid as a string.
            </summary>
        </member>
        <member name="P:UsbEject.Device.Description">
            <summary>
            Gets the device's description.
            </summary>
        </member>
        <member name="P:UsbEject.Device.FriendlyName">
            <summary>
            Gets the device's friendly name.
            </summary>
        </member>
        <member name="P:UsbEject.Device.Capabilities">
            <summary>
            Gets the device's capabilities.
            </summary>
        </member>
        <member name="P:UsbEject.Device.IsUsb">
            <summary>
            Gets a value indicating whether this device is a USB device.
            </summary>
        </member>
        <member name="P:UsbEject.Device.Parent">
            <summary>
            Gets the device's parent device or null if this device has not parent.
            </summary>
        </member>
        <member name="P:UsbEject.Device.RemovableDevices">
            <summary>
            Gets this device's list of removable devices.
            Removable devices are parent devices that can be removed.
            </summary>
        </member>
        <member name="M:UsbEject.Device.Eject(System.Boolean)">
            <summary>
            Ejects the device.
            </summary>
            <param name="allowUI">Pass true to allow the Windows shell to display any related UI element, false otherwise.</param>
            <returns>null if no error occured, otherwise a contextual text.</returns>
        </member>
        <member name="M:UsbEject.Device.CompareTo(System.Object)">
            <summary>
            Compares the current instance with another object of the same type.
            </summary>
            <param name="obj">An object to compare with this instance.</param>
            <returns>A 32-bit signed integer that indicates the relative order of the comparands.</returns>
        </member>
        <member name="T:UsbEject.DeviceCapabilities">
            <summary>
            Contains constants for determining devices capabilities.
            This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
            </summary>
        </member>
        <member name="F:UsbEject.DeviceCapabilities.Unknown">
            <summary>

            </summary>
        </member>
        <member name="F:UsbEject.DeviceCapabilities.LockSupported">
            <summary>
            Specifies whether the device supports physical-device locking that prevents device ejection.
            </summary>
        </member>
        <member name="F:UsbEject.DeviceCapabilities.EjectSupported">
            <summary>
            Specifies whether the device supports software-controlled device ejection while the system is in the PowerSystemWorking state.
            </summary>
        </member>
        <member name="F:UsbEject.DeviceCapabilities.Removable">
            <summary>
            Specifies whether the device can be dynamically removed from its immediate parent.
            </summary>
        </member>
        <member name="F:UsbEject.DeviceCapabilities.DockDevice">
            <summary>
            Specifies whether the device is a docking peripheral.
            </summary>
        </member>
        <member name="F:UsbEject.DeviceCapabilities.UniqueId">
            <summary>
            Specifies whether the device's instance ID is unique system-wide.
            </summary>
        </member>
        <member name="F:UsbEject.DeviceCapabilities.SilentInstall">
            <summary>
            Specifies whether Device Manager should suppress all installation dialog boxes; except required dialog boxes such as "no compatible drivers found."
            </summary>
        </member>
        <member name="F:UsbEject.DeviceCapabilities.RawDeviceOk">
            <summary>
            Specifies whether the driver for the underlying bus can drive the device if there is no function driver (for example, SCSI devices in pass-through mode).
            </summary>
        </member>
        <member name="F:UsbEject.DeviceCapabilities.SurpriseRemovalOk">
            <summary>
            Specifies whether the function driver for the device can handle the case where the device is removed before Windows can send IRP_MN_QUERY_REMOVE_DEVICE to it.
            </summary>
        </member>
        <member name="F:UsbEject.DeviceCapabilities.HardwareDisabled">
            <summary>
            When set, this flag specifies that the device's hardware is disabled.
            </summary>
        </member>
        <member name="F:UsbEject.DeviceCapabilities.NonDynamic">
            <summary>
            Reserved for future use.
            </summary>
        </member>
        <member name="T:UsbEject.DeviceClass">
            <summary>
            A generic base class for physical device classes.
            </summary>
        </member>
        <member name="M:UsbEject.DeviceClass.#ctor(System.Guid,Chimp.Logging.ILogger)">
            <summary>
            Initializes a new instance of the DeviceClass class.
            </summary>
            <param name="classGuid">A device class Guid.</param>
            <param name="logger">Logger.</param>
        </member>
        <member name="M:UsbEject.DeviceClass.#ctor(System.Guid,System.IntPtr,Chimp.Logging.ILogger)">
            <summary>
            Initializes a new instance of the DeviceClass class.
            </summary>
            <param name="classGuid">A device class Guid.</param>
            <param name="hwndParent">The handle of the top-level window to be used for any user interface or IntPtr.Zero for no handle.</param>
            <param name="logger">Logger.</param>
        </member>
        <member name="M:UsbEject.DeviceClass.Dispose(System.Boolean)">
            <summary>
            Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
            </summary>
            <param name="disposing"></param>
        </member>
        <member name="M:UsbEject.DeviceClass.Finalize">
            <inheritdoc/>
        </member>
        <member name="M:UsbEject.DeviceClass.Dispose">
            <summary>
            Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
            </summary>
        </member>
        <member name="P:UsbEject.DeviceClass.ClassGuid">
            <summary>
            Gets the device class's guid.
            </summary>
        </member>
        <member name="P:UsbEject.DeviceClass.Logger">
            <summary>
            Logger.
            </summary>
        </member>
        <member name="P:UsbEject.DeviceClass.Devices">
            <summary>
            Gets the list of devices of this device class.
            </summary>
        </member>
        <member name="T:UsbEject.Disk">
            <summary>
            A disk device.
            </summary>
        </member>
        <member name="P:UsbEject.Disk.DiskNumber">
            <summary>
            Gets the disk number.
            </summary>
        </member>
        <member name="T:UsbEject.DiskDeviceClass">
            <summary>
            The device class for disk devices.
            </summary>
        </member>
        <member name="M:UsbEject.DiskDeviceClass.#ctor">
            <summary>
            Initializes a new instance of the DiskDeviceClass class.
            </summary>
        </member>
        <member name="M:UsbEject.DiskDeviceClass.#ctor(Chimp.Logging.ILoggerFactory)">
            <summary>
            Initializes a new instance of the DiskDeviceClass class.
            </summary>
            <param name="loggerFactory">Logger factory.</param>
        </member>
        <member name="P:UsbEject.DiskDeviceClass.Disks">
            <summary>
            Gets the list of disks.
            </summary>
        </member>
        <member name="M:UsbEject.DiskDeviceClass.GetEnumerator">
            <inheritdoc/>
        </member>
        <member name="T:UsbEject.NamespaceDoc">
            <summary>
            UsbEject library types.
            </summary>
        </member>
        <member name="T:UsbEject.Volume">
            <summary>
            A volume device.
            </summary>
        </member>
        <member name="P:UsbEject.Volume.VolumeName">
            <summary>
            Gets the volume's name.
            </summary>
        </member>
        <member name="P:UsbEject.Volume.LogicalDrive">
            <summary>
            Gets the volume's logical drive in the form [letter]:\
            </summary>
        </member>
        <member name="P:UsbEject.Volume.Disks">
            <summary>
            Gets a list of underlying disks for this volume.
            </summary>
        </member>
        <member name="P:UsbEject.Volume.DiskNumbers">
            <summary>
            Gets the volume's disk numbers
            </summary>
        </member>
        <member name="M:UsbEject.Volume.CompareTo(System.Object)">
            <summary>
            Compares the current instance with another object of the same type.
            </summary>
            <param name="obj">An object to compare with this instance.</param>
            <returns>A 32-bit signed integer that indicates the relative order of the comparands.</returns>
        </member>
        <member name="T:UsbEject.VolumeDeviceClass">
            <summary>
            The device class for volume devices.
            </summary>
        </member>
        <member name="M:UsbEject.VolumeDeviceClass.#ctor">
            <summary>
            Initializes a new instance of the VolumeDeviceClass class.
            </summary>
        </member>
        <member name="M:UsbEject.VolumeDeviceClass.#ctor(Chimp.Logging.ILoggerFactory)">
            <summary>
            Initializes a new instance of the VolumeDeviceClass class.
            </summary>
            <param name="loggerFactory">Logger factory.</param>
        </member>
        <member name="P:UsbEject.VolumeDeviceClass.Volumes">
            <summary>
            Gets the list of volumes.
            </summary>
        </member>
        <member name="M:UsbEject.VolumeDeviceClass.GetEnumerator">
            <inheritdoc/>
        </member>
    </members>
</doc>


text:
#include <stdio.h>
#include "zlreactor/base/ProcessUtil.h"
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <unistd.h>
using namespace zl;
using namespace zl::base;

void test_CurrentProcess()
{
    printf("--------------------------------- test_CurrentProcess ---------------------------------\n");
    printf("====pid==== %d\n", zl::ProcessUtil::pid());
    printf("====uid==== %d\n", zl::ProcessUtil::uid());
    printf("====euid==== %d\n", zl::ProcessUtil::euid());
    printf("====procname==== %s\n", zl::ProcessUtil::procname().c_str());

    printf("====start time==== %s\n", zl::ProcessUtil::startTime().toString().c_str());
    printf("====elapsed time==== %ld\n", zl::ProcessUtil::elapsedTime());
    printf("====hostname==== %s\n", zl::ProcessUtil::hostname().c_str());
    printf("====username==== %s\n", zl::ProcessUtil::username().c_str());

    printf("====status====\n%s\n", zl::ProcessUtil::procStatus().c_str());
    printf("====stat==== %s\n", zl::ProcessUtil::procStat().c_str());
    printf("====thread stat==== %s\n", zl::ProcessUtil::threadStat().c_str());
    printf("====exePath==== %s\n", zl::ProcessUtil::exePath().c_str());

    printf("====opened files==== %d\n", zl::ProcessUtil::openedFiles());
    printf("====man open files==== %d\n", zl::ProcessUtil::maxOpenFiles());

    printf("====threads==== %zd\n", zl::ProcessUtil::threads().size());
    printf("====num threads==== %d\n", zl::ProcessUtil::numThreads());

    sleep(3);
    printf("====elapsed time==== %ld\n", zl::ProcessUtil::elapsedTime());
}

void test_OtherProcess(const char* procname)
{
    printf("--------------------------------- test_OtherProcess ---------------------------------\n");
    int pid = zl::ProcessUtil::getPidByName(procname);
    printf("====pid==== %d\n", pid);
    printf("====procname==== %s\n", zl::ProcessUtil::getNameByPid(pid).c_str());
    printf("====exePath==== %s\n", zl::ProcessUtil::exePath(pid).c_str());

    printf("====status====\n%s\n", zl::ProcessUtil::procStatus(pid).c_str());
    printf("====stat==== %s\n", zl::ProcessUtil::procStat(pid).c_str());
    //printf("====thread stat==== %s\n", zl::ProcessUtil::threadStat(pid).c_str());

    printf("====threads==== %zd\n", zl::ProcessUtil::threads(pid).size());
    printf("====num threads==== %d\n", zl::ProcessUtil::numThreads(pid));
}

int main(int argc, char* argv[])
{
    //test_CurrentProcess();

    test_OtherProcess("HttpInspectorServer");

    return 0;
}


text:
<!--
 * Copyright 2015 The Chromium Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
-->

<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.chromium.webview_shell"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="24" />

    <!-- "Normal" permissions which do not require user prompt -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
    <uses-permission android:name="android.permission.USE_CREDENTIALS"/>

    <!-- "Dangerous" permissions which require user prompt -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.RUN_INSTRUMENTATION" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Light"
        android:debuggable="true" >
        <activity
            android:name="org.chromium.webview_shell.TelemetryActivity"
            android:launchMode="singleTask"
            android:label="@string/title_activity_telemetry"
            android:exported="true">
        </activity>
        <activity
            android:name="org.chromium.webview_shell.TelemetryMemoryPressureActivity"
            android:launchMode="singleTask"
            android:label="@string/title_activity_telemetry"
            android:exported="true">
        </activity>
        <activity
            android:name="org.chromium.webview_shell.JankActivity"
            android:label="@string/title_activity_jank"
            android:noHistory="true"
            android:exported="true">
        </activity>
        <activity
            android:name="org.chromium.webview_shell.StartupTimeActivity"
            android:label="@string/title_activity_startup_time"
            android:noHistory="true"
            android:exported="true">
        </activity>
        <activity
            android:name="org.chromium.webview_shell.WebViewCreateDestroyActivity"
            android:launchMode="singleTask"
            android:label="@string/title_activity_create_destroy"
            android:exported="true">
        </activity>
        <activity
            android:name="org.chromium.webview_shell.WebViewBrowserActivity"
            android:label="@string/title_activity_browser"
            android:exported="true"
            android:windowSoftInputMode="adjustResize"
            android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <!-- Catch intents which do not specify a MIME type -->
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="http" />
                <data android:scheme="https" />
            </intent-filter>
            <!-- Catch intents which do specify a MIME type -->
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="http" />
                <data android:scheme="https" />
                <data android:mimeType="text/html"/>
                <data android:mimeType="text/plain"/>
                <data android:mimeType="application/xhtml+xml"/>
                <data android:mimeType="application/vnd.wap.xhtml+xml"/> <!-- XHTML MP -->
            </intent-filter>
        </activity>
        <activity
            android:name="org.chromium.webview_shell.WebViewLayoutTestActivity"
            android:label="@string/title_activity_layout_test"
            android:exported="true">
        </activity>
        <activity
            android:name="org.chromium.webview_shell.WebViewThreadTestActivity"
            android:label="@string/title_activity_thread_test"
            android:exported="true">
        </activity>
        <activity android:name="org.chromium.test.broker.OnDeviceInstrumentationBroker"
            android:exported="true"/>

        <activity
            android:name="org.chromium.webview_shell.PageCyclerTestActivity"
            android:label="@string/title_activity_page_cycler"
            android:exported="true">
        </activity>

        <uses-library android:name="android.test.runner" />
    </application>
</manifest>


text:
import Ember from 'ember';
import VNamespaceMixin from 'vishu-components/mixins/v-namespace';
import { module, test } from 'qunit';

module('Unit | Mixin | v namespace');

// Replace this with your real tests.
test('it works', function(assert) {
  let VNamespaceObject = Ember.Object.extend(VNamespaceMixin);
  let subject = VNamespaceObject.create();
  assert.ok(subject);
});


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Xml;
using System.Runtime.InteropServices;

#nullable disable

namespace Microsoft.Build.Tasks.Deployment.Bootstrapper
{
    internal enum CopyAllFilesType
    {
        CopyAllFilesFalse,
        CopyAllFilesTrue,
        CopyAllFilesIfNotHomeSite,
    }

    /// <summary>
    /// This class represents a product in the found by the BootstrapperBuilder in the Path property.
    /// </summary>
    [ComVisible(true)]
    [Guid("532BF563-A85D-4088-8048-41F51AC5239F")]
    [ClassInterface(ClassInterfaceType.None)]
    public class Product : IProduct
    {
        private readonly Dictionary<string, Package> _cultures = new Dictionary<string, Package>(StringComparer.OrdinalIgnoreCase);

        public Product()
        {
            Debug.Fail("Products are not to be created in this fashion.  Please use IBootstrapperBuilder.Products instead.");
            throw new InvalidOperationException();
        }

        internal Product(XmlNode node, string code, ProductValidationResults validationResults, string copyAll)
        {
            Node = node;
            Packages = new PackageCollection();
            Includes = new ProductCollection();
            Dependencies = new List<List<Product>>();
            MissingDependencies = new List<List<string>>();
            ProductCode = code;
            ValidationResults = validationResults;
            if (copyAll == "IfNotHomeSite")
            {
                CopyAllPackageFiles = CopyAllFilesType.CopyAllFilesIfNotHomeSite;
            }
            else if (copyAll == "false")
            {
                CopyAllPackageFiles = CopyAllFilesType.CopyAllFilesFalse;
            }
            else
            {
                CopyAllPackageFiles = CopyAllFilesType.CopyAllFilesTrue;
            }
        }

        internal XmlNode Node { get; }

        internal CopyAllFilesType CopyAllPackageFiles { get; }

        /// <summary>
        /// The ProductBuilder representation of this Product
        /// </summary>
        public ProductBuilder ProductBuilder => new ProductBuilder(this);

        /// <summary>
        /// A string specifying the unique identifier of this product
        /// </summary>
        public string ProductCode { get; }

        /// <summary>
        /// A human-readable name for this product
        /// </summary>
        public string Name
        {
            get
            {
                CultureInfo culture = Util.DefaultCultureInfo;
                Package p = Packages.Package(culture.Name);

                if (p != null)
                {
                    return p.Name;
                }

                while (culture != null && culture != CultureInfo.InvariantCulture)
                {
                    p = Packages.Package(culture.Parent.Name);

                    if (p != null)
                    {
                        return p.Name;
                    }

                    culture = culture.Parent;
                }

                if (Packages.Count > 0)
                {
                    return Packages.Item(0).Name;
                }

                return ProductCode;
            }
        }

        /// <summary>
        /// All products which this product also installs
        /// </summary>
        public ProductCollection Includes { get; }

        internal List<List<Product>> Dependencies { get; }

        internal bool ContainsCulture(string culture)
        {
            return _cultures.ContainsKey(culture);
        }

        internal bool ContainsDependencies(List<Product> dependenciesToCheck)
        {
            foreach (List<Product> d in Dependencies)
            {
                bool found = true;
                foreach (Product p in d)
                {
                    bool containedInDependencies = false;
                    foreach (Product pd in dependenciesToCheck)
                    {
                        if (p.ProductCode == pd.ProductCode)
                        {
                            containedInDependencies = true;
                            break;
                        }
                    }
                    if (!containedInDependencies)
                    {
                        found = false;
                        break;
                    }
                }

                if (found)
                {
                    return true;
                }
            }

            return false;
        }

        internal List<List<string>> MissingDependencies { get; }

        internal void AddPackage(Package package)
        {
            if (String.IsNullOrEmpty(package?.Culture))
            {
                throw new ArgumentNullException(nameof(package));
            }

            if (!_cultures.ContainsKey(package.Culture))
            {
                Packages.Add(package);
                _cultures.Add(package.Culture, package);
            }
            else
            {
                Debug.WriteLine(String.Format(CultureInfo.CurrentCulture, "A package with culture '{0}' has already been added to product '{1}'", package.Culture.ToLowerInvariant(), ProductCode));
            }
        }

        internal void AddIncludedProduct(Product product)
        {
            Includes.Add(product);
        }

        internal void AddDependentProduct(Product product)
        {
            var newDependency = new List<Product> { product };
            Dependencies.Add(newDependency);
        }

        internal void AddMissingDependency(List<string> productCodes)
        {
            bool found = false;
            foreach (List<string> md in MissingDependencies)
            {
                bool hasAll = true;
                foreach (string dep in md)
                {
                    if (!productCodes.Contains(dep))
                    {
                        hasAll = false;
                        break;
                    }
                }

                if (hasAll)
                {
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                MissingDependencies.Add(productCodes);
            }
        }

        internal PackageCollection Packages { get; }

        internal XmlValidationResults GetPackageValidationResults(string culture)
        {
            return ValidationResults?.PackageResults(culture);
        }

        internal bool ValidationPassed => ValidationResults?.ValidationPassed != false;

        internal ProductValidationResults ValidationResults { get; }
    }
}


text:
(function ($) {
	$(document).ready(function(){
		cat = '' ;
		$("#new_category").keyup(function(){
			getCat();
		});
		$('#add_category_button').click(function(){
			getCat();
			catCreate(cat);
			return;
		});

		$('#new_category').keypress(function (e) {
			var key = e.which;
			if (key == 13) { //enter key code
				catCreate(cat);
				return;
			}
		});
	});
		var catCreate = function(cat) {
			if (cat !== '') {
				$("div[id='new-category']").removeClass('has-error');
				$(".cat-error").remove();
				$("#new_category").css('position', 'absolute');
				$("#new_category").animate({
					bottom: 200,
					height: 0,
					width: 0,
					opacity: 0.5
				}, 600, "linear", function() {
					var url = '/category/add';
					var posting = $.post( url, { category: cat } );
					posting.done(function(data) {
						result = $.parseJSON(data);
						if (result.response == 'fail') {
							var newElement = $('
');
							var elemSpan = $('');
							var elemSpan2 = $('Error:' + ' ' + result.content + '
');
							$(newElement).append(elemSpan);
							$(newElement).append(elemSpan2);
						   	$(newElement).appendTo('.col-md-offset-7');
						}
						else {
	                        $('#category-wrapper').fadeOut(300, function(){
	                        	var cats = result.content;
	                        	$('#category-wrapper').empty();
	                        	$('#category-wrapper').append(cats);
	                        	$('	#category-wrapper').fadeIn().delay(300);
                        	});
						}
					});
					$("#new_category").removeAttr('style');
				});
			}
			else {
				$("div[id='new-category']").addClass('has-error');
			}
			$("#new_category").val('');
		}
		var getCat = function() {
			cat = $("#new_category").val();
			cat = $.trim(cat);
		}
})(jQuery);


text:
var express = require('express');
var router = express.Router();

module.exports = function(req, res, next) {
	res.render('login/login');
};


text:
'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	errorHandler = require('./errors.server.controller'),
	Tracker = mongoose.model('Tracker'),
	_ = require('lodash'),
	User = mongoose.model('User');

/**
* Create a Tracker
*/
exports.createOrUpdate = function(req, res) {
	var trackerReceived = new Tracker(req.body);
	trackerReceived.user = req.user;

	var setUserStartBPM = function(count) {
		if(count <= 7) {
			Tracker.find({user: req.user._id}, function(err, trackers) {
				if (err) {
					return; //TODO what should I do for this error?
				}

				var totalBPM = 0;
				for(var i=0; i < trackers.length; i++) {
					totalBPM += trackers[i].bpm;
				}

				var startingBPM = totalBPM / trackers.length;

				User.update({_id: req.user._id}, {startingHeartRate: startingBPM}, function(err) {
					if(err) {
						return; //TODO what do I do with this error?
					}
				});

				/*User.findOne({_id: req.user._id}, function(err, user) {

					user.startingHeartRate = startingBPM;

					user.save(function(err) {
						if(err) {
							return; //TODO what do I do with this error?
						}
					});
				});*/

				/*var userModel = new User(req.user);
				var userObj = userModel.toObject();

				userModel.startingHeartRate = startingBPM;
				userModel.save(function(err) {
					if(err) {
						return; //TODO what to do for this error?
					}
				});*/
			});
		}
	};

	Tracker.findOne({date: trackerReceived.date, user: req.user._id}).exec(function(err, tracker) {
		if(err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		}

		if(tracker) {
			tracker.bpm = trackerReceived.bpm;

			tracker.save(function(err) {
				if (err) {
					return res.status(400).send({
						message: errorHandler.getErrorMessage(err)
					});
				} else {
					res.jsonp(tracker);

					Tracker.count({user: req.user._id}, function(err, count) {
						if(err) {
							return; //TODO what kind of error should be thrown here?
						}

						setUserStartBPM(count);
					});
				}
			});
		} else {
			trackerReceived.save(function(err) {
				if (err) {
					return res.status(400).send({
						message: errorHandler.getErrorMessage(err)
					});
				} else {
					res.jsonp(trackerReceived);

					Tracker.count({user: req.user._id}, function(err, count) {
						if(err) {
							return; //TODO what kind of error should be thrown here?
						}

						setUserStartBPM(count);
					});
				}
			});
		}
	});
};

/**
* Get list of Trackers
*/
exports.list = function(req, res) {
	Tracker.find({user: req.user._id}).sort('date').exec(function(err, trackers) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		}

		res.jsonp(trackers);
	});
};

exports.getByDate = function(req, res) {
	Tracker.findOne({date: req.params.date, user: req.user._id}).exec(function(err, tracker) {
		if(err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		}

		if(tracker) {
			tracker = tracker.toObject();
			tracker.date = tracker.date.getFullYear().toString() + '-' +  (tracker.date.getMonth() + 1).toString() + '-' + tracker.date.getUTCDate().toString();
		}

		res.jsonp(tracker);
	});
};

/**
 * Create a Tracker with username provided in URL
 */
/*exports.create = function(req, res) {
	var tracker = new Tracker(req.body);

	User.findOne({'username': req.params.username}, function(err, user) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		}

		tracker.user = user;

		console.log(tracker);

		tracker.save(function(err) {
			if (err) {
				return res.status(400).send({
					message: errorHandler.getErrorMessage(err)
				});
			} else {
				res.jsonp(tracker);
			}
		});
	});
};*/

/**
 * Show the current Tracker
 */
exports.read = function(req, res) {
	res.jsonp(req.tracker);
};

/**
 * Update a Tracker
 */
exports.update = function(req, res) {
	var tracker = req.tracker ;

	tracker = _.extend(tracker , req.body);

	tracker.save(function(err) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(tracker);
		}
	});
};

/**
 * Delete an Tracker
 */
exports.delete = function(req, res) {
	var tracker = req.tracker ;

	tracker.remove(function(err) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(tracker);
		}
	});
};

/**
 * Tracker middleware
 */
exports.trackerByID = function(req, res, next, id) {
	Tracker.findById(id).populate('user', 'displayName').exec(function(err, tracker) {
		if (err) return next(err);
		if (! tracker) return next(new Error('Failed to load Tracker ' + id));
		req.tracker = tracker ;
		next();
	});
};

/**
 * Tracker authorization middleware
 */
exports.hasAuthorization = function(req, res, next) {
	if (req.tracker.user.id !== req.user.id) {
		return res.status(403).send('User is not authorized');
	}
	next();
};


text:
//  RCContactInfo.h
//  Created by xugang on 5/8/15.

#import <Foundation/Foundation.h>
/**
 *  联系信息类
 */
@interface RCContactInfo : NSObject
/**
 *  电话
 */
@property(nonatomic, copy) NSString *tel;
/**
 *  邮箱
 */
@property(nonatomic, copy) NSString *email;
/**
 *  地址
 */
@property(nonatomic, copy) NSString *address;
/**
 *  QQ
 */
@property(nonatomic, copy) NSString *qq;
/**
 *  微博ID
 */
@property(nonatomic, copy) NSString *weiBo;
/**
 *  微信号
 */
@property(nonatomic, copy) NSString *weiXin;

@end


text:
const domElements = ['div']

const styled = () => {}

domElements.forEach(domElement => {
  styled[domElement] = styled(domElement)
})


text:
package org.simpleframework.http.message;

import java.io.IOException;

import org.simpleframework.transport.ByteCursor;

/**
 * The ArrayConsumer object is a consumer that consumes
 * bytes in to an internal array before processing. This consumes
 * all bytes read in to an internal array. Each read is met with an
 * invocation of the scan method, which searches for
 * the terminal token within the read chunk. Once the terminal token
 * has been read the excess bytes are reset and the data can be
 * processed by the subclass implementation. The internal array is
 * expanded if the number of consumed bytes exceeds its capacity.
 *
 * @author Niall Gallagher
 */
public abstract class ArrayConsumer implements ByteConsumer {

   /**
    * This is the array that is used to contain the read bytes.
    */
   protected byte[] array;

   /**
    * This is the number of bytes that have been consumed so far.
    */
   protected int count;

   /**
    * This is the size of the chunk of bytes to read each time.
    */
   protected int chunk;

   /**
    * This determines whether the terminal token has been read.
    */
   protected boolean done;

   /**
    * Constructor for the ArrayConsumer object. This is
    * used to create a consumer that will consume all bytes in to an
    * internal array until a terminal token has been read. If excess
    * bytes are read by this consumer they are reset in the cursor.
    */
   public ArrayConsumer() {
      this(1024);
   }

   /**
    * Constructor for the ArrayConsumer object. This is
    * used to create a consumer that will consume all bytes in to an
    * internal array until a terminal token has been read. If excess
    * bytes are read by this consumer they are reset in the cursor.
    *
    * @param size this is the initial array and chunk size to use
    */
   public ArrayConsumer(int size) {
      this(size, 512);
   }

   /**
    * Constructor for the ArrayConsumer object. This is
    * used to create a consumer that will consume all bytes in to an
    * internal array until a terminal token has been read. If excess
    * bytes are read by this consumer they are reset in the cursor.
    *
    * @param size this is the initial array size that is to be used
    * @param chunk this is the chunk size to read bytes as
    */
   public ArrayConsumer(int size, int chunk) {
      this.array = new byte[size];
      this.chunk = chunk;
   }

   /**
    * This method is used to consume bytes from the provided cursor.
    * Each read performed is done in a specific chunk size to ensure
    * that a sufficiently large or small amount of data is read from
    * the ByteCursor object. After each read the byte
    * array is scanned for the terminal token. When the terminal
    * token is found the bytes are processed by the implementation.
    *
    * @param cursor this is the cursor to consume the bytes from
    */
   public void consume(ByteCursor cursor) throws IOException {
      if(!done) {
         int ready = cursor.ready();

         while(ready > 0) {
            int size = Math.min(ready, chunk);

            if(count + size > array.length) {
               resize(count + size);
            }
            size = cursor.read(array, count, size);
            count += size;

            if(size > 0) {
               int reset = scan();

               if(reset > 0) {
                  cursor.reset(reset);
               }
               if(done) {
                  process();
                  break;
               }
            }
            ready = cursor.ready();
         }
      }
   }

   /**
    * This method is used to add an additional chunk size to the
    * internal array. Resizing of the internal array is required as
    * the consumed bytes may exceed the initial size of the array.
    * In such a scenario the array is expanded the chunk size.
    *
    * @param size this is the minimum size to expand the array to
    */
   protected void resize(int size) throws IOException {
      if(array.length < size) {
         int expand = array.length + chunk;
         int max = Math.max(expand, size);
         byte[] temp = new byte[max];

         System.arraycopy(array, 0, temp, 0, count);
         array = temp;
      }
   }

   /**
    * When the terminal token is read from the cursor this will be
    * true. The scan method is used to determine the
    * terminal token. It is invoked after each read, when the scan
    * method returns a non-zero value then excess bytes are reset
    * and the consumer has finished.
    *
    * @return this returns true when the terminal token is read
    */
   public boolean isFinished() {
      return done;
   }

   /**
    * This method is invoked after the terminal token has been read.
    * It is used to process the consumed data and is typically used to
    * parse the input such that it can be used by the subclass for
    * some useful purpose. This is called only once by the consumer.
    */
   protected abstract void process() throws IOException;

   /**
    * This method is used to scan for the terminal token. It searches
    * for the token and returns the number of bytes in the buffer
    * after the terminal token. Returning the excess bytes allows the
    * consumer to reset the bytes within the consumer object.
    *
    * @return this returns the number of excess bytes consumed
    */
   protected abstract int scan() throws IOException;

}


text:
namespace WpfAnalyzers;

using Gu.Roslyn.AnalyzerExtensions;

internal class DependencyPropertyType : QualifiedType
{
    internal readonly QualifiedMethod Register;
    internal readonly QualifiedMethod RegisterReadOnly;
    internal readonly QualifiedMethod RegisterAttached;
    internal readonly QualifiedMethod RegisterAttachedReadOnly;

    internal readonly QualifiedMethod AddOwner;
    internal readonly QualifiedMethod OverrideMetadata;

    internal DependencyPropertyType()
        : base("System.Windows.DependencyProperty")
    {
        this.Register = new QualifiedMethod(this,                 nameof(this.Register));
        this.RegisterReadOnly = new QualifiedMethod(this,         nameof(this.RegisterReadOnly));
        this.RegisterAttached = new QualifiedMethod(this,         nameof(this.RegisterAttached));
        this.RegisterAttachedReadOnly = new QualifiedMethod(this, nameof(this.RegisterAttachedReadOnly));

        this.AddOwner = new QualifiedMethod(this,         nameof(this.AddOwner));
        this.OverrideMetadata = new QualifiedMethod(this, nameof(this.OverrideMetadata));
    }
}