text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using SystemEnvironment = System.Environment;

namespace Kudu.Core.Infrastructure
{
    internal static class PathUtility
    {
        private const string ProgramFiles64bitKey = "ProgramW6432";

        /// <summary>
        /// The version of node.exe that would be on PATH, when the user does not specify/specifies invalid node versions.
        /// </summary>
        private const string DefaultNodeVersion = "0.10.28";

        /// <summary>
        /// Maps to the version of NPM that shipped with the DefaultNodeVersion
        /// </summary>
        private const string DefaultNpmVersion = "1.4.9";

        internal static string ResolveGitPath()
        {
            string relativePath = Path.Combine("Git", "bin", "git.exe");
            return ResolveRelativePathToProgramFiles(relativePath, relativePath, Resources.Error_FailedToLocateGit);
        }

        internal static string ResolveHgPath()
        {
            string relativePath = Path.Combine("Mercurial", "hg.exe");
            return ResolveRelativePathToProgramFiles(relativePath, relativePath, Resources.Error_FailedToLocateHg);
        }

        internal static string ResolveSSHPath()
        {
            // version that before 2.5, ssh.exe has different path than in version 2.5
            string relativeX86Path = Path.Combine("Git", "bin", "ssh.exe");
            string programFiles = SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ProgramFilesX86);
            string path = Path.Combine(programFiles, relativeX86Path);
            if (File.Exists(path))
            {
                return path;
            }

            string relativePath = Path.Combine("Git", "usr", "bin", "ssh.exe");
            return ResolveRelativePathToProgramFiles(relativePath, relativePath, Resources.Error_FailedToLocateSsh);
        }

        internal static string ResolveBashPath()
        {
            string relativePath = Path.Combine("Git", "bin", "bash.exe");
            return ResolveRelativePathToProgramFiles(relativePath, relativePath, Resources.Error_FailedToLocateBash);
        }

        internal static string ResolveNpmJsPath()
        {
            string programFiles = SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ProgramFilesX86);
            string npmCliPath = Path.Combine("node_modules", "npm", "bin", "npm-cli.js");
            string npmVersion = ResolveNpmVersion();

            // 1. Attempt to look for the file under the S24 updated path that looks like
            // "C:\Program Files (x86)\npm\1.3.8\node_modules\npm\bin\npm-cli.js"
            string npmPath = Path.Combine(programFiles, "npm", npmVersion, npmCliPath);
            if (File.Exists(npmPath))
            {
                return npmPath;
            }

            // 2. Attempt to look for the file under the pre-S24 npm path
            // "C:\Program Files (x86)\npm\1.3.8\bin\npm-cli.js"
            npmPath = Path.Combine(programFiles, "npm", npmVersion, "bin", "npm-cli.js");
            if (File.Exists(npmPath))
            {
                return npmPath;
            }

            // 3. Use the default npm path from the NodeJS installation
            // "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js"
            return Path.Combine(programFiles, "nodejs", npmCliPath);
        }

        internal static string ResolveMSBuildPath()
        {
            string programFiles = SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ProgramFilesX86);
            return Path.Combine(programFiles, @"MSBuild", "14.0", "Bin", "MSBuild.exe");
        }

        internal static string ResolveVsTestPath()
        {
            string programFiles = SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ProgramFilesX86);
            return Path.Combine(programFiles, "Microsoft Visual Studio 11.0", "Common7", "IDE", "CommonExtensions", "Microsoft", "TestWindow", "vstest.console.exe");
        }

        internal static string ResolveSQLCmdPath()
        {
            string programFiles = SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ProgramFilesX86);
            return Path.Combine(programFiles, "Microsoft SQL Server", "110", "Tools", "Binn", "sqlcmd.exe");
        }

        internal static string ResolveNpmGlobalPrefix()
        {
            string appDataDirectory = SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ApplicationData);
            return Path.Combine(appDataDirectory, "npm");
        }

        private static string ResolveNodeVersion()
        {
            bool fromAppSetting;
            return ResolveNodeVersion(out fromAppSetting);
        }

        private static string ResolveNodeVersion(out bool fromAppSetting)
        {
            // We can't use ConfigurationManager.AppSettings[] here because during git push this runs in kudu.exe context
            // which doesn't have access to Azure ConfigurationManager.AppSettings[] of the site
            string appSettingNodeVersion = SystemEnvironment.GetEnvironmentVariable("APPSETTING_WEBSITE_NODE_DEFAULT_VERSION");

            if (IsNodeVersionInstalled(appSettingNodeVersion))
            {
                fromAppSetting = true;
                return appSettingNodeVersion;
            }
            else
            {
                fromAppSetting = false;
                return DefaultNodeVersion;
            }
        }

        private static string ResolveNpmVersion()
        {
            return ResolveNpmVersion(ResolveNodeVersion());
        }

        private static string ResolveNpmVersion(string nodeVersion)
        {
            string programFiles = SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ProgramFilesX86);
            string appSettingNpmVersion = SystemEnvironment.GetEnvironmentVariable("WEBSITE_NPM_DEFAULT_VERSION");

            if (!string.IsNullOrEmpty(appSettingNpmVersion))
            {
                return appSettingNpmVersion;
            }
            else if (nodeVersion.Equals("4.1.2", StringComparison.OrdinalIgnoreCase))
            {
                // This case is only to work around node version 4.1.2 with npm 2.x failing to publish ASP.NET 5 apps due to long path issues.
                return "3.3.6";
            }
            else
            {
                string npmTxtPath = Path.Combine(programFiles, "nodejs", nodeVersion, "npm.txt");

                return FileSystemHelpers.FileExists(npmTxtPath) ? FileSystemHelpers.ReadAllTextFromFile(npmTxtPath).Trim() : DefaultNpmVersion;
            }
        }

        private static bool IsNodeVersionInstalled(string version)
        {
            string programFiles = SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ProgramFilesX86);
            return (!String.IsNullOrEmpty(version)) &&
                   FileSystemHelpers.FileExists(Path.Combine(programFiles, "nodejs", version, "node.exe"));
        }

        internal static List<string> ResolveNodeNpmPaths()
        {
            var paths = new List<string>();
            string programFiles = SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ProgramFilesX86);
            bool fromAppSetting;
            string nodeVersion = ResolveNodeVersion(out fromAppSetting);

            // Only set node.exe path when WEBSITE_NODE_DEFAULT_VERSION is not set in app setting and the path is invalid.
            if (!fromAppSetting)
            {
                string nodePath = Path.Combine(programFiles, "nodejs", nodeVersion);
                if (FileSystemHelpers.FileExists(Path.Combine(nodePath, "node.exe")))
                {
                    paths.Add(nodePath);
                }
            }

            // Only set npm.cmd path when npm.cmd can be found
            string npmVersion = ResolveNpmVersion(nodeVersion);
            string npmPath = Path.Combine(programFiles, "npm", npmVersion);
            if (FileSystemHelpers.FileExists(Path.Combine(npmPath, "npm.cmd")))
            {
                paths.Add(npmPath);
            }

            return paths;
        }

        internal static string CleanPath(string path)
        {
            if (path == null)
            {
                return null;
            }

            return Path.GetFullPath(path.Trim()).TrimEnd(Path.DirectorySeparatorChar);
        }

        internal static bool PathsEquals(string path1, string path2)
        {
            if (path1 == null)
            {
                return path2 == null;
            }

            return String.Equals(CleanPath(path1), CleanPath(path2), StringComparison.OrdinalIgnoreCase);
        }

        internal static string ResolveBowerPath()
        {
            return ResolveNpmToolsPath("bower");
        }

        internal static string ResolveGulpPath()
        {
            return ResolveNpmToolsPath("gulp");
        }

        internal static string ResolveGruntPath()
        {
            return ResolveNpmToolsPath("grunt");
        }

        internal static string ResolveFSharpCPath()
        {
            string programFiles = SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ProgramFilesX86);
            return Path.Combine(programFiles, @"Microsoft SDKs", "F#", "3.1", "Framework", "v4.0", "Fsc.exe");
        }

        private static string ResolveNpmToolsPath(string toolName)
        {
            // If there is a TOOLNAME_PATH specified, then use that.
            // Otherwise use the pre-installed one
            var toolPath = SystemEnvironment.GetEnvironmentVariable(String.Format("APPSETTING_{0}_PATH", toolName));
            if (String.IsNullOrEmpty(toolPath))
            {
                var programFiles = SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ProgramFilesX86);
                var toolRootPath = Path.Combine(programFiles, toolName);
                if (Directory.Exists(toolRootPath))
                {
                    // If there is a TOOLNAME_VERSION defined, use that.
                    // Otherwise use the latest one.
                    var userVersion = SystemEnvironment.GetEnvironmentVariable(String.Format("APPSETTING_{0}_VERSION", toolName));

                    toolPath = String.IsNullOrEmpty(userVersion)
                        ? Directory.GetDirectories(toolRootPath).OrderByDescending(p => p, StringComparer.OrdinalIgnoreCase).FirstOrDefault()
                        : Path.Combine(toolRootPath, userVersion);
                }
            }

            return String.IsNullOrEmpty(toolPath)
                ? String.Empty
                : Path.Combine(toolPath, String.Format("{0}.cmd", toolName));
        }

        private static string ResolveRelativePathToProgramFiles(string relativeX86Path, string relativeX64Path, string errorMessge)
        {
            string programFiles = SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ProgramFilesX86);
            string path = Path.Combine(programFiles, relativeX86Path);
            if (!File.Exists(path))
            {
                programFiles = SystemEnvironment.GetEnvironmentVariable(ProgramFiles64bitKey) ?? SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ProgramFiles);
                path = Path.Combine(programFiles, relativeX64Path);
            }

            if (!File.Exists(path))
            {
                throw new InvalidOperationException(errorMessge);
            }

            return path;
        }
    }
}


text:
function getString(_state) {
	var key = _state.key;
	var object = _state.object;
	if ((key === null) || (typeof object.get(key) === 'undefined') || object.get(key) === null) {
		return "";
	}
	return object.get(key);
}

exports.getFullName = function(_object) {
	name = getString({object: _object, key: 'prefix'}) + " " + getString({object: _object, key: 'first_name'}) + " " + getString({object: _object, key: 'middle_name'}) + " " + getString({object: _object, key: 'last_name'}) + " " + getString({object: _object, key: 'suffix'});
	name = name.replace(/\s+/g, " ");
	name = name.replace(/^\s*/g, "");
	return name;
}

exports.getPhoneticName = function(_object) {
	phoneticName = getString({object: _object, key: 'first_name_phonetic'}) + " " + getString({object: _object, key: 'last_name_phonetic'});
	phoneticName = phoneticName.replace(/\s+/g, " ");
	phoneticName = phoneticName.replace(/^\s*/g, "");
	return phoneticName;
}

exports.getJobDepartment = function(_object) {
	var jobTitle = getString({object: _object, key: 'job_title'});
	var department = getString({object: _object, key: 'department'});
	var jobDepartment = jobTitle + ((jobTitle != '' && department != '') ? "-" : "" ) + department;
	jobDepartment = jobDepartment.replace(/\s+/g, " ");
	jobDepartment = jobDepartment.replace(/^\s*/g, "");
	return jobDepartment;
}

exports.getCompany = function(_object) {
	var company = getString({object: _object, key: 'company'});
	return company;
}

redpajama_set_name: RedPajamaGithub


text:
[![CI](https://github.com/modelmapper/modelmapper/actions/workflows/ci.yml/badge.svg)](https://github.com/modelmapper/modelmapper/actions/workflows/ci.yml)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.modelmapper/modelmapper/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.modelmapper/modelmapper)
[![License](http://img.shields.io/:license-apache-brightgreen.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)

ModelMapper is an intelligent object mapping library that automatically maps objects to each other. It uses a convention based approach while providing a simple refactoring safe API for handling specific use cases.

Visit [modelmapper.org](http://modelmapper.org) to learn more.

## Modules

In v2.0, ModelMapper provides modules for 3rd library integration you can easily register by ```modelMapper.registerModule(new TheModule())```.

- [Java 8](https://github.com/chhsiao90/modelmapper-module-java8)
- [Protocol Buffer](https://github.com/modelmapper/modelmapper/tree/master/extensions/protobuf)
- [Vavr](https://github.com/julianps/modelmapper-module-vavr)

## Related Projects

- [Spring Boot ModelMapper Starter](https://github.com/jmnarloch/modelmapper-spring-boot-starter)

## Contributing

Bug reports and feature requests are welcome via the [issue tracker](https://github.com/modelmapper/modelmapper/issues). Fixes and enhancements are also welcome via pull requests. If you're unsure about a contribution idea, feel free to [contact me][me].

[me]: mailto:jhalterman@gmail.com


text:
/* MACHINE GENERATED FILE, DO NOT EDIT */

package org.lwjgl.opengl;

import org.lwjgl.*;
import java.nio.*;

public final class NVPathRendering {

	/**
	 *  Accepted in elements of the <commands> array parameter of
	 *  PathCommandsNV and PathSubCommandsNV:
	 */
	public static final int GL_CLOSE_PATH_NV = 0x0,
		GL_MOVE_TO_NV = 0x2,
		GL_RELATIVE_MOVE_TO_NV = 0x3,
		GL_LINE_TO_NV = 0x4,
		GL_RELATIVE_LINE_TO_NV = 0x5,
		GL_HORIZONTAL_LINE_TO_NV = 0x6,
		GL_RELATIVE_HORIZONTAL_LINE_TO_NV = 0x7,
		GL_VERTICAL_LINE_TO_NV = 0x8,
		GL_RELATIVE_VERTICAL_LINE_TO_NV = 0x9,
		GL_QUADRATIC_CURVE_TO_NV = 0xA,
		GL_RELATIVE_QUADRATIC_CURVE_TO_NV = 0xB,
		GL_CUBIC_CURVE_TO_NV = 0xC,
		GL_RELATIVE_CUBIC_CURVE_TO_NV = 0xD,
		GL_SMOOTH_QUADRATIC_CURVE_TO_NV = 0xE,
		GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV = 0xF,
		GL_SMOOTH_CUBIC_CURVE_TO_NV = 0x10,
		GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV = 0x11,
		GL_SMALL_CCW_ARC_TO_NV = 0x12,
		GL_RELATIVE_SMALL_CCW_ARC_TO_NV = 0x13,
		GL_SMALL_CW_ARC_TO_NV = 0x14,
		GL_RELATIVE_SMALL_CW_ARC_TO_NV = 0x15,
		GL_LARGE_CCW_ARC_TO_NV = 0x16,
		GL_RELATIVE_LARGE_CCW_ARC_TO_NV = 0x17,
		GL_LARGE_CW_ARC_TO_NV = 0x18,
		GL_RELATIVE_LARGE_CW_ARC_TO_NV = 0x19,
		GL_CIRCULAR_CCW_ARC_TO_NV = 0xF8,
		GL_CIRCULAR_CW_ARC_TO_NV = 0xFA,
		GL_CIRCULAR_TANGENT_ARC_TO_NV = 0xFC,
		GL_ARC_TO_NV = 0xFE,
		GL_RELATIVE_ARC_TO_NV = 0xFF;

	/**
	 * Accepted by the <format> parameter of PathStringNV:
	 */
	public static final int GL_PATH_FORMAT_SVG_NV = 0x9070,
		GL_PATH_FORMAT_PS_NV = 0x9071;

	/**
	 *  Accepted by the <fontTarget> parameter of PathGlyphsNV and
	 *  PathGlyphRangeNV:
	 */
	public static final int GL_STANDARD_FONT_NAME_NV = 0x9072,
		GL_SYSTEM_FONT_NAME_NV = 0x9073,
		GL_FILE_NAME_NV = 0x9074;

	/**
	 *  Accepted by the <handleMissingGlyph> parameter of PathGlyphsNV and
	 *  PathGlyphRangeNV:
	 */
	public static final int GL_SKIP_MISSING_GLYPH_NV = 0x90A9,
		GL_USE_MISSING_GLYPH_NV = 0x90AA;

	/**
	 *  Accepted by the <pname> parameter of PathParameterfNV,
	 *  PathParameterfvNV, GetPathParameterfvNV, PathParameteriNV,
	 *  PathParameterivNV, and GetPathParameterivNV:
	 */
	public static final int GL_PATH_STROKE_WIDTH_NV = 0x9075,
		GL_PATH_INITIAL_END_CAP_NV = 0x9077,
		GL_PATH_TERMINAL_END_CAP_NV = 0x9078,
		GL_PATH_JOIN_STYLE_NV = 0x9079,
		GL_PATH_MITER_LIMIT_NV = 0x907A,
		GL_PATH_INITIAL_DASH_CAP_NV = 0x907C,
		GL_PATH_TERMINAL_DASH_CAP_NV = 0x907D,
		GL_PATH_DASH_OFFSET_NV = 0x907E,
		GL_PATH_CLIENT_LENGTH_NV = 0x907F,
		GL_PATH_DASH_OFFSET_RESET_NV = 0x90B4,
		GL_PATH_FILL_MODE_NV = 0x9080,
		GL_PATH_FILL_MASK_NV = 0x9081,
		GL_PATH_FILL_COVER_MODE_NV = 0x9082,
		GL_PATH_STROKE_COVER_MODE_NV = 0x9083,
		GL_PATH_STROKE_MASK_NV = 0x9084;

	/**
	 *  Accepted by the <pname> parameter of PathParameterfNV and
	 *  PathParameterfvNV:
	 */
	public static final int GL_PATH_END_CAPS_NV = 0x9076,
		GL_PATH_DASH_CAPS_NV = 0x907B;

	/**
	 *  Accepted by the <fillMode> parameter of StencilFillPathNV and
	 *  StencilFillPathInstancedNV:
	 */
	public static final int GL_COUNT_UP_NV = 0x9088,
		GL_COUNT_DOWN_NV = 0x9089;

	/**
	 *  Accepted by the <color> parameter of PathColorGenNV,
	 *  GetPathColorGenivNV, and GetPathColorGenfvNV:
	 */
	public static final int GL_PRIMARY_COLOR = 0x8577,
		GL_PRIMARY_COLOR_NV = 0x852C,
		GL_SECONDARY_COLOR_NV = 0x852D;

	/**
	 *  Accepted by the <genMode> parameter of PathColorGenNV and
	 *  PathTexGenNV:
	 */
	public static final int GL_PATH_OBJECT_BOUNDING_BOX_NV = 0x908A;

	/**
	 *  Accepted by the <coverMode> parameter of CoverFillPathNV and
	 *  CoverFillPathInstancedNV:
	 */
	public static final int GL_CONVEX_HULL_NV = 0x908B,
		GL_BOUNDING_BOX_NV = 0x908D;

	/**
	 *  Accepted by the <transformType> parameter of
	 *  StencilFillPathInstancedNV, StencilStrokePathInstancedNV,
	 *  CoverFillPathInstancedNV, and CoverStrokePathInstancedNV:
	 */
	public static final int GL_TRANSLATE_X_NV = 0x908E,
		GL_TRANSLATE_Y_NV = 0x908F,
		GL_TRANSLATE_2D_NV = 0x9090,
		GL_TRANSLATE_3D_NV = 0x9091,
		GL_AFFINE_2D_NV = 0x9092,
		GL_AFFINE_3D_NV = 0x9094,
		GL_TRANSPOSE_AFFINE_2D_NV = 0x9096,
		GL_TRANSPOSE_AFFINE_3D_NV = 0x9098;

	/**
	 *  Accepted by the <type> or <pathNameType> parameter of CallLists,
	 *  StencilFillPathInstancedNV, StencilStrokePathInstancedNV,
	 *  CoverFillPathInstancedNV, CoverStrokePathInstancedNV,
	 *  GetPathMetricsNV, and GetPathSpacingNV:
	 */
	public static final int GL_UTF8_NV = 0x909A,
		GL_UTF16_NV = 0x909B;

	/**
	 * Accepted by the <coverMode> parameter of CoverFillPathInstancedNV:
	 */
	public static final int GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV = 0x909C;

	/**
	 *  Accepted by the <pname> parameter of GetPathParameterfvNV and
	 *  GetPathParameterivNV:
	 */
	public static final int GL_PATH_COMMAND_COUNT_NV = 0x909D,
		GL_PATH_COORD_COUNT_NV = 0x909E,
		GL_PATH_DASH_ARRAY_COUNT_NV = 0x909F,
		GL_PATH_COMPUTED_LENGTH_NV = 0x90A0,
		GL_PATH_FILL_BOUNDING_BOX_NV = 0x90A1,
		GL_PATH_STROKE_BOUNDING_BOX_NV = 0x90A2;

	/**
	 *  Accepted by the <value> parameter of PathParameterfNV,
	 *  PathParameterfvNV, PathParameteriNV, and PathParameterivNV
	 *  when <pname> is one of PATH_END_CAPS_NV, PATH_INTIAL_END_CAP_NV,
	 *  PATH_TERMINAL_END_CAP_NV, PATH_DASH_CAPS_NV, PATH_INITIAL_DASH_CAP_NV,
	 *  and PATH_TERMINAL_DASH_CAP_NV:
	 */
	public static final int GL_SQUARE_NV = 0x90A3,
		GL_ROUND_NV = 0x90A4,
		GL_TRIANGULAR_NV = 0x90A5;

	/**
	 *  Accepted by the <value> parameter of PathParameterfNV,
	 *  PathParameterfvNV, PathParameteriNV, and PathParameterivNV
	 *  when <pname> is PATH_JOIN_STYLE_NV:
	 */
	public static final int GL_BEVEL_NV = 0x90A6,
		GL_MITER_REVERT_NV = 0x90A7,
		GL_MITER_TRUNCATE_NV = 0x90A8;

	/**
	 *  Accepted by the <value> parameter of PathParameterfNV,
	 *  PathParameterfvNV, PathParameteriNV, and PathParameterivNV when
	 *  <pname> is PATH_DASH_OFFSET_RESET_NV
	 */
	public static final int GL_MOVE_TO_RESETS_NV = 0x90B5,
		GL_MOVE_TO_CONTINUES_NV = 0x90B6;

	/**
	 * Accepted by the <fontStyle> parameter of PathStringNV:
	 */
	public static final int GL_BOLD_BIT_NV = 0x1,
		GL_ITALIC_BIT_NV = 0x2;

	/**
	 *  Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
	 *  GetInteger64v, GetFloatv, and GetDoublev:
	 */
	public static final int GL_PATH_ERROR_POSITION_NV = 0x90AB,
		GL_PATH_FOG_GEN_MODE_NV = 0x90AC,
		GL_PATH_STENCIL_FUNC_NV = 0x90B7,
		GL_PATH_STENCIL_REF_NV = 0x90B8,
		GL_PATH_STENCIL_VALUE_MASK_NV = 0x90B9,
		GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV = 0x90BD,
		GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV = 0x90BE,
		GL_PATH_COVER_DEPTH_FUNC_NV = 0x90BF;

	/**
	 *  Accepted as a bit within the <metricQueryMask> parameter of
	 *  GetPathMetricRangeNV or GetPathMetricsNV:
	 */
	public static final int GL_GLYPH_WIDTH_BIT_NV = 0x1,
		GL_GLYPH_HEIGHT_BIT_NV = 0x2,
		GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV = 0x4,
		GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV = 0x8,
		GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV = 0x10,
		GL_GLYPH_VERTICAL_BEARING_X_BIT_NV = 0x20,
		GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV = 0x40,
		GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV = 0x80,
		GL_GLYPH_HAS_KERNING_NV = 0x100,
		GL_FONT_X_MIN_BOUNDS_NV = 0x10000,
		GL_FONT_Y_MIN_BOUNDS_NV = 0x20000,
		GL_FONT_X_MAX_BOUNDS_NV = 0x40000,
		GL_FONT_Y_MAX_BOUNDS_NV = 0x80000,
		GL_FONT_UNITS_PER_EM_NV = 0x100000,
		GL_FONT_ASCENDER_NV = 0x200000,
		GL_FONT_DESCENDER_NV = 0x400000,
		GL_FONT_HEIGHT_NV = 0x800000,
		GL_FONT_MAX_ADVANCE_WIDTH_NV = 0x1000000,
		GL_FONT_MAX_ADVANCE_HEIGHT_NV = 0x2000000,
		GL_FONT_UNDERLINE_POSITION_NV = 0x4000000,
		GL_FONT_UNDERLINE_THICKNESS_NV = 0x8000000,
		GL_FONT_HAS_KERNING_NV = 0x10000000;

	/**
	 * Accepted by the <pathListMode> parameter of GetPathSpacingNV:
	 */
	public static final int GL_ACCUM_ADJACENT_PAIRS_NV = 0x90AD,
		GL_ADJACENT_PAIRS_NV = 0x90AE,
		GL_FIRST_TO_REST_NV = 0x90AF;

	/**
	 *  Accepted by the <pname> parameter of GetPathColorGenivNV,
	 *  GetPathColorGenfvNV, GetPathTexGenivNV and GetPathTexGenfvNV:
	 */
	public static final int GL_PATH_GEN_MODE_NV = 0x90B0,
		GL_PATH_GEN_COEFF_NV = 0x90B1,
		GL_PATH_GEN_COLOR_FORMAT_NV = 0x90B2,
		GL_PATH_GEN_COMPONENTS_NV = 0x90B3;

	private NVPathRendering() {}

	public static void glPathCommandsNV(int path, ByteBuffer commands, int coordType, ByteBuffer coords) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathCommandsNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(commands);
		BufferChecks.checkDirect(coords);
		nglPathCommandsNV(path, commands.remaining(), MemoryUtil.getAddress(commands), coords.remaining(), coordType, MemoryUtil.getAddress(coords), function_pointer);
	}
	static native void nglPathCommandsNV(int path, int commands_numCommands, long commands, int coords_numCoords, int coordType, long coords, long function_pointer);

	public static void glPathCoordsNV(int path, int coordType, ByteBuffer coords) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathCoordsNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(coords);
		nglPathCoordsNV(path, coords.remaining(), coordType, MemoryUtil.getAddress(coords), function_pointer);
	}
	static native void nglPathCoordsNV(int path, int coords_numCoords, int coordType, long coords, long function_pointer);

	public static void glPathSubCommandsNV(int path, int commandStart, int commandsToDelete, ByteBuffer commands, int coordType, ByteBuffer coords) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathSubCommandsNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(commands);
		BufferChecks.checkDirect(coords);
		nglPathSubCommandsNV(path, commandStart, commandsToDelete, commands.remaining(), MemoryUtil.getAddress(commands), coords.remaining(), coordType, MemoryUtil.getAddress(coords), function_pointer);
	}
	static native void nglPathSubCommandsNV(int path, int commandStart, int commandsToDelete, int commands_numCommands, long commands, int coords_numCoords, int coordType, long coords, long function_pointer);

	public static void glPathSubCoordsNV(int path, int coordStart, int coordType, ByteBuffer coords) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathSubCoordsNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(coords);
		nglPathSubCoordsNV(path, coordStart, coords.remaining(), coordType, MemoryUtil.getAddress(coords), function_pointer);
	}
	static native void nglPathSubCoordsNV(int path, int coordStart, int coords_numCoords, int coordType, long coords, long function_pointer);

	public static void glPathStringNV(int path, int format, ByteBuffer pathString) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathStringNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(pathString);
		nglPathStringNV(path, format, pathString.remaining(), MemoryUtil.getAddress(pathString), function_pointer);
	}
	static native void nglPathStringNV(int path, int format, int pathString_length, long pathString, long function_pointer);

	public static void glPathGlyphsNV(int firstPathName, int fontTarget, ByteBuffer fontName, int fontStyle, int type, ByteBuffer charcodes, int handleMissingGlyphs, int pathParameterTemplate, float emScale) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathGlyphsNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(fontName);
		BufferChecks.checkNullTerminated(fontName);
		BufferChecks.checkDirect(charcodes);
		nglPathGlyphsNV(firstPathName, fontTarget, MemoryUtil.getAddress(fontName), fontStyle, charcodes.remaining() / GLChecks.calculateBytesPerCharCode(type), type, MemoryUtil.getAddress(charcodes), handleMissingGlyphs, pathParameterTemplate, emScale, function_pointer);
	}
	static native void nglPathGlyphsNV(int firstPathName, int fontTarget, long fontName, int fontStyle, int charcodes_numGlyphs, int type, long charcodes, int handleMissingGlyphs, int pathParameterTemplate, float emScale, long function_pointer);

	public static void glPathGlyphRangeNV(int firstPathName, int fontTarget, ByteBuffer fontName, int fontStyle, int firstGlyph, int numGlyphs, int handleMissingGlyphs, int pathParameterTemplate, float emScale) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathGlyphRangeNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(fontName);
		BufferChecks.checkNullTerminated(fontName);
		nglPathGlyphRangeNV(firstPathName, fontTarget, MemoryUtil.getAddress(fontName), fontStyle, firstGlyph, numGlyphs, handleMissingGlyphs, pathParameterTemplate, emScale, function_pointer);
	}
	static native void nglPathGlyphRangeNV(int firstPathName, int fontTarget, long fontName, int fontStyle, int firstGlyph, int numGlyphs, int handleMissingGlyphs, int pathParameterTemplate, float emScale, long function_pointer);

	public static void glWeightPathsNV(int resultPath, IntBuffer paths, FloatBuffer weights) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glWeightPathsNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(paths);
		BufferChecks.checkBuffer(weights, paths.remaining());
		nglWeightPathsNV(resultPath, paths.remaining(), MemoryUtil.getAddress(paths), MemoryUtil.getAddress(weights), function_pointer);
	}
	static native void nglWeightPathsNV(int resultPath, int paths_numPaths, long paths, long weights, long function_pointer);

	public static void glCopyPathNV(int resultPath, int srcPath) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glCopyPathNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		nglCopyPathNV(resultPath, srcPath, function_pointer);
	}
	static native void nglCopyPathNV(int resultPath, int srcPath, long function_pointer);

	public static void glInterpolatePathsNV(int resultPath, int pathA, int pathB, float weight) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glInterpolatePathsNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		nglInterpolatePathsNV(resultPath, pathA, pathB, weight, function_pointer);
	}
	static native void nglInterpolatePathsNV(int resultPath, int pathA, int pathB, float weight, long function_pointer);

	public static void glTransformPathNV(int resultPath, int srcPath, int transformType, FloatBuffer transformValues) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glTransformPathNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		if (transformValues != null)
			BufferChecks.checkBuffer(transformValues, GLChecks.calculateTransformPathValues(transformType));
		nglTransformPathNV(resultPath, srcPath, transformType, MemoryUtil.getAddressSafe(transformValues), function_pointer);
	}
	static native void nglTransformPathNV(int resultPath, int srcPath, int transformType, long transformValues, long function_pointer);

	public static void glPathParameterNV(int path, int pname, IntBuffer value) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathParameterivNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkBuffer(value, 4);
		nglPathParameterivNV(path, pname, MemoryUtil.getAddress(value), function_pointer);
	}
	static native void nglPathParameterivNV(int path, int pname, long value, long function_pointer);

	public static void glPathParameteriNV(int path, int pname, int value) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathParameteriNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		nglPathParameteriNV(path, pname, value, function_pointer);
	}
	static native void nglPathParameteriNV(int path, int pname, int value, long function_pointer);

	public static void glPathParameterNV(int path, int pname, FloatBuffer value) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathParameterfvNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkBuffer(value, 4);
		nglPathParameterfvNV(path, pname, MemoryUtil.getAddress(value), function_pointer);
	}
	static native void nglPathParameterfvNV(int path, int pname, long value, long function_pointer);

	public static void glPathParameterfNV(int path, int pname, float value) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathParameterfNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		nglPathParameterfNV(path, pname, value, function_pointer);
	}
	static native void nglPathParameterfNV(int path, int pname, float value, long function_pointer);

	public static void glPathDashArrayNV(int path, FloatBuffer dashArray) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathDashArrayNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(dashArray);
		nglPathDashArrayNV(path, dashArray.remaining(), MemoryUtil.getAddress(dashArray), function_pointer);
	}
	static native void nglPathDashArrayNV(int path, int dashArray_dashCount, long dashArray, long function_pointer);

	public static int glGenPathsNV(int range) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGenPathsNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		int __result = nglGenPathsNV(range, function_pointer);
		return __result;
	}
	static native int nglGenPathsNV(int range, long function_pointer);

	public static void glDeletePathsNV(int path, int range) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glDeletePathsNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		nglDeletePathsNV(path, range, function_pointer);
	}
	static native void nglDeletePathsNV(int path, int range, long function_pointer);

	public static boolean glIsPathNV(int path) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glIsPathNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		boolean __result = nglIsPathNV(path, function_pointer);
		return __result;
	}
	static native boolean nglIsPathNV(int path, long function_pointer);

	public static void glPathStencilFuncNV(int func, int ref, int mask) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathStencilFuncNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		nglPathStencilFuncNV(func, ref, mask, function_pointer);
	}
	static native void nglPathStencilFuncNV(int func, int ref, int mask, long function_pointer);

	public static void glPathStencilDepthOffsetNV(float factor, int units) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathStencilDepthOffsetNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		nglPathStencilDepthOffsetNV(factor, units, function_pointer);
	}
	static native void nglPathStencilDepthOffsetNV(float factor, int units, long function_pointer);

	public static void glStencilFillPathNV(int path, int fillMode, int mask) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glStencilFillPathNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		nglStencilFillPathNV(path, fillMode, mask, function_pointer);
	}
	static native void nglStencilFillPathNV(int path, int fillMode, int mask, long function_pointer);

	public static void glStencilStrokePathNV(int path, int reference, int mask) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glStencilStrokePathNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		nglStencilStrokePathNV(path, reference, mask, function_pointer);
	}
	static native void nglStencilStrokePathNV(int path, int reference, int mask, long function_pointer);

	public static void glStencilFillPathInstancedNV(int pathNameType, ByteBuffer paths, int pathBase, int fillMode, int mask, int transformType, FloatBuffer transformValues) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glStencilFillPathInstancedNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(paths);
		if (transformValues != null)
			BufferChecks.checkBuffer(transformValues, GLChecks.calculateTransformPathValues(transformType));
		nglStencilFillPathInstancedNV(paths.remaining() / GLChecks.calculateBytesPerPathName(pathNameType), pathNameType, MemoryUtil.getAddress(paths), pathBase, fillMode, mask, transformType, MemoryUtil.getAddressSafe(transformValues), function_pointer);
	}
	static native void nglStencilFillPathInstancedNV(int paths_numPaths, int pathNameType, long paths, int pathBase, int fillMode, int mask, int transformType, long transformValues, long function_pointer);

	public static void glStencilStrokePathInstancedNV(int pathNameType, ByteBuffer paths, int pathBase, int reference, int mask, int transformType, FloatBuffer transformValues) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glStencilStrokePathInstancedNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(paths);
		if (transformValues != null)
			BufferChecks.checkBuffer(transformValues, GLChecks.calculateTransformPathValues(transformType));
		nglStencilStrokePathInstancedNV(paths.remaining() / GLChecks.calculateBytesPerPathName(pathNameType), pathNameType, MemoryUtil.getAddress(paths), pathBase, reference, mask, transformType, MemoryUtil.getAddressSafe(transformValues), function_pointer);
	}
	static native void nglStencilStrokePathInstancedNV(int paths_numPaths, int pathNameType, long paths, int pathBase, int reference, int mask, int transformType, long transformValues, long function_pointer);

	public static void glPathCoverDepthFuncNV(int zfunc) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathCoverDepthFuncNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		nglPathCoverDepthFuncNV(zfunc, function_pointer);
	}
	static native void nglPathCoverDepthFuncNV(int zfunc, long function_pointer);

	public static void glPathColorGenNV(int color, int genMode, int colorFormat, FloatBuffer coeffs) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathColorGenNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		if (coeffs != null)
			BufferChecks.checkBuffer(coeffs, GLChecks.calculatePathColorGenCoeffsCount(genMode, colorFormat));
		nglPathColorGenNV(color, genMode, colorFormat, MemoryUtil.getAddressSafe(coeffs), function_pointer);
	}
	static native void nglPathColorGenNV(int color, int genMode, int colorFormat, long coeffs, long function_pointer);

	public static void glPathTexGenNV(int texCoordSet, int genMode, FloatBuffer coeffs) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathTexGenNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		if (coeffs != null)
			BufferChecks.checkDirect(coeffs);
		nglPathTexGenNV(texCoordSet, genMode, GLChecks.calculatePathTextGenCoeffsPerComponent(coeffs, genMode), MemoryUtil.getAddressSafe(coeffs), function_pointer);
	}
	static native void nglPathTexGenNV(int texCoordSet, int genMode, int coeffs_components, long coeffs, long function_pointer);

	public static void glPathFogGenNV(int genMode) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPathFogGenNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		nglPathFogGenNV(genMode, function_pointer);
	}
	static native void nglPathFogGenNV(int genMode, long function_pointer);

	public static void glCoverFillPathNV(int path, int coverMode) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glCoverFillPathNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		nglCoverFillPathNV(path, coverMode, function_pointer);
	}
	static native void nglCoverFillPathNV(int path, int coverMode, long function_pointer);

	public static void glCoverStrokePathNV(int name, int coverMode) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glCoverStrokePathNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		nglCoverStrokePathNV(name, coverMode, function_pointer);
	}
	static native void nglCoverStrokePathNV(int name, int coverMode, long function_pointer);

	public static void glCoverFillPathInstancedNV(int pathNameType, ByteBuffer paths, int pathBase, int coverMode, int transformType, FloatBuffer transformValues) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glCoverFillPathInstancedNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(paths);
		if (transformValues != null)
			BufferChecks.checkBuffer(transformValues, GLChecks.calculateTransformPathValues(transformType));
		nglCoverFillPathInstancedNV(paths.remaining() / GLChecks.calculateBytesPerPathName(pathNameType), pathNameType, MemoryUtil.getAddress(paths), pathBase, coverMode, transformType, MemoryUtil.getAddressSafe(transformValues), function_pointer);
	}
	static native void nglCoverFillPathInstancedNV(int paths_numPaths, int pathNameType, long paths, int pathBase, int coverMode, int transformType, long transformValues, long function_pointer);

	public static void glCoverStrokePathInstancedNV(int pathNameType, ByteBuffer paths, int pathBase, int coverMode, int transformType, FloatBuffer transformValues) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glCoverStrokePathInstancedNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(paths);
		if (transformValues != null)
			BufferChecks.checkBuffer(transformValues, GLChecks.calculateTransformPathValues(transformType));
		nglCoverStrokePathInstancedNV(paths.remaining() / GLChecks.calculateBytesPerPathName(pathNameType), pathNameType, MemoryUtil.getAddress(paths), pathBase, coverMode, transformType, MemoryUtil.getAddressSafe(transformValues), function_pointer);
	}
	static native void nglCoverStrokePathInstancedNV(int paths_numPaths, int pathNameType, long paths, int pathBase, int coverMode, int transformType, long transformValues, long function_pointer);

	public static void glGetPathParameterNV(int name, int param, IntBuffer value) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathParameterivNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkBuffer(value, 4);
		nglGetPathParameterivNV(name, param, MemoryUtil.getAddress(value), function_pointer);
	}
	static native void nglGetPathParameterivNV(int name, int param, long value, long function_pointer);

	/** Overloads glGetPathParameterivNV. */
	public static int glGetPathParameteriNV(int name, int param) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathParameterivNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		IntBuffer value = APIUtil.getBufferInt(caps);
		nglGetPathParameterivNV(name, param, MemoryUtil.getAddress(value), function_pointer);
		return value.get(0);
	}

	public static void glGetPathParameterfvNV(int name, int param, FloatBuffer value) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathParameterfvNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkBuffer(value, 4);
		nglGetPathParameterfvNV(name, param, MemoryUtil.getAddress(value), function_pointer);
	}
	static native void nglGetPathParameterfvNV(int name, int param, long value, long function_pointer);

	/** Overloads glGetPathParameterfvNV. */
	public static float glGetPathParameterfNV(int name, int param) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathParameterfvNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		FloatBuffer value = APIUtil.getBufferFloat(caps);
		nglGetPathParameterfvNV(name, param, MemoryUtil.getAddress(value), function_pointer);
		return value.get(0);
	}

	public static void glGetPathCommandsNV(int name, ByteBuffer commands) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathCommandsNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(commands);
		nglGetPathCommandsNV(name, MemoryUtil.getAddress(commands), function_pointer);
	}
	static native void nglGetPathCommandsNV(int name, long commands, long function_pointer);

	public static void glGetPathCoordsNV(int name, FloatBuffer coords) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathCoordsNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(coords);
		nglGetPathCoordsNV(name, MemoryUtil.getAddress(coords), function_pointer);
	}
	static native void nglGetPathCoordsNV(int name, long coords, long function_pointer);

	public static void glGetPathDashArrayNV(int name, FloatBuffer dashArray) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathDashArrayNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(dashArray);
		nglGetPathDashArrayNV(name, MemoryUtil.getAddress(dashArray), function_pointer);
	}
	static native void nglGetPathDashArrayNV(int name, long dashArray, long function_pointer);

	public static void glGetPathMetricsNV(int metricQueryMask, int pathNameType, ByteBuffer paths, int pathBase, int stride, FloatBuffer metrics) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathMetricsNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkDirect(paths);
		BufferChecks.checkBuffer(metrics, GLChecks.calculateMetricsSize(metricQueryMask, stride));
		nglGetPathMetricsNV(metricQueryMask, paths.remaining() / GLChecks.calculateBytesPerPathName(pathNameType), pathNameType, MemoryUtil.getAddress(paths), pathBase, stride, MemoryUtil.getAddress(metrics), function_pointer);
	}
	static native void nglGetPathMetricsNV(int metricQueryMask, int paths_numPaths, int pathNameType, long paths, int pathBase, int stride, long metrics, long function_pointer);

	public static void glGetPathMetricRangeNV(int metricQueryMask, int fistPathName, int numPaths, int stride, FloatBuffer metrics) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathMetricRangeNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkBuffer(metrics, GLChecks.calculateMetricsSize(metricQueryMask, stride));
		nglGetPathMetricRangeNV(metricQueryMask, fistPathName, numPaths, stride, MemoryUtil.getAddress(metrics), function_pointer);
	}
	static native void nglGetPathMetricRangeNV(int metricQueryMask, int fistPathName, int numPaths, int stride, long metrics, long function_pointer);

	public static void glGetPathSpacingNV(int pathListMode, int pathNameType, ByteBuffer paths, int pathBase, float advanceScale, float kerningScale, int transformType, FloatBuffer returnedSpacing) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathSpacingNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		int numPaths = paths.remaining() / GLChecks.calculateBytesPerPathName(pathNameType);
		BufferChecks.checkDirect(paths);
		BufferChecks.checkBuffer(returnedSpacing, numPaths - 1);
		nglGetPathSpacingNV(pathListMode, numPaths, pathNameType, MemoryUtil.getAddress(paths), pathBase, advanceScale, kerningScale, transformType, MemoryUtil.getAddress(returnedSpacing), function_pointer);
	}
	static native void nglGetPathSpacingNV(int pathListMode, int paths_numPaths, int pathNameType, long paths, int pathBase, float advanceScale, float kerningScale, int transformType, long returnedSpacing, long function_pointer);

	public static void glGetPathColorGenNV(int color, int pname, IntBuffer value) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathColorGenivNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkBuffer(value, 16);
		nglGetPathColorGenivNV(color, pname, MemoryUtil.getAddress(value), function_pointer);
	}
	static native void nglGetPathColorGenivNV(int color, int pname, long value, long function_pointer);

	/** Overloads glGetPathColorGenivNV. */
	public static int glGetPathColorGeniNV(int color, int pname) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathColorGenivNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		IntBuffer value = APIUtil.getBufferInt(caps);
		nglGetPathColorGenivNV(color, pname, MemoryUtil.getAddress(value), function_pointer);
		return value.get(0);
	}

	public static void glGetPathColorGenNV(int color, int pname, FloatBuffer value) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathColorGenfvNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkBuffer(value, 16);
		nglGetPathColorGenfvNV(color, pname, MemoryUtil.getAddress(value), function_pointer);
	}
	static native void nglGetPathColorGenfvNV(int color, int pname, long value, long function_pointer);

	/** Overloads glGetPathColorGenfvNV. */
	public static float glGetPathColorGenfNV(int color, int pname) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathColorGenfvNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		FloatBuffer value = APIUtil.getBufferFloat(caps);
		nglGetPathColorGenfvNV(color, pname, MemoryUtil.getAddress(value), function_pointer);
		return value.get(0);
	}

	public static void glGetPathTexGenNV(int texCoordSet, int pname, IntBuffer value) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathTexGenivNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkBuffer(value, 16);
		nglGetPathTexGenivNV(texCoordSet, pname, MemoryUtil.getAddress(value), function_pointer);
	}
	static native void nglGetPathTexGenivNV(int texCoordSet, int pname, long value, long function_pointer);

	/** Overloads glGetPathTexGenivNV. */
	public static int glGetPathTexGeniNV(int texCoordSet, int pname) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathTexGenivNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		IntBuffer value = APIUtil.getBufferInt(caps);
		nglGetPathTexGenivNV(texCoordSet, pname, MemoryUtil.getAddress(value), function_pointer);
		return value.get(0);
	}

	public static void glGetPathTexGenNV(int texCoordSet, int pname, FloatBuffer value) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathTexGenfvNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		BufferChecks.checkBuffer(value, 16);
		nglGetPathTexGenfvNV(texCoordSet, pname, MemoryUtil.getAddress(value), function_pointer);
	}
	static native void nglGetPathTexGenfvNV(int texCoordSet, int pname, long value, long function_pointer);

	/** Overloads glGetPathTexGenfvNV. */
	public static float glGetPathTexGenfNV(int texCoordSet, int pname) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathTexGenfvNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		FloatBuffer value = APIUtil.getBufferFloat(caps);
		nglGetPathTexGenfvNV(texCoordSet, pname, MemoryUtil.getAddress(value), function_pointer);
		return value.get(0);
	}

	public static boolean glIsPointInFillPathNV(int path, int mask, float x, float y) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glIsPointInFillPathNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		boolean __result = nglIsPointInFillPathNV(path, mask, x, y, function_pointer);
		return __result;
	}
	static native boolean nglIsPointInFillPathNV(int path, int mask, float x, float y, long function_pointer);

	public static boolean glIsPointInStrokePathNV(int path, float x, float y) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glIsPointInStrokePathNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		boolean __result = nglIsPointInStrokePathNV(path, x, y, function_pointer);
		return __result;
	}
	static native boolean nglIsPointInStrokePathNV(int path, float x, float y, long function_pointer);

	public static float glGetPathLengthNV(int path, int startSegment, int numSegments) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glGetPathLengthNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		float __result = nglGetPathLengthNV(path, startSegment, numSegments, function_pointer);
		return __result;
	}
	static native float nglGetPathLengthNV(int path, int startSegment, int numSegments, long function_pointer);

	public static boolean glPointAlongPathNV(int path, int startSegment, int numSegments, float distance, FloatBuffer x, FloatBuffer y, FloatBuffer tangentX, FloatBuffer tangentY) {
		ContextCapabilities caps = GLContext.getCapabilities();
		long function_pointer = caps.glPointAlongPathNV;
		BufferChecks.checkFunctionAddress(function_pointer);
		if (x != null)
			BufferChecks.checkBuffer(x, 1);
		if (y != null)
			BufferChecks.checkBuffer(y, 1);
		if (tangentX != null)
			BufferChecks.checkBuffer(tangentX, 1);
		if (tangentY != null)
			BufferChecks.checkBuffer(tangentY, 1);
		boolean __result = nglPointAlongPathNV(path, startSegment, numSegments, distance, MemoryUtil.getAddressSafe(x), MemoryUtil.getAddressSafe(y), MemoryUtil.getAddressSafe(tangentX), MemoryUtil.getAddressSafe(tangentY), function_pointer);
		return __result;
	}
	static native boolean nglPointAlongPathNV(int path, int startSegment, int numSegments, float distance, long x, long y, long tangentX, long tangentY, long function_pointer);
}


text:
var ojp = angular.module('orgjswapp',['ui.tinymce','ngFileUpload','ngSanitize','ngCookies']);

/*
This directive allows us to pass a function in on an enter key to do what we want.
 */
ojp.directive('ngEnter', function () {
    return function (scope, element, attrs) {
        element.bind("keydown keypress", function (event) {
            if(event.which === 13) {
                scope.$apply(function (){
                    scope.$eval(attrs.ngEnter);
                });

                event.preventDefault();
            }
        });
    };
});

ojp.controller('ajpctrlr', ['$scope' ,'$http', 'Upload','$cookies',function ($scope,$http,Upload,$cookies) {
	//$scope.articletitle="Title of Test";
	//$scope.mainarticle="dsdsds";

	$scope.hidearticles=true;

	var ck = $cookies.get("Clancapuser");
	var cka = ck.split(";");
	$scope.hidelodr=true;
	$scope.email = cka[0];
	$scope.uid = cka[1];
	$scope.token = cka[2];

	 $scope.$watch('articleimage', function () {
        $scope.upload($scope.articleimage);
    });

	 $scope.upload = function (articleimage) {//Upload Header Main Image
	 	if(!articleimage || !articleimage.length)
	 		return;

		$scope.hidearticles=true;
	 	//for (var i = 0; i < articleimage.length; i++) {
                var file = articleimage[0];
                Upload.upload({
                    url: '/touch/srvc/getArticleMainImage.php?a='+$scope.uid+'&b='+$scope.token,
                    fields: {'user': $scope.uid,'token': $scope.token},
                    file: file
                }).progress(function (evt) {
                    var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);
                    console.log('progress: ' + progressPercentage + '% ' + evt.config.file.name);

                }).success(function (data, status, headers, config) {
                	$scope.hidelodr=true;
                    console.log('file ' + config.file.name + 'uploaded. Response: ' + data);
                    console.log('Success',data);
                    if(data.success){
                    	$scope.mainarticleimage='https://www.clancap.com/touch/srvc/profiles.php?i=k&k='+data.mainarticleimage;
                    	$scope.thumbimg='https://www.clancap.com/touch/srvc/profiles.php?i=k&k='+data.thumbimg;
                    }
                    //$scope.mainarticleimage=data.message;
                    else
                    	alert('Error: '+data.message);
                    $scope.hidelodr=true;
                });
        //}

	 	//alert('Image'+articleimage);
	 }

  $scope.phones = [
    {'name': 'Nexus S',
     'snippet': 'Fast just got faster with Nexus S.'},
    {'name': 'Motorola XOOM™ with Wi-Fi',
     'snippet': 'The Next, Next Generation tablet.'},
    {'name': 'MOTOROLA XOOM™',
     'snippet': 'The Next, Next Generation tablet.'}
  ];

$scope.imageup=function(a,b,c,d,e){
	console.log('gotit',$scope.contimgs);
}

$scope.newarticle=function(){
	$scope.articleid = '';
		$scope.articletitle='';
		$scope.mainarticleimage=null;
		$scope.mainarticle ='';
		$scope.thumbimg = null;
		$scope.pvt = true;
		$scope.thumbimg = '';
		$scope.articleimage = '';
}
$scope.loadarticle=function(me){
	$scope.hidearticles=false;
	$scope.hidelodr=false;
	/*$.ajax({
	url:'/touch/srvc/dbgetCont.php?a='+$scope.uid+'&b='+$scope.token,
	context: document.body,
	method:'post',
	data:{aid:me.article.a}
	})*/

	$http({
		method:'POST',
		url:'/touch/srvc/dbgetCont.php?a='+$scope.uid+'&b='+$scope.token,
		data:$.param( {aid:me.article.a} ),
		headers : {'Content-Type': 'application/x-www-form-urlencoded'}

	}).success(function(data1) {
		$scope.hidelodr=true;
		//$scope.articles=data1.contdata;
		$scope.articleid = data1.contdata[0].a;
		$scope.articletitle=data1.contdata[0].t;
		$scope.mainarticleimage=data1.contdata[0].mainimg;
		$scope.mainarticle = data1.contdata[0].pu;
		$scope.thumbimg = data1.contdata[0].thumb;
		$scope.pvt = Boolean(data1.contdata[0].p);

    	//console.log( "success",$scope.articletitle  );
  	})
  	.error(function() {
  		$scope.hidelodr=true;
    	alert( "error" );
  	});

	/*console.log(me.article.a);
	  $http.post('/touch/srvc/dbgetCont.php?a='+$scope.userToken+'&b='+$scope.sessionToken, {aid:me.article.a}).
	  success(function(data, status, headers, config) {
	    // this callback will be called asynchronously
	    // when the response is available
	    //$scope.articles=data.contdata;
	    console.log(data.contdata);
	  }).
	  error(function(data, status, headers, config) {
	    // called asynchronously if an error occurs
	    // or server returns response with an error status.
	  });
*/

}
$scope.submitarticle=function(){
	$scope.hidelodr=false;
//$http.post('/touch/srvc/submitarticle.php?a='+$scope.uid+'&b='+$scope.token, {aid:$scope.articleid, title:$scope.articletitle, content:$scope.mainarticle, mainimg:$scope.mainarticleimage, thumb:$scope.thumbimg, pvt:$scope.pvt }).

$http({
	method:'POST',
	url:'/touch/srvc/submitarticle.php?a='+$scope.uid+'&b='+$scope.token,
	data:$.param( {aid:$scope.articleid, title:$scope.articletitle, content:$scope.mainarticle, mainimg:$scope.mainarticleimage, thumb:$scope.thumbimg, pvt:$scope.pvt } ),
	headers : {'Content-Type': 'application/x-www-form-urlencoded'}

}).success(function(data, status, headers, config) {
	$scope.hidelodr=true;
    // this callback will be called asynchronously
    // when the response is available
    alert(data);
}).error(function(data, status, headers, config) {
	$scope.hidelodr=true;
    // called asynchronously if an error occurs
    // or server returns response with an error status.
    alert('Error');
  });
}

var d;

//
/*$.ajax({
	url:'/touch/srvc/dbgetCont.php?a='+$scope.userToken+'&b='+$scope.sessionToken,
	context: document.body,
	method:'post',
	data:{l:0}
})
*/
$scope.LoadArticlesAgain=true;
$scope.Refresharticlelist=function(){
	$scope.LoadArticlesAgain=true;
	$scope.LoadArticles();
}
$scope.LoadArticles=function(){
	$scope.hideall();

	if($scope.LoadArticlesAgain === false)
		return;
	$scope.hidelodr=false;

	$http({
		method:'POST',
		url:'/touch/srvc/dbgetCont.php?admin=true&a='+$scope.uid+'&b='+$scope.token,
		data:$.param({l:0}),
		headers : {'Content-Type': 'application/x-www-form-urlencoded'}

	}).success(function(data1) {
		$scope.LoadArticlesAgain=false;
		$scope.hidelodr=true;
		$scope.articles=data1.contdata;
		console.log($scope.articles);
		//$scope.assign($scope.articles,data1.contdata);
	    //console.log( "success",data1.contdata  );
	}).error(function(err) {
		$scope.hidelodr=true;
	    alert( "error" );
	  });

	$scope.assign=function(a,b){
		a=b;
	}
}

$scope.hideprofiles=true;

$scope.getprofileToadmin=function(me){
	console.log('Rec:  ',me.profilemail);
	$scope.hidelodr=false;
	$http({
		method:'POST',
		url:'/touch/srvc/dbProfileAdmin.php?admin=true&a='+$scope.uid+'&b='+$scope.token,
		data:$.param({email:me.profilemail}),
		headers : {'Content-Type': 'application/x-www-form-urlencoded'}

	}).success(function(data1) {
		//$scope.LoadArticlesAgain=false;
		$scope.hidelodr=true;
		//alert(data1.userStatus);
		$scope.profilelevel=(data1.level)?data1.level:0;
		$scope.userStatus=data1.userStatus;

		//$scope.assign($scope.articles,data1.contdata);
	    //console.log( "success",data1.contdata  );
	}).error(function(err) {
		$scope.hidelodr=true;
	    alert( "error" );
	});
}

$scope.submitprofile=function(){
	$scope.hidelodr=false;
	$http({
		method:'POST',
		url:'/touch/srvc/dbProfileAdmin.php?admin=true&a='+$scope.uid+'&b='+$scope.token,
		data:$.param({e:$scope.profilemail,l:$scope.profilelevel,u:$scope.userStatus}),
		headers : {'Content-Type': 'application/x-www-form-urlencoded'}

	}).success(function(data1) {
		//$scope.LoadArticlesAgain=false;
		$scope.hidelodr=true;
		//$scope.assign($scope.articles,data1.contdata);
	    //console.log( "success",data1.contdata  );
	    alert(data1.message);
	}).error(function(err) {
		$scope.hidelodr=true;
	    alert( "error" );
	});
}

$scope.hideall=function(){
	$scope.hideprofiles=true;
	$scope.hidearticles=true;
}

$scope.ProfileEditForm=function(){
	$scope.hideall();
	$scope.hideprofiles=false;

}

}]);


text:
class CreateRecipes < ActiveRecord::Migration
  def change
    create_table :recipes do |t|
      t.string :name
      t.integer :recipe_group_id
      t.integer :row_order_position

      t.timestamps
    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- START SNIPPET: config -->
<beans xmlns="http://xfire.codehaus.org/config/1.0">

  <bean id="weatherService" class="org.codehaus.xfire.jaxb.WeatherServiceImpl"/>

  <service>
    <serviceBean>#weatherService</serviceBean>
    <serviceFactory>#jaxbServiceFactory</serviceFactory>
    <schemas>
      <schema>META-INF/xfire/WeatherForecast.xsd</schema>
    </schemas>
    <style>document</style>
  </service>

  <bean name="jaxbServiceFactory" class="org.codehaus.xfire.jaxb2.JaxbServiceFactory">
    <constructor-arg ref="xfire.transportManager"/>
  </bean>

</beans>
<!-- END SNIPPET: config -->


text:
__author__ = 'Antony Cherepanov'

def repeat_string():
    """ Repeat string several times simply multiplying it by some number """
    string = "And Again "
    long_string = string * 5
    print("Original string :", string)
    print("Repeated string :", long_string)

def immutability():
    """ Strings are immutable objects. You can't change them. """
    string = "example"
    print("Our string: " + string + "; id = " + str(id(string)))

    try:
        string[0] = 'f'
        print("You will not see this because of exception!")
    except Exception:
        print("Failed to change string object!")

    string = "new " + string
    print("We can change string only by creating new object: " + string + "; id = " + str(id(string)))

def transform_to_list():
    """ Transform string to list of it's characters """

    string = "example"
    characters_list = list(string)
    print("Transform string \"" + string + "\" to list: " + str(characters_list))

def string_formatting():
    string_one = "Example"
    string_two = "string formatting"

    print("%s of %s 1" % (string_one, string_two))
    print("{0} of {1} 2".format(string_one, string_two))
    print("{} of {} 3".format(string_one, string_two))

def string_formatting_with_dict():
    data = dict(name="Bob", action="working")
    formatted_string_first = "1: %(name)s is %(action)s"
    print(formatted_string_first % data)

    formatted_string_second = "2: {name} is {action}"
    print(formatted_string_second.format(name="Ann", action="cooking"))

    from string import Template
    temp = Template("3: $name is $action")
    print(temp.substitute(name="Jane", action="reading"))

repeat_string()
immutability()
transform_to_list()
string_formatting()
string_formatting_with_dict()


text:
'use strict';

var path = require('path');

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    // Configuration to be run (and then tested).
    liquibase: {
      // Common options to be used for testing all commands
      options: {
        classpath: path.join(__dirname, 'test', 'hsqldb-2.3.3.jar'),
        url: 'jdbc:hsqldb:mem:testdb',
        username: 'sa',
        password: '',
        changeLogFile: path.join(__dirname, 'test/fixtures', 'changelog.xml'),
        driver: 'org.hsqldb.jdbcDriver'
      },
      version: {
        options: {
        },
        command: 'version'
      },
      update: {
        command: 'update'
      },
      dropAll: {
        command: 'dropAll'
      },
      changelogSync: {
        command: 'changelogSync'
      },
      changelogSyncSQL: {
        command: 'changelogSyncSQL'
      },
      tag: {
        command: 'tag',
        commandAttr: 'v1'
      },
      clearCheckSums: {
        command: 'clearCheckSums'
      },
      rollbackCount: {
        command: 'rollbackCount',
        commandAttr: '1'
      },
     updateTestingRollback: {
        command: 'updateTestingRollback'
      }
    },
    jshint: {
      all: [
        'Gruntfile.js',
        'tasks/*.js'
      ],
      options: {
        jshintrc: '.jshintrc'
      }
    }
  });

  // Actually load this plugin's task(s).
  grunt.loadTasks('tasks');

  // load up jslint
  grunt.loadNpmTasks('grunt-contrib-jshint');

  grunt.registerTask('test', ['liquibase']);

  grunt.registerTask('default', ['jshint', 'test']);
};


text:
package org.yi.happy.archive;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Write fragments to an {@link OutputStream}. This deals with overlap and gaps.
 */
public class FragmentOutputStream {
    private OutputStream out;
    private long written;

    /**
     * The buffer size when generating gap data. This is the same buffer size
     * used by {@link BufferedInputStream}.
     */
    private static int BUFFER_SIZE = 8192;

    /**
     * set up to write to an {@link OutputStream}.
     *
     * @param out
     *            the {@link OutputStream} to write to.
     */
    public FragmentOutputStream(OutputStream out) {
        this.out = out;
        this.written = 0;
    }

    /**
     * Write out a fragment. If the position is ahead of the data written a gap
     * of null bytes is made. If the position is behind of the data written the
     * part that is in the already written part of the stream is skipped.
     *
     * @param position
     *            where in the stream the fragment is located.
     * @param bytes
     *            the array to find the data in.
     * @param offset
     *            the offset into bytes to find that data.
     * @param length
     *            the length of the data.
     * @throws IOException
     *             on errors.
     */
    private void write(long position, byte[] bytes, int offset, int length)
            throws IOException {
        /*
         * there is a gap between the already written part of the stream and the
         * fragment.
         */
        if (written < position) {
            long gap = position - written;
            byte[] pad;
            if (gap > BUFFER_SIZE) {
                pad = new byte[BUFFER_SIZE];
            } else {
                pad = new byte[(int) gap];
            }

            while (gap > pad.length) {
                out.write(pad);
                written += pad.length;
                gap -= pad.length;
            }

            out.write(pad, 0, (int) gap);
            written += gap;
        }

        long overlap = written - position;

        /*
         * the fragment is entirely in the already written part of the stream.
         */
        if (overlap > length) {
            return;
        }

        /*
         * the fragment is partially in the already written part of the stream.
         */
        if (overlap > 0) {
            offset += overlap;
            length -= overlap;
            position += overlap;
        }

        /*
         * write out the visible fragment.
         */
        out.write(bytes, offset, length);
        this.written += length;
    }

    /**
     * Write out a fragment. If the position is ahead of the data written a gap
     * of null bytes is made. If the position is behind of the data written the
     * part that is in the already written part of the stream is skipped.
     *
     * @param position
     *            where in the stream the fragment is located.
     * @param bytes
     *            the content of the fragment.
     * @throws IOException
     *             on errors.
     */
    public void write(long position, Bytes bytes) throws IOException {
        write(position, bytes.toByteArray(), 0, bytes.getSize());
    }

    /**
     * Write out a fragment. If the position is ahead of the data written a gap
     * of null bytes is made. If the position is behind of the data written the
     * part that is in the already written part of the stream is skipped.
     *
     * @param fragment
     *            the fragment.
     * @throws IOException
     *             on errors.
     */
    public void write(Fragment fragment) throws IOException {
        write(fragment.getOffset(), fragment.getData());
    }

}


text:
package com.ntut.killboss.core;

import java.util.Calendar;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageButton;

import com.ntut.killboss.R;
import com.ntut.killboss.core.GameView.OnEndOfGameInterface;
import com.ntut.killboss.setting.GameSetting;

public class StartGameActivity extends Activity implements OnEndOfGameInterface {
	// Constant
	private static int MOVE_HERO_SPEED;// 下面33行處初始化,避免NULL POINT
	private static int SLIDE_HERO_SPEED;

	// Class
	private GameView _gameview;

	// Music Player
	private MediaPlayer _mediaPlayer;
	public static boolean _musicFlag = true;

	// UI
	Button ibOver;
	ImageButton ibSkillA;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.game_view);

		// VIEW
		_gameview = (GameView) findViewById(R.id.game_view_skill_gameView);
		_gameview.setOnEndOfGame(this); // 传入this,设定自己为回调目标

		_mediaPlayer = MediaPlayer.create(getApplicationContext(),
				R.raw.background);
		_mediaPlayer.setLooping(true);
		_mediaPlayer.start();

		MOVE_HERO_SPEED = GameView._screenSize.x / 40;
		SLIDE_HERO_SPEED = GameView._screenSize.x / 3;

		ImageButton ibRight = (ImageButton) findViewById(R.id.game_view_right);
		ibRight.setOnTouchListener(new ImageButton.OnTouchListener() {

			long now;
			long now2;
			boolean touchFlag = false;

			long down1;
			long down2;
			boolean downFlag = false;

			@Override
			public boolean onTouch(View v, MotionEvent event) {
				if (event.getAction() == android.view.MotionEvent.ACTION_DOWN) {
					downFlag = !downFlag;
					if (downFlag) {
						down1 = Calendar.getInstance().getTimeInMillis();
					} else {
						down2 = Calendar.getInstance().getTimeInMillis();
					}
					// Button Double Clicked
					if (Math.abs(down2 - down1) < 200) {
						_gameview.flashHeroRight(SLIDE_HERO_SPEED);
					}

					now = Calendar.getInstance().getTimeInMillis();
					touchFlag = true;
				} else if (event.getAction() == android.view.MotionEvent.ACTION_UP) {
					now2 = Calendar.getInstance().getTimeInMillis();
					touchFlag = false;

					// Button Clicked
					if (now2 - now < 100) {
						_gameview.changeHeroDirection(true);
					}
				}

				// Button Pressed
				if (touchFlag) {
					_gameview.moveHeroRight(MOVE_HERO_SPEED);
				}
				return false;
			}
		});

		ImageButton ibLeft = (ImageButton) findViewById(R.id.game_view_left);
		ibLeft.setOnTouchListener(new ImageButton.OnTouchListener() {

			long now;
			long now2;
			boolean touchFlag = false;

			long down1;
			long down2;
			boolean downFlag = false;

			@Override
			public boolean onTouch(View v, MotionEvent event) {
				if (event.getAction() == android.view.MotionEvent.ACTION_DOWN) {
					downFlag = !downFlag;
					if (downFlag) {
						down1 = Calendar.getInstance().getTimeInMillis();
					} else {
						down2 = Calendar.getInstance().getTimeInMillis();
					}
					// Button Double Clicked
					if (Math.abs(down2 - down1) < 200) {
						_gameview.flashHeroLeft(SLIDE_HERO_SPEED);
					}

					now = Calendar.getInstance().getTimeInMillis();
					touchFlag = true;
				} else if (event.getAction() == android.view.MotionEvent.ACTION_UP) {
					now2 = Calendar.getInstance().getTimeInMillis();
					touchFlag = false;

					// Button Clicked
					if (now2 - now < 100) {
						_gameview.changeHeroDirection(false);
					}
				}

				// Button Pressed
				if (touchFlag) {
					_gameview.moveHeroLeft(MOVE_HERO_SPEED);
				}
				return false;
			}
		});

		ibSkillA = (ImageButton) findViewById(R.id.game_view_skill_a);
		ibSkillA.setImageResource(GameSetting._weapon.get_bitmapSkillA());
		ibSkillA.setOnClickListener(new ImageButton.OnClickListener() {

			@Override
			public void onClick(View v) {
				ibSkillA.setEnabled(false);
				// TODO
				_gameview.shotSkillA(1);
				new Handler().postDelayed(new Runnable() {
					@Override
					public void run() {
						ibSkillA.setEnabled(true);
					}
				}, 200);
			}

		});

		ImageButton ibSkillB = (ImageButton) findViewById(R.id.game_view_skill_b);
		ibSkillB.setImageResource(GameSetting._weapon.get_bitmapSkillB());
		ibSkillB.setOnClickListener(new ImageButton.OnClickListener() {

			@Override
			public void onClick(View v) {
				_gameview.shotSkillB(1);
			}

		});
		Button ibJump = (Button) findViewById(R.id.game_view_jump);
		ibJump.setOnClickListener(new Button.OnClickListener() {
			int i;

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				i++;
				if (i == 1) {
					_gameview.heroJump();
					i = 0;
				} else if (i == 2) {
					i = 0;
					_gameview.heroDoubleJump();
				}
			}
		});

		ImageButton ibSetting = (ImageButton) findViewById(R.id.game_view_setting);
		ibSetting.setOnClickListener(new Button.OnClickListener() {

			@Override
			public void onClick(View v) {
				if (_musicFlag) {
					_mediaPlayer.pause();
				} else {
					_mediaPlayer.start();
				}
				_musicFlag = !_musicFlag;
			}
		});

	}

	@Override
	protected void onPause() {
		_mediaPlayer.pause();
		super.onPause();
	}

	@Override
	protected void onDestroy() {
		_mediaPlayer.release();
		super.onDestroy();
	}

	@Override
	public void onBackPressed() {
		AlertDialog.Builder dialog = new AlertDialog.Builder(this);
		dialog.setTitle("Back To Menu?");
		dialog.setPositiveButton("YES", new DialogInterface.OnClickListener() {

			@Override
			public void onClick(DialogInterface dialog, int which) {
				StartGameActivity.super.onBackPressed();
			}
		});
		dialog.setNegativeButton("No", new DialogInterface.OnClickListener() {

			@Override
			public void onClick(DialogInterface dialog, int which) {
			}
		});
		dialog.show();
	}

	public void showGameOverDialog(boolean ifWin) {
		ibOver.setVisibility(View.VISIBLE);
		if (ifWin) {
			ibOver.setText("Victory");
		} else {
			ibOver.setText("Defeat");
		}
	}

	@Override
	public void onEndOfGame() {
		AlertDialog.Builder dialog = new AlertDialog.Builder(this);
		dialog.setTitle("Game Over?");
		dialog.setPositiveButton("Victory",
				new DialogInterface.OnClickListener() {

					@Override
					public void onClick(DialogInterface dialog, int which) {
						StartGameActivity.this.finish();
					}
				});
		dialog.show();

	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                            http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        id="my-project" version="2.5">
    <display-name>My Project</display-name>

    <!-- Spring Framework Configuration -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            classpath:spring/appContext-jdbc.xml,
            classpath:spring/appContext-app.xml
        </param-value>
    </context-param>

    <!-- Filter Configurations -->
    <!-- UTF-8 encoding filter -->

    <!-- Invocation filter, populates the request context -->
    <filter>
        <filter-name>corsFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>corsFilter</filter-name>
        <url-pattern>/api/*</url-pattern>
    </filter-mapping>

    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>
            org.springframework.web.filter.CharacterEncodingFilter
        </filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/api/*</url-pattern>
    </filter-mapping>

    <!-- Invocation filter, populates the request context -->
    <filter>
        <filter-name>invocationFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>invocationFilter</filter-name>
        <url-pattern>/api/*</url-pattern>
    </filter-mapping>

    <!-- JWT Token Auth filter -->
    <filter>
        <filter-name>jwtTokenAuthFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>jwtTokenAuthFilter</filter-name>
        <url-pattern>/api/*</url-pattern>
    </filter-mapping>

    <!-- Servlet Configurations -->
    <!-- Spring Servlet for WebApp -->

    <servlet>
        <servlet-name>apiServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:spring/appContext-web.xml</param-value>
        </init-param>
        <load-on-startup>10</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>apiServlet</servlet-name>
        <url-pattern>/api/*</url-pattern>
    </servlet-mapping>

    <!-- Mentioning the Context Loader Listener class of Spring Framework as a listener -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

    <!-- We don't have any error pages except 404, as it's a single page app
         and all errors happen in AJAX requests (and handled by Angular services).
    -->

    <error-page>
        <error-code>404</error-code>
        <location>/404.html</location>
    </error-page>
</web-app>


text:
#include <tinyara/config.h>
#include <string.h>
#include "Decoder.h"
#include <debug.h>

#define PV_SUCCESS 0
#define PV_FAILURE -1

namespace media {

Decoder::Decoder()
{
#ifdef CONFIG_AUDIO_CODEC
	memset(&mPlayer, 0, sizeof(pv_player_t));
	if (pv_player_init(&mPlayer, CONFIG_AUDIO_CODEC_RINGBUFFER_SIZE, this, _configFunc, nullptr, nullptr) !=
		PV_SUCCESS) {
		meddbg("Error! pv_player_init failed!\n");
	}
#endif
}

Decoder::Decoder(const Decoder *source)
{
#ifdef CONFIG_AUDIO_CODEC
	mPlayer = source->mPlayer;
#endif
}

Decoder::~Decoder()
{
#ifdef CONFIG_AUDIO_CODEC
	if (pv_player_finish(&mPlayer) != PV_SUCCESS) {
		meddbg("Error! pv_player_finish failed!\n");
	}
#endif
}

size_t Decoder::pushData(unsigned char *buf, size_t size)
{
#ifdef CONFIG_AUDIO_CODEC
	size_t rmax = getAvailSpace();
	if (size > rmax) {
		meddbg("Error!! data is larger than rmax\n");
		size = rmax;
	}

	return pv_player_pushdata(&mPlayer, buf, size);
#endif
	return 0;
}

bool Decoder::getFrame(unsigned char *buf, size_t *size, unsigned int *sampleRate, unsigned short *channels)
{
#ifdef CONFIG_AUDIO_CODEC
	/*
	 * Need to get the enough data to parse data format.
	 */
	if (mPlayer.audio_type == type_unknown) {
		mPlayer.audio_type = _get_audio_type(mPlayer.rbsp);

		if (mPlayer.audio_type) {
			if (_init_decoder(&mPlayer) != 0) {
				meddbg("Error! _init_decoder failed!\n");
				return false;
			}
		}
	}

	if (mPlayer.audio_type == type_unknown) {
		medvdbg("Decoder: Unknown audio_type\n");
		return false;
	}

	if (_get_frame(&mPlayer)) {
		pcm_data_t pcm;
		if (_frame_decoder(&mPlayer, &pcm) != PV_FAILURE) {
			*size = pcm.length * sizeof(short);
			*sampleRate = pcm.samplerate;
			*channels = pcm.channels;
			memcpy(buf, pcm.samples, *size);
			return true;
		} else {
			meddbg("Error: Decoding frame failed!\n");
			return false;
		}
	} else {
		meddbg("Error: Getting frame failed!\n");
		return false;
	}
#endif
	return false;
}

bool Decoder::empty()
{
#ifdef CONFIG_AUDIO_CODEC
	return pv_player_dataspace_is_empty(&mPlayer);
#endif
	return false;
}

size_t Decoder::getAvailSpace()
{
#ifdef CONFIG_AUDIO_CODEC
	return rb_avail(mPlayer.rbsp->rbp);
#endif
	return 0;
}

#ifdef CONFIG_AUDIO_CODEC
int Decoder::_configFunc(void *user_data, int audio_type, void *dec_ext)
{
	/* To-do: Below buffer size and channel count must be calculated correctly. */
	static const int TARGET_SOUND_TRACK = 2;
	static uint8_t inputBuf[4096];
	static int16_t outputBuf[4096];

	if (audio_type == type_mp3) {
		tPVMP3DecoderExternal *mp3_ext = (tPVMP3DecoderExternal *)dec_ext;
		mp3_ext->equalizerType = flat;
		mp3_ext->crcEnabled = false;
		mp3_ext->pInputBuffer = inputBuf;
		mp3_ext->pOutputBuffer = outputBuf;
		mp3_ext->outputFrameSize = sizeof(outputBuf) / sizeof(int16_t);
		return 0;
	} else if (audio_type == type_aac) {
		tPVMP4AudioDecoderExternal *aac_ext = (tPVMP4AudioDecoderExternal *)dec_ext;
		aac_ext->outputFormat = OUTPUTFORMAT_16PCM_INTERLEAVED;
		aac_ext->desiredChannels = TARGET_SOUND_TRACK;
		aac_ext->pInputBuffer = inputBuf;
		aac_ext->pOutputBuffer = outputBuf;
		aac_ext->aacPlusEnabled = 1;
		return 0;
	}

	meddbg("Error! Not supported audio format!\n");
	return -1;
}
#endif

} // namespace media


text:
namespace tf_opt {
namespace testing {

// Implements IsOk() as a polymorphic matcher.
MATCHER(IsOk, "") { return arg.ok(); }

#define TFOPT_ASSERT_OK(status_expr) \
  ASSERT_THAT(status_expr, ::tf_opt::testing::IsOk())

#define TFOPT_EXPECT_OK(status_expr) \
  EXPECT_THAT(status_expr, ::tf_opt::testing::IsOk())

#define TFOPT_ASSERT_OK_AND_ASSIGN(lhs, rexpr) \
  TFOPT_ASSERT_OK(rexpr);                      \
  lhs = (rexpr).value();

namespace internal {

// Monomorphic matcher for the error code of a Status.
bool StatusIsMatcher(const absl::Status& actual_status,
                     const absl::StatusCode& expected_error_code) {
  return actual_status.code() == expected_error_code;
}

// Monomorphic matcher for the error code of a StatusOr.
template <typename T>
bool StatusIsMatcher(const absl::StatusOr<T>& actual_status_or,
                     const absl::StatusCode& expected_error_code) {
  return StatusIsMatcher(actual_status_or.status(), expected_error_code);
}

// Monomorphic matcher for the error code & message of a Status.
bool StatusIsMatcher(
    const absl::Status& actual_status,
    const absl::StatusCode& expected_error_code,
    const ::testing::Matcher<const std::string&>& expected_message) {
  ::testing::StringMatchResultListener sink;
  return actual_status.code() == expected_error_code &&
         expected_message.MatchAndExplain(std::string(actual_status.message()),
                                          &sink);
}

// Monomorphic matcher for the error code & message of a StatusOr.
template <typename T>
bool StatusIsMatcher(
    const absl::StatusOr<T>& actual_status_or,
    const absl::StatusCode& expected_error_code,
    const ::testing::Matcher<const std::string&>& expected_message) {
  return StatusIsMatcher(actual_status_or.status(), expected_error_code,
                         expected_message);
}

}  // namespace internal

// Implements StatusIs() as a polymorphic matcher.
MATCHER_P(StatusIs, expected_error_code, "") {
  return ::tf_opt::testing::internal::StatusIsMatcher(arg, expected_error_code);
}

// Implements StatusIs() as a polymorphic matcher.
MATCHER_P2(StatusIs, expected_error_code, expected_message, "") {
  return ::tf_opt::testing::internal::StatusIsMatcher(arg, expected_error_code,
                                                      expected_message);
}

namespace internal {

// Monomorphic implementation of a matcher for a StatusOr.
template <typename StatusOrType>
class IsOkAndHoldsMatcherImpl
    : public ::testing::MatcherInterface<StatusOrType> {
 public:
  using ValueType = typename std::remove_reference<decltype(
      std::declval<StatusOrType>().value())>::type;

  template <typename InnerMatcher>
  explicit IsOkAndHoldsMatcherImpl(InnerMatcher&& inner_matcher)
      : inner_matcher_(::testing::SafeMatcherCast<const ValueType&>(
            std::forward<InnerMatcher>(inner_matcher))) {}

  void DescribeTo(std::ostream* os) const {
    *os << "is OK and has a value that ";
    inner_matcher_.DescribeTo(os);
  }

  void DescribeNegationTo(std::ostream* os) const {
    *os << "isn't OK or has a value that ";
    inner_matcher_.DescribeNegationTo(os);
  }

  bool MatchAndExplain(StatusOrType actual_value,
                       ::testing::MatchResultListener* listener) const {
    if (!actual_value.ok()) {
      *listener << "which has status " << actual_value.status();
      return false;
    }

    ::testing::StringMatchResultListener inner_listener;
    const bool matches =
        inner_matcher_.MatchAndExplain(actual_value.value(), &inner_listener);
    const std::string inner_explanation = inner_listener.str();
    if (!inner_explanation.empty()) {
      *listener << "which contains value "
                << ::testing::PrintToString(actual_value.value()) << ", "
                << inner_explanation;
    }
    return matches;
  }

 private:
  const ::testing::Matcher<const ValueType&> inner_matcher_;
};

// Implements IsOkAndHolds() as a polymorphic matcher.
template <typename InnerMatcher>
class IsOkAndHoldsMatcher {
 public:
  explicit IsOkAndHoldsMatcher(InnerMatcher inner_matcher)
      : inner_matcher_(std::move(inner_matcher)) {}

  // Converts this polymorphic matcher to a monomorphic one of the given type.
  // StatusOrType can be either StatusOr<T> or a reference to StatusOr<T>.
  template <typename StatusOrType>
  operator ::testing::Matcher<StatusOrType>() const {
    return ::testing::MakeMatcher(
        new IsOkAndHoldsMatcherImpl<StatusOrType>(inner_matcher_));
  }

 private:
  const InnerMatcher inner_matcher_;
};

}  // namespace internal

// Returns a gMock matcher that matches a StatusOr<> whose status is
// OK and whose value matches the inner matcher.
template <typename InnerMatcher>
internal::IsOkAndHoldsMatcher<typename std::decay<InnerMatcher>::type>
IsOkAndHolds(InnerMatcher&& inner_matcher) {
  return internal::IsOkAndHoldsMatcher<typename std::decay<InnerMatcher>::type>(
      std::forward<InnerMatcher>(inner_matcher));
}

}  // namespace testing
}  // namespace tf_opt
#endif  // TF_OPT_OPEN_SOURCE_STATUS_MATCHERS_H_


text:
<?php

namespace FU\ApiBundle\Controller;

use FOS\RestBundle\Controller\Annotations as Rest;
use FOS\RestBundle\Controller\FOSRestController;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;

class ProductsController extends FOSRestController
{
    /**
     * List all products.
     *
     * @ApiDoc(
     *   resource = true,
     *   statusCodes = {
     *     200 = "Returned when successful"
     *   }
     * )
     * @Rest\View
     */
    public function allAction()
    {
        $products = $this->get('product_repository')->findAll();
        return array('products' => $products);
    }
}


text:
'use strict';

import React, { Component } from 'react';
import ReactDOM from 'react-dom';
//import natural from 'natural';

import data from './data';

class FeedItem extends Component {
  render() {
    return (

Posted on { this.props.published } / { this.props.source }

 this.props.onclick(this.props.key)}>
            { this.props.title }

{ this.props.content.replace(/<[^>]+>/ig, '') }

    );
  }
}

class App extends Component {
  constructor(props) {
    super(props);
    this.state = { activeScreen: 'latest', selected: null };
  }

  handleFeedItemClick(key) {
    alert(key);
    this.setState({ selected: key });
  }

  render() {
    const feed = data.items.map((item, index) =>
      <FeedItem
        key={index.toString()}
        onclick={this.handleFeedItemClick}
        title={item.title}
        source={data.feed.title}
        content={item.content}
        published={item.pubDate} />
    );

    return (

News Feed

{this.state.selected}

          {feed}

    );
  }
}

ReactDOM.render(
    <App />,
    document.getElementById('app')
);