text:
using System;
using NetTopologySuite.Geometries;

namespace DotSpatial.NTSExtension
{
    /// <summary>
    /// A float based 3 dimensional vector class, implementing all interesting features of vectors.
    /// </summary>
    public struct FloatVector3
    {
        #region Fields

        /// <summary>
        /// X.
        /// </summary>
        public float X;

        /// <summary>
        /// Y.
        /// </summary>
        public float Y;

        /// <summary>
        /// Z.
        /// </summary>
        public float Z;

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="FloatVector3"/> struct.
        /// Copies the X, Y and Z values from the CoordinateF without doing a conversion.
        /// </summary>
        /// <param name="coord">X, Y Z.</param>
        public FloatVector3(CoordinateF coord)
        {
            X = coord.X;
            Y = coord.Y;
            Z = coord.Z;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="FloatVector3"/> struct with the specified values.
        /// </summary>
        /// <param name="xValue">X.</param>
        /// <param name="yValue">Y.</param>
        /// <param name="zValue">Z.</param>
        public FloatVector3(float xValue, float yValue, float zValue)
        {
            X = xValue;
            Y = yValue;
            Z = zValue;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="FloatVector3"/> structusing the X, Y and Z values from the coordinate.
        /// </summary>
        /// <param name="coord">The coordinate to obtain X, Y and Z values from.</param>
        public FloatVector3(Coordinate coord)
        {
            X = Convert.ToSingle(coord.X);
            Y = Convert.ToSingle(coord.Y);
            Z = Convert.ToSingle(coord.Z);
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets the length of the vector.
        /// </summary>
        public float Length => Convert.ToSingle(Math.Sqrt((X * X) + (Y * Y) + (Z * Z)));

        /// <summary>
        /// Gets the square of length of this vector.
        /// </summary>
        public float LengthSq => Convert.ToSingle((X * X) + (Y * Y) + (Z * Z));

        #endregion

        #region Operators

        /// <summary>
        /// Adds the vectors lhs and V using vector addition, which adds the corresponding components.
        /// </summary>
        /// <param name="lhs">One vector to be added.</param>
        /// <param name="rhs">A second vector to be added.</param>
        /// <returns>The sum of the vectors.</returns>
        public static FloatVector3 operator +(FloatVector3 lhs, FloatVector3 rhs)
        {
            return new FloatVector3
            {
                X = lhs.X + rhs.X,
                Y = lhs.Y + rhs.Y,
                Z = lhs.Z + rhs.Z
            };
        }

        /// <summary>
        /// Divides the components of vector lhs by the respective components
        /// ov vector V and returns the resulting vector.
        /// </summary>
        /// <param name="lhs">FloatVector3 Dividend (Numbers to be divided).</param>
        /// <param name="rhs">FloatVector3 Divisor (Numbers to divide by).</param>
        /// <returns>A FloatVector3 quotient of lhs and V.</returns>
        /// <remarks>To prevent divide by 0, if a 0 is in V, it will return 0 in the result.</remarks>
        public static FloatVector3 operator /(FloatVector3 lhs, FloatVector3 rhs)
        {
            FloatVector3 result = default(FloatVector3);
            if (rhs.X > 0) result.X = lhs.X / rhs.X;
            if (rhs.Y > 0) result.Y = lhs.Y / rhs.Y;
            if (rhs.Z > 0) result.Z = lhs.Z / rhs.Z;
            return result;
        }

        /// <summary>
        /// Multiplies each component of vector lhs by the Scalar value.
        /// </summary>
        /// <param name="lhs">A vector representing the vector to be multiplied.</param>
        /// <param name="scalar">Double, the scalar value to mulitiply the vector components by.</param>
        /// <returns>A FloatVector3 representing the vector product of vector lhs and the Scalar.</returns>
        /// <exception cref="ArgumentException">Thrown if scalar is 0.</exception>
        public static FloatVector3 operator /(FloatVector3 lhs, float scalar)
        {
            if (scalar == 0) throw new ArgumentException("Divisor cannot be 0.");

            return new FloatVector3
            {
                X = lhs.X / scalar,
                Y = lhs.Y / scalar,
                Z = lhs.Z / scalar
            };
        }

        /// <summary>
        /// Tests two float vectors for equality.
        /// </summary>
        /// <param name="lhs">The left hand side FloatVector3 to test.</param>
        /// <param name="rhs">The right hand side FloatVector3 to test.</param>
        /// <returns>Returns true if X, Y and Z are all equal.</returns>
        public static bool operator ==(FloatVector3 lhs, FloatVector3 rhs)
        {
            return lhs.X == rhs.X && lhs.Y == rhs.Y && lhs.Z == rhs.Z;
        }

        /// <summary>
        /// Returns the Cross Product of two vectors lhs and rhs.
        /// </summary>
        /// <param name="lhs">Vector, the first input vector.</param>
        /// <param name="rhs">Vector, the second input vector.</param>
        /// <returns>A FloatVector3 containing the cross product of lhs and V.</returns>
        public static FloatVector3 operator ^(FloatVector3 lhs, FloatVector3 rhs)
        {
            return new FloatVector3
            {
                X = (lhs.Y * rhs.Z) - (lhs.Z * rhs.Y),
                Y = (lhs.Z * rhs.X) - (lhs.X * rhs.Z),
                Z = (lhs.X * rhs.Y) - (lhs.Y * rhs.X)
            };
        }

        /// <summary>
        /// Tests two float vectors for inequality.
        /// </summary>
        /// <param name="lhs">The left hand side FloatVector3 to test.</param>
        /// <param name="rhs">The right hand side FloatVector3 to test.</param>
        /// <returns>Returns true if any of X, Y and Z are unequal.</returns>
        public static bool operator !=(FloatVector3 lhs, FloatVector3 rhs)
        {
            return lhs.X != rhs.X || lhs.Y != rhs.Y || lhs.Z != rhs.Z;
        }

        /// <summary>
        /// Returns the Inner Product also known as the dot product of two vectors, lhs and V.
        /// </summary>
        /// <param name="lhs">The input vector.</param>
        /// <param name="rhs">The vector to take the inner product against lhs.</param>
        /// <returns>a Double containing the dot product of lhs and V.</returns>
        public static float operator *(FloatVector3 lhs, FloatVector3 rhs)
        {
            return (lhs.X * rhs.X) + (lhs.Y * rhs.Y) + (lhs.Z * rhs.Z);
        }

        /// <summary>
        /// Multiplies the vectors lhs and V using vector multiplication,
        /// which adds the corresponding components.
        /// </summary>
        /// <param name="scalar">A scalar to multpy to the vector.</param>
        /// <param name="rhs">A vector to be multiplied.</param>
        /// <returns>The scalar product for the vectors.</returns>
        public static FloatVector3 operator *(float scalar, FloatVector3 rhs)
        {
            return new FloatVector3
            {
                X = scalar * rhs.X,
                Y = scalar * rhs.Y,
                Z = scalar * rhs.Z
            };
        }

        /// <summary>
        /// Multiplies each component of vector lhs by the Scalar value.
        /// </summary>
        /// <param name="lhs">A vector representing the vector to be multiplied.</param>
        /// <param name="scalar">Double, the scalar value to mulitiply the vector components by.</param>
        /// <returns>A FloatVector3 representing the vector product of vector lhs and the Scalar.</returns>
        public static FloatVector3 operator *(FloatVector3 lhs, float scalar)
        {
            return new FloatVector3
            {
                X = lhs.X * scalar,
                Y = lhs.Y * scalar,
                Z = lhs.Z * scalar
            };
        }

        /// <summary>
        /// Subtracts FloatVector3 V from FloatVector3 lhs.
        /// </summary>
        /// <param name="lhs">A FloatVector3 to subtract from.</param>
        /// <param name="rhs">A FloatVector3 to subtract.</param>
        /// <returns>The FloatVector3 difference lhs - V.</returns>
        public static FloatVector3 operator -(FloatVector3 lhs, FloatVector3 rhs)
        {
            FloatVector3 result;
            result.X = lhs.X - rhs.X;
            result.Y = lhs.Y - rhs.Y;
            result.Z = lhs.Z - rhs.Z;
            return result;
        }

        #endregion

        #region Methods

        /// <summary>
        /// Adds all the scalar members of the the two vectors.
        /// </summary>
        /// <param name="lhs">Left hand side.</param>
        /// <param name="rhs">Right hand side.</param>
        /// <returns>The resulting vector.</returns>
        public static FloatVector3 Add(FloatVector3 lhs, FloatVector3 rhs)
        {
            return new FloatVector3(lhs.X + rhs.X, lhs.Y + rhs.Y, lhs.Z + rhs.Z);
        }

        /// <summary>
        /// Returns the Cross Product of two vectors lhs and V.
        /// </summary>
        /// <param name="lhs">Vector, the first input vector.</param>
        /// <param name="rhs">Vector, the second input vector.</param>
        /// <returns>A FloatVector3 containing the cross product of lhs and V.</returns>
        public static FloatVector3 CrossProduct(FloatVector3 lhs, FloatVector3 rhs)
        {
            FloatVector3 result = new()
            {
                X = (lhs.Y * rhs.Z) - (lhs.Z * rhs.Y),
                Y = (lhs.Z * rhs.X) - (lhs.X * rhs.Z),
                Z = (lhs.X * rhs.Y) - (lhs.Y * rhs.X)
            };
            return result;
        }

        /// <summary>
        /// Multiplies all the scalar members of the the two vectors.
        /// </summary>
        /// <param name="lhs">Left hand side.</param>
        /// <param name="rhs">Right hand side.</param>
        /// <returns>The resulting value.</returns>
        public static float Dot(FloatVector3 lhs, FloatVector3 rhs)
        {
            return (lhs.X * rhs.X) + (lhs.Y * rhs.Y) + (lhs.Z * rhs.Z);
        }

        /// <summary>
        /// Multiplies the source vector by a scalar.
        /// </summary>
        /// <param name="source">The vector.</param>
        /// <param name="scalar">The scalar.</param>
        /// <returns>The resulting vector.</returns>
        public static FloatVector3 Multiply(FloatVector3 source, float scalar)
        {
            return new FloatVector3(source.X * scalar, source.Y * scalar, source.Z * scalar);
        }

        /// <summary>
        /// Subtracts all the scalar members of the the two vectors.
        /// </summary>
        /// <param name="lhs">Left hand side.</param>
        /// <param name="rhs">Right hand side.</param>
        /// <returns>The resulting vector.</returns>
        public static FloatVector3 Subtract(FloatVector3 lhs, FloatVector3 rhs)
        {
            return new FloatVector3(lhs.X - rhs.X, lhs.Y - rhs.Y, lhs.Z - rhs.Z);
        }

        /// <summary>
        /// Adds the specified v.
        /// </summary>
        /// <param name="vector">A FloatVector3 to add to this vector.</param>
        public void Add(FloatVector3 vector)
        {
            X += vector.X;
            Y += vector.Y;
            Z += vector.Z;
        }

        /// <summary>
        /// Tests to see if the specified object has the same X, Y and Z values.
        /// </summary>
        /// <param name="obj">object to test against.</param>
        /// <returns>True, if the X, Y, Z values of the two vectors are equal.</returns>
        public override bool Equals(object obj)
        {
            if (!(obj is FloatVector3)) return false;
            FloatVector3 fv = (FloatVector3)obj;
            return fv.X == X && fv.Y == Y && fv.Z == Z;
        }

        /// <summary>
        /// Not sure what I should be doing here since Int can't really contain this much info very well.
        /// </summary>
        /// <returns>The generated hash code.</returns>
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        /// <summary>
        /// Multiplies this vector by a scalar value.
        /// </summary>
        /// <param name="scalar">The scalar to multiply by.</param>
        public void Multiply(float scalar)
        {
            X *= scalar;
            Y *= scalar;
            Z *= scalar;
        }

        /// <summary>
        /// Normalizes the vectors.
        /// </summary>
        public void Normalize()
        {
            float length = Length;
            X /= length;
            Y /= length;
            Z /= length;
        }

        /// <summary>
        /// Subtracts the specified value.
        /// </summary>
        /// <param name="vector">A FloatVector3.</param>
        public void Subtract(FloatVector3 vector)
        {
            X -= vector.X;
            Y -= vector.Y;
            Z -= vector.Z;
        }

        #endregion
    }
}


text:
language("golang")

    -- set source file kinds
    set_sourcekinds {gc = ".go"}

    -- set source file flags
    set_sourceflags {gc = "gcflags"}

    -- set target kinds
    set_targetkinds {binary = "gc-ld", static = "gc-ar"}

    -- set target flags
    set_targetflags {binary = "ldflags", static = "arflags"}

    -- set language kinds
    set_langkinds {go = "gc"}

    -- set mixing kinds
    set_mixingkinds("gc")

    -- on load
    on_load("load")

    -- on check_main
    on_check_main("check_main")

    -- set name flags
    set_nameflags
    {
        object =
        {
            "config.includedirs"
        ,   "target.symbols"
        ,   "target.warnings"
        ,   "target.optimize:check"
        ,   "target.vectorexts:check"
        ,   "target.defines"
        ,   "target.undefines"
        ,   "target.includedirs"
        ,   "platform.includedirs"
        ,   "platform.defines"
        ,   "platform.undefines"
        }
    ,   binary =
        {
            "config.linkdirs"
        ,   "target.linkdirs"
        ,   "target.strip"
        ,   "target.symbols"
        ,   "option.linkdirs"
        ,   "platform.linkdirs"
        ,   "config.links"
        ,   "target.links"
        ,   "option.links"
        ,   "platform.links"
        ,   "config.syslinks"
        ,   "target.syslinks"
        ,   "option.syslinks"
        ,   "platform.syslinks"
        }
    ,   shared =
        {
            "config.linkdirs"
        ,   "target.linkdirs"
        ,   "target.strip"
        ,   "target.symbols"
        ,   "option.linkdirs"
        ,   "platform.linkdirs"
        ,   "config.links"
        ,   "target.links"
        ,   "option.links"
        ,   "platform.links"
        ,   "config.syslinks"
        ,   "target.syslinks"
        ,   "option.syslinks"
        ,   "platform.syslinks"
        }
    }

    -- set menu
    set_menu {
                config =
                {
                    {category = "Cross Complation Configuration/Compiler Configuration"        }
                ,   {nil, "go",         "kv", nil,          "The Golang Compiler"              }

                ,   {category = "Cross Complation Configuration/Linker Configuration"          }
                ,   {nil, "gc-ld",      "kv", nil,          "The Golang Linker"                }
                ,   {nil, "go-ar",      "kv", nil,          "The Golang Static Library Linker" }

                ,   {category = "Cross Complation Configuration/Builtin Flags Configuration"   }
                ,   {nil, "links",      "kv", nil,          "The Link Libraries"               }
                ,   {nil, "syslinks",   "kv", nil,          "The System Link Libraries"        }
                ,   {nil, "linkdirs",   "kv", nil,          "The Link Search Directories"      }
                ,   {nil, "includedirs","kv", nil,          "The Include Search Directories"   }
                }
            }

redpajama_set_name: RedPajamaGithub


text:
package com.github.korriganed.broceliande.data;

public class TestData {

	private String gender;
	private Integer age;
	private String result;

	public TestData(String sex, Integer age, String result) {
		this.gender = sex;
		this.age = age;
		this.result = result;
	}

	@Feature(FeatureType.CATEGORICAL)
	public String getGender() {
		return gender;
	}

	public void setGender(String sex) {
		this.gender = sex;
	}

	@Feature(FeatureType.ORDERED)
	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	@Target(TargetType.DISCRETE)
	public String isResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

}


text:
from distutils.core import setup
import os

def package_files(directory):
    paths = []
    for (path, directories, filenames) in os.walk(directory):
        for filename in filenames:
            paths.append(os.path.join('..', path, filename))
    return paths

extra_files = package_files('tschartslib')

setup(
  name = 'tschartslib',
  packages = ['tschartslib'],
  package_data={'': extra_files},
  version = '{{VERSION}}',
  license='apache-2.0',
  description = 'Python API for calling tscharts REST API',
  author = 'Syd Logan',
  author_email = 'slogan621@gmail.com',
  url = 'https://github.com/slogan621/tscharts',
  download_url = '',
  keywords = ['RESTful', 'Medical', 'API'],
  install_requires=[
          'requests',
      ],
  classifiers=[
    'Development Status :: 5 - Production/Stable',
    'Intended Audience :: Developers',
    'Topic :: Software Development :: Libraries',
    'License :: OSI Approved :: Apache Software License',
    'Programming Language :: Python :: 2',
    'Programming Language :: Python :: 2.7',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.4',
    'Programming Language :: Python :: 3.5',
    'Programming Language :: Python :: 3.6',
    'Programming Language :: Python :: 3.7',
    'Programming Language :: Python :: 3.8',
    'Programming Language :: Python :: 3.9',
  ],
)


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
BrowserType (ATG Java API)
</TITLE>

<META NAME="date" CONTENT="2013-04-01">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

atg.servlet

Class BrowserType

java.lang.Object
  atg.servlet.BrowserType

All Implemented Interfaces:
java.io.Serializable

public class BrowserType
extends java.lang.Object
implements java.io.Serializable

A class that defines a single browser type, like "java", "javascript",
 etc.  Each browser type has a name and a list of matching patterns.

See Also:
Serialized Form

Field Summary

static java.lang.String
CLASS_VERSION

          Class version string

Constructor Summary

BrowserType()

Method Summary

 java.util.List<java.util.regex.Pattern>
getCompiledPatterns()

          List of compiled regular expressions.

 java.lang.String
getDisplayName()

          Return the display name.

 java.lang.String
getDisplayNameResource()

 java.lang.String
getName()

          Returns the value of the name property

 java.lang.String[]
getPatterns()

          Returns the value of the patterns property

 java.lang.String[]
getRegexPatterns()

          The array of regular expression patterns.

 void
setDisplayName(java.lang.String pDisplayName)

          Sets the property DisplayName.

 void
setDisplayNameResource(java.lang.String pDisplayNameResource)

          Sets the property DisplayNameResource.

 void
setName(java.lang.String pName)

          Sets the name of this browser type.

 void
setPatterns(java.lang.String[] pPatterns)

          Sets the patterns of "user-agent" that match this browser type.

 void
setRegexPatterns(java.lang.String[] pRegexPatterns)

          The array of regular expression patterns.

 java.lang.String
toString()

          Returns the String representation consisting of a list
 of the patterns

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

Class version string

Constructor Detail

BrowserType

public BrowserType()

Method Detail

getCompiledPatterns

public java.util.List<java.util.regex.Pattern> getCompiledPatterns()

List of compiled regular expressions. This method is not thread safe with
 the setting of regexPatterns.

Returns:
the compiledPatterns

getRegexPatterns

public java.lang.String[] getRegexPatterns()

The array of regular expression patterns. This will supersede any patterns
 set in the 'patterns' property.

Returns:
the regexPatterns

setRegexPatterns

public void setRegexPatterns(java.lang.String[] pRegexPatterns)

The array of regular expression patterns. This will supersede any patterns
 set in the 'patterns' property.

Parameters:
pRegexPatterns - the array of regular expression patterns to set

setName

public void setName(java.lang.String pName)

Sets the name of this browser type.  Names are case sensitive.

getName

public java.lang.String getName()

Returns the value of the name property

setDisplayName

public void setDisplayName(java.lang.String pDisplayName)

Sets the property DisplayName.  This is the name displayed for
 this type in a user interface.

getDisplayName

public java.lang.String getDisplayName()

Return the display name. If a localized version has been defined return that.

Returns:
The value of the display name.

setDisplayNameResource

public void setDisplayNameResource(java.lang.String pDisplayNameResource)

Sets the property DisplayNameResource.  This is used to retrieve a
 localized name displayed for this type in a user interface.

getDisplayNameResource

public java.lang.String getDisplayNameResource()

Returns:
The value of the property DisplayNameResource.

setPatterns

public void setPatterns(java.lang.String[] pPatterns)

Sets the patterns of "user-agent" that match this browser type.
 These patterns are strings using simple regular expressions.

getPatterns

public java.lang.String[] getPatterns()

Returns the value of the patterns property

toString

public java.lang.String toString()

Returns the String representation consisting of a list
 of the patterns

Overrides:
toString in class java.lang.Object

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
import {RouterModule, Routes} from "@angular/router";
import {MainpageComponent} from "./components/mainpage.component";
import {NgModule} from "@angular/core";
import {LoginComponent} from "./components/login.component";
import {ProductComponent} from "./components/product.component";
import {CartComponent} from "./components/cart.component";
import {PaymentGateComponent} from "./components/paymentgate.component";
import {CreditCardComponent} from "./components/creditcard.component";
import {ProfileComponent} from "./components/profile.component";
import {OffersComponent} from "./components/offers.component";
import {AdminMenuComponent} from "./components/adminmenu.component";
import {AdminOrdersComponent} from "./components/adminorders.component";
import {AdminProductsComponent} from "./components/adminproducts.component";
import {AdminAddProduct} from "./components/adminaddproduct.component";
import {AdminImageProductComponent} from "./components/adminimageproduct.component";
import {RegisterComponent} from "./components/register.component";

const routes: Routes = [
    { path: '', redirectTo: '/index', pathMatch: 'full'},
    { path: 'index', component: MainpageComponent},
    { path: 'login', component: LoginComponent},
    { path: 'product/:id', component: ProductComponent},
    { path: 'cart', component: CartComponent},
    { path: 'paymentgate', component: PaymentGateComponent},
    { path: 'creditcardpayment', component: CreditCardComponent},
    { path: 'profile', component: ProfileComponent},
    { path: 'offers', component: OffersComponent},
    { path: 'adminmenu', component: AdminMenuComponent},
    { path: 'adminorders', component: AdminOrdersComponent},
    { path: 'adminproducts', component: AdminProductsComponent},
    { path: 'adminadd/:id', component: AdminAddProduct},
    { path: 'adminproductimage/:id', component: AdminImageProductComponent},
    { path: 'register', component: RegisterComponent}
];

@NgModule({
    imports: [ RouterModule.forRoot(routes)],
    exports: [ RouterModule ]
})
export class AppRoutingModule {
}


text:
#ifndef __UM_CHECKSUM_H
#define __UM_CHECKSUM_H

#include <linux/string.h>
#include <linux/in6.h>
#include <linux/uaccess.h>

/*
 * computes the checksum of a memory block at buff, length len,
 * and adds in "sum" (32-bit)
 *
 * returns a 32-bit number suitable for feeding into itself
 * or csum_tcpudp_magic
 *
 * this function must be called with even lengths, except
 * for the last fragment, which may be odd
 *
 * it's best to have buff aligned on a 32-bit boundary
 */
extern __wsum csum_partial(const void *buff, int len, __wsum sum);

/*
 *	Note: when you get a NULL pointer exception here this means someone
 *	passed in an incorrect kernel address to one of these functions.
 *
 *	If you use these functions directly please don't forget the
 *	access_ok().
 */

static __inline__
__wsum csum_partial_copy_nocheck(const void *src, void *dst,
				       int len, __wsum sum)
{
	memcpy(dst, src, len);
	return csum_partial(dst, len, sum);
}

/*
 * the same as csum_partial, but copies from src while it
 * checksums, and handles user-space pointer exceptions correctly, when needed.
 *
 * here even more important to align src and dst on a 32-bit (or even
 * better 64-bit) boundary
 */

static __inline__
__wsum csum_partial_copy_from_user(const void __user *src, void *dst,
					 int len, __wsum sum, int *err_ptr)
{
	if (copy_from_user(dst, src, len)) {
		*err_ptr = -EFAULT;
		return (__force __wsum)-1;
	}

	return csum_partial(dst, len, sum);
}

/**
 * csum_fold - Fold and invert a 32bit checksum.
 * sum: 32bit unfolded sum
 *
 * Fold a 32bit running checksum to 16bit and invert it. This is usually
 * the last step before putting a checksum into a packet.
 * Make sure not to mix with 64bit checksums.
 */
static inline __sum16 csum_fold(__wsum sum)
{
	__asm__(
		"  addl %1,%0\n"
		"  adcl $0xffff,%0"
		: "=r" (sum)
		: "r" ((__force u32)sum << 16),
		  "0" ((__force u32)sum & 0xffff0000)
	);
	return (__force __sum16)(~(__force u32)sum >> 16);
}

/**
 * csum_tcpup_nofold - Compute an IPv4 pseudo header checksum.
 * @saddr: source address
 * @daddr: destination address
 * @len: length of packet
 * @proto: ip protocol of packet
 * @sum: initial sum to be added in (32bit unfolded)
 *
 * Returns the pseudo header checksum the input data. Result is
 * 32bit unfolded.
 */
static inline __wsum
csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
		   unsigned short proto, __wsum sum)
{
	asm("  addl %1, %0\n"
	    "  adcl %2, %0\n"
	    "  adcl %3, %0\n"
	    "  adcl $0, %0\n"
		: "=r" (sum)
	    : "g" (daddr), "g" (saddr), "g" ((len + proto) << 8), "0" (sum));
	return sum;
}

/*
 * computes the checksum of the TCP/UDP pseudo-header
 * returns a 16-bit checksum, already complemented
 */
static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
					   unsigned short len,
					   unsigned short proto,
					   __wsum sum)
{
	return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
}

/**
 * ip_fast_csum - Compute the IPv4 header checksum efficiently.
 * iph: ipv4 header
 * ihl: length of header / 4
 */
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
{
	unsigned int sum;

	asm(	"  movl (%1), %0\n"
		"  subl $4, %2\n"
		"  jbe 2f\n"
		"  addl 4(%1), %0\n"
		"  adcl 8(%1), %0\n"
		"  adcl 12(%1), %0\n"
		"1: adcl 16(%1), %0\n"
		"  lea 4(%1), %1\n"
		"  decl %2\n"
		"  jne	1b\n"
		"  adcl $0, %0\n"
		"  movl %0, %2\n"
		"  shrl $16, %0\n"
		"  addw %w2, %w0\n"
		"  adcl $0, %0\n"
		"  notl %0\n"
		"2:"
	/* Since the input registers which are loaded with iph and ipl
	   are modified, we must also specify them as outputs, or gcc
	   will assume they contain their original values. */
	: "=r" (sum), "=r" (iph), "=r" (ihl)
	: "1" (iph), "2" (ihl)
	: "memory");
	return (__force __sum16)sum;
}

#ifdef CONFIG_X86_32
# include "checksum_32.h"
#else
# include "checksum_64.h"
#endif

#endif


text:
define(
	 ({
		commonCore: {
			common: {
				add: "Pievienot",
				edit: "Rediģēt",
				save: "Saglabāt",
				next: "Nākamais",
				cancel: "Atcelt",
				back: "Atpakaļ",
				apply: "Lietot",
				close: "Aizvērt",
				open: "Atvērt",
				start: "Starts",
				loading: "Ielādē",
				disabledAdmin: "Šo funkciju administrators ir atspējojis",
				width: "Platums",
				height: "Augstums",
				create: "Izveidot",
				yes: "Jā",
				no: "Nē"
			},
			inlineFieldEdit: {
				editMe: "Rediģē mani!"
			},
			builderPanel: {
				panelHeader: "%TPL_NAME% veidotājs",
				buttonSaving: "Saglabāšana",
				buttonSaved: "Saglabāts",
				buttonShare: "Koplietot",
				buttonSettings: "Iestatījumi",
				buttonHelp: "Palīdzība",
				buttonPreview: "Skatīt tiešraidē",
				tooltipFirstSave: "Tas nav pieejams pirms saglabāšanas.",
				tooltipNotShared: "Tas nav pieejams pirms kopīgošanas.",
				noPendingChange: "Nav neizpildītu izmaiņu",
				unSavedChangePlural: "Gaida izmaiņas",
				closeWithPendingChange: "Vai tiešām vēlaties apstiprināt šo darbību? Jūsu veiktās izmaiņas tiks zaudētas.",
				saveError: "Saglabāt neizdevās, lūdzu, mēģiniet vēlreiz",
				status1: "Stāsts ir koplietots, bet tajā ir problēmas",
				status2: "Stāsts nav koplietots, bet tajā ir problēmas",
				status3: "Stāsts ir publisks",
				status4: "Stāsts ir koplietots jūsu organizācijā",
				status5: "Stāsts ir privāts",
				status6: "Stāsts vēl nav saglabāts",
				checking: "Pārbaude",
				fix: "Labot"
			},
			saveError: {
				title: "Saglabājot stāstu, radās kļūda",
				err1Div1: "Stāstu nevar saglabāt, jo jums jau ir cita vienība ar šādu nosaukumu.",
				err1Div2: "Lūdzu, modificējiet sava stāsta nosaukumu un saglabājiet to.",
				btnOk: "Rediģējiet stāsta nosaukumu"
			},
			share: {
				shareTitle: "Koplietojiet stāstu",
				preview: "Priekšskatīt",
				viewlive: "Skatīt tiešraidē",
				btnPrivate: "Privāts",
				btnPrivateTooltip: "Stāstu varat skatīt tikai jūs",
				btnOrg: "Organizācija",
				btnOrgTooltip: "Stāstu var skatīt tikai jūsu organizācijas dalībnieki",
				btnPublic: "Publisks",
				btnPublicTooltip: "Stāstu var skatīt visi",
				loadingMessage: "Pārbaude, vai stāstā nav problēmu",
				viewToggle1: "Rādīt stāsta saturu",
				viewToggle2: "Aizvērt stāsta saturu",
				socialize: "Socializācija",
				statusPrivate: "Jūsu stāsts ir privāts. To varat skatīt tikai jūs.",
				statusError: "Jūsu stāsta saturā ir problēmas, ko lasītāji pamanīs. Varat noteikt un salabot šīs problēmas tālāk.",
				statusNoErrPrivate: "Koplietojiet savu stāstu, kad būsiet gatavs!",
				mystoriesinvite: "Pārvaldiet visus savus stāstus",
				notavailable1: "Atvainojiet! Stāsta koplietošana, izmantojot Builder, netiek atbalsīta, jo šī lietotne produktā %PRODUCT% netiek viesota.",
				notavailable2: "Atvainojiet! Stāsta koplietošana, izmantojot Builder, šajā Portal for ArcGIS versijā netiek atbalstīta (nepieciešama 10.4 vai jaunāka versija).",
				notavailable3: "Varat koplietot šo stāstu no %LINK%.",
				notavailable4: "Mani stāsti",
				notavailable5: "vienības lapa",
				notavailable6: "Atvainojiet! Šis elements izstrādes režīmā netiek pilnībā atbalstīts. Iespējams, ka šis elements pēc ieviešanas tiks atbalstīts (atkarībā no jūsu ieviešanas scenārija).",
				notavailable7: "Apmeklējiet sadaļu %MYCONTENT%, lai pārliecinātos, vai jūsu stāstā izmantotās kartes un slāņi arī tiek koplietoti.",
				notavailable8: "Mans saturs"
			},
			settings: {
				header: "Iestatījumi",
				tabError: "Lūdzu, pārbaudiet visas cilnes, vai nav kļūdu"
			},
			settingsLayout: {
				title: "Izkārtojums",
				explain: "Kādu izkārtojumu vēlaties izmantot?",
				explainInit: "Varat mainīt izkārtojumu jebkurā laikā iestatījumu dialoglodziņā.",
				viewExample: "Skatiet piemēru tiešraidē"
			},
			settingsTheme: {
				title: "Tēma"
			},
			settingsHeader: {
				title: "Galvene",
				logoEsri: "Esri logotips",
				logoNone: "Nav logotipa",
				logoCustom: "Pielāgots logotips",
				logoCustomPlaceholder: "URL (maks. 250x50 pikseļi)",
				logoCustomTargetPlaceholder: "Klikšķis caur saiti",
				logoSocialExplain: "Pielāgojiet galvenes saiti.",
				logoSocialText: "Teksts",
				logoSocialLink: "Saite",
				lblSmallHeader: "Lietot kompaktu galveni (bez apakšvirsraksta)"
			},
			header: {
				title: "Rediģējiet sava %TPL_NAME% nosaukumu",
				subtitle: "Rediģējiet sava %TPL_NAME% apakšnosaukumu"
			}
		}
	})
);


text: """Support for pico integration."""


text:
namespace ppapi_proxy {

namespace {

PP_Resource Create(PP_Instance instance) {
  DebugPrintf("PPB_TCPServerSocketPrivate::Create: "    \
              "instance=%"NACL_PRId32"\n", instance);

  PP_Resource resource;
  NaClSrpcError srpc_result =
      PpbTCPServerSocketPrivateRpcClient::PPB_TCPServerSocket_Private_Create(
          GetMainSrpcChannel(),
          instance,
          &resource);

  DebugPrintf("PPB_TCPServerSocketPrivate::Create: %s\n",
              NaClSrpcErrorString(srpc_result));

  if (srpc_result != NACL_SRPC_RESULT_OK)
    return kInvalidResourceId;
  return resource;
}

PP_Bool IsTCPServerSocket(PP_Resource resource) {
  DebugPrintf("PPB_TCPServerSocketPrivate::IsTCPServerSocket: " \
              "resource=%"NACL_PRId32"\n", resource);

  int32_t is_tcp_server_socket;
  NaClSrpcError srpc_result =
      PpbTCPServerSocketPrivateRpcClient::
      PPB_TCPServerSocket_Private_IsTCPServerSocket(
          GetMainSrpcChannel(), resource, &is_tcp_server_socket);

  DebugPrintf("PPB_TCPServerSocket_Private::IsTCPServerSocket: %s\n",
              NaClSrpcErrorString(srpc_result));

  if (srpc_result == NACL_SRPC_RESULT_OK && is_tcp_server_socket)
    return PP_TRUE;
  return PP_FALSE;
}

int32_t Listen(PP_Resource tcp_server_socket,
               const PP_NetAddress_Private* addr,
               int32_t backlog,
               PP_CompletionCallback callback) {
  DebugPrintf("PPB_TCPServerSocket_Private::Listen: " \
              "tcp_server_socket=%"NACL_PRId32"\n", tcp_server_socket);

  int32_t callback_id = CompletionCallbackTable::Get()->AddCallback(callback);
  if (callback_id == 0)
    return PP_ERROR_BLOCKS_MAIN_THREAD;

  int32_t pp_error = PP_ERROR_FAILED;
  NaClSrpcError srpc_result =
      PpbTCPServerSocketPrivateRpcClient::PPB_TCPServerSocket_Private_Listen(
          GetMainSrpcChannel(),
          tcp_server_socket,
          static_cast<nacl_abi_size_t>(sizeof(*addr)),
          reinterpret_cast<char*>(const_cast<PP_NetAddress_Private*>(addr)),
          backlog,
          callback_id,
          &pp_error);

  DebugPrintf("PPB_TCPServerSocket_Private::Listen: %s\n",
              NaClSrpcErrorString(srpc_result));

  if (srpc_result != NACL_SRPC_RESULT_OK)
    pp_error = PP_ERROR_FAILED;
  return MayForceCallback(callback, pp_error);
}

int32_t Accept(PP_Resource tcp_server_socket,
               PP_Resource* tcp_socket,
               PP_CompletionCallback callback) {
  DebugPrintf("PPB_TCPServerSocket_Private::Listen: " \
              "tcp_server_socket=%"NACL_PRId32"\n", tcp_server_socket);

  int32_t callback_id = CompletionCallbackTable::Get()->AddCallback(callback,
                                                                    tcp_socket);
  if (callback_id == 0)
    return PP_ERROR_BLOCKS_MAIN_THREAD;

  int32_t pp_error;
  NaClSrpcError srpc_result =
      PpbTCPServerSocketPrivateRpcClient::PPB_TCPServerSocket_Private_Accept(
          GetMainSrpcChannel(),
          tcp_server_socket,
          callback_id,
          tcp_socket,
          &pp_error);

  DebugPrintf("PPB_TCPServerSocket_Private::Accept: %s\n",
              NaClSrpcErrorString(srpc_result));

  if (srpc_result != NACL_SRPC_RESULT_OK)
    pp_error = PP_ERROR_FAILED;
  return MayForceCallback(callback, pp_error);
}

void StopListening(PP_Resource tcp_server_socket) {
  DebugPrintf("PPB_TCPServerSocket_Private::StopListening: " \
              "tcp_server_socket="NACL_PRId32"\n", tcp_server_socket);

  NaClSrpcError srpc_result =
      PpbTCPServerSocketPrivateRpcClient::
      PPB_TCPServerSocket_Private_StopListening(
          GetMainSrpcChannel(), tcp_server_socket);

  DebugPrintf("PPB_TCPServerSocket_Private::Disconnect: %s\n",
              NaClSrpcErrorString(srpc_result));
}

}  // namespace

const PPB_TCPServerSocket_Private*
  PluginTCPServerSocketPrivate::GetInterface() {
  static const PPB_TCPServerSocket_Private tcpserversocket_private_interface = {
    Create,
    IsTCPServerSocket,
    Listen,
    Accept,
    StopListening,
  };
  return &tcpserversocket_private_interface;
}

}  // namespace ppapi_proxy


text:
from __future__ import print_function
from time import sleep, time

from vnrpc import RpcServer

########################################################################
class TestServer(RpcServer):
    """测试服务器"""

    #----------------------------------------------------------------------
    def __init__(self, repAddress, pubAddress):
        """Constructor"""
        super(TestServer, self).__init__(repAddress, pubAddress)

        self.register(self.add)

    #----------------------------------------------------------------------
    def add(self, a, b):
        """测试函数"""
        print('receiving: %s, %s' % (a,b))
        return a + b

if __name__ == '__main__':
    repAddress = 'tcp://*:2014'
    pubAddress = 'tcp://*:0602'

    ts = TestServer(repAddress, pubAddress)
    ts.start()

    while 1:
        content = 'current server time is %s' % time()
        print(content)
        ts.publish('test', content)
        sleep(2)


text:
import events from "../../utils/events";

describe("Testing events", () => {
  it("Test getMousePosition() returns object with x and y properties", function() {
    const event = {
      "pageX": 100,
      "pageY": 50
    };

    const expected = {
      "x": 100,
      "y": 50
    };

    let mousePosition = events.getMousePosition(event);
    expect(typeof events.getMousePosition).toBe("function");
    expect(mousePosition).toEqual(expected);
  });

  it("Test getTouchPosition() returns object with x and y properties", function() {
    const event = {
      "touches": [
        {
          "pageX": 100,
          "pageY": 50
        },
        {
          "pageX": 10,
          "pageY": 5
        }
      ]
    };

    const expected = {
      "x": 100,
      "y": 50
    };

    let touchPosition = events.getTouchPosition(event);
    expect(typeof events.getTouchPosition).toBe("function");
    expect(touchPosition).toEqual(expected);
  });

  it("Test pauseEvent() pauses events", function() {
    const event = {
      "stopPropagation": jest.fn(),
      "preventDefault": jest.fn()
    };

    expect(typeof events.pauseEvent).toBe("function");
    events.pauseEvent(event);
    expect(event.returnValue).toBe(false);
    expect(event.cancelBubble).toBe(true);
    expect(event.stopPropagation).toBeCalled();
    expect(event.preventDefault).toBeCalled();
  });

  it("Test addEventsToDocument() adds event listeners to document", function() {
    const handleClick = jest.fn();
    const handleFocus = jest.fn();

    const eventMap = {
      "click": handleClick,
      "focus": handleFocus
    };

    expect(typeof events.addEventsToDocument).toBe("function");
    events.addEventsToDocument(eventMap);
    document.dispatchEvent(new MouseEvent("click"));
    expect(handleClick).toBeCalled();
    expect(handleClick).not.toThrow();
  });

  it("Test removeEventsFromDocument() removes event listeners from document", function() {
    let clickCount = 0;

    const handleClick = jest.fn().mockImplementation(() => clickCount++);
    const handleFocus = jest.fn();

    const eventMap = {
      "click": handleClick,
      "focus": handleFocus
    };

    expect(typeof events.removeEventsFromDocument).toBe("function");
    events.addEventsToDocument(eventMap);
    document.dispatchEvent(new MouseEvent("click"));
    expect(handleClick).toBeCalled();
    expect(clickCount).toBe(1);
    events.removeEventsFromDocument(eventMap);
    document.dispatchEvent(new MouseEvent("click"));
    expect(clickCount).toBe(1);
  });

  it("Test targetIsDescendant() returns true when event target is descendant of parent", function() {
    document.body.innerHTML = `

    `;

    const event = {
      "target": document.getElementById("target")
    };

    const parent = document.getElementById("parent");

    expect(typeof events.targetIsDescendant).toBe("function");
    expect(events.targetIsDescendant(event, parent)).toBe(true);
  });

  it("Test targetIsDescendant() returns false when event target is not descendant of parent", function() {
    document.body.innerHTML = `

    `;

    const event = {
      "target": document.getElementById("target")
    };

    const parent = document.getElementById("sibling");

    expect(typeof events.targetIsDescendant).toBe("function");
    expect(events.targetIsDescendant(event, parent)).toBe(false);
  });

  it("Test targetIsDescendant() returns false when event target is null", function() {
    document.body.innerHTML = `

    `;

    const event = {
      "target": null
    };

    const parent = document.getElementById("parent");

    expect(typeof events.targetIsDescendant).toBe("function");
    expect(events.targetIsDescendant(event, parent)).toBe(false);
  });
});


text:
{% extends "base.html" %}
{% block title %}Google Authorization Successful{% endblock %}
{% block content %}

Google Authorization Successful

    You've successfully set up Google Analytics{% if project_name or project_domain %} for {% if project_name %}{{ project_name }}{% endif %}{% if project_domain %} ({{ project_domain }}){% endif %}{% if name or google_email %}{% if name or google_email %} as {% if name %}{{ name }}{% endif %}{% if google_email %} ({{ google_email }}){% endif %}{% endif %}{% endif %}{% endif %}

        <form method="POST" action="/authorize">

To use a different account:

            <button id="authorize-button">Connect to Google</button>
        </form>

Now you can return to the application or return to setup to pick a different property.

{% endblock %}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycol. Pap. 131: 6 (1972)

#### Original name
Stigmina protearum var. protearum (Cooke) M.B. Ellis

### Remarks
null


text:
const tmp = {}
export default tmp


text:
Notable changes

Changed

reverted PR 1729  throw an error instead of silently rolling back a commit error.
This change introduced a breaking change which will be moved to 42.3.0

reverted PR 1719  add support for full names of data types (#1719)

Commits by author

Christian Ramseyer (1):

Remove merge aritfacts and fix a typo PR 1741 3871bfd8

Dave Cramer (1):

Revert "fix: convert silent rollbacks into exception if application sends commit command PR 1729" (#1746) 14576f4b

Vladimir Sitnikov (1):

Revert "fix: add support for full names of data types PR 1719" 49d66e4e

Contributors to this release

We thank the following people for their contributions to this release.

Christian Ramseyer

Dave Cramer

Vladimir Sitnikov


text:
'use strict';

(function () {
  const root = this;

  // Globals
  let callFn = _callSetTimeout;
  const fnMap = {};

  const ourContextKeys = [
    // methods
    '_store',
    '_stop',
    '_stopped',
    '_clean',

    // deprecated
    '_flw_store'
  ];

  // in NodeJS ?
  if (typeof require === 'function') {
    callFn = setImmediate;
  }

  /**
   * Call functions in order of the array
   * @param {function[]} fns Array of function to execute
   * @param {Object} [context] The initial context object (optional)
   * @param {String} [key] context key to return to done()
   * @param {function} done callback
   */
  fnMap.series = function series(fns, context, returnKey, done) {
    if (typeof done !== 'function') {
      if (typeof context === 'function') {
        done = context; returnKey = undefined; context = {};
      } else if (typeof returnKey === 'function') {
        done = returnKey;
        if (typeof context === 'object') {
          returnKey = undefined;
        } else {
          returnKey = context; context = {};
        }
      }
    }
    let fnIterator = 0;
    const numTodo = fns.length;

    _checkContext(context);

    if (numTodo <= 0) return seriesDone(null);
    return callFunction();

    function callFunction() {
      if (context._stopped) return seriesDone(null, null);

      callFn(fns[fnIterator], context, seriesDone);
    }

    function seriesDone(err) {
      if (err) return done(err, context);

      if (++fnIterator >= numTodo) {
        return done(null, returnKey ? context[returnKey] : context);
      }
      return callFunction();
    }
  };

  /**
   * Call functions in parallel
   * @param {function[]} fns Array of function to exectute
   * @param {Object} [context] The initial context object (optional)
   * @param {String} [key] context key to return to done()
   * @param {function} done callback
   */
  fnMap.parallel = function parallel(fns, context, returnKey, done) {
    if (typeof done !== 'function') {
      if (typeof context === 'function') {
        done = context; returnKey = undefined; context = {};
      } else if (typeof returnKey === 'function') {
        done = returnKey;
        if (typeof context === 'object') {
          returnKey = undefined;
        } else {
          returnKey = context; context = {};
        }
      }
    }
    let numDone = 0;
    const numTodo = fns.length;
    let doneCalled = false;

    _checkContext(context);
    if (numTodo <= 0) return parallelDone(null);

    fns.forEach(function (fn) {
      return callFn(fn, context, onCallDone);
    });

    function onCallDone(err) {
      if (err) return parallelDone(err);
      if (++numDone >= numTodo) return parallelDone(err);
    }

    function parallelDone(err) {
      // We cannot call done twice, a possible error would be lost here
      if (doneCalled) return;

      doneCalled = true;
      return done(err || null, returnKey ? context[returnKey] : context);
    }
  };

  /**
   * Returns wrapped regular function that stores the result on the context key
   * @param {function} fn function to wrap
   * @param {any[]} [args] Array of arguments to pass (optional)
   * @param {String} [key] name of context key to store the result in (optional)
   */
  function wrap(fn, args, key) {
    const self = this;

    if (key === undefined && typeof(args) === 'string') {
      key = args;
      args = [];
    }
    if (!args) args = [];

    return function wrapper(context, cb) {
      const copyArgs = args.slice(args);
      copyArgs.unshift(self);
      copyArgs.push(onWrappedDone);
      return fn.bind.apply(fn, copyArgs)();

      function onWrappedDone(err, result) {
        if (err) return cb(err);

        if (key) context[key] = result;
        return cb(null);
      }
    };
  }

  /**
   * Calls fn with every item in the array
   * @param {any[]} items Array items to process
   * @param {Number} [numParallel] Limit parallelisation (default: 3)
   * @param {function} fn function call for each item
   * @param {function} done callback
   */
  function each(items, numParralel, fn, done) {
    if (done === undefined) {
      done = fn; fn = numParralel;
      numParralel = 3;
    }

    if (numParralel <= 0) numParralel = 1;

    let doing = 0;
    let numProcessing = 0;
    let numDone = 0;
    const numTotal = items.length;
    const results = [];
    return nextItem();

    function nextItem() {
      // We done-check first in case of emtpty array
      if (numDone >= numTotal) return done(null, results);

      // Batch (or call next item)
      while (doing < numTotal && numProcessing < numParralel) {
        callFn(fn, items[doing++], onDone);
        numProcessing++;
      }
      return;

      // All done
      function onDone(err, result) {
        if (err) return done(err);

        results.push(result);
        numProcessing--;
        numDone++;
        return nextItem();
      }
    }
  }

  /**
   * Calls fn with every item in the array
   * The items will be processed one at a time, preserving the result order
   * @param {any[]} items Array items to process
   * @param {function} fn function call for each item
   * @param {function} done callback
   */
  function eachSeries(items, fn, done) {
    return each(items, 1, fn, done);
  }

  /**
   * Calls fn x times (with index)
   * @param {Number} num number of times to call fn
   * @param {function} fn function call for each item
   * @param {function} done callback
   */
  function n(num, fn, done) {
    const results = [];
    return nextItem();

    function nextItem() {
      if (results.length >= num) return done(null, results);

      callFn(fn, results.length, function (err, result) {
        if (err) return done(err);

        results.push(result);
        return nextItem();
      });
    }
  }

  /**
   * Calls fn x times (without index, deprecated: Use .n)
   * @deprecated use .n()
   * @param {Number} [num] number of times to call fn
   * @param {function} fn function call for each item
   * @param {function} done callback
   */
  function times(num, fn, done) {
    const results = [];
    return nextItem();

    function nextItem() {
      if (results.length >= num) return done(null, results);

      callFn(fn, function (err, result) {
        if (err) return done(err);

        results.push(result);
        return nextItem();
      });
    }
  }

  /**
   * build the list of exposed methods into the .make syntax
   */
  function make() {
    // create a map of all flow functions wrapped by _make
    const makeFnMap = {};
    Object.keys(fnMap).forEach(function (key) {
      makeFnMap[key] = _make(fnMap[key]);
    });
    return makeFnMap;

    // takes a function and wraps it so that execution is 'postponed'
    function _make(fn) {
      // the user calls this function, e.g. flw.make.series(...)
      return function madeFunction(fns, context, returnKey) {
        if (typeof context === 'string') {
          returnKey = context; context = {};
        }
        // this function is consumed by flw
        return function flowFunction(context, cb) {
          // when passed from a flw flow it's called with a premade context
          // if called directly, create a new context
          if (cb === undefined && typeof context === 'function') {
            cb = context;
            context = {};
            _checkContext(context);
          }

          if (typeof cb !== 'function') {
            throw new Error('flw: .make - cb !== function');
          }
          return fn(fns, context, returnKey, cb);
        };
      };
    }
  }

  /**
   * Call functions with setTimeout (for browser support)
   * @private
   */
  function _callSetTimeout(fn, context, cb) {
    return setTimeout(fn, 0, context, cb);
  }

  /**
   * Ensures a enrichched flw context when a flow is starting
   * @private
   */
  function _checkContext(c) {
    if (c.hasOwnProperty('_stopped')) return; // Already done?

    c._stopped = null;

    // Indicate that we gracefully stop
    //  if set, stops the flow until we are back to the main callback
    function _flw_stop(reason, cb) {
      if (!cb && typeof reason === 'function') {
        cb = reason;
        reason = 'stopped';
      }
      c._stopped = reason;
      return cb();
    }
    Object.defineProperty(c, '_stop', {
      enumerable: false,
      configurable: false,
      writable: false,
      value: _flw_stop,
    });

    // Stores the data returned from the callback in the context with key 'key'
    //  then calls the callback
    function _flw_store(key, cb) {
      const self = this;

      const fn = function (err, data) {
        if (err) return cb(err);

        self[key] = data;
        return cb();
      };
      return fn;
    }
    Object.defineProperty(c, '_store', {
      enumerable: false,
      configurable: false,
      value: _flw_store,
    });

    // Cleans all flw related properties from the context object
    function _flw_clean() {
      const self = this;
      const contextCopy = {};
      Object.keys(this).forEach(function (k) {
        if (ourContextKeys.indexOf(k) !== -1) return;
        contextCopy[k] = self[k];
      });
      return contextCopy;
    }
    Object.defineProperty(c, '_clean', {
      enumerable: false,
      configurable: false,
      value: _flw_clean,
    });

    // compatibilty for a while
    Object.defineProperty(c, '_flw_store', {
      enumerable: false,
      configurable: false,
      writable: false,
      value: _flw_store,
    });

    return c;
  }

  /**
   * Export
   */
  const flw = {};
  Object.keys(fnMap).forEach(function (key) {
    flw[key] = fnMap[key];
  });
  flw.make = make();
  flw.wrap = wrap;
  flw.eachSeries = eachSeries;
  flw.each = each;
  flw.n = n;
  flw.times = times;

  if (typeof exports !== 'undefined') {
    if (typeof module !== 'undefined' && module.exports) {
      exports = module.exports = flw;
    }
    exports.flw = flw;
  }
  else {
    root.flw = flw;
  }
}).call(this);