text:
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { CoreModule } from '../core.module';

import { AddressModule } from '../address';
import { checkoutRouting } from './routes';

import { CheckoutRouteComponent } from './checkout-route.component';
import { CheckoutContentComponent, CheckoutItemComponent } from './content';
import { CheckoutAddrsComponent } from './address-selector';
import { CheckoutAddrCreatorComponent } from './address-creator';
import { InvoicePageComponent, InvoiceComponent } from './invoice';
import { CheckoutItemsResolver } from './checkout.resolver';

@NgModule({
  declarations: [
    CheckoutRouteComponent,
    CheckoutContentComponent, CheckoutItemComponent,
    CheckoutAddrsComponent,
    CheckoutAddrCreatorComponent,
    InvoicePageComponent, InvoiceComponent,
  ],
  imports: [
    CommonModule,
    CoreModule,
    AddressModule,
    checkoutRouting,
  ],
  exports: [
    CheckoutRouteComponent,
    CheckoutContentComponent,
    CheckoutAddrsComponent,
    CheckoutAddrCreatorComponent,
    InvoicePageComponent,
  ],
  providers: [
    CheckoutItemsResolver,
  ],
})
export class CheckoutModule { }


text:
package oauth2

import (
	"github.com/ory-am/fosite/token/jwt"
)

type JWTSessionContainer interface {
	// GetJWTClaims returns the claims.
	GetJWTClaims() *jwt.JWTClaims

	// GetJWTHeader returns the header.
	GetJWTHeader() *jwt.Headers
}

// JWTSession Container for the JWT session.
type JWTSession struct {
	JWTClaims *jwt.JWTClaims
	JWTHeader *jwt.Headers
}

func (j *JWTSession) GetJWTClaims() *jwt.JWTClaims {
	if j.JWTClaims == nil {
		j.JWTClaims = &jwt.JWTClaims{}
	}
	return j.JWTClaims
}

func (j *JWTSession) GetJWTHeader() *jwt.Headers {
	if j.JWTHeader == nil {
		j.JWTHeader = &jwt.Headers{}
	}
	return j.JWTHeader
}

redpajama_set_name: RedPajamaGithub


text:
<?php

declare (strict_types=1);
namespace Ssch\TYPO3Rector\Contract\FileProcessor\TypoScript\Conditions;

interface TyposcriptConditionMatcher
{
    /**
     * @var array<string, string>
     */
    public const OPERATOR_MAPPING = ['=' => '==', '>=' => '>=', '<=' => '<=', '>' => '>', '<' => '<', '!=' => '!='];
    /**
     * @var string
     */
    public const ALLOWED_OPERATORS_REGEX = '\\<\\=|\\>\\=|\\!\\=|\\=|\\>|\\<';
    /**
     * @var string
     */
    public const ZERO_ONE_OR_MORE_WHITESPACES = '\\s*';
    /**
     * @var string
     */
    public const CONTAINS_CONSTANT = '{$';
    /**
     * If we return null it means conditions can be removed
     */
    public function change(string $condition) : ?string;
    public function shouldApply(string $condition) : bool;
}


text:
         TASK ID:
         TP_01

             Status:
             Completed

            Last Modified:
            23-Aug-16

        <form>

                        Description
                        Delivery Date
                        Blocker
                        On Time Delivery
                        Quality Delivery
                        Sprint Deleivery Date

                        Description
                        Delivery Date
                        Blocker
                        On Time Delivery
                        Quality Delivery
                        Sprint Delivery Date

        </form>

Justification

            Issue:
            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Provident mollitia aperiam praesentium alias harum architecto animi facere eaque doloremque, odit eum omnis eius, nesciunt ab quis similique voluptatibus placeat commodi!

            IMPACT:
            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Provident mollitia aperiam praesentium alias harum architecto animi facere eaque doloremque, odit eum omnis eius, nesciunt ab quis similique voluptatibus placeat commodi!

            DEV NOTES:
            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Provident mollitia aperiam praesentium alias harum architecto animi facere eaque doloremque, odit eum omnis eius, nesciunt ab quis similique voluptatibus placeat commodi!

            TENTATIVE COMPLETE DATE:
            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Provident mollitia aperiam praesentium alias harum architecto animi facere eaque doloremque, odit eum omnis eius, nesciunt ab quis similique voluptatibus placeat commodi!

            HELP:
            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Provident mollitia aperiam praesentium alias harum architecto animi facere eaque doloremque, odit eum omnis eius, nesciunt ab quis similique voluptatibus placeat commodi!

    <button> Add info</button>
    <button> Close Task</button>


text:
package sk.tuke.xhl.core;

import org.junit.Test;

import java.io.IOException;
import java.io.StringReader;
import java.util.Iterator;

import static org.junit.Assert.assertEquals;
import static sk.tuke.xhl.core.Token.TokenType.*;

/**
 * Test lexer module.
 *
 * @author Sergej Chodarev
 */
public class LexerTest {
    private static Iterator<Token> makeLexer(String code) throws IOException {
        MaybeError<Iterator<Token>> tokens = Lexer.readTokens(
                new StringReader(code), "<test>");
        return tokens.get();
    }

    @Test
    public void braces() throws Exception {
        String code = "{[()]}";
        Iterator<Token> l = makeLexer(code);
        assertEquals(BRACE_OPEN, l.next().type);
        assertEquals(BRACKET_OPEN, l.next().type);
        assertEquals(PAR_OPEN, l.next().type);
        assertEquals(PAR_CLOSE, l.next().type);
        assertEquals(BRACKET_CLOSE, l.next().type);
        assertEquals(BRACE_CLOSE, l.next().type);
    }

    @Test
    public void punctuation() throws Exception {
        String code = ",";
        Iterator<Token> l = makeLexer(code);
        assertEquals(COMMA, l.next().type);
    }

    @Test
    public void symbols() throws Exception {
        String code = "abc ABc_98";
        Iterator<Token> l = makeLexer(code);
        Token t = l.next();
        assertEquals(SYMBOL, t.type);
        assertEquals("abc", t.stringValue);
        t = l.next();
        assertEquals(SYMBOL, t.type);
        assertEquals("ABc_98", t.stringValue);
    }

    @Test
    public void operators() throws Exception {
        String code = "+ ->>";
        Iterator<Token> l = makeLexer(code);
        Token t = l.next();
        assertEquals(OPERATOR, t.type);
        assertEquals("+", t.stringValue);
        t = l.next();
        assertEquals(OPERATOR, t.type);
        assertEquals("->>", t.stringValue);
    }

    @Test
    public void numbers() throws Exception {
        String code = "-42 3.14";
        Iterator<Token> l = makeLexer(code);
        Token t = l.next();
        assertEquals(NUMBER, t.type);
        assertEquals(-42.0, t.doubleValue, 0);
        t = l.next();
        assertEquals(NUMBER, t.type);
        assertEquals(3.14, t.doubleValue, 0);
    }

    @Test
    public void scientificNumbers() throws Exception {
        String code = "-4.2e15 3.14e-2";
        Iterator<Token> l = makeLexer(code);
        Token t = l.next();
        assertEquals(NUMBER, t.type);
        assertEquals(-4.2e15, t.doubleValue, 0);
        t = l.next();
        assertEquals(NUMBER, t.type);
        assertEquals(3.14e-2, t.doubleValue, 0);
    }

    @Test
    public void strings() throws Exception {
        String code = "\"hello\"";
        Iterator<Token> l = makeLexer(code);
        Token t = l.next();
        assertEquals(STRING, t.type);
        assertEquals("hello", t.stringValue);
    }

    @Test
    public void escapes() throws Exception {
        String code = "\"hello\\n\\t\\\"world\\\"\"";
        Iterator<Token> l = makeLexer(code);
        Token t = l.next();
        assertEquals(STRING, t.type);
        assertEquals("hello\n\t\"world\"", t.stringValue);
    }

    @Test
    public void keywords() throws Exception {
        String code = "true false null";
        Iterator<Token> l = makeLexer(code);
        assertEquals(TRUE, l.next().type);
        assertEquals(FALSE, l.next().type);
        assertEquals(NULL, l.next().type);
    }

    @Test
    public void newline() throws Exception {
        String code = "a\nb\n";
        Iterator<Token> l = makeLexer(code);
        assertEquals(SYMBOL, l.next().type);
        assertEquals(LINE_END, l.next().type);
        assertEquals(SYMBOL, l.next().type);
        assertEquals(LINE_END, l.next().type);
    }

    @Test
    public void newlineInBraces() throws Exception {
        String code = "a\n(b\n[c\n]\n)\n";
        Iterator<Token> l = makeLexer(code);
        assertEquals(SYMBOL, l.next().type);
        assertEquals(LINE_END, l.next().type);
        assertEquals(PAR_OPEN, l.next().type);
        assertEquals(SYMBOL, l.next().type);
        assertEquals(BRACKET_OPEN, l.next().type);
        assertEquals(SYMBOL, l.next().type);
        assertEquals(BRACKET_CLOSE, l.next().type);
        assertEquals(PAR_CLOSE, l.next().type);
        assertEquals(LINE_END, l.next().type);
    }

    @Test
    public void emptyLinesAndComments() throws Exception {
        String code = "a\n\n   #comment\nb";
        Iterator<Token> l = makeLexer(code);
        assertEquals(SYMBOL, l.next().type);
        assertEquals(LINE_END, l.next().type);
        assertEquals(SYMBOL, l.next().type);
        assertEquals(LINE_END, l.next().type);
        assertEquals(EOF, l.next().type);
    }

    @Test
    public void indentation() throws Exception {
        String code = "a:\n  b\nc\n    d";
        Iterator<Token> l = makeLexer(code);
        assertEquals(SYMBOL, l.next().type);
        assertEquals(OPERATOR, l.next().type);
        assertEquals(LINE_END, l.next().type);
        assertEquals(INDENT, l.next().type);
        assertEquals(SYMBOL, l.next().type);
        assertEquals(LINE_END, l.next().type);
        assertEquals(DEDENT, l.next().type);
        assertEquals(SYMBOL, l.next().type);
        assertEquals(LINE_END, l.next().type);
        assertEquals(INDENT, l.next().type);
        assertEquals(SYMBOL, l.next().type);
        assertEquals(LINE_END, l.next().type);
        assertEquals(DEDENT, l.next().type);
    }

    @Test
    public void combination() throws Exception {
        String code = "a \"hello\":\n  b [42++true,\n()]\n";
        Iterator<Token> l = makeLexer(code);
        assertEquals(SYMBOL, l.next().type);
        assertEquals(STRING, l.next().type);
        assertEquals(OPERATOR, l.next().type);
        assertEquals(LINE_END, l.next().type);
        assertEquals(INDENT, l.next().type);
        assertEquals(SYMBOL, l.next().type);
        assertEquals(BRACKET_OPEN, l.next().type);
        assertEquals(NUMBER, l.next().type);
        assertEquals(OPERATOR, l.next().type);
        assertEquals(TRUE, l.next().type);
        assertEquals(COMMA, l.next().type);
        assertEquals(PAR_OPEN, l.next().type);
        assertEquals(PAR_CLOSE, l.next().type);
        assertEquals(BRACKET_CLOSE, l.next().type);
        assertEquals(LINE_END, l.next().type);
        assertEquals(DEDENT, l.next().type);
    }

    @Test
    public void eof() throws Exception {
        String code = "a";
        Iterator<Token> l = makeLexer(code);
        assertEquals(SYMBOL, l.next().type);
        assertEquals(LINE_END, l.next().type);
        assertEquals(EOF, l.next().type);
    }

    @Test
    public void testErrors() throws Exception {
        String code = "\"hello";
        MaybeError<Iterator<Token>> tokens = Lexer.readTokens(
                new StringReader(code), "<test>");
        assertEquals(1, tokens.getErrors().size());
    }
}


text:
	local p = premake
	local tree = p.tree
	local project = p.project
	local config = p.config
	local fileconfig = p.fileconfig
	local slickedit = p.modules.slickedit

	slickedit.project = {}
	local m = slickedit.project
	m.elements = {}

	function slickedit.getLinks(cfg)
		-- System libraries are undecorated, add the required extension
		return config.getlinks(cfg, "system", "fullpath")
	end

	function slickedit.getSiblingLinks(cfg)
		-- If we need sibling projects to be listed explicitly, add them on
		return config.getlinks(cfg, "siblings", "fullpath")
	end

	function m.quote_string(s)
		if string.find(s, '"') then
			return "'" .. s .. "'"
		else
			return '"' .. s .. '"'
		end
	end

	function m.emit_element(depth, element, options, optionsKeys, close)
		-- sort options into order
		local values = {}
		local count = 0
		for i, el in ipairs(optionsKeys) do
			for opt, val in pairs(options) do
				if string.lower(el) == string.lower(opt) then
					count = count + 1
					values[count] = { el, m.quote_string(val) }
				end
			end
		end

		-- emit options
		if count == 0 then
			_p(depth, '<%s%s', element, iif(close == true, "/>", ">"))
		else
			if count == 1 then
				_p(depth, '<%s %s=%s%s', element, values[1][1], values[1][2], iif(close == true, "/>", ">"))
			else
				_p(depth, '<%s', element)
				for i = 1, count do
					_x(depth + 1, "%s=%s%s", values[i][1], values[i][2], iif(i == count, iif(close == true, "/>", ">"), ""))
				end
			end
		end
	end

-- Menu

	m.elements.menu = function(cfg)
		return {
			m.compile,
			m.link,
			m.build,
			m.rebuild,
			m.debug,
			m.execute,
			m.dash,
			m.coptions,
		}
	end

	function m.menu(cfg, toolset, toolinfo)
		_p(2, '<Menu>')

		p.callArray(m.elements.menu, cfg, toolset, toolinfo)

		_p(2, '</Menu>')
	end

	m.target_elements = {
		"Name",
		"MenuCaption",
		"ShowOnMenu",
		"Dialog",
		"BuildFirst",
		"CaptureOutputWith",
		"Deletable",
		"OutputExts",
		"SaveOption",
		"RunFromDir",
		"ClearProcessBuffer",
		"Verbose",
		"Beep",
	}
	m.exec_elements = {
		"CmdLine",
		"OtherOptions",
		"Type",
	}
	function m.emit_target(options, exec)
		m.emit_element(3, "Target", options, m.target_elements)
		m.emit_element(4, "Exec", exec or {}, m.exec_elements, true)
		_p(3, '</Target>')
	end

	function m.compile(cfg, toolset, toolinfo)
		local options = {
			name="Compile",
			menuCaption="&Compile",
			dialog="_gnuc_options_form Compile",
			captureOutputWith="ProcessBuffer",
			deletable="0",
			outputExts="*.o",
			saveOption="SaveCurrent",
			runFromDir="%rw",
		}
		local exec = {}

		-- build command line
		local tool = toolset.gettoolname({gccprefix=""}, iif(cfg.language == "C", "cc", "cxx"))
		exec.cmdLine = tool .. ' -c %xup ' .. iif(toolinfo.tool == "msc", '%defs ', '%defd ')

		-- compile flags
		local cppFlags = toolset.getcppflags(cfg)
		local cFlags = toolset.getcflags(cfg)
		local cxxFlags = {}
		if cfg.language ~= "C" then
			cxxFlags = toolset.getcxxflags(cfg)
		end

		local allFlags = table.join(cppFlags, cFlags, cxxFlags)
		exec.cmdLine = exec.cmdLine .. table.concat(allFlags, " ")

		-- additional build options
		if #cfg.buildoptions > 0 then
			exec.otherOptions = table.concat(cfg.buildoptions, " ")
			exec.cmdLine = exec.cmdLine .. ' %~other'
		end

		-- output and source file
		exec.cmdLine = exec.cmdLine .. ' -o "%bd%n%oe" %i "%f"'

		m.emit_target(options, exec)
	end

	function m.link(cfg, toolset, toolinfo)
		local options = {
			name="Link",
			menuCaption="&Link",
			showOnMenu="Never",
			dialog="_gnuc_options_form Link",
			captureOutputWith="ProcessBuffer",
			deletable="0",
			saveOption="SaveCurrent",
			runFromDir="%rw",
		}
		local exec = { cmdLine = "" }

		local mkdir = "mkdir -p " .. cfg.buildtarget.directory

		if cfg.kind == premake.STATICLIB then
			if cfg.architecture == premake.UNIVERSAL then
				exec.cmdLine = 'libtool %xup -o "%o" %f'
			else
				local tool = toolset.gettoolname({gccprefix=""}, "ar")
				exec.cmdLine = mkdir .. " && " .. tool .. ' -rs %xup "%o" %f'  -- TODO CHECK THAT THIS IS CORRECT? should be -rcs?
--				exec.cmdLine = mkdir .. " && " .. tool .. ' -rcs %xup "%o" %f'
			end
		else
			-- build command line
			local tool = toolset.gettoolname({gccprefix=""}, iif(cfg.language == "C", "cc", "cxx"))
			exec.cmdLine = mkdir .. " && " .. tool .. ' %xup '

			-- compile flags
			local ldFlags = toolset.getldflags(cfg)
			exec.cmdLine = exec.cmdLine .. table.concat(ldFlags, " ")

			-- lib paths
			local libPaths = toolset.getLibraryDirectories(cfg)
			if #libPaths > 0 then
				exec.otherOptions = table.concat(libPaths, " ")
			end

			-- additional build options
			if #cfg.linkoptions > 0 then
				if exec.otherOptions then
					exec.otherOptions = exec.otherOptions .. " "
				else
					exec.otherOptions = ""
				end
				exec.otherOptions = exec.otherOptions .. table.concat(cfg.linkoptions, " ")
				exec.cmdLine = exec.cmdLine .. ' %~other'
			end

			-- output and source file
			exec.cmdLine = exec.cmdLine .. ' -o "%o" %f %libs'
		end

		m.emit_target(options, exec)
	end

	function m.build(cfg)
		local options = {
			name="Build",
			menuCaption="&Build",
			dialog="_gnuc_options_form Compile",
			captureOutputWith="ProcessBuffer",
			deletable="0",
			saveOption="SaveWorkspaceFiles",
			runFromDir="%rw",
		}

		-- HACK: clear before each build...
--		options.clearProcessBuffer = "1"
--		options.verbose = "1"

		local exec = { cmdLine = '"%(VSLICKBIN1)vsbuild" "%w" "%r" -t build' }
		m.emit_target(options, exec)
	end

	function m.rebuild(cfg)
		local options = {
			name="Rebuild",
			menuCaption="&Rebuild",
			dialog="_gnuc_options_form Compile",
			captureOutputWith="ProcessBuffer",
			deletable="0",
			saveOption="SaveWorkspaceFiles",
			runFromDir="%rw",
		}
		local exec = { cmdLine = '"%(VSLICKBIN1)vsbuild" "%w" "%r" -t rebuild' }
		m.emit_target(options, exec)
	end

	function m.debug(cfg)
		local options = {
			name="Debug",
			menuCaption="&Debug",
			dialog="_gnuc_options_form Run/Debug",
			buildFirst="1",
			captureOutputWith="ProcessBuffer",
			deletable="0",
			saveOption="SaveNone",
			runFromDir="%rw",
		}
		local exec = { cmdLine = "" }
		if cfg.kind == premake.WINDOWEDAPP or cfg.kind == p.CONSOLEAPP then
			exec.cmdLine = 'vsdebugio -prog "%o"'
		end
		m.emit_target(options, exec)
	end

	function m.execute(cfg)
		local options = {
			name="Execute",
			menuCaption="E&xecute",
			dialog="_gnuc_options_form Run/Debug",
			buildFirst="1",
			captureOutputWith="ProcessBuffer",
			deletable="0",
			saveOption="SaveWorkspaceFiles",
			runFromDir="%rw",
		}
		local exec = { cmdLine = "" }
		if cfg.kind == premake.WINDOWEDAPP or cfg.kind == p.CONSOLEAPP then
			exec.cmdLine = '"%o"'
		end
		m.emit_target(options, exec)
	end

	function m.dash(cfg)
		local options = {
			name="dash",
			menuCaption="-",
			deletable="0",
		}
		m.emit_target(options)
	end

	function m.coptions(cfg, toolset, toolinfo)
		local options = {
			showOnMenu="HideIfNoCmdLine",
			deletable="0",
			saveOption="SaveNone",
		}
		local exec = {
			type = "Slick-C",
		}

		if toolinfo.tool == "gcc" then
			options.name="GNU C Options"
			options.menuCaption="GNU C &Options..."
			exec.cmdLine = "gnucoptions"
		elseif toolinfo.tool == "clang" then
			options.name="Clang Options"
			options.menuCaption="Clang &Options..."
			exec.cmdLine = "clangoptions"
		end

		m.emit_target(options, exec)
	end

-- List

	m.elements.list_cpp = function(cfg)
		return {
			m.kind,
		}
	end

	function m.list(cfg)
		local name = "GNUC Options"
		_p(2, '<List Name="%s">', name)

		p.callArray(m.elements.list_cpp, cfg)

		_p(2, '</List>')
	end

	function m.kind(cfg)
		local values = {
			ConsoleApp = "Executable",
			WindowedApp = "Executable",
			SharedLib = "SharedLibrary",
			StaticLib = "StaticLibrary",
--			Makefile = ???,
--			None = ???,
--			Utility = ???,
		}

		if values[cfg.kind] == nil then
			return
		end

		_p(3, '<Item')
		_p(4, 'Name="LinkerOutputType"')
		_p(4, 'Value="%s"/>', values[cfg.kind])
	end

-- Dependencies

	function m.dependencies(cfg)

		local prj = cfg.project
		local dependencies = project.getdependencies(prj)
		if #dependencies > 0 then

			local name = slickedit.cfgname(cfg)
			_p(2, '<Dependencies Name="%s">', name)

			for _, dependency in ipairs(dependencies) do
				local path = project.getrelative(cfg.project, dependency.filename)
				_p(3, '<Dependency Project="%s.vpj"/>', path)
			end

			_p(2, '</Dependencies>');
		end

	end

-- PreBuildCommands

	function m.customBuilds(cfg)
		local files = {}
		local tr = project.getsourcetree(cfg.project)
		tree.traverse(tr, {
			onleaf = function(node)
				local fcfg = fileconfig.getconfig(node, cfg)
				if fileconfig.hasCustomBuildRule(fcfg) then
					table.insert(files, node)
				end
			end
		})
		return files
	end

	function m.prebuild(cfg)

		local customFiles = m.customBuilds(cfg)

		if #cfg.prebuildcommands > 0 or #customFiles > 0 then

			local stopOnError = "" -- ' StopOnError="1"'
			_p(2, '<PreBuildCommands%s>', stopOnError)

			if cfg.prebuildmessage then
				-- TODO emit an echo statement or something?
			end

			for i, cmd in ipairs(cfg.prebuildcommands) do
				_p(3, '<Exec CmdLine=%s/>', m.quote_string(cmd))
			end

			for i, file in ipairs(customFiles) do
				local fcfg = fileconfig.getconfig(file, cfg)
				if fcfg.buildmessage ~= nil then
					_p(3, '<Exec CmdLine=%s/>', m.quote_string("echo " .. m.quote_string(fcfg.buildmessage)))
				end
				if #fcfg.buildcommands > 0 then
					for i, cmd in ipairs(fcfg.buildcommands) do
						_p(3, '<Exec CmdLine=%s/>', m.quote_string(cmd))
					end
				end
--				fcfg.buildoutputs = { output }
			end

			_p(2, '</PreBuildCommands>')
		end

	end

-- PreBuildCommands

	function m.postbuild(cfg)

		if #cfg.postbuildcommands > 0 then

			local stopOnError = "" -- ' StopOnError="1"'
			_p(2, '<PreBuildCommands%s>', stopOnError)

			if cfg.postbuildmessage then
				-- TODO emit an echo statement or something?
			end

			for i, cmd in ipairs(cfg.postbuildcommands) do
				_p(3, '<Exec CmdLine=%s/>', m.quote_string(cmd))
			end

			_p(2, '</PreBuildCommands>')
		end

	end

-- Libs

	function m.libs(cfg, toolset)

		local links = toolset.getlinks(cfg)

		if #links > 0 then

			local preObjects = "0"
			_p(2, '<Libs PreObjects="%s">', preObjects)

			for _, lib in ipairs(links) do
				_p(3, '<Lib File=%s/>', m.quote_string(lib))
			end

			_p(2, '</Libs>')

		end

	end

-- Inlcude

	function m.includes(cfg)

		if #cfg.includedirs > 0 then

			_p(2, '<Includes>')

			for _, dir in ipairs(cfg.includedirs) do
				dir = project.getrelative(cfg.project, dir)
				_p(3, '<Include Dir=%s/>', m.quote_string(dir))
			end

			_p(2, '</Includes>')
		end

	end

-- Files

	function m.files(prj)
		_p(1, '<Files AutoFolders="DirectoryView">')

		local tr = project.getsourcetree(prj)
		tree.traverse(tr, {
			-- folders are handled at the internal nodes
			onbranchenter = function(node, depth)
--				_p(depth, '<VirtualDirectory Name="%s">', node.name)
			end,
			onbranchexit = function(node, depth)
--				_p(depth, '</VirtualDirectory>')
			end,
			-- source files are handled at the leaves
			onleaf = function(node, depth)
				_p(depth, '<F N="%s"/>', node.relpath)
			end,
		}, false, 1)

		_p(1, '</Files>')
	end

--
-- Project: Generate the SlickEdit project file.
--

	m.elements.config = function(cfg)
		return {
			m.menu,
			m.list,
			m.dependencies,
			m.prebuild,
			m.postbuild,
			m.libs,
			m.includes,
		}
	end

	m.config_elements = {
		"Name",
		"Type",
		"DebugCallbackName",
		"Version",
		"OutputFile",
		"CompilerConfigName",
		"Defines",
		"ObjectDir",
	}
	function m.generate(prj)
		p.utf8()

		-- Header
		_p('<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">')

		local version = "10.0"
		local template = "GNU C/C++"
		local workingDirectory = "."
		local buildSystem = "vsbuild"

		_p('<Project')
		_p(1, 'Version="%s"', version)
		_p(1, 'VendorName="SlickEdit"')
		_p(1, 'TemplateName="%s"', template)
		_p(1, 'WorkingDir="%s"', workingDirectory)
		_p(1, 'BuildSystem="%s">', buildSystem)

		-- Configs
		for cfg in project.eachconfig(prj) do

			local tool, toolver = p.config.toolset(cfg)
			tool = tool or "gcc"
			local toolset = premake.tools[tool]
			local toolinfo = { tool=tool, version=toolver }

			local config_attrib = {
				name = slickedit.cfgname(cfg),
				type = "gnuc",
				debugCallbackName = "gdb",
				version = "1",
				outputFile = cfg.buildtarget.abspath,
				compilerConfigName = "Latest Version",
				objectDir = cfg.objdir,
			}

			-- defines and undefines
			if #cfg.defines > 0 or #cfg.undefines > 0 then
				local def, undef
				if #cfg.defines > 0 then
					def = table.implode(cfg.defines, '"/D', '"', ' ')
				end
				if #cfg.undefines > 0 then
					undef = table.implode(cfg.undefines, '"/U', '"', ' ')
				end
				if def and undef then
					config_attrib.defines = def .. " " .. undef
				else
					config_attrib.defines = def or undef
				end
			end

			m.emit_element(1, "Config", config_attrib, m.config_elements)

			p.callArray(m.elements.config, cfg, toolset, toolinfo)

			_p(1, '</Config>')
		end

		-- Files
		m.files(prj)

		-- Macros

		-- these are scripts that can be run when the project becomes active...
--		<Macro>
--			<ExecMacro CmdLine="open commands"/>
--		</Macro>

		_p('</Project>')
	end


text:
namespace Academy.Models
{
    using System;

    using Contracts;
    using Models.Enums;
    using Core.Providers;

    public class HomeworkResource : LectureResource, ILectureResource
    {
        public HomeworkResource(ResourceType type, string name, string url, DateTime dueDate)
            : base(ResourceType.Homework, name, url)
        {
            this.DueDate = dueDate;
        }

        public DateTime DueDate { get; set; }

        public override string ToString()
        {
            return base.ToString() + string.Format("\n     - Due date: {0}", this.DueDate);
        }
    }
}


text:
module Data.Text.AhoCorasick (
  compile,
  search
  ) where

import Data.Function (on)
import Data.List (groupBy, sort)
import Data.Maybe (fromMaybe)
import Data.Word
import qualified Data.ByteString.Lazy as B
import qualified Data.IntMap as M

type Children a = M.IntMap a

data Trie = Root (Children Trie)
          | Node Bool (Children Trie) Trie

goto :: Trie -> Word8 -> Maybe Trie
goto (Root m) ch = M.lookup (fromIntegral ch) m
goto (Node _ m _) ch = M.lookup (fromIntegral ch) m

-- | Turn a set of patterns into a data structure that can be used for
-- efficient substring search.
compile :: [B.ByteString] -> Trie
compile patterns = if any B.null patterns
                   then error "no null patterns"
                   else root
    where
        root = Root (M.fromList . map f $ level1)
        level1 = partition . sort $ patterns
        f (ch, xs) = (fromIntegral ch, Node (any B.null xs) (expand root xs) root)

expand :: Trie -> [B.ByteString] -> Children Trie
expand failure = M.fromList . map f . partition
  where
    f p@(ch, _) = (fromIntegral ch, buildNode failure p)

buildNode :: Trie -> (Word8, [B.ByteString]) -> Trie
buildNode parentFailure (ch, xs) = Node (any B.null xs) (expand failure xs) failure
  where
    failure = backtrack parentFailure
    backtrack n =
      goto n ch `orElse` case n of
        Root _ -> n
        Node _ _ failure' -> backtrack failure'

-- | Given a compiled set of patterns, check if a substring contains
-- any of the patterns.
search :: Trie -> B.ByteString -> Bool
search r s = search' r 0
  where
    size = B.length s
    search' (Node True _ _) _ = True
    search' n idx | idx == size = loop n
      where
        loop (Root _) = False
        loop (Node True _ _) = True
        loop (Node _ _ failure) = loop failure
    search' r@(Root _) idx =
      case goto r (s `B.index` idx) of
        Just n -> search' n (idx + 1)
        Nothing -> search' r (idx + 1)
    search' n@(Node _ _ failure) idx =
      case goto n (s `B.index` idx) of
        Just n -> search' n (idx + 1)
        Nothing -> search' failure idx

orElse :: Maybe a -> a -> a
orElse = flip fromMaybe

-- | Extract the prefixes and remainders from a sorted list of
-- strings.  For example:
--
--   partition ["abc", "apple", "toast"] =
--     [('a', ["bc", "pple"])
--     ,('t', ["oast"])
--     ]
partition :: [B.ByteString] -> [(Word8, [B.ByteString])]
partition xs = splits
  where
    fulls = filter (not . B.null) xs
    firsts = groupBy ((==) `on` B.head) fulls
    splits = map (\ys -> (B.head $ head ys, map B.tail ys)) firsts


text:
const Coder = require('./coder');
const { dest_ext, pn, production } = require('../def');

const common = `import { renderer as ${pn}renderer, combine as ${pn}combine } from 'vpp';`;
function pack_deps (include_list) {
    const coder = new Coder();
    coder.add_line(common);
    if (!production)
        coder.add_line(`import { types as ${pn}types } from 'vpp';`);
    for (let i of include_list)
        coder.add_line('import { ' + pn + i.file + '_f as '+ pn +
            (i.alias === null ? i.file : i.alias)
            +' } from \'' +
            i.filePath + '\';');
    return coder;
}

module.exports = pack_deps;


text:
package com.wangyuanwmm.wmm.detail;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.wangyuanwmm.wmm.R;
import com.wangyuanwmm.wmm.entity.BeanType;

public class DetailActivity extends AppCompatActivity {

    private DetailFragment fragment;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.frame);

        if (savedInstanceState != null) {
            fragment = (DetailFragment) getSupportFragmentManager().getFragment(savedInstanceState,"detailFragment");
        } else {
            fragment = new DetailFragment();
            getSupportFragmentManager().beginTransaction()
                    .replace(R.id.container, fragment)
                    .commit();
        }

        Intent intent = getIntent();

        DetailPresenter presenter = new DetailPresenter(DetailActivity.this, fragment);

        presenter.setType((BeanType) intent.getSerializableExtra("type"));
        presenter.setId(intent.getIntExtra("id", 0));
        presenter.setTitle(intent.getStringExtra("title"));
        presenter.setCoverUrl(intent.getStringExtra("coverUrl"));

    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        if (fragment.isAdded()) {
            getSupportFragmentManager().putFragment(outState, "detailFragment", fragment);
        }
    }
}


text:
[![Maven Central](https://img.shields.io/maven-central/v/io.airlift/aircompressor.svg?label=Maven%20Central)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.airlift%22%20AND%20a%3A%22aircompressor%22)
[![Build Status](https://travis-ci.org/airlift/aircompressor.svg?branch=master)](https://travis-ci.org/airlift/aircompressor)

This library contains implementations of
[LZ4](https://www.lz4.org/),
[Zstandard](https://www.zstd.net/) (Zstd),
[Snappy](https://google.github.io/snappy/), and
[LZO](https://www.oberhumer.com/opensource/lzo/) written in pure Java. They are
typically 10-40% faster than the JNI wrapper for the native libraries.

# Hadoop CompressionCodec

In addition to the raw block encoders, there are implementations of the
Hadoop CompressionCodec for each algorithm. They are
typically 300% faster than the JNI wrappers.

# Requirements

This library requires a Java 1.8+ virtual machine containing the `sun.misc.Unsafe` interface running on a little endian platform.

# Users

This library is used in projects such as Trino (https://trino.io), a distributed SQL engine.


text:
namespace MineLib.Network.Modern.Enums
{
    public enum UpdateBlockEntityAction
    {
        SetSpawnPotentialsOfAMobSpawner     = 1,
        SetCommandBlockText                 = 2,
        SetTheLevelOfABeacon                = 3,
        SetRotationAndSkinOfMobHead         = 4,
        SetTypeOfFlowerInFlowerPot          = 5,
        SetBaseColorAndPatternsOnABanner    = 6
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Bot. Repos. 8: t. 538. 1808

#### Original name
null

### Remarks
null


text:
require "ruboty/slide_me/version"
require "ruboty/handlers/slide_me"

module Ruboty
  module SlideMe
    # Your code goes here...
  end
end


text:
import winston = require('winston');
import redis = require('redis');

export interface IDBManager {
    set(key: string, value: string, callback?: Function): void;
    get(key: string, callback?: Function): void;
    client : redis.RedisClient;
}

class RedigMnager implements IDBManager {
    client : redis.RedisClient;
    constructor() {
        var env = process.env;
        winston.info('env: ' + env);
        winston.info('ENV: ' + env.ENV);
        if (env.ENV === "debug") {
            this.client = redis.createClient(6379, "localhost", null);
        } else {
            winston.info('REDISTOGO_URL: ' + env.REDISTOGO_URL);
            var rtg   = require("url").parse(env.REDISTOGO_URL);
            var redisOps : redis.RedisOptions = {parser: "javascript", no_ready_check : false};
            this.client = redis.createClient(rtg.port, rtg.hostname, redisOps);
            this.client.auth(env.REDIS_PASSWORD, (err, res) =>
            {
                winston.info(res);
                if (err) {
                    winston.info(err.toString());
                }
            });
        }
    }

    set(key: string, value: string, callback?: Function): void {
        this.client.set(key, value, callback);
    }
    get(key: string, callback?: Function): void {
        this.client.get(key, callback);
    }

    get getClient() {
        return this.client;
    }
}

export var manager : IDBManager = new RedigMnager();


text:
export class HeroModel {
    id: number;
    name: string;
}


text:
package org.pbrt.core;

import java.util.ArrayList;

public class MIPMapSpectrum {

    public static class ResampleWeight {
        public int firstTexel;
        public float[] weight = { 0, 0, 0, 0 };
    }

    public MIPMapSpectrum(Point2i resolution, Spectrum[] data, boolean doTri, float maxAniso, Texture.ImageWrap wrapMode, Spectrum black){
        this.doTrilinear = doTri;
        this.maxAnisotropy = maxAniso;
        this.wrapMode = wrapMode;
        this.resolution = new Point2i(resolution);
        this.black = black;

        Spectrum[] resampledImage = null;
        if (!Pbrt.IsPowerOf2(resolution.x) || !Pbrt.IsPowerOf2(resolution.y)) {
            // Resample image to power-of-two resolution
            Point2i resPow2 = new Point2i(Pbrt.RoundUpPow2(resolution.x), Pbrt.RoundUpPow2(resolution.y));
            PBrtTLogger.Info("Resampling MIPMap from %s to %s. Ratio = %f", resolution.toString(), resPow2.toString(), (float)(resPow2.x * resPow2.y) / (float)(resolution.x * resolution.y));
            // Resample image in $s$ direction
            ResampleWeight[] sWeights = resampleWeights(resolution.x, resPow2.x);
            resampledImage = new Spectrum[resPow2.x * resPow2.y];

            // Apply _sWeights_ to zoom in $s$ direction
            for (int t = 0; t < resolution.y; t++) {
                for (int s = 0; s < resPow2.x; ++s) {
                    // Compute texel $(s,t)$ in $s$-zoomed image
                    resampledImage[t * resPow2.x + s] = black;
                    for (int j = 0; j < 4; ++j) {
                        int origS = sWeights[s].firstTexel + j;
                        if (wrapMode == Texture.ImageWrap.Repeat)
                            origS = Pbrt.Mod(origS, resolution.x);
                        else if (wrapMode == Texture.ImageWrap.Clamp)
                            origS = Pbrt.Clamp(origS, 0, resolution.x - 1);
                        if (origS >= 0 && origS < resolution.x) {
                            Spectrum pixel = resampledImage[t * resPow2.x + s];
                            resampledImage[t * resPow2.x + s] = pixel.add(data[t * resolution.x + origS].scale(sWeights[s].weight[j]));
                        }
                    }
                }
            }

            // Resample image in $t$ direction
            ResampleWeight[] tWeights = resampleWeights(resolution.y, resPow2.y);
            Spectrum[] workData = new Spectrum[resolution.y * resolution.y];
            for (int s = 0; s < resPow2.x; s++) {
                for (int t = 0; t < resPow2.y; ++t) {
                    workData[t] = black;
                    for (int j = 0; j < 4; ++j) {
                        int offset = tWeights[t].firstTexel + j;
                        if (wrapMode == Texture.ImageWrap.Repeat)
                            offset = Pbrt.Mod(offset, resolution.y);
                        else if (wrapMode == Texture.ImageWrap.Clamp)
                            offset = Pbrt.Clamp(offset, 0, resolution.y - 1);
                        if (offset >= 0 && offset < resolution.y) {
                            Spectrum pixel = resampledImage[offset * resPow2.x + s];
                            Spectrum workPixel = workData[t];
                            workData[t] = workPixel.add(pixel.scale(tWeights[t].weight[j]));
                        }
                    }
                }
                for (int t = 0; t < resPow2.y; ++t) {
                    Spectrum workPixel = workData[t];
                    resampledImage[t * resPow2.x + s] = workPixel.clamp(0, Pbrt.Infinity);
                }
            }
            resolution = resPow2;
        }
        else {
            resampledImage = new Spectrum[resolution.x * resolution.y];
            for (int s = 0; s < resolution.x; s++) {
                for (int t = 0; t < resolution.y; t++) {
                    resampledImage[t * resolution.x + s] = data[t * resolution.x + s];
                }
            }
        }
        // Initialize levels of MIPMap from image
        int nLevels = 1 + Pbrt.Log2Int(Math.max(resolution.x, resolution.y));
        this.pyramid = new ArrayList<>(nLevels);

        // Initialize most detailed level of MIPMap
        int logBlockSize = 4;
        pyramid.add(new BlockedArray(resolution.x, resolution.y, logBlockSize, resampledImage));
        for (int i = 1; i < nLevels; ++i) {
            // Initialize $i$th MIPMap level from $i-1$st level
            int sRes = Math.max(1, pyramid.get(i - 1).uSize() / 2);
            int tRes = Math.max(1, pyramid.get(i - 1).vSize() / 2);
            pyramid.add(new BlockedArray(sRes, tRes, logBlockSize, null));

            // Filter four texels from finer level of pyramid
            for (int t = 0; t < tRes; t++) {
                for (int s = 0; s < sRes; ++s) {
                    pyramid.get(i).set(s, t, (Texel(i - 1, 2 * s, 2 * t).add(Texel(i - 1, 2 * s + 1, 2 * t)).add(Texel(i - 1, 2 * s, 2 * t + 1)).add(
                            Texel(i - 1, 2 * s + 1, 2 * t + 1))).scale(0.25f));
                }
            }
        }

        // Initialize EWA filter weights if needed
        if (weightLut[0] == 0) {
            for (int i = 0; i < WeightLUTSize; ++i) {
                float alpha = 2;
                float r2 = (float)i / (float)(WeightLUTSize - 1);
                weightLut[i] = (float)(Math.exp(-alpha * r2) - Math.exp(-alpha));
            }
        }
        mipMapMemory.increment((4 * resolution.x * resolution.y * 4*3) / 3);
    }

    public MIPMapSpectrum(Point2i resolution, Spectrum[] data, Spectrum black) {
        this(resolution, data, false, 8, Texture.ImageWrap.Repeat, black);
    }

    public int Width() { return resolution.x; }
    public int Height() { return resolution.y; }
    public int Levels(){ return pyramid.size(); }
    public Spectrum Texel(int level, int s, int t) {
        assert(level < pyramid.size());
        BlockedArray l = pyramid.get(level);
        // Compute texel $(s,t)$ accounting for boundary conditions
        switch (wrapMode) {
            case Repeat:
                s = Pbrt.Mod(s, l.uSize());
                t = Pbrt.Mod(t, l.vSize());
                break;
            case Clamp:
                s = Pbrt.Clamp(s, 0, l.uSize() - 1);
                t = Pbrt.Clamp(t, 0, l.vSize() - 1);
                break;
            case Black: {
                if (s < 0 || s >= l.uSize() || t < 0 || t >= l.vSize())
                    return black;
                break;
            }
        }
        return (Spectrum)l.at(s, t);
    }

    public Spectrum Lookup(Point2f st, float width) {

        nTrilerpLookups.increment();
        // Compute MIPMap level for trilinear filtering
        float level = Levels() - 1 + Pbrt.Log2((float)Math.max(width, 1e-8));

        // Perform trilinear interpolation at appropriate MIPMap level
        if (level < 0)
            return triangle(0, st);
        else if (level >= Levels() - 1)
            return Texel(Levels() - 1, 0, 0);
        else {
            int iLevel = (int)Math.floor(level);
            float delta = level - iLevel;
            return triangle(iLevel, st).lerp(delta, triangle(iLevel + 1, st));
        }
    }
    public Spectrum Lookup(Point2f st) {
        return this.Lookup(st, 0);
    }

    public Spectrum Lookup(Point2f st, Vector2f dst0, Vector2f dst1) {
        if (doTrilinear) {
            float width = Math.max(Math.max(Math.abs(dst0.x), Math.abs(dst0.y)),
                Math.max(Math.abs(dst1.x), Math.abs(dst1.y)));
            return Lookup(st, 2 * width);
        }

        nEWALookups.increment();
        // Compute ellipse minor and major axes
        if (dst0.LengthSquared() < dst1.LengthSquared()) {
            Vector2f temp = dst0;
            dst0 = dst1;
            dst1 = temp;
        }

        float majorLength = dst0.Length();
        float minorLength = dst1.Length();

        // Clamp ellipse eccentricity if too large
        if (minorLength * maxAnisotropy < majorLength && minorLength > 0) {
            float scale = majorLength / (minorLength * maxAnisotropy);
            dst1 = dst1.scale(scale);
            minorLength *= scale;
        }
        if (minorLength == 0) return triangle(0, st);

        // Choose level of detail for EWA lookup and perform EWA filtering
        float lod = Math.max(0, Levels() - 1 + Pbrt.Log2(minorLength));
        int ilod = (int)Math.floor(lod);
        return EWA(ilod, st, dst0, dst1).lerp(lod - ilod, EWA(ilod + 1, st, dst0, dst1));
    }

    private ResampleWeight[] resampleWeights(int oldRes, int newRes) {
        assert(newRes >= oldRes);

        ResampleWeight[] wt = new ResampleWeight[newRes];
        float filterwidth = 2;
        for (int i = 0; i < newRes; ++i) {
            wt[i] = new ResampleWeight();
            // Compute image resampling weights for _i_th texel
            float center = (i + .5f) * oldRes / newRes;
            wt[i].firstTexel = (int)Math.floor((center - filterwidth) + 0.5);
            for (int j = 0; j < 4; ++j) {
                float pos = wt[i].firstTexel + j + .5f;
                wt[i].weight[j] = Texture.Lanczos((pos - center) / filterwidth, 2);
            }

            // Normalize filter weights for texel resampling
            float invSumWts = 1 / (wt[i].weight[0] + wt[i].weight[1] + wt[i].weight[2] + wt[i].weight[3]);
            for (int j = 0; j < 4; ++j) wt[i].weight[j] *= invSumWts;
        }
        return wt;
    }

    private Spectrum triangle(int level, Point2f st) {
        level = Pbrt.Clamp(level, 0, Levels() - 1);
        float s = st.x * pyramid.get(level).uSize() - 0.5f;
        float t = st.y * pyramid.get(level).vSize() - 0.5f;
        int s0 = (int)Math.floor(s), t0 = (int)Math.floor(t);
        float ds = s - s0, dt = t - t0;

        return Texel(level, s0, t0).scale((1 - ds) * (1 - dt)).add(Texel(level, s0, t0 + 1).scale((1 - ds) * dt).add(Texel(level, s0 + 1, t0).scale(ds * (1 - dt)).add(Texel(level, s0 + 1, t0 + 1).scale(ds * dt))));
    }

    private Spectrum EWA(int level, Point2f st, Vector2f dst0, Vector2f dst1) {
        if (level >= Levels()) return Texel(Levels() - 1, 0, 0);
        // Convert EWA coordinates to appropriate scale for level
        st.x = st.x * pyramid.get(level).uSize() - 0.5f;
        st.y = st.y * pyramid.get(level).vSize() - 0.5f;
        dst0.x *= pyramid.get(level).uSize();
        dst0.y *= pyramid.get(level).vSize();
        dst1.x *= pyramid.get(level).uSize();
        dst1.y *= pyramid.get(level).vSize();

        // Compute ellipse coefficients to bound EWA filter region
        float A = dst0.y * dst0.y + dst1.y * dst1.y + 1;
        float B = -2 * (dst0.x * dst0.y + dst1.x * dst1.y);
        float C = dst0.x * dst0.x + dst1.x * dst1.x + 1;
        float invF = 1 / (A * C - B * B * 0.25f);
        A *= invF;
        B *= invF;
        C *= invF;

        // Compute the ellipse's $(s,t)$ bounding box in texture space
        float det = -B * B + 4 * A * C;
        float invDet = 1 / det;
        float uSqrt = (float)Math.sqrt(det * C), vSqrt = (float)Math.sqrt(A * det);
        int s0 = (int)Math.ceil(st.x - 2 * invDet * uSqrt);
        int s1 = (int)Math.floor(st.x + 2 * invDet * uSqrt);
        int t0 = (int)Math.ceil(st.y - 2 * invDet * vSqrt);
        int t1 = (int)Math.floor(st.y + 2 * invDet * vSqrt);

        // Scan over ellipse bound and compute quadratic equation
        Spectrum sum = black;
        float sumWts = 0;
        for (int it = t0; it <= t1; ++it) {
            float tt = it - st.y;
            for (int is = s0; is <= s1; ++is) {
                float ss = is - st.x;
                // Compute squared radius and filter texel if inside ellipse
                float r2 = A * ss * ss + B * ss * tt + C * tt * tt;
                if (r2 < 1) {
                    int index = Math.min((int)(r2 * WeightLUTSize), WeightLUTSize - 1);
                    float weight = weightLut[index];
                    sum = sum.add(Texel(level, is, it).scale(weight));
                    sumWts += weight;
                }
            }
        }
        return sum.scale(1 / sumWts);
    }

    private final boolean doTrilinear;
    private final float maxAnisotropy;
    private final Texture.ImageWrap wrapMode;
    private final Spectrum black;
    private Point2i resolution;
    ArrayList<BlockedArray> pyramid;
    private static final int WeightLUTSize = 128;
    private static float[] weightLut = new float[WeightLUTSize];

    public static Stats.Counter nEWALookups = new Stats.Counter("Texture/EWA lookups");
    public static Stats.Counter nTrilerpLookups = new Stats.Counter("Texture/Trilinear lookups");
    public static Stats.MemoryCounter mipMapMemory = new Stats.MemoryCounter("Memory/Texture MIP maps");
}


text:
using System.Collections.Generic;

using Itinero.Profiles.Lua.Execution;

namespace Itinero.Profiles.Lua.Tree.Statements
{
	class CompositeStatement : Statement
	{
		List<Statement> m_Statements = new List<Statement>();

		public CompositeStatement(ScriptLoadingContext lcontext)
			: base(lcontext)
		{
			while (true)
			{
				Token t = lcontext.Lexer.Current;
				if (t.IsEndOfBlock()) break;

				bool forceLast;

				Statement s = Statement.CreateStatement(lcontext, out forceLast);
				m_Statements.Add(s);

				if (forceLast) break;
			}

			// eat away all superfluos ';'s
			while (lcontext.Lexer.Current.Type == TokenType.SemiColon)
				lcontext.Lexer.Next();
		}

		public override void Compile(Execution.VM.ByteCode bc)
		{
			if (m_Statements != null)
			{
				foreach (Statement s in m_Statements)
				{
					s.Compile(bc);
				}
			}
		}
	}
}


text:
<BroadcastMonitor>
  <updated>2015-08-03T08:23:38</updated>
  <stationName>Radio 6</stationName>
  <Current>
    <startTime>2015-08-03T08:23:38</startTime>
    <itemId>1000080503:1242028</itemId>
    <titleId>216064123</titleId>
    <itemCode></itemCode>
    <itemReference></itemReference>
    <titleName>*** TUNE Salsameter 2</titleName>
    <artistName></artistName>
    <albumName></albumName>
    <CategoryCode>653</CategoryCode>
    <CategoryName>Bedjes</CategoryName>
    <itemDuration>115</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Current>
  <Next>
    <startTime>2015-08-03T08:25:33</startTime>
    <itemId>1000080503:1242029</itemId>
    <titleId>216049764</titleId>
    <itemCode></itemCode>
    <itemReference></itemReference>
    <titleName>*** FX Pauk lang</titleName>
    <artistName></artistName>
    <albumName></albumName>
    <CategoryCode>725</CategoryCode>
    <CategoryName>FX</CategoryName>
    <itemDuration>36</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Next>
</BroadcastMonitor>


text:
package yitian.study.adapter;

import yitian.study.Sample;

public class AdapterSample implements Sample {
    @Override
    public void run() {
        MusicPlayer musicPlayer = new MyMusicPlayer();
        VideoPlayer videoPlayer = new MyVideoPlayer();

        MediaPlayer player1 = new MediaPlayerAdapter(musicPlayer);
        player1.play();

        MediaPlayer player2 = new MediaPlayerAdapter(videoPlayer);
        player2.play();
    }
}


text:
<?php

namespace Drugstore\UserBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;

/**
 * Drugstore\UserBundle\Entity\User
 *
 * @ORM\Entity
 * @ORM\Table(name="users")
 * @ORM\Entity(repositoryClass="Drugstore\UserBundle\Entity\UserRepository")
 */

class User implements UserInterface, \Serializable
{
	/**
	 * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
	private $id;

	/**
     * @ORM\Column(type="string", length=255, unique=true)
     */
	private $username;

	/**
     * @ORM\Column(type="string", length=255)
     */
	private $password;

	/**
     * @ORM\Column(type="string", length=255)
     */
	private $salt;

	/**
     * se utilizó user_roles para no hacer conflicto al aplicar ->toArray en getRoles()
     * @ORM\ManyToMany(targetEntity="Role")
     * @ORM\JoinTable(name="user_role",
     *     joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
     *     inverseJoinColumns={@ORM\JoinColumn(name="role_id", referencedColumnName="id")}
     * )
     */
     protected $user_roles;

	public function __construct()
    {
        $this->user_roles = new \Doctrine\Common\Collections\ArrayCollection();
        // may not be needed, see section on salt below
        // $this->salt = md5(uniqid(null, true));
    }

    /**
     * @inheritDoc
     */
    public function getUsername()
    {
        return $this->username;
    }

    /**
     * @inheritDoc
     */
    public function getSalt()
    {
        // you *may* need a real salt depending on your encoder
        // see section on salt below
        return null;
    }

    /**
     * @inheritDoc
     */
    public function getPassword()
    {
        return $this->password;
    }

    /**
     * @inheritDoc
     */
    public function getRoles()
    {
        return $this->user_roles->toArray();
    }

    /**
     * @inheritDoc
     */
    public function eraseCredentials()
    {
    }

    /**
     * @see \Serializable::serialize()
     */
    public function serialize()
    {
        return serialize(array(
            $this->id,
            $this->username,
            $this->password,
            // see section on salt below
            // $this->salt,
        ));
    }

    /**
     * @see \Serializable::unserialize()
     */
    public function unserialize($serialized)
    {
        list (
            $this->id,
            $this->username,
            $this->password,
            // see section on salt below
            // $this->salt
        ) = unserialize($serialized);
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set username
     *
     * @param string $username
     * @return User
     */
    public function setUsername($username)
    {
        $this->username = $username;

        return $this;
    }

    /**
     * Set password
     *
     * @param string $password
     * @return User
     */
    public function setPassword($password)
    {
        $this->password = $password;

        return $this;
    }

    /**
     * Compares this user to another to determine if they are the same.
     *
     * @param UserInterface $user The user
     * @return boolean True if equal, false othwerwise.
     */
    public function equals(UserInterface $user) {
        return md5($this->getUsername()) == md5($user->getUsername());

    }

    /**
     * Add user_roles
     *
     * @param Maycol\BlogBundle\Entity\Role $userRoles
     */
    public function addRole(\Maycol\BlogBundle\Entity\Role $userRoles)
    {
        $this->user_roles[] = $userRoles;
    }

    public function setUserRoles($roles) {
        $this->user_roles = $roles;
    }

    /**
     * Get user_roles
     *
     * @return Doctrine\Common\Collections\Collection
     */
    public function getUserRoles()
    {
        return $this->user_roles;
    }

    /**
     * Set salt
     *
     * @param string $salt
     */
    public function setSalt($salt)
    {
        $this->salt = $salt;
    }

}


text:
require 'optparse'

require_relative '../util/struct'

module Kay

  class BranchRemoveParse

    @@branch = '--branch <branch>'

    def self.parse(args)
      options = base_struct
      opt_parser = OptionParser.new do |opts|

        opts.banner = 'Usage: kay branch-remove [options]'

        opts.on(@@branch, String, 'name of branch') do |name|
          options.branch = name
        end

      end

      opt_parser.parse!(args)
      self.validate(options)

      options

    end

    def self.validate(options)
      raise '%s required' % [@@branch] if options[:branch].nil?
    end

  end

end


text:
function setUpInstanceName() {

    $('#instance-name-typeahead').typeahead({highlight: true}, {
        name: 'name-typeahead',
        displayKey: 'value',
        source: nameByFullName.ttAdapter()})
        .on('typeahead:opened', function($e,datum) {
            // Start afresh.
        })
        .on('typeahead:selected', function($e,datum) {
            $('#instance_name_id').val(datum.id);
        })
        .on('typeahead:autocompleted', function($e,datum) {
            $('#instance_name_id').val(datum.id);
        })
        .on('typeahead:closed', function($e,datum) {
            // NOOP: cannot distinguish tabbing through vs emptying vs typing text.
            // Users must select or autocomplete.
        });
}


text:
(function() {
  function vendorModule() {
    'use strict';

    return { 'default': self['imagesLoaded'] };
  }

  define('imagesloaded', [], vendorModule);
})();


text:
// Copyright 2005-2011 Gallio Project - http://www.gallio.org/
// Portions Copyright 2000-2004 Jonathan de Halleux
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Gallio.Framework.Data.DataObjects
{
    /// <summary>
    /// Helpful utility methods to aid in working around the XmlDataObject's idiosynracies.
    /// </summary>
    public class XmlDataObjectUtility
    {
        /// <summary>
        /// Method for finding an immediate child element that has an attribute with a certain value.
        /// </summary>
        /// <param name="ChildElements">Either an XmlDataObject or a List of XmlDataObjects</param>
        /// <param name="AttributeName">Name of Xml attribute we're querying</param>
        /// <param name="AttributeValue">Expect value of the Xml attribute</param>
        /// <returns>XmlDataObject Element</returns>
        public static dynamic FindFirstElementByAttribute(dynamic ChildElements, string AttributeName, string AttributeValue)
        {
            List<XmlDataObject> ListOfElements = XmlDataObject.AsList(ChildElements);

            foreach (XmlDataObject Element in ListOfElements)
            {
                if (Element.GetMember(AttributeName) as string == AttributeValue)
                    return Element;
            }

            // If we have a value type i.e. a leaf, then it obviously won't have attributes
            return null;
        }

        /// <summary>
        /// Takes sequence (or solitary member) of Elements and dumps the values into string List
        /// </summary>
        public static List<string> ElementValuesToStringList(dynamic ChildElements)
        {
            List<XmlDataObject> ListOfElements = XmlDataObject.AsList(ChildElements);
            List<string> retval = new List<string>();

            foreach (dynamic Element in XmlDataObject.AsList(ChildElements))
                retval.Add(Element.Value);

            return retval.Cast<string>().ToList<string>();
        }
    }
}


text:
A Go type system and demo AI player for [sirpent-rust](https://github.com/sirpent-team/sirpent-rust), a multiplayer snake server.

## Installation

```
go get github.com/sirpent-team/ai-go
```

<!--
These need testing before advertising them:

Sirpent can use any of the [Regular Tilings](https://en.wikipedia.org/wiki/Euclidean_tilings_by_convex_regular_polygons#Regular_Tilings) for its Grid. Rust's type system is a little too limited to choose at runctime, so it's a compile-time option.

``` sh
cargo run --no-default-features --features square
```

``` sh
cargo run --no-default-features --features triangle
```
-->

<!--
## API Reference

Depending on the size of the project, if it is small and simple enough the reference docs can be added to the README. For medium size to larger projects it is important to at least provide a link to where the API reference docs live.

## Tests

Describe and show how to run the tests with code examples.

## Contributors

Let people know how they can dive into the project, include important links to things like issue trackers, irc, twitter accounts if applicable.
-->

## License

`sirpent-rust` and this AI is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.

See LICENSE-APACHE, and LICENSE-MIT for details.


text:
require 'rubygems'
require 'wtf-tools'
require 'active_support/logger'

# default: puts
WTF.time {
  sleep 1.01
}

# logging time with specified precision and options
WTF.options = {
  output: {
    default: ActiveSupport::Logger.new('./example.log'),
  }
}
result = WTF.time(4, :nl) {
  sleep 3.12346
  17
}
p result # => 17


text:
require 'rails_helper'

RSpec.describe ActiveAdmin::ViewHelpers::FlashHelper do

  describe '.flash_messages' do
    let(:view) { action_view }

    it "should not include 'timedout' flash messages by default" do
      view.request.flash[:alert] = "Alert"
      view.request.flash[:timedout] = true
      expect(view.flash_messages).to include 'alert'
      expect(view.flash_messages).to_not include 'timedout'
    end

    it "should not return flash messages included in flash_keys_to_except" do
      expect(view.active_admin_application).to receive(:flash_keys_to_except).and_return ["hideme"]
      view.request.flash[:alert] = "Alert"
      view.request.flash[:hideme] = "Do not show"
      expect(view.flash_messages).to include 'alert'
      expect(view.flash_messages).to_not include 'hideme'
    end

  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#000">
    <VideoView
        android:id="@+id/myVideo"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:focusable="false"
        android:focusableInTouchMode="false"
        android:layout_centerHorizontal="true"
        android:layout_alignParentTop="true" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="retour"
        android:id="@+id/returnBtt"
        android:layout_alignParentTop="true"
        android:textColor="#fff"
        android:gravity="center"
        android:textSize="25dp"
        android:padding="5dp"
        android:visibility="gone" />
</RelativeLayout>


text:
static const void *kKey = &kKey;
@implementation UIView (MaskView)

+ (void)addMaskViewToView:(UIView *)view{
    UIView *maskView = [[UIView alloc]initWithFrame:view.bounds];
    maskView.backgroundColor = [UIColor colorWithWhite:0.65 alpha:0.6];
    objc_setAssociatedObject(view, kKey, maskView, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
    [view addSubview:maskView];
}

+ (void)removeMaskViewFromView:(UIView *)view{
    UIView *maskView = objc_getAssociatedObject(view, kKey);
    if (maskView) {
        [maskView removeFromSuperview];
        objc_removeAssociatedObjects(view);
    }
}

@end


text:
xpath-service
=============

Provides XPath and Stylesheet features for Hudson and Jelly (which no longer
contain Jaxen).

Converting dom4j XPath-related calls to XPath service is usually trivial, e.g.,

    doc.selectNodes(pathExpr)

becomes

    new XPath(pathExpr).selectNodes(doc)


text:
/*
 * flatiron-cli-users.js: Top-level include for the `flatiron-cli-users` module.
 *
 * (C) 2010, Nodejitsu Inc.
 *
 */

var common = require('flatiron').common;

var cliUsers = exports;

//
// Expose commands and name this plugin
//
cliUsers.commands = require('./commands');
cliUsers.name = 'cli-users';

//
// ### function attach (options)
// #### @options {Object} Options to use when attaching.
// Attaches the `flatiron-cli-users` behavior to the application.
//
cliUsers.attach = function (options) {
  var app = this;
  options = options || {};

  if (!app.plugins.cli) {
    throw new Error('`cli` plugin is required to use `flatiron-cli-users`');
  }
  else if (!app.config) {
    throw new Error('`app.config` must be set to use `flatiron-cli-users`');
  }

  if (app.config.stores.literal) {
    app.config.remove('literal');
  }

  //
  // Setup state from the application attached to.
  //
  app.skipAuth    = false;
  cliUsers.app    = app;
  cliUsers.after  = options.after || {};
  cliUsers.before = options.before || {};
  common.templateUsage(app, cliUsers.commands);

  //
  // Mixin properties for the application prompt.
  //
  // Remark: This causes stdin to be evaluated and thus causes
  // ~100ms delay. `flatiron.plugins.cli` should be refactored
  // to avoid this latency.
  //
  app.prompt.properties = common.mixin(app.prompt.properties, require('./properties'));

  //
  // Add the necessary `<app> users *` commands
  //
  app.commands['users'] = app.commands['users'] || {};
  app.commands['users'] = common.mixin(app.commands['users'], cliUsers.commands);

  //
  // Setup aliases for `<app> users *` commands.
  //
  app.alias('login',  { resource: 'users', command: 'login' });
  app.alias('logout', { resource: 'users', command: 'logout' });
  app.alias('signup', { resource: 'users', command: 'create' });
  app.alias('whoami', { resource: 'users', command: 'whoami' });

  //
  // ### function auth (callback)
  // #### @callback {function} Continuation to pass control to when complete.
  // Attempts to authenicate the user identified in `app.config.get('username'|'password')`
  //
  app.auth = function (callback) {
    if (app.skipAuth) {
      return callback();
    }

    var username = app.config.get('username');
    app.log.silly('Attempting to authenticate as ' + username.magenta);
    app.users.auth(function (err, success) {
      if (err || !success) {
        app.log.error('Unable to Authenticate as ' + username.magenta);
        app.log.error(err.message);
        return callback(err);
      }

      app.skipAuth = true;
      app.log.info('Authenticated as ' + username.magenta);
      return callback();
    })
  };
};

//
// ### function detach ()
// Detaches this plugin from the application.
//
cliUsers.detach = function () {
  var app = this;

  Object.keys(app.commands['users']).forEach(function (method) {
    if (cliUsers.commands[method]) {
      delete app.commands['config'][method];
    }

    cliUsers.commands.app = null;
  });
};


text:
package javax.crypto;

import java.util.*;

import java.security.*;
import java.security.Provider.Service;
import java.security.spec.*;

import sun.security.jca.*;
import sun.security.jca.GetInstance.Instance;

/**
 * This class provides the functionality of a secret (symmetric) key generator.
 *
 *
Key generators are constructed using one of the getInstance
 * class methods of this class.
 *
 *
KeyGenerator objects are reusable, i.e., after a key has been
 * generated, the same KeyGenerator object can be re-used to generate further
 * keys.
 *
 *
There are two ways to generate a key: in an algorithm-independent
 * manner, and in an algorithm-specific manner.
 * The only difference between the two is the initialization of the object:
 *
 *

 *
Algorithm-Independent Initialization
 *
All key generators share the concepts of a keysize and a
 * source of randomness.
 * There is an
 * {@link #init(int, java.security.SecureRandom) init}
 * method in this KeyGenerator class that takes these two universally
 * shared types of arguments. There is also one that takes just a
 * keysize argument, and uses the SecureRandom implementation
 * of the highest-priority installed provider as the source of randomness
 * (or a system-provided source of randomness if none of the installed
 * providers supply a SecureRandom implementation), and one that takes just a
 * source of randomness.
 *
 *
Since no other parameters are specified when you call the above
 * algorithm-independent init methods, it is up to the
 * provider what to do about the algorithm-specific parameters (if any) to be
 * associated with each of the keys.
 *
 *
Algorithm-Specific Initialization
 *
For situations where a set of algorithm-specific parameters already
 * exists, there are two
 * {@link #init(java.security.spec.AlgorithmParameterSpec) init}
 * methods that have an AlgorithmParameterSpec
 * argument. One also has a SecureRandom argument, while the
 * other uses the SecureRandom implementation
 * of the highest-priority installed provider as the source of randomness
 * (or a system-provided source of randomness if none of the installed
 * providers supply a SecureRandom implementation).
 *

 *
 *
In case the client does not explicitly initialize the KeyGenerator
 * (via a call to an init method), each provider must
 * supply (and document) a default initialization.
 *
 *
 Every implementation of the Java platform is required to support the
 * following standard KeyGenerator algorithms with the keysizes in
 * parentheses:
 *

 *
<tt>AES</tt> (128)

 *
<tt>DES</tt> (56)

 *
<tt>DESede</tt> (168)

 *
<tt>HmacSHA1</tt>

 *
<tt>HmacSHA256</tt>

 *

 * These algorithms are described in the
 * KeyGenerator section of the
 * Java Cryptography Architecture Standard Algorithm Name Documentation.
 * Consult the release documentation for your implementation to see if any
 * other algorithms are supported.
 *
 * @author Jan Luehe
 *
 * @see SecretKey
 * @since 1.4
 */

public class KeyGenerator {

    // see java.security.KeyPairGenerator for failover notes

    private final static int I_NONE   = 1;
    private final static int I_RANDOM = 2;
    private final static int I_PARAMS = 3;
    private final static int I_SIZE   = 4;

    // The provider
    private Provider provider;

    // The provider implementation (delegate)
    private volatile KeyGeneratorSpi spi;

    // The algorithm
    private final String algorithm;

    private final Object lock = new Object();

    private Iterator<Service> serviceIterator;

    private int initType;
    private int initKeySize;
    private AlgorithmParameterSpec initParams;
    private SecureRandom initRandom;

    /**
     * Creates a KeyGenerator object.
     *
     * @param keyGenSpi the delegate
     * @param provider the provider
     * @param algorithm the algorithm
     */
    protected KeyGenerator(KeyGeneratorSpi keyGenSpi, Provider provider,
                           String algorithm) {
        this.spi = keyGenSpi;
        this.provider = provider;
        this.algorithm = algorithm;
    }

    private KeyGenerator(String algorithm) throws NoSuchAlgorithmException {
        this.algorithm = algorithm;
        List<Service> list =
                GetInstance.getServices("KeyGenerator", algorithm);
        serviceIterator = list.iterator();
        initType = I_NONE;
        // fetch and instantiate initial spi
        if (nextSpi(null, false) == null) {
            throw new NoSuchAlgorithmException
                (algorithm + " KeyGenerator not available");
        }
    }

    /**
     * Returns the algorithm name of this KeyGenerator object.
     *
     *
This is the same name that was specified in one of the
     * getInstance calls that created this
     * KeyGenerator object.
     *
     * @return the algorithm name of this KeyGenerator object.
     */
    public final String getAlgorithm() {
        return this.algorithm;
    }

    /**
     * Returns a KeyGenerator object that generates secret keys
     * for the specified algorithm.
     *
     *
 This method traverses the list of registered security Providers,
     * starting with the most preferred Provider.
     * A new KeyGenerator object encapsulating the
     * KeyGeneratorSpi implementation from the first
     * Provider that supports the specified algorithm is returned.
     *
     *
 Note that the list of registered providers may be retrieved via
     * the {@link Security#getProviders() Security.getProviders()} method.
     *
     * @param algorithm the standard name of the requested key algorithm.
     * See the KeyGenerator section in the
     * Java Cryptography Architecture Standard Algorithm Name Documentation
     * for information about standard algorithm names.
     *
     * @return the new KeyGenerator object.
     *
     * @exception NullPointerException if the specified algorithm is null.
     *
     * @exception NoSuchAlgorithmException if no Provider supports a
     *          KeyGeneratorSpi implementation for the
     *          specified algorithm.
     *
     * @see java.security.Provider
     */
    public static final KeyGenerator getInstance(String algorithm)
            throws NoSuchAlgorithmException {
        return new KeyGenerator(algorithm);
    }

    /**
     * Returns a KeyGenerator object that generates secret keys
     * for the specified algorithm.
     *
     *
 A new KeyGenerator object encapsulating the
     * KeyGeneratorSpi implementation from the specified provider
     * is returned.  The specified provider must be registered
     * in the security provider list.
     *
     *
 Note that the list of registered providers may be retrieved via
     * the {@link Security#getProviders() Security.getProviders()} method.
     *
     * @param algorithm the standard name of the requested key algorithm.
     * See the KeyGenerator section in the
     * Java Cryptography Architecture Standard Algorithm Name Documentation
     * for information about standard algorithm names.
     *
     * @param provider the name of the provider.
     *
     * @return the new KeyGenerator object.
     *
     * @exception NullPointerException if the specified algorithm is null.
     *
     * @exception NoSuchAlgorithmException if a KeyGeneratorSpi
     *          implementation for the specified algorithm is not
     *          available from the specified provider.
     *
     * @exception NoSuchProviderException if the specified provider is not
     *          registered in the security provider list.
     *
     * @exception IllegalArgumentException if the provider
     *          is null or empty.
     *
     * @see java.security.Provider
     */
    public static final KeyGenerator getInstance(String algorithm,
            String provider) throws NoSuchAlgorithmException,
            NoSuchProviderException {
        Instance instance = JceSecurity.getInstance("KeyGenerator",
                KeyGeneratorSpi.class, algorithm, provider);
        return new KeyGenerator((KeyGeneratorSpi)instance.impl,
                instance.provider, algorithm);
    }

    /**
     * Returns a KeyGenerator object that generates secret keys
     * for the specified algorithm.
     *
     *
 A new KeyGenerator object encapsulating the
     * KeyGeneratorSpi implementation from the specified Provider
     * object is returned.  Note that the specified Provider object
     * does not have to be registered in the provider list.
     *
     * @param algorithm the standard name of the requested key algorithm.
     * See the KeyGenerator section in the
     * Java Cryptography Architecture Standard Algorithm Name Documentation
     * for information about standard algorithm names.
     *
     * @param provider the provider.
     *
     * @return the new KeyGenerator object.
     *
     * @exception NullPointerException if the specified algorithm is null.
     *
     * @exception NoSuchAlgorithmException if a KeyGeneratorSpi
     *          implementation for the specified algorithm is not available
     *          from the specified Provider object.
     *
     * @exception IllegalArgumentException if the provider
     *          is null.
     *
     * @see java.security.Provider
     */
    public static final KeyGenerator getInstance(String algorithm,
            Provider provider) throws NoSuchAlgorithmException {
        Instance instance = JceSecurity.getInstance("KeyGenerator",
                KeyGeneratorSpi.class, algorithm, provider);
        return new KeyGenerator((KeyGeneratorSpi)instance.impl,
                instance.provider, algorithm);
    }

    /**
     * Returns the provider of this KeyGenerator object.
     *
     * @return the provider of this KeyGenerator object
     */
    public final Provider getProvider() {
        synchronized (lock) {
            disableFailover();
            return provider;
        }
    }

    /**
     * Update the active spi of this class and return the next
     * implementation for failover. If no more implemenations are
     * available, this method returns null. However, the active spi of
     * this class is never set to null.
     */
    private KeyGeneratorSpi nextSpi(KeyGeneratorSpi oldSpi,
            boolean reinit) {
        synchronized (lock) {
            // somebody else did a failover concurrently
            // try that spi now
            if ((oldSpi != null) && (oldSpi != spi)) {
                return spi;
            }
            if (serviceIterator == null) {
                return null;
            }
            while (serviceIterator.hasNext()) {
                Service s = serviceIterator.next();
                if (JceSecurity.canUseProvider(s.getProvider()) == false) {
                    continue;
                }
                try {
                    Object inst = s.newInstance(null);
                    // ignore non-spis
                    if (inst instanceof KeyGeneratorSpi == false) {
                        continue;
                    }
                    KeyGeneratorSpi spi = (KeyGeneratorSpi)inst;
                    if (reinit) {
                        if (initType == I_SIZE) {
                            spi.engineInit(initKeySize, initRandom);
                        } else if (initType == I_PARAMS) {
                            spi.engineInit(initParams, initRandom);
                        } else if (initType == I_RANDOM) {
                            spi.engineInit(initRandom);
                        } else if (initType != I_NONE) {
                            throw new AssertionError
                                ("KeyGenerator initType: " + initType);
                        }
                    }
                    provider = s.getProvider();
                    this.spi = spi;
                    return spi;
                } catch (Exception e) {
                    // ignore
                }
            }
            disableFailover();
            return null;
        }
    }

    void disableFailover() {
        serviceIterator = null;
        initType = 0;
        initParams = null;
        initRandom = null;
    }

    /**
     * Initializes this key generator.
     *
     * @param random the source of randomness for this generator
     */
    public final void init(SecureRandom random) {
        if (serviceIterator == null) {
            spi.engineInit(random);
            return;
        }
        RuntimeException failure = null;
        KeyGeneratorSpi mySpi = spi;
        do {
            try {
                mySpi.engineInit(random);
                initType = I_RANDOM;
                initKeySize = 0;
                initParams = null;
                initRandom = random;
                return;
            } catch (RuntimeException e) {
                if (failure == null) {
                    failure = e;
                }
                mySpi = nextSpi(mySpi, false);
            }
        } while (mySpi != null);
        throw failure;
    }

    /**
     * Initializes this key generator with the specified parameter set.
     *
     *
 If this key generator requires any random bytes, it will get them
     * using the
     * {@link java.security.SecureRandom}
     * implementation of the highest-priority installed
     * provider as the source of randomness.
     * (If none of the installed providers supply an implementation of
     * SecureRandom, a system-provided source of randomness will be used.)
     *
     * @param params the key generation parameters
     *
     * @exception InvalidAlgorithmParameterException if the given parameters
     * are inappropriate for this key generator
     */
    public final void init(AlgorithmParameterSpec params)
        throws InvalidAlgorithmParameterException
    {
        init(params, JceSecurity.RANDOM);
    }

    /**
     * Initializes this key generator with the specified parameter
     * set and a user-provided source of randomness.
     *
     * @param params the key generation parameters
     * @param random the source of randomness for this key generator
     *
     * @exception InvalidAlgorithmParameterException if params is
     * inappropriate for this key generator
     */
    public final void init(AlgorithmParameterSpec params, SecureRandom random)
        throws InvalidAlgorithmParameterException
    {
        if (serviceIterator == null) {
            spi.engineInit(params, random);
            return;
        }
        Exception failure = null;
        KeyGeneratorSpi mySpi = spi;
        do {
            try {
                mySpi.engineInit(params, random);
                initType = I_PARAMS;
                initKeySize = 0;
                initParams = params;
                initRandom = random;
                return;
            } catch (Exception e) {
                if (failure == null) {
                    failure = e;
                }
                mySpi = nextSpi(mySpi, false);
            }
        } while (mySpi != null);
        if (failure instanceof InvalidAlgorithmParameterException) {
            throw (InvalidAlgorithmParameterException)failure;
        }
        if (failure instanceof RuntimeException) {
            throw (RuntimeException)failure;
        }
        throw new InvalidAlgorithmParameterException("init() failed", failure);
    }

    /**
     * Initializes this key generator for a certain keysize.
     *
     *
 If this key generator requires any random bytes, it will get them
     * using the
     * {@link java.security.SecureRandom}
     * implementation of the highest-priority installed
     * provider as the source of randomness.
     * (If none of the installed providers supply an implementation of
     * SecureRandom, a system-provided source of randomness will be used.)
     *
     * @param keysize the keysize. This is an algorithm-specific metric,
     * specified in number of bits.
     *
     * @exception InvalidParameterException if the keysize is wrong or not
     * supported.
     */
    public final void init(int keysize) {
        init(keysize, JceSecurity.RANDOM);
    }

    /**
     * Initializes this key generator for a certain keysize, using a
     * user-provided source of randomness.
     *
     * @param keysize the keysize. This is an algorithm-specific metric,
     * specified in number of bits.
     * @param random the source of randomness for this key generator
     *
     * @exception InvalidParameterException if the keysize is wrong or not
     * supported.
     */
    public final void init(int keysize, SecureRandom random) {
        if (serviceIterator == null) {
            spi.engineInit(keysize, random);
            return;
        }
        RuntimeException failure = null;
        KeyGeneratorSpi mySpi = spi;
        do {
            try {
                mySpi.engineInit(keysize, random);
                initType = I_SIZE;
                initKeySize = keysize;
                initParams = null;
                initRandom = random;
                return;
            } catch (RuntimeException e) {
                if (failure == null) {
                    failure = e;
                }
                mySpi = nextSpi(mySpi, false);
            }
        } while (mySpi != null);
        throw failure;
    }

    /**
     * Generates a secret key.
     *
     * @return the new key
     */
    public final SecretKey generateKey() {
        if (serviceIterator == null) {
            return spi.engineGenerateKey();
        }
        RuntimeException failure = null;
        KeyGeneratorSpi mySpi = spi;
        do {
            try {
                return mySpi.engineGenerateKey();
            } catch (RuntimeException e) {
                if (failure == null) {
                    failure = e;
                }
                mySpi = nextSpi(mySpi, true);
            }
        } while (mySpi != null);
        throw failure;
   }
}


text:
/*
 * Location Intelligence APIs
 *
 * Incorporate our extensive geodata into everyday applications, business processes and workflows.
 *
 * OpenAPI spec version: 8.5.0
 *
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace pb.locationIntelligence.Model
{
    /// <summary>
    /// HouseholdFinance
    /// </summary>
    [DataContract]
    public partial class HouseholdFinance :  IEquatable<HouseholdFinance>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="HouseholdFinance" /> class.
        /// </summary>
        /// <param name="AverageIncome">AverageIncome.</param>
        /// <param name="AverageAssets">AverageAssets.</param>
        /// <param name="AverageWealth">AverageWealth.</param>
        /// <param name="Boundary">Boundary.</param>
        public HouseholdFinance(string AverageIncome = null, string AverageAssets = null, string AverageWealth = null, Boundary Boundary = null)
        {
            this.AverageIncome = AverageIncome;
            this.AverageAssets = AverageAssets;
            this.AverageWealth = AverageWealth;
            this.Boundary = Boundary;
        }

        /// <summary>
        /// Gets or Sets AverageIncome
        /// </summary>
        [DataMember(Name="averageIncome", EmitDefaultValue=false)]
        public string AverageIncome { get; set; }
        /// <summary>
        /// Gets or Sets AverageAssets
        /// </summary>
        [DataMember(Name="averageAssets", EmitDefaultValue=false)]
        public string AverageAssets { get; set; }
        /// <summary>
        /// Gets or Sets AverageWealth
        /// </summary>
        [DataMember(Name="averageWealth", EmitDefaultValue=false)]
        public string AverageWealth { get; set; }
        /// <summary>
        /// Gets or Sets Boundary
        /// </summary>
        [DataMember(Name="boundary", EmitDefaultValue=false)]
        public Boundary Boundary { get; set; }
        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.Append("class HouseholdFinance {\n");
            sb.Append("  AverageIncome: ").Append(AverageIncome).Append("\n");
            sb.Append("  AverageAssets: ").Append(AverageAssets).Append("\n");
            sb.Append("  AverageWealth: ").Append(AverageWealth).Append("\n");
            sb.Append("  Boundary: ").Append(Boundary).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public string ToJson()
        {
            return JsonConvert.SerializeObject(this, Formatting.Indented);
        }

        /// <summary>
        /// Returns true if objects are equal
        /// </summary>
        /// <param name="obj">Object to be compared</param>
        /// <returns>Boolean</returns>
        public override bool Equals(object obj)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            return this.Equals(obj as HouseholdFinance);
        }

        /// <summary>
        /// Returns true if HouseholdFinance instances are equal
        /// </summary>
        /// <param name="other">Instance of HouseholdFinance to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(HouseholdFinance other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
                return false;

            return
                (
                    this.AverageIncome == other.AverageIncome ||
                    this.AverageIncome != null &&
                    this.AverageIncome.Equals(other.AverageIncome)
                ) &&
                (
                    this.AverageAssets == other.AverageAssets ||
                    this.AverageAssets != null &&
                    this.AverageAssets.Equals(other.AverageAssets)
                ) &&
                (
                    this.AverageWealth == other.AverageWealth ||
                    this.AverageWealth != null &&
                    this.AverageWealth.Equals(other.AverageWealth)
                ) &&
                (
                    this.Boundary == other.Boundary ||
                    this.Boundary != null &&
                    this.Boundary.Equals(other.Boundary)
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;
                // Suitable nullity checks etc, of course :)
                if (this.AverageIncome != null)
                    hash = hash * 59 + this.AverageIncome.GetHashCode();
                if (this.AverageAssets != null)
                    hash = hash * 59 + this.AverageAssets.GetHashCode();
                if (this.AverageWealth != null)
                    hash = hash * 59 + this.AverageWealth.GetHashCode();
                if (this.Boundary != null)
                    hash = hash * 59 + this.Boundary.GetHashCode();
                return hash;
            }
        }
    }

}


text:
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Input;
using Amazon;
using Sync.Net.Configuration;
using Sync.Net.UI.Utils;

namespace Sync.Net.UI.ViewModels
{
    public class ConfigurationViewModel : INotifyPropertyChanged
    {
        private readonly IConfigFile _configFile;
        private readonly IWindowManager _windowManager;
        private readonly IConfigurationTester _configurationTester;
        private readonly IConfigurationProvider _configurationProvider;
        private readonly IProcessorConfigurationValidator _validator;

        public ConfigurationViewModel(IConfigurationProvider configurationProvider, IWindowManager windowManager, IConfigFile configFile, IConfigurationTester configurationTester, IProcessorConfigurationValidator validator)
        {
            _configurationProvider = configurationProvider;
            _windowManager = windowManager;
            _configFile = configFile;
            _configurationTester = configurationTester;
            SelectFile = new RelayCommand(
                p => true,
                p => { LocalDirectory = _windowManager.ShowDirectoryDialog(); });

            Save = new RelayCommand(
                p => true,
                p => { SaveConfiguration(); });

            Test = new RelayCommand(
                p => true,
                p => { CheckIfConfigurationIsValid(true); });
            _validator = validator;
        }

        private void SaveConfiguration()
        {
            bool canSave = CheckIfConfigurationIsValid(false);

            if (canSave)
            {
                _configFile.Clear();
                try
                {
                    _configurationProvider.Save();
                    _windowManager.RestartApplication();
                }
                catch (Exception e)
                {
                    _windowManager.ShowMessage(e.Message);
                }
            }
        }

        private bool CheckIfConfigurationIsValid(bool showConfirmationMessage)
        {
            var validationResults = _validator.Validate(_configurationProvider.Current);
            if (!validationResults.IsValid)
            {
                _windowManager.ShowMessage(validationResults.Message);
                return false;
            }

            var testResults = _configurationTester.Test(_configurationProvider.Current);

            if (!testResults.TestPassed)
            {
                _windowManager.ShowMessage(testResults.Message);
            }
            else if (showConfirmationMessage)
                _windowManager.ShowMessage("Ok");
            return testResults.TestPassed;
        }

        public string ProfileName
        {
            get { return _configurationProvider.Current.ProfileName; }
            set
            {
                _configurationProvider.Current.ProfileName = value;
                OnPropertyChanged();
            }
        }

        public string KeySecret
        {
            get { return _configurationProvider.Current.KeySecret; }
            set
            {
                _configurationProvider.Current.KeySecret = value;
                OnPropertyChanged();
            }
        }

        public string KeyId
        {
            get { return _configurationProvider.Current.KeyId; }
            set
            {
                _configurationProvider.Current.KeyId = value;
                OnPropertyChanged();
            }
        }

        public CredentialsType? CredentialsType
        {
            get { return _configurationProvider.Current.CredentialsType; }
            set
            {
                _configurationProvider.Current.CredentialsType = value;
                OnPropertyChanged();
                OnPropertyChanged($"CredentialsTypeSet");
            }
        }

        public bool CredentialsTypeSet => CredentialsType.HasValue;

        public string LocalDirectory
        {
            get { return _configurationProvider.Current.LocalDirectory; }
            set
            {
                _configurationProvider.Current.LocalDirectory = value;
                OnPropertyChanged();
            }
        }

        public string S3Bucket
        {
            get { return _configurationProvider.Current.S3Bucket; }
            set
            {
                _configurationProvider.Current.S3Bucket = value;
                OnPropertyChanged();
            }
        }

        public RegionEndpoint RegionEndpoint
        {
            get { return _configurationProvider.Current.RegionEndpoint; }
            set
            {
                _configurationProvider.Current.RegionEndpoint = value;
                OnPropertyChanged();
            }
        }

        public ICommand SelectFile { get; }

        public ICommand Save { get; }

        public ICommand Test { get; }

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}


text:
@class DVTFilePath, DVTHashTable, NSSet, NSString;

@interface IDEAutoImportBuildableProductProxy : NSObject
{
    BOOL _cached;
    id <IDEBuildableProduct> _buildableProduct;
    id <IDEBlueprint> _blueprint;
    DVTFilePath *_filePath;
    NSSet *_namesOfLinkedBinaries;
    NSString *_productName;
    DVTHashTable *_supportedPlatforms;
    DVTHashTable *_SDKs;
    NSSet *_sourceCodeFilePaths;
    NSSet *_publicHeaders;
    NSSet *_privateHeaders;
    NSSet *_projectHeaders;
}

@property(copy, nonatomic) NSSet *projectHeaders; // @synthesize projectHeaders=_projectHeaders;
@property(copy, nonatomic) NSSet *privateHeaders; // @synthesize privateHeaders=_privateHeaders;
@property(copy, nonatomic) NSSet *publicHeaders; // @synthesize publicHeaders=_publicHeaders;
@property(copy, nonatomic) NSSet *sourceCodeFilePaths; // @synthesize sourceCodeFilePaths=_sourceCodeFilePaths;
@property(retain, nonatomic) DVTHashTable *SDKs; // @synthesize SDKs=_SDKs;
@property(retain, nonatomic) DVTHashTable *supportedPlatforms; // @synthesize supportedPlatforms=_supportedPlatforms;
@property(copy, nonatomic) NSString *productName; // @synthesize productName=_productName;
@property(retain, nonatomic) NSSet *namesOfLinkedBinaries; // @synthesize namesOfLinkedBinaries=_namesOfLinkedBinaries;
@property(retain, nonatomic) DVTFilePath *filePath; // @synthesize filePath=_filePath;
@property(nonatomic, getter=isCached) BOOL cached; // @synthesize cached=_cached;
@property(nonatomic) __weak id <IDEBlueprint> blueprint; // @synthesize blueprint=_blueprint;
@property(nonatomic) __weak id <IDEBuildableProduct> buildableProduct; // @synthesize buildableProduct=_buildableProduct;
- (void).cxx_destruct;
@property(readonly, nonatomic, getter=isValid) BOOL valid;
- (unsigned long long)visibilityOfHeaderAtFilePath:(id)arg1;
- (BOOL)containsFilePath:(id)arg1;
- (void)cacheBuildableProductDataIfNecessary;
- (void)cacheBuildableProductData;
- (id)initWithBuildableProduct:(id)arg1;

@end