text:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by CSGenerator.
// </auto-generated>
//------------------------------------------------------------------------------
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;

using jsval = JSApi.jsval;

public class JSB_System_Math
{

////////////////////// Math ///////////////////////////////////////
// constructors

// fields
static void Math_E(JSVCall vc)
{
        var result = System.Math.E;
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(result));
}
static void Math_PI(JSVCall vc)
{
        var result = System.Math.PI;
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(result));
}

// properties

// methods

static bool Math_Abs__Int64(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Int64 arg0 = (System.Int64)JSApi.getInt64((int)JSApi.GetType.Arg);
                JSApi.setInt64((int)JSApi.SetType.Rval, (System.Int64)(System.Math.Abs(arg0)));
    }

    return true;
}

static bool Math_Abs__SByte(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.SByte arg0 = (System.SByte)JSApi.getSByte((int)JSApi.GetType.Arg);
                JSApi.setSByte((int)JSApi.SetType.Rval, (System.SByte)(System.Math.Abs(arg0)));
    }

    return true;
}

static bool Math_Abs__Int16(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Int16 arg0 = (System.Int16)JSApi.getInt16((int)JSApi.GetType.Arg);
                JSApi.setInt16((int)JSApi.SetType.Rval, (System.Int16)(System.Math.Abs(arg0)));
    }

    return true;
}

static bool Math_Abs__Int32(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Int32 arg0 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
                JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(System.Math.Abs(arg0)));
    }

    return true;
}

static bool Math_Abs__Decimal(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Decimal arg0 = (System.Decimal)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
                JSMgr.datax.setObject((int)JSApi.SetType.Rval, System.Math.Abs(arg0));
    }

    return true;
}

static bool Math_Abs__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Abs(arg0)));
    }

    return true;
}

static bool Math_Abs__Single(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Single arg0 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
                JSApi.setSingle((int)JSApi.SetType.Rval, (System.Single)(System.Math.Abs(arg0)));
    }

    return true;
}

static bool Math_Acos__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Acos(arg0)));
    }

    return true;
}

static bool Math_Asin__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Asin(arg0)));
    }

    return true;
}

static bool Math_Atan__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Atan(arg0)));
    }

    return true;
}

static bool Math_Atan2__Double__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
        System.Double arg1 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Atan2(arg0, arg1)));
    }

    return true;
}

static bool Math_BigMul__Int32__Int32(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Int32 arg0 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
        System.Int32 arg1 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
                JSApi.setInt64((int)JSApi.SetType.Rval, (System.Int64)(System.Math.BigMul(arg0, arg1)));
    }

    return true;
}

static bool Math_Ceiling__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Ceiling(arg0)));
    }

    return true;
}

static bool Math_Ceiling__Decimal(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Decimal arg0 = (System.Decimal)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
                JSMgr.datax.setObject((int)JSApi.SetType.Rval, System.Math.Ceiling(arg0));
    }

    return true;
}

static bool Math_Cos__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Cos(arg0)));
    }

    return true;
}

static bool Math_Cosh__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Cosh(arg0)));
    }

    return true;
}

static bool Math_DivRem__Int64__Int64__Int64(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 3)
    {
        System.Int64 arg0 = (System.Int64)JSApi.getInt64((int)JSApi.GetType.Arg);
        System.Int64 arg1 = (System.Int64)JSApi.getInt64((int)JSApi.GetType.Arg);
        int r_arg2 = JSApi.incArgIndex();
        System.Int64 arg2;
                JSApi.setInt64((int)JSApi.SetType.Rval, (System.Int64)(System.Math.DivRem(arg0, arg1, out arg2)));
        JSApi.setArgIndex(r_arg2);
        JSApi.setInt64((int)JSApi.SetType.ArgRef, arg2);
    }

    return true;
}

static bool Math_DivRem__Int32__Int32__Int32(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 3)
    {
        System.Int32 arg0 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
        System.Int32 arg1 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
        int r_arg2 = JSApi.incArgIndex();
        System.Int32 arg2;
                JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(System.Math.DivRem(arg0, arg1, out arg2)));
        JSApi.setArgIndex(r_arg2);
        JSApi.setInt32((int)JSApi.SetType.ArgRef, arg2);
    }

    return true;
}

static bool Math_Exp__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Exp(arg0)));
    }

    return true;
}

static bool Math_Floor__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Floor(arg0)));
    }

    return true;
}

static bool Math_Floor__Decimal(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Decimal arg0 = (System.Decimal)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
                JSMgr.datax.setObject((int)JSApi.SetType.Rval, System.Math.Floor(arg0));
    }

    return true;
}

static bool Math_IEEERemainder__Double__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
        System.Double arg1 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.IEEERemainder(arg0, arg1)));
    }

    return true;
}

static bool Math_Log__Double__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
        System.Double arg1 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Log(arg0, arg1)));
    }

    return true;
}

static bool Math_Log__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Log(arg0)));
    }

    return true;
}

static bool Math_Log10__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Log10(arg0)));
    }

    return true;
}

static bool Math_Max__UInt16__UInt16(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.UInt16 arg0 = (System.UInt16)JSApi.getUInt16((int)JSApi.GetType.Arg);
        System.UInt16 arg1 = (System.UInt16)JSApi.getUInt16((int)JSApi.GetType.Arg);
                JSApi.setUInt16((int)JSApi.SetType.Rval, (System.UInt16)(System.Math.Max(arg0, arg1)));
    }

    return true;
}

static bool Math_Max__Single__Single(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Single arg0 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
        System.Single arg1 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
                JSApi.setSingle((int)JSApi.SetType.Rval, (System.Single)(System.Math.Max(arg0, arg1)));
    }

    return true;
}

static bool Math_Max__Int32__Int32(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Int32 arg0 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
        System.Int32 arg1 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
                JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(System.Math.Max(arg0, arg1)));
    }

    return true;
}

static bool Math_Max__Double__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
        System.Double arg1 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Max(arg0, arg1)));
    }

    return true;
}

static bool Math_Max__Byte__Byte(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Byte arg0 = (System.Byte)JSApi.getByte((int)JSApi.GetType.Arg);
        System.Byte arg1 = (System.Byte)JSApi.getByte((int)JSApi.GetType.Arg);
                JSApi.setByte((int)JSApi.SetType.Rval, (System.Byte)(System.Math.Max(arg0, arg1)));
    }

    return true;
}

static bool Math_Max__Decimal__Decimal(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Decimal arg0 = (System.Decimal)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
        System.Decimal arg1 = (System.Decimal)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
                JSMgr.datax.setObject((int)JSApi.SetType.Rval, System.Math.Max(arg0, arg1));
    }

    return true;
}

static bool Math_Max__UInt32__UInt32(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.UInt32 arg0 = (System.UInt32)JSApi.getUInt32((int)JSApi.GetType.Arg);
        System.UInt32 arg1 = (System.UInt32)JSApi.getUInt32((int)JSApi.GetType.Arg);
                JSApi.setUInt32((int)JSApi.SetType.Rval, (System.UInt32)(System.Math.Max(arg0, arg1)));
    }

    return true;
}

static bool Math_Max__UInt64__UInt64(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.UInt64 arg0 = (System.UInt64)JSApi.getUInt64((int)JSApi.GetType.Arg);
        System.UInt64 arg1 = (System.UInt64)JSApi.getUInt64((int)JSApi.GetType.Arg);
                JSApi.setUInt64((int)JSApi.SetType.Rval, (System.UInt64)(System.Math.Max(arg0, arg1)));
    }

    return true;
}

static bool Math_Max__Int16__Int16(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Int16 arg0 = (System.Int16)JSApi.getInt16((int)JSApi.GetType.Arg);
        System.Int16 arg1 = (System.Int16)JSApi.getInt16((int)JSApi.GetType.Arg);
                JSApi.setInt16((int)JSApi.SetType.Rval, (System.Int16)(System.Math.Max(arg0, arg1)));
    }

    return true;
}

static bool Math_Max__Int64__Int64(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Int64 arg0 = (System.Int64)JSApi.getInt64((int)JSApi.GetType.Arg);
        System.Int64 arg1 = (System.Int64)JSApi.getInt64((int)JSApi.GetType.Arg);
                JSApi.setInt64((int)JSApi.SetType.Rval, (System.Int64)(System.Math.Max(arg0, arg1)));
    }

    return true;
}

static bool Math_Max__SByte__SByte(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.SByte arg0 = (System.SByte)JSApi.getSByte((int)JSApi.GetType.Arg);
        System.SByte arg1 = (System.SByte)JSApi.getSByte((int)JSApi.GetType.Arg);
                JSApi.setSByte((int)JSApi.SetType.Rval, (System.SByte)(System.Math.Max(arg0, arg1)));
    }

    return true;
}

static bool Math_Min__UInt16__UInt16(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.UInt16 arg0 = (System.UInt16)JSApi.getUInt16((int)JSApi.GetType.Arg);
        System.UInt16 arg1 = (System.UInt16)JSApi.getUInt16((int)JSApi.GetType.Arg);
                JSApi.setUInt16((int)JSApi.SetType.Rval, (System.UInt16)(System.Math.Min(arg0, arg1)));
    }

    return true;
}

static bool Math_Min__Double__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
        System.Double arg1 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Min(arg0, arg1)));
    }

    return true;
}

static bool Math_Min__Single__Single(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Single arg0 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
        System.Single arg1 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
                JSApi.setSingle((int)JSApi.SetType.Rval, (System.Single)(System.Math.Min(arg0, arg1)));
    }

    return true;
}

static bool Math_Min__UInt64__UInt64(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.UInt64 arg0 = (System.UInt64)JSApi.getUInt64((int)JSApi.GetType.Arg);
        System.UInt64 arg1 = (System.UInt64)JSApi.getUInt64((int)JSApi.GetType.Arg);
                JSApi.setUInt64((int)JSApi.SetType.Rval, (System.UInt64)(System.Math.Min(arg0, arg1)));
    }

    return true;
}

static bool Math_Min__Decimal__Decimal(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Decimal arg0 = (System.Decimal)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
        System.Decimal arg1 = (System.Decimal)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
                JSMgr.datax.setObject((int)JSApi.SetType.Rval, System.Math.Min(arg0, arg1));
    }

    return true;
}

static bool Math_Min__Int32__Int32(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Int32 arg0 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
        System.Int32 arg1 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
                JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(System.Math.Min(arg0, arg1)));
    }

    return true;
}

static bool Math_Min__Int16__Int16(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Int16 arg0 = (System.Int16)JSApi.getInt16((int)JSApi.GetType.Arg);
        System.Int16 arg1 = (System.Int16)JSApi.getInt16((int)JSApi.GetType.Arg);
                JSApi.setInt16((int)JSApi.SetType.Rval, (System.Int16)(System.Math.Min(arg0, arg1)));
    }

    return true;
}

static bool Math_Min__UInt32__UInt32(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.UInt32 arg0 = (System.UInt32)JSApi.getUInt32((int)JSApi.GetType.Arg);
        System.UInt32 arg1 = (System.UInt32)JSApi.getUInt32((int)JSApi.GetType.Arg);
                JSApi.setUInt32((int)JSApi.SetType.Rval, (System.UInt32)(System.Math.Min(arg0, arg1)));
    }

    return true;
}

static bool Math_Min__Int64__Int64(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Int64 arg0 = (System.Int64)JSApi.getInt64((int)JSApi.GetType.Arg);
        System.Int64 arg1 = (System.Int64)JSApi.getInt64((int)JSApi.GetType.Arg);
                JSApi.setInt64((int)JSApi.SetType.Rval, (System.Int64)(System.Math.Min(arg0, arg1)));
    }

    return true;
}

static bool Math_Min__SByte__SByte(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.SByte arg0 = (System.SByte)JSApi.getSByte((int)JSApi.GetType.Arg);
        System.SByte arg1 = (System.SByte)JSApi.getSByte((int)JSApi.GetType.Arg);
                JSApi.setSByte((int)JSApi.SetType.Rval, (System.SByte)(System.Math.Min(arg0, arg1)));
    }

    return true;
}

static bool Math_Min__Byte__Byte(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Byte arg0 = (System.Byte)JSApi.getByte((int)JSApi.GetType.Arg);
        System.Byte arg1 = (System.Byte)JSApi.getByte((int)JSApi.GetType.Arg);
                JSApi.setByte((int)JSApi.SetType.Rval, (System.Byte)(System.Math.Min(arg0, arg1)));
    }

    return true;
}

static bool Math_Pow__Double__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
        System.Double arg1 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Pow(arg0, arg1)));
    }

    return true;
}

static bool Math_Round__Decimal__Int32__MidpointRounding(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 3)
    {
        System.Decimal arg0 = (System.Decimal)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
        System.Int32 arg1 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
        System.MidpointRounding arg2 = (System.MidpointRounding)JSApi.getEnum((int)JSApi.GetType.Arg);
                JSMgr.datax.setObject((int)JSApi.SetType.Rval, System.Math.Round(arg0, arg1, arg2));
    }

    return true;
}

static bool Math_Round__Double__Int32__MidpointRounding(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 3)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
        System.Int32 arg1 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
        System.MidpointRounding arg2 = (System.MidpointRounding)JSApi.getEnum((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Round(arg0, arg1, arg2)));
    }

    return true;
}

static bool Math_Round__Decimal__MidpointRounding(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Decimal arg0 = (System.Decimal)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
        System.MidpointRounding arg1 = (System.MidpointRounding)JSApi.getEnum((int)JSApi.GetType.Arg);
                JSMgr.datax.setObject((int)JSApi.SetType.Rval, System.Math.Round(arg0, arg1));
    }

    return true;
}

static bool Math_Round__Decimal__Int32(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Decimal arg0 = (System.Decimal)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
        System.Int32 arg1 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
                JSMgr.datax.setObject((int)JSApi.SetType.Rval, System.Math.Round(arg0, arg1));
    }

    return true;
}

static bool Math_Round__Double__MidpointRounding(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
        System.MidpointRounding arg1 = (System.MidpointRounding)JSApi.getEnum((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Round(arg0, arg1)));
    }

    return true;
}

static bool Math_Round__Double__Int32(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 2)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
        System.Int32 arg1 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Round(arg0, arg1)));
    }

    return true;
}

static bool Math_Round__Decimal(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Decimal arg0 = (System.Decimal)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
                JSMgr.datax.setObject((int)JSApi.SetType.Rval, System.Math.Round(arg0));
    }

    return true;
}

static bool Math_Round__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Round(arg0)));
    }

    return true;
}

static bool Math_Sign__Int32(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Int32 arg0 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
                JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(System.Math.Sign(arg0)));
    }

    return true;
}

static bool Math_Sign__Int64(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Int64 arg0 = (System.Int64)JSApi.getInt64((int)JSApi.GetType.Arg);
                JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(System.Math.Sign(arg0)));
    }

    return true;
}

static bool Math_Sign__Single(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Single arg0 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
                JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(System.Math.Sign(arg0)));
    }

    return true;
}

static bool Math_Sign__Decimal(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Decimal arg0 = (System.Decimal)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
                JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(System.Math.Sign(arg0)));
    }

    return true;
}

static bool Math_Sign__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(System.Math.Sign(arg0)));
    }

    return true;
}

static bool Math_Sign__SByte(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.SByte arg0 = (System.SByte)JSApi.getSByte((int)JSApi.GetType.Arg);
                JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(System.Math.Sign(arg0)));
    }

    return true;
}

static bool Math_Sign__Int16(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Int16 arg0 = (System.Int16)JSApi.getInt16((int)JSApi.GetType.Arg);
                JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(System.Math.Sign(arg0)));
    }

    return true;
}

static bool Math_Sin__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Sin(arg0)));
    }

    return true;
}

static bool Math_Sinh__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Sinh(arg0)));
    }

    return true;
}

static bool Math_Sqrt__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Sqrt(arg0)));
    }

    return true;
}

static bool Math_Tan__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Tan(arg0)));
    }

    return true;
}

static bool Math_Tanh__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Tanh(arg0)));
    }

    return true;
}

static bool Math_Truncate__Double(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Double arg0 = (System.Double)JSApi.getDouble((int)JSApi.GetType.Arg);
                JSApi.setDouble((int)JSApi.SetType.Rval, (System.Double)(System.Math.Truncate(arg0)));
    }

    return true;
}

static bool Math_Truncate__Decimal(JSVCall vc, int argc)
{
    int len = argc;
    if (len == 1)
    {
        System.Decimal arg0 = (System.Decimal)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
                JSMgr.datax.setObject((int)JSApi.SetType.Rval, System.Math.Truncate(arg0));
    }

    return true;
}

//register

public static void __Register()
{
    JSMgr.CallbackInfo ci = new JSMgr.CallbackInfo();
    ci.type = typeof(System.Math);
    ci.fields = new JSMgr.CSCallbackField[]
    {
        Math_E,
        Math_PI,

    };
    ci.properties = new JSMgr.CSCallbackProperty[]
    {

    };
    ci.constructors = new JSMgr.MethodCallBackInfo[]
    {

    };
    ci.methods = new JSMgr.MethodCallBackInfo[]
    {
        new JSMgr.MethodCallBackInfo(Math_Abs__Int64, "Abs"),
        new JSMgr.MethodCallBackInfo(Math_Abs__SByte, "Abs"),
        new JSMgr.MethodCallBackInfo(Math_Abs__Int16, "Abs"),
        new JSMgr.MethodCallBackInfo(Math_Abs__Int32, "Abs"),
        new JSMgr.MethodCallBackInfo(Math_Abs__Decimal, "Abs"),
        new JSMgr.MethodCallBackInfo(Math_Abs__Double, "Abs"),
        new JSMgr.MethodCallBackInfo(Math_Abs__Single, "Abs"),
        new JSMgr.MethodCallBackInfo(Math_Acos__Double, "Acos"),
        new JSMgr.MethodCallBackInfo(Math_Asin__Double, "Asin"),
        new JSMgr.MethodCallBackInfo(Math_Atan__Double, "Atan"),
        new JSMgr.MethodCallBackInfo(Math_Atan2__Double__Double, "Atan2"),
        new JSMgr.MethodCallBackInfo(Math_BigMul__Int32__Int32, "BigMul"),
        new JSMgr.MethodCallBackInfo(Math_Ceiling__Double, "Ceiling"),
        new JSMgr.MethodCallBackInfo(Math_Ceiling__Decimal, "Ceiling"),
        new JSMgr.MethodCallBackInfo(Math_Cos__Double, "Cos"),
        new JSMgr.MethodCallBackInfo(Math_Cosh__Double, "Cosh"),
        new JSMgr.MethodCallBackInfo(Math_DivRem__Int64__Int64__Int64, "DivRem"),
        new JSMgr.MethodCallBackInfo(Math_DivRem__Int32__Int32__Int32, "DivRem"),
        new JSMgr.MethodCallBackInfo(Math_Exp__Double, "Exp"),
        new JSMgr.MethodCallBackInfo(Math_Floor__Double, "Floor"),
        new JSMgr.MethodCallBackInfo(Math_Floor__Decimal, "Floor"),
        new JSMgr.MethodCallBackInfo(Math_IEEERemainder__Double__Double, "IEEERemainder"),
        new JSMgr.MethodCallBackInfo(Math_Log__Double__Double, "Log"),
        new JSMgr.MethodCallBackInfo(Math_Log__Double, "Log"),
        new JSMgr.MethodCallBackInfo(Math_Log10__Double, "Log10"),
        new JSMgr.MethodCallBackInfo(Math_Max__UInt16__UInt16, "Max"),
        new JSMgr.MethodCallBackInfo(Math_Max__Single__Single, "Max"),
        new JSMgr.MethodCallBackInfo(Math_Max__Int32__Int32, "Max"),
        new JSMgr.MethodCallBackInfo(Math_Max__Double__Double, "Max"),
        new JSMgr.MethodCallBackInfo(Math_Max__Byte__Byte, "Max"),
        new JSMgr.MethodCallBackInfo(Math_Max__Decimal__Decimal, "Max"),
        new JSMgr.MethodCallBackInfo(Math_Max__UInt32__UInt32, "Max"),
        new JSMgr.MethodCallBackInfo(Math_Max__UInt64__UInt64, "Max"),
        new JSMgr.MethodCallBackInfo(Math_Max__Int16__Int16, "Max"),
        new JSMgr.MethodCallBackInfo(Math_Max__Int64__Int64, "Max"),
        new JSMgr.MethodCallBackInfo(Math_Max__SByte__SByte, "Max"),
        new JSMgr.MethodCallBackInfo(Math_Min__UInt16__UInt16, "Min"),
        new JSMgr.MethodCallBackInfo(Math_Min__Double__Double, "Min"),
        new JSMgr.MethodCallBackInfo(Math_Min__Single__Single, "Min"),
        new JSMgr.MethodCallBackInfo(Math_Min__UInt64__UInt64, "Min"),
        new JSMgr.MethodCallBackInfo(Math_Min__Decimal__Decimal, "Min"),
        new JSMgr.MethodCallBackInfo(Math_Min__Int32__Int32, "Min"),
        new JSMgr.MethodCallBackInfo(Math_Min__Int16__Int16, "Min"),
        new JSMgr.MethodCallBackInfo(Math_Min__UInt32__UInt32, "Min"),
        new JSMgr.MethodCallBackInfo(Math_Min__Int64__Int64, "Min"),
        new JSMgr.MethodCallBackInfo(Math_Min__SByte__SByte, "Min"),
        new JSMgr.MethodCallBackInfo(Math_Min__Byte__Byte, "Min"),
        new JSMgr.MethodCallBackInfo(Math_Pow__Double__Double, "Pow"),
        new JSMgr.MethodCallBackInfo(Math_Round__Decimal__Int32__MidpointRounding, "Round"),
        new JSMgr.MethodCallBackInfo(Math_Round__Double__Int32__MidpointRounding, "Round"),
        new JSMgr.MethodCallBackInfo(Math_Round__Decimal__MidpointRounding, "Round"),
        new JSMgr.MethodCallBackInfo(Math_Round__Decimal__Int32, "Round"),
        new JSMgr.MethodCallBackInfo(Math_Round__Double__MidpointRounding, "Round"),
        new JSMgr.MethodCallBackInfo(Math_Round__Double__Int32, "Round"),
        new JSMgr.MethodCallBackInfo(Math_Round__Decimal, "Round"),
        new JSMgr.MethodCallBackInfo(Math_Round__Double, "Round"),
        new JSMgr.MethodCallBackInfo(Math_Sign__Int32, "Sign"),
        new JSMgr.MethodCallBackInfo(Math_Sign__Int64, "Sign"),
        new JSMgr.MethodCallBackInfo(Math_Sign__Single, "Sign"),
        new JSMgr.MethodCallBackInfo(Math_Sign__Decimal, "Sign"),
        new JSMgr.MethodCallBackInfo(Math_Sign__Double, "Sign"),
        new JSMgr.MethodCallBackInfo(Math_Sign__SByte, "Sign"),
        new JSMgr.MethodCallBackInfo(Math_Sign__Int16, "Sign"),
        new JSMgr.MethodCallBackInfo(Math_Sin__Double, "Sin"),
        new JSMgr.MethodCallBackInfo(Math_Sinh__Double, "Sinh"),
        new JSMgr.MethodCallBackInfo(Math_Sqrt__Double, "Sqrt"),
        new JSMgr.MethodCallBackInfo(Math_Tan__Double, "Tan"),
        new JSMgr.MethodCallBackInfo(Math_Tanh__Double, "Tanh"),
        new JSMgr.MethodCallBackInfo(Math_Truncate__Double, "Truncate"),
        new JSMgr.MethodCallBackInfo(Math_Truncate__Decimal, "Truncate"),

    };
    JSMgr.allCallbackInfo.Add(ci);
}

}


text:
using System;
using System.Collections.Generic;
using System.Reflection;
using Newtonsoft.Json.Linq;

namespace AzureSearchUtil
{
    public static class JsonObjectExtensions
    {
        public static void FillObject(this JObject sourceObj, object objToFill)
        {
            var props = objToFill.GetType().GetRuntimeProperties();
            foreach (var propertyInfo in props)
            {
                var sourceFieldName = propertyInfo.GetSourceFieldName();

                if (sourceObj[sourceFieldName] != null)
                {
                    var val = sourceObj[sourceFieldName];

                    if (val != null)
                    {
                        objToFill.SetValue(propertyInfo, val);
                    }
                }
                else if (sourceFieldName.Contains("."))
                {
                    var propNames = sourceFieldName.Split(".".ToCharArray());

                    var propValue = GetValue(sourceObj, propNames);
                    if (propValue != null)
                    {
                        objToFill.SetValue(propertyInfo, propValue);
                    }
                }
            }
        }

        private static object GetValue(JObject doc, string[] propNames)
        {
            if (propNames.Length > 0)
            {
                var propName = propNames[0];

                var newPropNames = new string[propNames.Length - 1];
                for (var i = 1; i < propNames.Length; i++)
                {
                    newPropNames[i - 1] = propNames[i];
                }

                if (doc[propName] == null)
                    return null;

                if (doc[propName].Type == JTokenType.Array)
                {
                    // Since AzureSearch only supports string collections
                    var list = new List<string>();

                    var arr = doc[propName] as JArray;
                    foreach (var val in arr)
                    {
                        if (val.Type == JTokenType.Object)
                        {
                            var item = GetValue(val as JObject, newPropNames).ToString();
                            list.Add(item);
                        }
                        else if (val.Type == JTokenType.Array)
                        {
                            throw new Exception("Unsupported data structure");
                        }
                        else
                        {
                            list.Add(val.ToString());
                        }
                    }

                    return list.ToArray();
                }
                else
                {
                    if (doc[propName].Type == JTokenType.Object)
                    {
                        var bsonDoc = doc[propName] as JObject;
                        return GetValue(bsonDoc, newPropNames);
                    }
                    else
                    {
                        return doc[propName];
                    }
                }

            }
            else
            {
                return string.Empty;
            }
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

  <title>Tooltip on hover with createLayer() | Cartodb.js</title>
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

  <link rel="stylesheet" href="https://libs.cartocdn.com/cartodb.js/v3/3.15/themes/css/cartodb.css" />


text:
package commands

import (
	"bytes"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"regexp"
	"strconv"
	"strings"
	"time"

	"github.com/github/hub/v2/github"
	"github.com/github/hub/v2/ui"
	"github.com/github/hub/v2/utils"
)

var cmdAPI = &Command{
	Run:   apiCommand,
	Usage: "api [-it] [-X <METHOD>] [-H <HEADER>] [--cache <TTL>] <ENDPOINT> [-F <FIELD>|--input <FILE>]",
	Long: `Low-level GitHub API request interface.

## Options:
	-X, --method <METHOD>
		The HTTP method to use for the request (default: "GET"). The method is
		automatically set to "POST" if ''--field'', ''--raw-field'', or ''--input''
		are used.

		Use ''-XGET'' to force serializing fields into the query string for the GET
		request instead of JSON body of the POST request.

	-F, --field <KEY>=<VALUE>
		Data to serialize with the request. <VALUE> has some magic handling; use
		''--raw-field'' for sending arbitrary string values.

		If <VALUE> starts with "@", the rest of the value is interpreted as a
		filename to read the value from. Use "@-" to read from standard input.

		If <VALUE> is "true", "false", "null", or looks like a number, an
		appropriate JSON type is used instead of a string.

		It is not possible to serialize <VALUE> as a nested JSON array or hash.
		Instead, construct the request payload externally and pass it via
		''--input''.

		Unless ''-XGET'' was used, all fields are sent serialized as JSON within
		the request body. When <ENDPOINT> is "graphql", all fields other than
		"query" are grouped under "variables". See
		<https://graphql.org/learn/queries/#variables>

	-f, --raw-field <KEY>=<VALUE>
		Same as ''--field'', except that it allows values starting with "@", literal
		strings "true", "false", and "null", as well as strings that look like
		numbers.

	--input <FILE>
		The filename to read the raw request body from. Use "-" to read from standard
		input. Use this when you want to manually construct the request payload.

	-H, --header <KEY>:<VALUE>
		Set an HTTP request header.

	-i, --include
		Include HTTP response headers in the output.

	-t, --flat
		Parse response JSON and output the data in a line-based key-value format
		suitable for use in shell scripts.

	--paginate
		Automatically request and output the next page of results until all
		resources have been listed. For GET requests, this follows the ''<next\>''
		resource as indicated in the "Link" response header. For GraphQL queries,
		this utilizes ''pageInfo'' that must be present in the query; see EXAMPLES.

		Note that multiple JSON documents will be output as a result. If the API
		rate limit has been reached, the final document that is output will be the
		HTTP 403 notice, and the process will exit with a non-zero status. One way
		this can be avoided is by enabling ''--obey-ratelimit''.

	--color[=<WHEN>]
		Enable colored output even if stdout is not a terminal. <WHEN> can be one
		of "always" (default for ''--color''), "never", or "auto" (default).

	--cache <TTL>
		Cache valid responses to GET requests for <TTL> seconds.

		When using "graphql" as <ENDPOINT>, caching will apply to responses to POST
		requests as well. Just make sure to not use ''--cache'' for any GraphQL
		mutations.

	--obey-ratelimit
		After exceeding the API rate limit, pause the process until the reset time
		of the current rate limit window and retry the request. Note that this may
		cause the process to hang for a long time (maximum of 1 hour).

	<ENDPOINT>
		The GitHub API endpoint to send the HTTP request to (default: "/").

		To learn about available endpoints, see <https://developer.github.com/v3/>.
		To make GraphQL queries, use "graphql" as <ENDPOINT> and pass ''-F query=QUERY''.

		If the literal strings "{owner}" or "{repo}" appear in <ENDPOINT> or in the
		GraphQL "query" field, fill in those placeholders with values read from the
		git remote configuration of the current git repository.

## Examples:

		# fetch information about the currently authenticated user as JSON
		$ hub api user

		# list user repositories as line-based output
		$ hub api --flat users/octocat/repos

		# post a comment to issue #23 of the current repository
		$ hub api repos/{owner}/{repo}/issues/23/comments --raw-field 'body=Nice job!'

		# perform a GraphQL query read from a file
		$ hub api graphql -F query=@path/to/myquery.graphql

		# perform pagination with GraphQL
		$ hub api --paginate graphql -f query='
		  query($endCursor: String) {
		    repositoryOwner(login: "USER") {
		      repositories(first: 100, after: $endCursor) {
		        nodes {
		          nameWithOwner
		        }
		        pageInfo {
		          hasNextPage
		          endCursor
		        }
		      }
		    }
		  }
		'

## See also:

hub(1)
`,
}

func init() {
	CmdRunner.Use(cmdAPI)
}

func apiCommand(_ *Command, args *Args) {
	path := ""
	if !args.IsParamsEmpty() {
		path = args.GetParam(0)
	}

	method := "GET"
	if args.Flag.HasReceived("--method") {
		method = args.Flag.Value("--method")
	} else if args.Flag.HasReceived("--field") || args.Flag.HasReceived("--raw-field") || args.Flag.HasReceived("--input") {
		method = "POST"
	}
	cacheTTL := args.Flag.Int("--cache")

	params := make(map[string]interface{})
	for _, val := range args.Flag.AllValues("--field") {
		parts := strings.SplitN(val, "=", 2)
		if len(parts) >= 2 {
			params[parts[0]] = magicValue(parts[1])
		}
	}
	for _, val := range args.Flag.AllValues("--raw-field") {
		parts := strings.SplitN(val, "=", 2)
		if len(parts) >= 2 {
			params[parts[0]] = parts[1]
		}
	}

	headers := make(map[string]string)
	for _, val := range args.Flag.AllValues("--header") {
		parts := strings.SplitN(val, ":", 2)
		if len(parts) >= 2 {
			headers[parts[0]] = strings.TrimLeft(parts[1], " ")
		}
	}

	host := ""
	owner := ""
	repo := ""
	localRepo, localRepoErr := github.LocalRepo()
	if localRepoErr == nil {
		var project *github.Project
		if project, localRepoErr = localRepo.MainProject(); localRepoErr == nil {
			host = project.Host
			owner = project.Owner
			repo = project.Name
		}
	}
	if host == "" {
		defHost, err := github.CurrentConfig().DefaultHostNoPrompt()
		utils.Check(err)
		host = defHost.Host
	}

	isGraphQL := path == "graphql"
	if isGraphQL && params["query"] != nil {
		query := params["query"].(string)
		query = strings.Replace(query, "{owner}", owner, -1)
		query = strings.Replace(query, "{repo}", repo, -1)

		variables := make(map[string]interface{})
		for key, value := range params {
			if key != "query" {
				variables[key] = value
			}
		}
		if len(variables) > 0 {
			params = make(map[string]interface{})
			params["variables"] = variables
		}

		params["query"] = query
	} else {
		path = strings.Replace(path, "{owner}", owner, -1)
		path = strings.Replace(path, "{repo}", repo, -1)
	}

	var body interface{}
	if args.Flag.HasReceived("--input") {
		fn := args.Flag.Value("--input")
		if fn == "-" {
			body = os.Stdin
		} else {
			fi, err := os.Open(fn)
			utils.Check(err)
			body = fi
			defer fi.Close()
		}
	} else {
		body = params
	}

	gh := github.NewClient(host)

	out := ui.Stdout
	colorize := colorizeOutput(args.Flag.HasReceived("--color"), args.Flag.Value("--color"))
	parseJSON := args.Flag.Bool("--flat")
	includeHeaders := args.Flag.Bool("--include")
	paginate := args.Flag.Bool("--paginate")
	rateLimitWait := args.Flag.Bool("--obey-ratelimit")

	args.NoForward()

	for {
		response, err := gh.GenericAPIRequest(method, path, body, headers, cacheTTL)
		utils.Check(err)

		if rateLimitWait && response.StatusCode == 403 && response.RateLimitRemaining() == 0 {
			pauseUntil(response.RateLimitReset())
			continue
		}

		success := response.StatusCode < 300
		jsonType := true
		if !success {
			jsonType, _ = regexp.MatchString(`[/+]json(?:;|$)`, response.Header.Get("Content-Type"))
		}

		if includeHeaders {
			fmt.Fprintf(out, "%s %s\r\n", response.Proto, response.Status)
			response.Header.Write(out)
			fmt.Fprintf(out, "\r\n")
		}

		endCursor := ""
		hasNextPage := false

		if parseJSON && jsonType {
			hasNextPage, endCursor = utils.JSONPath(out, response.Body, colorize)
		} else if paginate && isGraphQL {
			bodyCopy := &bytes.Buffer{}
			io.Copy(out, io.TeeReader(response.Body, bodyCopy))
			hasNextPage, endCursor = utils.JSONPath(ioutil.Discard, bodyCopy, false)
		} else {
			io.Copy(out, response.Body)
		}
		response.Body.Close()

		if !success {
			if ssoErr := github.ValidateGitHubSSO(response.Response); ssoErr != nil {
				ui.Errorln()
				ui.Errorln(ssoErr)
			}
			if scopeErr := github.ValidateSufficientOAuthScopes(response.Response); scopeErr != nil {
				ui.Errorln()
				ui.Errorln(scopeErr)
			}
			os.Exit(22)
		}

		if paginate {
			if isGraphQL && hasNextPage && endCursor != "" {
				if v, ok := params["variables"]; ok {
					variables := v.(map[string]interface{})
					variables["endCursor"] = endCursor
				} else {
					variables := map[string]interface{}{"endCursor": endCursor}
					params["variables"] = variables
				}
				goto next
			} else if nextLink := response.Link("next"); nextLink != "" {
				path = nextLink
				goto next
			}
		}

		break
	next:
		if !parseJSON {
			fmt.Fprintf(out, "\n")
		}

		if rateLimitWait && response.RateLimitRemaining() == 0 {
			pauseUntil(response.RateLimitReset())
		}
	}
}

func pauseUntil(timestamp int) {
	rollover := time.Unix(int64(timestamp)+1, 0)
	duration := time.Until(rollover)
	if duration > 0 {
		ui.Errorf("API rate limit exceeded; pausing until %v ...\n", rollover)
		time.Sleep(duration)
	}
}

const (
	trueVal  = "true"
	falseVal = "false"
	nilVal   = "null"
)

func magicValue(value string) interface{} {
	switch value {
	case trueVal:
		return true
	case falseVal:
		return false
	case nilVal:
		return nil
	default:
		if strings.HasPrefix(value, "@") {
			return string(readFile(value[1:]))
		} else if i, err := strconv.Atoi(value); err == nil {
			return i
		} else {
			return value
		}
	}
}

func readFile(file string) (content []byte) {
	var err error
	if file == "-" {
		content, err = ioutil.ReadAll(os.Stdin)
	} else {
		content, err = ioutil.ReadFile(file)
	}
	utils.Check(err)
	return
}


text:
<?php
namespace Girc;

use Girc\BotInterface;
use Girc\Command\Join;
use Girc\Command\Nick;
use Girc\Command\Pong;
use Girc\Command\User;
use Girc\Connection\ConnectionInterface;
use Zend\EventManager\EventManager;

class Bot implements BotInterface
{
    /**
     * @var ConnectionInterface
     */
    protected $connection;

    protected $eventManager;

    public function __construct(ConnectionInterface $c)
    {
        $this->getEventManager();
        $this->setConnection($c);
        $this->getConnection()->send(User::send('BotDiProva', 'BotDiProva'));
        $this->getConnection()->send(Nick::send('BotDiProva'));
        $this->getConnection()->send(Join::send('#BotDiProva'));
    }

    public function getEventManager()
    {
        if ($this->eventManager instanceof EventManager) {
            return $this->eventManager;
        }
        return $this->eventManager = new EventManager();
    }

    /**
     * @return ConnectionInterface
     */
    public function getConnection()
    {
        return $this->connection;
    }

    /**
     * @param ConnectionInterface $connection
     */
    public function setConnection(ConnectionInterface $connection)
    {
        $this->connection  = $connection;
    }

    public function run()
    {
        do {
            $message = $this->getConnection()->get();
            if (preg_match("/PING/", $message)) {
                $this->getConnection()->send(Pong::send());
            }
            $this->getEventManager()->trigger("Bot::run", $this, array('bot' => $this, 'message' => $message));
        } while (true);
    }
}


text:
var Bomb = (function () {
    var bombImage = '/assets/img/bomb.png';
    var explosionImage = '/assets/img/fire.png';
    var sprite;

    var Bomb = Entity.extend({
        id: 0,

        staticBomb: undefined,

        exploded: false,

        bombImage: undefined,

        explosionImage: undefined,

        position: {},

        frames: {},

        animation: {},

        spriteSheet: undefined,

        sprite: undefined,

        explosionSprite: undefined,

        size: {
            w: 28,
            h: 28
        },
        coordinatesToCheck: [
            {x: 0, y: 0},
            {x: -50, y: 0},
            {x: 50, y: 0},
            {x: 0, y: -50},
            {x: 0, y: 50}
        ],
        extendedCoordinatesToCheck:[
            {x:-50,y:50},
            {x:50,y:50},
            {x:-50,y:-50},
            {x:50,y:-50}
        ],

        init: function (id, position,extendedExplosion) {

            if(extendedExplosion){
                coordinatesToCheck = this.coordinatesToCheck.concat(this.extendedCoordinatesToCheck);

            }else {
                coordinatesToCheck = this.coordinatesToCheck;
            }

            if (!sprite) {
                var frames = {width: 28, height: 28, regX: 0, regY: 0};
                var animations = {
                    idle: [0, 4, 'idle', 0.2]
                };

                var data = {
                    images: [bombImage],
                    frames: frames,
                    animations: animations
                };

                var spriteSheet = new createjs.SpriteSheet(data);
                sprite = new createjs.Sprite(spriteSheet, 'idle');

            }

            this.explosionImage = explosionImage;
            this.sprite = sprite.clone();

            return this;
        },
        activate: function (stage) {
            var base = this;
            setTimeout(function () {
                base.detonation(stage);
            }, 5000);
        },
        detonation: function (stage) {
            if(!gameEngine.player.alive){
                gameEngine.containers.playerBombs.children.forEach(function(bomb){
                   bomb.stop();
                });
                return;
            }
            var frames,
                animations,
                data,
                spriteSheet,
                x,
                y;

            frames = {width: 38, height: 37, count: 7, regX: 0, regY: 0, spacing: 0, margin: 0};
            animations = {
                idle: 6,
                explode: [0, 5, 'idle', 0.1]
            };

            data = {
                images: [this.explosionImage],
                frames: frames,
                animations: animations
            };

            stage.removeChild(this.sprite);

            x = this.sprite.x-5;
            y = this.sprite.y-5;

            spriteSheet = new createjs.SpriteSheet(data);
            this.explosionSprite = new createjs.Sprite(spriteSheet, 'explode');

            this.explosionSprite.x = x;
            this.explosionSprite.y = y;
            var base = this;

            stage.addChild(this.explosionSprite);
            this.explosionSprite.on('animationend',function(){
               stage.removeChild(base.explosionSprite);
            });
            createjs.Sound.play('bomb-sound');
            gameEngine.levelData.map[(this.sprite.y / 50 | 0)][(this.sprite.x / 50 | 0)] =0;
            this.kill(x,y);

            gameEngine.player.avaliableBombs++;

            this.exploded = true;
        },
        kill:function(x,y){
            this.removeBreakableTiles(x,y);
            this.killBots(x,y);
            this.killPlayer(x,y);
        },
        removeBreakableTiles:function(x,y){
            for(var i=0;i<coordinatesToCheck.length;i+=1){
                var xToCheck = x+coordinatesToCheck[i].x,
                    yToCheck = y+coordinatesToCheck[i].y;
                var toRemove = gameEngine.containers.backgroundDestructable.getObjectUnderPoint(xToCheck, yToCheck);

                if (gameEngine.containers.backgroundDestructable.removeChild(toRemove)) {
                    gameEngine.levelData.map[(yToCheck / 50 | 0)][(xToCheck / 50 | 0)] = 0;
                    if(multiplayer) {
                        server.sendMapUpdate(gameEngine.levelData.map);
                    }
                }
            }
        },
        killBots:function(x,y){
            for(var i=0;i<coordinatesToCheck.length;i+=1){
                var additionalCoordinatesToCheck = [{x:0,y:15},{x:15,y:0},{x:15,y:30},{x:30,y:15}];

                for(var j=0;j<additionalCoordinatesToCheck.length;j++) {

                    var xToCheck = x + coordinatesToCheck[i].x + additionalCoordinatesToCheck[j].x+4,
                        yToCheck = y + coordinatesToCheck[i].y + additionalCoordinatesToCheck[j].y+4;
                    var toRemove = gameEngine.containers.bot.getObjectUnderPoint(xToCheck, yToCheck);

                    if(toRemove){
                        var botToKill = utils.getBotBySprite(toRemove);
                        if(botToKill===-1){
                            return;
                        }
                        botToKill.alive=false;
                        botToKill.sprite.gotoAndPlay('die');
                        botToKill.sprite.on('animationend',function(){
                            gameEngine.containers.bot.removeChild(botToKill.sprite);
                            gameEngine.removeBot(botToKill);
                        });

                    }
                }
            }
        },
        killPlayer:function(x,y){
            for(var i=0;i<coordinatesToCheck.length;i+=1){
                var additionalCoordinatesToCheck = [{x:0,y:15},{x:15,y:0},{x:15,y:30},{x:30,y:15}];

                for(var j=0;j<additionalCoordinatesToCheck.length;j++) {

                    var xToCheck = x + coordinatesToCheck[i].x + additionalCoordinatesToCheck[j].x+4,
                        yToCheck = y + coordinatesToCheck[i].y + additionalCoordinatesToCheck[j].y+4;
                    var toRemove = gameEngine.containers.player.getObjectUnderPoint(xToCheck, yToCheck);

                    if(toRemove){
                        gameEngine.killPlayer();
                    }
                }
            }
        }
    });

    return Bomb;
}());


text:
package org.ops4j.pax.jms.config.impl;

import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Function;

import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Helper class to track multiple services in cascade.
 * As it's exclusively using the ServiceTracker helper class,
 * the whole tracking mechanism is thread safe.
 */
public class ServiceTrackerHelper {

    private static final Logger LOGGER = LoggerFactory.getLogger(ServiceTrackerHelper.class.getName());

    private final BundleContext context;

    private ServiceTrackerHelper(BundleContext context) {
        this.context = context;
    }

    /**
     * Build a ServiceTrackerHelper using the given BundleContext.
     */
    public static ServiceTrackerHelper helper(BundleContext bundleContext) {
        return new ServiceTrackerHelper(bundleContext);
    }

    /**
     * Start tracking a service for class S, and chain with another service tracking call.
     *
     * @param clazz the service class
     * @param consumer a function receiving the tracked service and chaining with another service tracking call
     * @param <S> the tracked service class
     * @param <T> the chained service tracker class
     * @return an opened service tracker
     */
    public <S, T extends ServiceTracker> ServiceTracker<S, T> track(
            Class<S> clazz,
            Function<S, T> consumer
    ) {
        return track(clazz, defaultFilter(clazz), consumer, ServiceTracker::close);
    }

    /**
     * Start tracking a service for class S with a given filter, and chain with another service tracking call.
     * If a null filter is given, the service tracking is completely bypassed and a null value will be
     * immediately given to the consumer.
     *
     * @param clazz the service class
     * @param filter the filter to use
     * @param consumer a function receiving the tracked service and chaining with another service tracking call
     * @param <S> the tracked service class
     * @param <T> the chained service tracker class
     * @return an opened service tracker
     */
    public <S, T extends ServiceTracker> ServiceTracker<S, T> track(
            Class<S> clazz,
            String filter,
            Function<S, T> consumer
    ) {
        return track(clazz, filter, consumer, ServiceTracker::close);
    }

    /**
     * Start tracking a service for class S with a given filter, and create the final object.
     *
     * @param clazz the service class
     * @param creator a function receiving the tracked service and creating the final object
     * @param destroyer a callback to destroy the final object when the tracked service is lost
     * @param <S> the tracked service class
     * @param <T> the final object type
     * @return an opened service tracker
     */
    public <S, T> ServiceTracker<S, T> track(
            Class<S> clazz,
            Function<S, T> creator,
            Consumer<T> destroyer
    ) {
        return track(clazz, defaultFilter(clazz), creator, destroyer);
    }

    /**
     * Start tracking a service for class S with a given filter, and create the final object.
     * If a null filter is given, the service tracking is completely bypassed and a null value will be
     * immediately given to the consumer.
     *
     * @param clazz the service class
     * @param filter the filter to use
     * @param creator a function receiving the tracked service and creating the final object
     * @param destroyer a callback to destroy the final object when the tracked service is lost
     * @param <S> the tracked service class
     * @param <T> the final object type
     * @return an opened service tracker
     */
    public <S, T> ServiceTracker<S, T> track(
            Class<S> clazz,
            String filter,
            Function<S, T> creator,
            Consumer<T> destroyer
    ) {
        if (filter != null) {
            ServiceTracker<S, T> tracker = new ServiceTracker<S, T>(context, getOrCreateFilter(filter), null) {
                @Override
                public T addingService(ServiceReference<S> reference) {
                    LOGGER.info("Obtained service dependency: " + filter);
                    S s = context.getService(reference);
                    return creator.apply(s);
                }
                @Override
                public void removedService(ServiceReference<S> reference, T service) {
                    LOGGER.info("Lost service dependency: " + filter);
                    destroyer.accept(service);
                    context.ungetService(reference);
                }
            };
            tracker.open();
            if (tracker.isEmpty()) {
                LOGGER.info("Waiting for service dependency: " + filter);
            }
            return tracker;
        } else {
            T t = creator.apply(null);
            return new ServiceTracker<S, T>(context, clazz, null) {
                @Override
                public void close() {
                    destroyer.accept(t);
                }
            };
        }
    }

    /**
     * Start tracking a service for class S with a given filter, and create the final object.
     * If a null filter is given, the service tracking is completely bypassed and a null value will be
     * immediately given to the consumer.
     *
     * @param clazz the service class
     * @param filter the filter to use
     * @param creator a function receiving the tracked service plus its {@link ServiceReference} and creating the final object
     * @param destroyer a callback to destroy the final object when the tracked service is lost
     * @param <S> the tracked service class
     * @param <T> the final object type
     * @return an opened service tracker
     */
    public <S, T> ServiceTracker<S, T> track(
            Class<S> clazz,
            String filter,
            BiFunction<S, ServiceReference<S>, T> creator,
            Consumer<T> destroyer
    ) {
        if (filter != null) {
            ServiceTracker<S, T> tracker = new ServiceTracker<S, T>(context, getOrCreateFilter(filter), null) {
                @Override
                public T addingService(ServiceReference<S> reference) {
                    LOGGER.info("Obtained service dependency: " + filter);
                    S s = context.getService(reference);
                    return creator.apply(s, reference);
                }
                @Override
                public void removedService(ServiceReference<S> reference, T service) {
                    LOGGER.info("Lost service dependency: " + filter);
                    destroyer.accept(service);
                    context.ungetService(reference);
                }
            };
            tracker.open();
            if (tracker.isEmpty()) {
                LOGGER.info("Waiting for service dependency: " + filter);
            }
            return tracker;
        } else {
            T t = creator.apply(null, null);
            return new ServiceTracker<S, T>(context, clazz, null) {
                @Override
                public void close() {
                    destroyer.accept(t);
                }
            };
        }
    }

    private String defaultFilter(Class<?> clazz) {
        return "(" + Constants.OBJECTCLASS + "=" + clazz.getName() + ")";
    }

    private Filter getOrCreateFilter(String filter) {
        try {
            return context.createFilter(filter);
        } catch (InvalidSyntaxException e) {
            throw new RuntimeException("Unable to create filter", e);
        }
    }

}


text:
package com.github.davidmoten.rx2.internal.flowable;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

import org.junit.Assert;
import org.junit.Test;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;

import com.github.davidmoten.rx2.flowable.Transformers;

import io.reactivex.Flowable;

public class FlowableWindowMinMaxTest {
    @Test
    public void testEmpty() {
        boolean empty = Flowable.<Integer>empty().compose(Transformers.<Integer>windowMin(5)).isEmpty()
                .blockingGet();
        assertTrue(empty);
    }

    @Test
    public void testIncreasing() {
        List<Integer> list = Flowable.just(1, 2, 3, 4).compose(Transformers.<Integer>windowMin(2)).toList()
                .blockingGet();
        assertEquals(Arrays.asList(1, 2, 3), list);
    }

    @Test
    public void testDecreasing() {
        List<Integer> list = Flowable.just(4, 3, 2, 1).compose(Transformers.<Integer>windowMin(2)).toList()
                .blockingGet();
        assertEquals(Arrays.asList(3, 2, 1), list);
    }

    @Test
    public void testWindowSizeBiggerThanAvailableProducesEmptyList() {
        List<Integer> list = Flowable.just(4, 3, 2, 1).compose(Transformers.<Integer>windowMin(10)).toList()
                .blockingGet();
        assertTrue(list.isEmpty());
    }

    @Test
    public void testWindowMax() {
        List<Integer> list = Flowable.just(4, 3, 2, 1).compose(Transformers.<Integer>windowMax(2)).toList()
                .blockingGet();
        assertEquals(Arrays.asList(4, 3, 2), list);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testWindowSizeNegativeThrowsIAE() {
        Flowable.just(1).compose(Transformers.<Integer>windowMax(-2));
    }

    @Test(expected = IllegalArgumentException.class)
    public void testWindowSizeZeroThrowsIAE() {
        Flowable.just(1).compose(Transformers.<Integer>windowMax(0));
    }

    @Test
    public void testErrorPropagated() {
        RuntimeException r = new RuntimeException();
        Flowable.<Integer>error(r) //
                .compose(Transformers.<Integer>windowMax(2)) //
                .test() //
                .assertError(r);
    }

    @Test
    public void testCancellation() {
        final AtomicInteger count = new AtomicInteger();
        Flowable.just(3, 2, 5) //
                .compose(Transformers.<Integer>windowMin(2)) //
                .subscribe(new Subscriber<Integer>() {

                    private Subscription s;

                    @Override
                    public void onSubscribe(Subscription s) {
                        this.s = s;
                        s.request(Long.MAX_VALUE);
                    }

                    @Override
                    public void onNext(Integer t) {
                        count.incrementAndGet();
                        s.cancel();
                    }

                    @Override
                    public void onError(Throwable t) {

                    }

                    @Override
                    public void onComplete() {

                    }
                });
        Assert.assertEquals(1, count.get());
    }

    @Test
    public void testExample() {
        Flowable.just(3, 2, 5, 1, 6, 4) //
                .compose(Transformers.<Integer>windowMin(3)) //
                .test() //
                .assertValues(2, 1, 1, 1) //
                .assertComplete();
    }
}


text:
TODO
====

This list is kept here, because they aren't really issues, and aren't well
defined enough to become tickets.


text:
<!DOCTYPE>

        <meta charset="utf-8"/>
        <link rel="stylesheet" href="../app.css"/>

root


text:
var gl;

window.onload = function init()
{
    // Get canvas and setup webGL

    var canvas = document.getElementById("gl-canvas");
    gl = WebGLUtils.setupWebGL(canvas);
    if (!gl) { alert("WebGL isn't available"); }

    // Specify position and color of the vertices

    var vertices = new Float32Array([   -0.5, 1,
                                        0, -1,
                                        0.5, 1]);
    var colors = new Float32Array([ 1, 0, 0, 1,
                                    1, 1, 0, 1,
                                    0, 1, 0, 1,]);

    // Configure viewport

    gl.viewport(0,0,canvas.width,canvas.height);
    gl.clearColor(1.0,1.0,1.0,1.0);

    // Init shader program and bind it

    var program = initShaders(gl, "vertex-shader", "fragment-shader");

    gl.useProgram(program);

    // Load colors into the GPU and associate shader variables

    var cBuffer = gl.createBuffer();
    gl.bindBuffer(gl.ARRAY_BUFFER, cBuffer);
    gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW);

    var vColor = gl.getAttribLocation(program, "vColor");
    gl.vertexAttribPointer(vColor, 4, gl.FLOAT, false, 0, 0);
    gl.enableVertexAttribArray(vColor);

    // Load positions into the GPU and associate shader variables

    var bufferId = gl.createBuffer();
    gl.bindBuffer(gl.ARRAY_BUFFER, bufferId);
    gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);

    var vPosition = gl.getAttribLocation(program, "vPosition");
    gl.vertexAttribPointer(vPosition, 2, gl.FLOAT, false, 0, 0);
    gl.enableVertexAttribArray(vPosition);
    render();
};

function render()
{
    gl.clear(gl.COLOR_BUFFER_BIT);
    gl.drawArrays(gl.TRIANGLES, 0, 3);
}


text:
new BenchmarkSuite('SubarrayNoSpecies', [1000], [
  new Benchmark('SubarrayNoSpecies', false, false, 0,
                subarray, subarraySetup, subarrayTearDown),
]);

var size = 1000;
var initialFloat64Array = new Float64Array(size);
for (var i = 0; i < size; ++i) {
  initialFloat64Array[i] = Math.random();
}
var arr;
var new_arr;

function subarray() {
  new_arr = arr.subarray(1, -1);
}

function subarraySetup() {
  arr = new Float64Array(initialFloat64Array);
}

function subarrayTearDown() {
  for (var i = 1; i < size - 1; ++i) {
    if (arr[i] != new_arr[i - 1]) {
      throw new TypeError("Unexpected result!\n" + new_arr);
    }
  }
  arr = void 0;
  new_arr = void 0;
}


text:
package com.blinkfox.test.query;

import java.util.List;
import java.util.Map;

/**
 * Created by blinkfox on 2016/12/21.
 */
public class Book {

    private List<Author> authorList;
    private Map<String, Author> authorMap;
    private Author mainAuthor;
    private String name;
    private double price;

    public Book() {
        super();
    }

    public List<Author> getAuthorList() {
        return authorList;
    }

    public void setAuthorList(List<Author> authorList) {
        this.authorList = authorList;
    }

    public Map<String, Author> getAuthorMap() {
        return authorMap;
    }

    public void setAuthorMap(Map<String, Author> authorMap) {
        this.authorMap = authorMap;
    }

    public Author getMainAuthor() {
        return mainAuthor;
    }

    public void setMainAuthor(Author mainAuthor) {
        this.mainAuthor = mainAuthor;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

}


text:
import React, { useState, useEffect } from 'react'
import { useQuery } from '@resolve-js/react-hooks'
import { Redirect } from 'react-router-dom'
import ProfileWithViewModel from './ProfileWithViewModel'
import Loading from './Loading'
const Profile = () => {
  const [userId, setUserId] = useState('unknown')
  const getUserId = useQuery(
    {
      name: 'user-profiles',
      resolver: 'profile',
      args: {},
    },
    (err, result) => {
      if (err) {
        setUserId(null)
        return
      }
      setUserId(result.data.id)
    },
    [userId]
  )
  useEffect(() => {
    getUserId()
  }, [])
  if (userId === 'unknown') {
    return <Loading />
  }
  if (userId === null) {
    return <Redirect to="/" />
  }
  return (
    <React.Fragment>
      <ProfileWithViewModel userId={userId} />
    </React.Fragment>
  )
}
export default Profile


text:
import os, re, string

src_dir = r"c:\Documents and Settings\Jim\My Documents\Visual Studio Projects\IronPython"

meth_pat = r"(?P<ret_type>\w+)\s+(?P<name>\w+)\s*\((?P<params>(?:\w|\s|,)*)\)"
meth_pat = re.compile(r"public\s+(?P<mods>static\s+)?(virtual\s+)?"+meth_pat)

class_pat = re.compile(r"public\s+(abstract\s+)?class\s+(?P<name>\w+)\s*(:\s*(?P<super_name>\w+))?")

START = "//BEGIN-GENERATED"
END = "//END-GENERATED"

generated_pat = re.compile(START+".*"+END, re.DOTALL)

from_table = {
    'int':"Py.asInt(%s)",
    'double':"Py.asDouble(%s)",
    'char':"Py.asChar(%s)",
    'PyObject':"%s",
}

def from_any(totype, name):
    pat = from_table.get(totype, None)
    if pat is None:
        return "(%s)%s" % (totype, name)
    else:
        return pat % name

to_table = {
    'int':"PyInteger.make(%s)",
    'double':"PyFloat.make(%s)",
    'bool':"PyBoolean.make(%s)",
    'char':"PyString.make(%s)",
    'PyObject':"%s",
}

def to_any(totype, name):
    pat = to_table.get(totype, None)
    if pat is None:
        return name #"(%s)%s" % (totype, name)
    else:
        return pat % name

BINOP = """
public override PyObject __%(name)s__(PyObject other) {
    %(type)s ov;
    if (!Py.check%(ctype)s(other, out ov)) return Py.NotImplemented;
    return %(ret_type)s.make(%(name)s(_value, ov));
}
public override PyObject __r%(name)s__(PyObject other) {
    %(type)s ov;
    if (!Py.check%(ctype)s(other, out ov)) return Py.NotImplemented;
    return %(ret_type)s.make(%(name)s(ov, _value));
}
"""

UNOP = """
public override PyObject __%(name)s__() {
    return %(ret_type)s.make(%(name)s(_value));
}
"""

class Method:
    def __init__(self, ret_type, name, params, mods=None):
        self.param_list = map(lambda s: s.strip(), string.split(params, ","))
        self.param_list = filter(lambda s: s, self.param_list)
        self.ret_type = ret_type
        self.name = name
        self.mods = mods
        self.is_invokable = True

    def get_public_name(self):
        name = self.name
        if name.endswith("_") and not name.endswith("__"):
            name = name[:-1]
        return name

    def is_any(self):
        if self.ret_type != ANY or self.mods: return False
        for p in self.param_list:
            if not p.startswith(ANY): return False
        return True

    def is_static(self):
        return self.mods is not None

    def is_internal(self):
        return self.name.endswith("__")

    def make_op(self):
        self.is_invokable = False
        type = self.param_list[0].split(" ")[0]
        dict = {
            'name':self.get_public_name(),
            'type':type,
            'ctype':type.capitalize(),
            'ret_type':to_table[self.ret_type].split('.')[0]
            }

        if len(self.param_list) == 2:
            return (BINOP % dict).split("\n")
        else:
            return (UNOP % dict).split("\n")

    def make_any(self, in_module=False):
        if not in_module and self.is_static():
            return self.make_op()

        name = self.get_public_name()
        params = []
        args = []
        for p in self.param_list:
            ptype, pname = string.split(p)
            args.append(from_any(ptype, pname))
            params.append("PyObject %s" % pname)

        if self.is_internal():
            mods = "override "
            self.is_invokable = False
        else:
            mods = ""

        if self.is_static():
            mods += "static "

        ret = ["public %sPyObject %s(%s) {" % (mods, name, string.join(params, ", "))]
        if self.ret_type == 'void':
            ret.append("    %s(%s);" % (self.name, string.join(args, ", ")))
            ret.append("    return Py.None;")
        else:
            value = "%s(%s)" % (self.name, string.join(args, ", "))
            ret.append("    return %s;" % to_any(self.ret_type, value))

        ret.append("}")
        return ret

    def __repr__(self):
        return "Method(%s, %s, %s)" % (self.ret_type, self.name, self.param_list)

class Class:
    def __init__(self, name, super_name, methods):
        self.name = name
        self.super_name = super_name
        self.methods = methods
        self.strings = {}

    def get_constant_string(self, s):
        if not self.strings.has_key(s):
            self.strings[s] = s + "_str"

        return self.strings[s]

    def make_invoke_method(self, nargs):
        params = ["PyString name"]
        args = ["name"]
        for i in range(nargs):
            params.append("PyObject arg%d" % i)
            args.append("arg%d" % i)
        ret = ["public override PyObject invoke(%s) {" % ", ".join(params)]
        ret.append("    if (name.interned) {")

        #TODO create switch clause when more than 3-8 matches
        for method in self.methods:
            if not method.is_invokable or len(method.param_list) != nargs:
                continue
            name = method.get_public_name()
            ret.append("        if (name == %s) return %s(%s);" %
                       (self.get_constant_string(name), name,
                        ", ".join(args[1:])))

        if len(ret) == 2: return []

        ret.append("    }")
        ret.append("    return base.invoke(%s);" % ", ".join(args))
        ret.append("}")
        return ret

    def make_any_methods(self):
        ret = []
        # first generate the any forms of each method
        for method in self.methods:
            if not method.is_any():
                ret.extend(method.make_any(self.super_name == 'PyModule'))

        # now generate the various invoke methods
        for i in range(4):
            ret.extend(self.make_invoke_method(i))
        #TODO invokeN

        for value, name in self.strings.items():
            ret.append('static readonly PyString %s = PyString.intern("%s");' %
                       (name, value))

        return ret

    def __repr__(self):
        return "Class(%s, %s)" % (self.name, self.super_name)

def collect_methods(text):
    text = generated_pat.sub("", text)

    ret = []
    match= class_pat.search(text)
    #print match
    if match is None:
        return None
    cl = Class(match.group('name'), match.group('super_name'), ret)

    for match in meth_pat.finditer(text):
        meth = Method(**match.groupdict())
        if meth.is_static() and meth.name in ['make', 'intern']: continue
        ret.append(meth)

    return cl

base = collect_methods(open(os.path.join(src_dir, "PyObject.cs")).read())
ANY = base.name

for file in os.listdir(src_dir):
    filename = os.path.join(src_dir, file)
    if not filename.endswith(".cs"): continue
    text = open(filename).read()

    if generated_pat.search(text) is None: continue

    c = collect_methods(text)
    assert c is not None and c.name != base.name
    #if c.super_name != 'PyModule':
    #    assert c.super_name == base.name, c.super_name

    print c, c.methods
    code = c.make_any_methods()
    code.insert(0, START)
    code.append(END)
    generated_code = "\n\t\t".join(code)
    new_text = generated_pat.sub(generated_code, text)
    #print new_text
    if text != new_text:
        open(filename, 'w').write(new_text)

#print c, c.methods

#print meth_pat.search("public void m(int a, float d)").groups()


text:
#region Copyright Simple Injector Contributors

#endregion

namespace SimpleInjector.Advanced
{
    using System;
    using System.Diagnostics;

    [DebuggerDisplay("{lifestyle.Name,nq}LifestyleSelectionBehavior")]
    internal sealed class DefaultLifestyleSelectionBehavior : ILifestyleSelectionBehavior
    {
        private readonly Lifestyle lifestyle;

        internal DefaultLifestyleSelectionBehavior(Lifestyle lifestyle)
        {
            this.lifestyle = lifestyle;
        }

        public Lifestyle SelectLifestyle(Type serviceType, Type implementationType)
        {
            Requires.IsNotNull(serviceType, nameof(serviceType));
            Requires.IsNotNull(implementationType, nameof(implementationType));

            return this.lifestyle;
        }
    }
}


text: WebSocket endpoint for every company-wide integration


text:
export function lowerFirst(value: string): string {
  return value.charAt(0).toLowerCase() + value.slice(1);
}

export function isNil(value: any): boolean {
  return value == null;
}

export function groupBy<T, K>(list: T[], getKey: (item: T) => K): Map<K, T[]> {
  const map = new Map<K, T[]>();
  list.forEach(item => {
    const key = getKey(item);
    const collection = map.get(key);
    if (!collection) {
      map.set(key, [item]);
    } else {
      collection.push(item);
    }
  });
  return map;
}

export function flatMap<T, U>(array: T[], mapFunc: (x: T) => U[]): U[] {
  return array.reduce((cumulus: U[], next: T) => [...mapFunc(next), ...cumulus], <U[]>[]);
}


text:
export const GET_ALL_ATTACHMENTS_IN_CARD = 'attachments/GET_ALL_ATTACHMENTS_IN_CARD'
export const ADD_ATTACHMENT = 'attachments/ADD_ATTACHMENT'
export const REMOVE_ATTACHMENT = 'attachments/REMOVE_ATTACHMENT'


text:
include $(TOPDIR)/rules.mk

LUCI_TITLE:=LuCI Support for Aria2
LUCI_DEPENDS:=+aria2

include ../../luci.mk

# call BuildPackage - OpenWrt buildroot signature


text:
use 5.010;
use warnings;
use strict;
use threads;
use IO::Handle; # for autoflush

use constant THREADS => 503;
# stack size may need tuning for your arch, default of 8MB is likely to not
# work well on 32 bit systems or those with limited memory.
use constant THREAD_STACK_SIZE => 512 * 1024;

my $passes = shift;
die "Usage: $0 [passes]\n"
  unless defined $passes && int($passes) > 0;
$passes = int($passes);

my(@pipes, @threads);

@pipes = map {
  pipe my($r, $w) or die "pipe() failed";
  { read => $r, write => $w }
} (0 .. THREADS-1);

@threads = map {
  my $in = $pipes[$_]{read};
  $in->autoflush;
  my $out = $pipes[($_ + 1) % THREADS]{write};
  $out->autoflush;
  my $thread_id = $_ + 1;
  threads->create
    ({ stack_size => THREAD_STACK_SIZE, },
     sub {	     # $in, $out and $thread_id are captured in this closure
       while(my $msg = <$in>) { # receive message
	 chomp $msg;
	 if($msg eq 'EXIT') {	# asked to exit
	   last;
	 } elsif($msg > 0) {	# still work to do
	   say $out --$msg;	# send message
	 } else {		# no more work to do
	   say $thread_id;	# output result
	   # tell all threads to exit
	   say $_ 'EXIT' foreach map { $_->{write} } @pipes;
	   last;
	 }
       }
     });
} (0 .. THREADS-1);

# inject initial message
my $start_fh = $pipes[0]{write};
say $start_fh $passes;

# collect exited threads
$_->join foreach @threads;


text:
import unittest
from gunstar.utils import import_object

class UtilsTestCase(unittest.TestCase):

    def test_import_object(self):
        import gunstar
        from tests.resources import config_settings
        self.assertEqual(
            import_object('gunstar.http.Request'),
            gunstar.http.Request
        )
        self.assertEqual(
            import_object('gunstar.http.Response'),
            gunstar.http.Response
        )
        self.assertEqual(
            import_object('gunstar.http'),
            gunstar.http
        )
        self.assertEqual(
            import_object('tests.resources.config_settings'),
            config_settings
        )
        self.assertEqual(
            import_object('gunstar'),
            gunstar
        )
        self.assertRaises(
            ImportError, import_object, 'gunstar.missing'
        )


text:
package org.fest.assertions.internal;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

/**
 * @author Alex
 * @author Alex
 */
@RunWith(Suite.class)
@SuiteClasses({
  Bytes_TestSuite.class,
  ByteArrays_TestSuite.class,
  Shorts_TestSuite.class,
  ShortArrays_TestSuite.class,
  Integers_TestSuite.class,
  IntArrays_TestSuite.class,
  Longs_TestSuite.class,
  LongArrays_TestSuite.class,
  Floats_TestSuite.class,
  FloatArrays_TestSuite.class,
  Doubles_TestSuite.class,
  DoubleArrays_TestSuite.class,
  Characters_TestSuite.class,
  CharArrays_TestSuite.class,
  Objects_TestSuite.class,
  ObjectArrays_TestSuite.class,
  BooleanArrays_TestSuite.class,
  BigDecimals_TestSuite.class,
  Strings_TestSuite.class,
  Collections_TestSuite.class,
  Lists_TestSuite.class,
  Sets_TestSuite.class,
  Maps_TestSuite.class
})
public class Interal_TestSuites {

}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Controller;

import Beans.KhachHangBean;
import Model.KhachHangModel;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 *
 * @author Phuong
 */
public class AccountController extends HttpServlet {

    /**
     * Processes requests for both HTTP GET and POST
     * methods.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
//    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
//            throws ServletException, IOException {
//        response.setContentType("text/html;charset=UTF-8");
//        try (PrintWriter out = response.getWriter()) {
//            /* TODO output your page here. You may use following sample code. */
//            out.println("<!DOCTYPE html>");
//            out.println("");
//            out.println("");
//            out.println("<title>Servlet AccountController</title>");
//            out.println("");
//            out.println("");
//            out.println("
Servlet AccountController at " + request.getContextPath() + "
");
//            out.println("");
//            out.println("");
//        }
//    }
    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /**
     * Handles the HTTP GET method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        //processRequest(request, response);
        HttpSession session = request.getSession();
        session.setAttribute("id", null);
        session.setAttribute("user", null);
        String location = request.getParameter("location")+".jsp";
        request.getRequestDispatcher(location).forward(request, response);
    }

    /**
     * Handles the HTTP POST method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        //processRequest(request, response);
        request.setCharacterEncoding("UTF-8");
        String task = request.getParameter("location");
        if (task.equals("Đăng ký")) {
            KhachHangBean khb = new KhachHangBean();
            KhachHangModel khm = new KhachHangModel();
            String username = request.getParameter("ten_dang_nhap");
            khb.setTAIKHOAN(username);
            String password = request.getParameter("mat_khau");
            khb.setMATKHAU(password);
            String name = request.getParameter("ho_ten");
            khb.setTENKH(name);
            int date_birth = Integer.parseInt(request.getParameter("date"));
            int month_birth = Integer.parseInt(request.getParameter("month"));
            int year_birth = Integer.parseInt(request.getParameter("year"));
            khb.setNGAYSINH(date_birth, month_birth, year_birth);
            String gen = request.getParameter("gender");
            int gender = (gen.equals("Nam")) ? 1 : 0;
            khb.setGIOITINH(gender);
            String email = request.getParameter("e-mail");
            khb.setEMAIL(email);
            String diachi = request.getParameter("diachi");
            khb.setDIACHI(diachi);
            String tinh = request.getParameter("tinh");
            khb.setTINH(tinh);
            String tp = request.getParameter("thanh_pho");
            khb.setTP(tp);
            String sdt = request.getParameter("sdt");
            khb.setSDT(sdt);
            int result = 0;
            try {
                result = khm.addCustomer(khb);
                if (result > 0) {
                    request.setAttribute("announce", "Success");
                } else {
                    request.setAttribute("announce", "Fail");
                }
            } catch (SQLException ex) {
                Logger.getLogger(AccountController.class.getName()).log(Level.SEVERE, null, ex);
                request.setAttribute("announce", "SQLException occur!");
            }
            request.setAttribute("go_back", "Member.jsp");
        }
        else {
            HttpSession session = request.getSession();
            String location = task + ".jsp";
            String taikhoan = request.getParameter("username");
            String matkhau = request.getParameter("password");
            KhachHangModel md = new KhachHangModel();
            int result = 0;
            try {
                result = md.checkAccount(taikhoan, matkhau);
                if (result != 0) {
                    session.setAttribute("MAKH", result);
                    session.setAttribute("user", taikhoan);
                    request.getRequestDispatcher(location).forward(request, response);
                } else {
                    request.getRequestDispatcher("Member.jsp").forward(request, response);
                }
            } catch (SQLException ex) {
                Logger.getLogger(AccountController.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        request.setAttribute("go_back", "Member.jsp");
        request.getRequestDispatcher("Server Announce.jsp").forward(request, response);
    }

    /**
     * Returns a short description of the servlet.
     *
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>

}


text:
Gebruiker - {{user.displayName}}

              Naam

              Email

Balans:

              <form ng-hide="submitted" name="paymentForm" ng-submit="submitPaymentForm(paymentForm.$valid)" class="form-inline" novalidate>

                  Betaling
                  <input type="number" ng-model="amount" class="form-control" ng-min="0.01" id="paymentAmount" placeholder="€0.00">
                  <button class="btn btn-default" ng-disabled="paymentForm.$invalid">Innen</button>

              </form>

De betaling is ontvangen.

              <button ng-show="submitted" class="btn btn-default" ng-click="submitted = false">Nog een betaling</button>


text:
package errors

import (
	"bytes"
	"fmt"
	"io"
)

// multiError type allows combining multiple errors into one.
type multiError []error

// NewMulti returns multiError with provided errors added if not nil.
func NewMulti(errs ...error) multiError { // nolint:golint
	m := multiError{}
	m.Add(errs...)
	return m
}

// Add adds single or many errors to the error list. Each error is added only if not nil.
// If the error is a nonNilMultiError type, the errors inside nonNilMultiError are added to the main multiError.
func (es *multiError) Add(errs ...error) {
	for _, err := range errs {
		if err == nil {
			continue
		}
		if merr, ok := err.(nonNilMultiError); ok {
			*es = append(*es, merr.errs...)
			continue
		}
		*es = append(*es, err)
	}
}

// Err returns the error list as an error or nil if it is empty.
func (es multiError) Err() error {
	if len(es) == 0 {
		return nil
	}
	return nonNilMultiError{errs: es}
}

// nonNilMultiError implements the error interface, and it represents
// multiError with at least one error inside it.
// This type is needed to make sure that nil is returned when no error is combined in multiError for err != nil
// check to work.
type nonNilMultiError struct {
	errs multiError
}

// Error returns a concatenated string of the contained errors.
func (es nonNilMultiError) Error() string {
	var buf bytes.Buffer

	if len(es.errs) > 1 {
		fmt.Fprintf(&buf, "%d errors: ", len(es.errs))
	}

	for i, err := range es.errs {
		if i != 0 {
			buf.WriteString("; ")
		}
		buf.WriteString(err.Error())
	}

	return buf.String()
}

// CloseAll closes all given closers while recording error in MultiError.
func CloseAll(cs []io.Closer) error {
	errs := NewMulti()
	for _, c := range cs {
		errs.Add(c.Close())
	}
	return errs.Err()
}


text:
/*
 * Desenvolvido por João Victor
 * Email: contato@joaovictor.net.br
 * URL: joaovictor.net.br
 * Página: acessar.php
 */

html, body{
    padding-top: initial;
}
body{
	background-attachment: fixed;
	/*background-image: url('../img/background-login.jpg');  */
	background: #54162e;
	background-position: center;  background-size: cover;  height: 100%;   }

body:before{
    content: none;  position: initial;  top: 0;  left: 0;  right: 0;  height: initial;  background: initial;  background-image: initial;
}
.container{  align-items: center;  display: flex;  height: 100%;  }

#form_acessar fieldset > legend{  color: #4d4d4d;  font-size: 1.5rem;  font-weight: 700;  margin-bottom: 40px;  text-transform: uppercase;  }

#form_acessar .input-group{  display:flex;  flex-direction: row-reverse;  }

#form_acessar .input-group-label{  border: none;  padding: 0;  width: 50px;  height: 50px;  color: #acacac;  background-color: #ffffff;  transition:all .5s ease;  }

#form_acessar .input-group-label .material-icons{  line-height: 50px;  }

#form_acessar .input-group-field{  border:1px solid #ffffff; }

#form_acessar .input-group-field:focus + .input-group-label, #form_acessar .input-group-field:hover + .input-group-label{  background-color: #1E87DB;  color: #ffffff;  }

#form_acessar input{  height: 50px;  font-size: 1rem; }

#form_acessar input[type=submit]{   width: 350px; }

@media screen and (max-width: 370px){
    #form_acessar input[type=submit]{   width: 100%; }
}

span > a{  color: #fff;  display: block;  font-size: .9rem;  margin: 5px 0;  -webkit-transition: all .5s;  -moz-transition: all .5s;  -ms-transition: all .5s;  -o-transition: all .5s;  transition: all .5s;  }

span > a:hover, span > a:focus {  color: #1E87DB; -webkit-text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);  -moz-text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);  }


text:
require_relative '../spec_helper'

describe '=> /domain-types/:type/actions/' do
  before(:all) do
    RestfulObjects::DomainModel.current.reset
  end

  it 'should generate an action description representation' do
    class ActionTest
      include RestfulObjects::Object
      action :do_something, return_type: :int, friendly_name: 'do something!', description: 'description of something'
    end

    expected = {
      'id' => 'do_something',
      'friendlyName' => 'do something!',
      'description' => 'description of something',
      'hasParams' => false,
      'memberOrder' => :integer,
      'parameters' => {},
      'links' => [
        { 'rel' => 'self',
          'href' => 'http://localhost/domain-types/ActionTest/actions/do_something',
          'type' => 'application/json;profile="urn:org.restfulobjects:repr-types/action-description"',
          'method' => 'GET' },
        { 'rel' => 'up',
          'href' => 'http://localhost/domain-types/ActionTest',
          'type' => 'application/json;profile="urn:org.restfulobjects:repr-types/domain-type"',
          'method' => 'GET' },
        { 'rel' => 'urn:org.restfulobjects:rels/return-type',
          'href' => 'http://localhost/domain-types/int',
          'type' => 'application/json;profile="urn:org.restfulobjects:repr-types/domain-type"',
          'method' => 'GET' }
      ]
    }

    get '/domain-types/ActionTest/actions/do_something'

    last_response.body.should match_json_expression expected
  end
end


text:
package com.platform.modules.test.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.platform.common.persistence.Page;
import com.platform.common.service.CrudService;
import com.platform.modules.test.bean.TestData;
import com.platform.modules.test.dao.TestDataDao;

/**
 * 单表生成Service
 * @author sunshine
 * @date 2015-04-06
 */
@Service
@Transactional(readOnly = true)
public class TestDataService extends CrudService<TestDataDao, TestData> {

	public TestData get(String id) {
		return super.get(id);
	}

	public List<TestData> findList(TestData testData) {
		return super.findList(testData);
	}

	public Page<TestData> findPage(Page<TestData> page, TestData testData) {
		return super.findPage(page, testData);
	}

	@Transactional(readOnly = false)
	public void save(TestData testData) {
		super.save(testData);
	}

	@Transactional(readOnly = false)
	public void delete(TestData testData) {
		super.delete(testData);
	}

}


text:
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import Vega from 'react-vega';

const spec = {
  $schema: 'https://vega.github.io/schema/vega/v5.json',
};
let Chart = Vega.createClassFromSpec(spec);
Chart = Vega.createClassFromSpec('chart', spec);

const data = {
  table: [{ key: 'A', value: 1 }, { key: 'B', value: 2 }],
};
ReactDOM.render(
  <Chart className="chart" data={data} width={256} height={128} />,
  document.body,
);

ReactDOM.render(<Vega spec={spec} />, document.body);