text:
/**
 * Originally from http://www.cornetdesign.com/files/BeanTestCase.java.txt
 */
package org.connectbot.mock;

import java.lang.reflect.Field;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

public class BeanAssertions {
	private static final String TEST_STRING_VAL1 = "Some Value";
	private static final String TEST_STRING_VAL2 = "Some Other Value";

	private BeanAssertions() {
	}

	public static void assertMeetsEqualsContract(Class<?> classUnderTest,
			String[] fieldNames) {
		Object o1;
		Object o2;
		try {
			// Get Instances
			o1 = classUnderTest.newInstance();
			o2 = classUnderTest.newInstance();

			assertTrue(
					"Instances with default constructor not equal (o1.equals(o2))",
					o1.equals(o2));
			assertTrue(
					"Instances with default constructor not equal (o2.equals(o1))",
					o2.equals(o1));

			Field[] fields = getFieldsByNameOrAll(classUnderTest, fieldNames);

			for (int i = 0; i < fields.length; i++) {

				// Reset the instances
				o1 = classUnderTest.newInstance();
				o2 = classUnderTest.newInstance();

				Field field = fields[i];
				field.setAccessible(true);
				if (field.getType() == String.class) {
					field.set(o1, TEST_STRING_VAL1);
				} else if (field.getType() == boolean.class) {
					field.setBoolean(o1, true);
				} else if (field.getType() == short.class) {
					field.setShort(o1, (short) 1);
				} else if (field.getType() == long.class) {
					field.setLong(o1, (long) 1);
				} else if (field.getType() == float.class) {
					field.setFloat(o1, (float) 1);
				} else if (field.getType() == int.class) {
					field.setInt(o1, 1);
				} else if (field.getType() == byte.class) {
					field.setByte(o1, (byte) 1);
				} else if (field.getType() == char.class) {
					field.setChar(o1, (char) 1);
				} else if (field.getType() == double.class) {
					field.setDouble(o1, (double) 1);
				} else if (field.getType().isEnum()) {
					field.set(o1, field.getType().getEnumConstants()[0]);
				} else if (Object.class.isAssignableFrom(field.getType())) {
					field.set(o1, field.getType().newInstance());
				} else {
					fail("Don't know how to set a " + field.getType().getName());
				}

				assertFalse("Instances with o1 having " + field.getName()
						+ " set and o2 having it not set are equal", o1
						.equals(o2));

				field.set(o2, field.get(o1));

				assertTrue(
						"After setting o2 with the value of the object in o1, the two objects in the field are not equal",
						field.get(o1).equals(field.get(o2)));

				assertTrue(
						"Instances with o1 having "
								+ field.getName()
								+ " set and o2 having it set to the same object of type "
								+ field.get(o2).getClass().getName()
								+ " are not equal", o1.equals(o2));

				if (field.getType() == String.class) {
					field.set(o2, TEST_STRING_VAL2);
				} else if (field.getType() == boolean.class) {
					field.setBoolean(o2, false);
				} else if (field.getType() == short.class) {
					field.setShort(o2, (short) 0);
				} else if (field.getType() == long.class) {
					field.setLong(o2, (long) 0);
				} else if (field.getType() == float.class) {
					field.setFloat(o2, (float) 0);
				} else if (field.getType() == int.class) {
					field.setInt(o2, 0);
				} else if (field.getType() == byte.class) {
					field.setByte(o2, (byte) 0);
				} else if (field.getType() == char.class) {
					field.setChar(o2, (char) 0);
				} else if (field.getType() == double.class) {
					field.setDouble(o2, (double) 1);
				} else if (field.getType().isEnum()) {
					field.set(o2, field.getType().getEnumConstants()[1]);
				} else if (Object.class.isAssignableFrom(field.getType())) {
					field.set(o2, field.getType().newInstance());
				} else {
					fail("Don't know how to set a " + field.getType().getName());
				}
				if (field.get(o1).equals(field.get(o2))) {
					// Even though we have different instances, they are equal.
					// Let's walk one of them
					// to see if we can find a field to set
					Field[] paramFields = field.get(o1).getClass()
							.getDeclaredFields();
					for (int j = 0; j < paramFields.length; j++) {
						paramFields[j].setAccessible(true);
						if (paramFields[j].getType() == String.class) {
							paramFields[j].set(field.get(o1), TEST_STRING_VAL1);
						}
					}
				}

				assertFalse(
						"After setting o2 with a different object than what is in o1, the two objects in the field are equal. "
								+ "This is after an attempt to walk the fields to make them different",
						field.get(o1).equals(field.get(o2)));
				assertFalse(
						"Instances with o1 having "
								+ field.getName()
								+ " set and o2 having it set to a different object are equal",
						o1.equals(o2));
			}

		} catch (InstantiationException e) {
			e.printStackTrace();
			throw new AssertionError(
					"Unable to construct an instance of the class under test");
		} catch (IllegalAccessException e) {
			e.printStackTrace();
			throw new AssertionError(
					"Unable to construct an instance of the class under test");
		} catch (SecurityException e) {
			e.printStackTrace();
			throw new AssertionError(
					"Unable to read the field from the class under test");
		} catch (NoSuchFieldException e) {
			e.printStackTrace();
			throw new AssertionError(
					"Unable to find field in the class under test");
		}
	}

	/**
	 * @param classUnderTest
	 * @param fieldNames
	 * @return
	 * @throws NoSuchFieldException
	 */
	private static Field[] getFieldsByNameOrAll(Class<?> classUnderTest,
			String[] fieldNames) throws NoSuchFieldException {
		Field fields[];
		if (fieldNames == null) {
			fields = classUnderTest.getDeclaredFields();
		} else {
			fields = new Field[fieldNames.length];
			for (int i = 0; i < fieldNames.length; i++)
				fields[i] = classUnderTest.getDeclaredField(fieldNames[i]);
		}
		return fields;
	}

	public static void assertMeetsHashCodeContract(Class<?> classUnderTest,
			String[] fieldNames) {
		try {
			Field[] fields = getFieldsByNameOrAll(classUnderTest, fieldNames);

			for (int i = 0; i < fields.length; i++) {
				Object o1 = classUnderTest.newInstance();
				int initialHashCode = o1.hashCode();

				Field field = fields[i];
				field.setAccessible(true);
				if (field.getType() == String.class) {
					field.set(o1, TEST_STRING_VAL1);
				} else if (field.getType() == boolean.class) {
					field.setBoolean(o1, true);
				} else if (field.getType() == short.class) {
					field.setShort(o1, (short) 1);
				} else if (field.getType() == long.class) {
					field.setLong(o1, (long) 1);
				} else if (field.getType() == float.class) {
					field.setFloat(o1, (float) 1);
				} else if (field.getType() == int.class) {
					field.setInt(o1, 1);
				} else if (field.getType() == byte.class) {
					field.setByte(o1, (byte) 1);
				} else if (field.getType() == char.class) {
					field.setChar(o1, (char) 1);
				} else if (field.getType() == double.class) {
					field.setDouble(o1, (double) 1);
				} else if (field.getType().isEnum()) {
					field.set(o1, field.getType().getEnumConstants()[0]);
				} else if (Object.class.isAssignableFrom(field.getType())) {
					field.set(o1, field.getType().newInstance());
				} else {
					fail("Don't know how to set a " + field.getType().getName());
				}
				int updatedHashCode = o1.hashCode();
				assertFalse(
						"The field "
								+ field.getName()
								+ " was not taken into account for the hashCode contract ",
						initialHashCode == updatedHashCode);
			}
		} catch (InstantiationException e) {
			e.printStackTrace();
			throw new AssertionError(
					"Unable to construct an instance of the class under test");
		} catch (IllegalAccessException e) {
			e.printStackTrace();
			throw new AssertionError(
					"Unable to construct an instance of the class under test");
		} catch (NoSuchFieldException e) {
			e.printStackTrace();
			throw new AssertionError(
					"Unable to find field in the class under test");
		}
	}
}


text:
module Fae
  class DeployHook < ApplicationRecord
    include Fae::BaseModelConcern

    acts_as_list add_new_at: :top
    default_scope { order(:position) }

    default_scope { order(:environment) }

    validates :url, :environment, presence: true
  end
end

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

  <title>command.coffee</title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
  <link rel="stylesheet" media="all" href="docco.css" />

          Jump To …
          +

                browser.coffee

                cake.coffee

                coffee-script.coffee

                command.coffee

                grammar.coffee

                helpers.coffee

                index.coffee

                lexer.coffee

                nodes.coffee

                optparse.coffee

                repl.coffee

                rewriter.coffee

                scope.litcoffee

                sourcemap.litcoffee

command.coffee

                ¶

The coffee utility. Handles command-line compilation of CoffeeScript
into various forms: saved into .js files or printed to stdout, piped to
JavaScript Lint or recompiled every time the source is
saved, printed as a token stream or as the syntax tree, or launch an
interactive REPL.

External dependencies.

fs             = require 'fs'
path           = require 'path'
helpers        = require './helpers'
optparse       = require './optparse'
CoffeeScript   = require './coffee-script'
{spawn, exec}  = require 'child_process'
{EventEmitter} = require 'events'

exists         = fs.exists or path.exists

                ¶

Allow CoffeeScript to emit Node.js events.

helpers.extend CoffeeScript, new EventEmitter

printLine = (line) -> process.stdout.write line + '\n'
printWarn = (line) -> process.stderr.write line + '\n'

hidden = (file) -> /^\.|~$/.test file

                ¶

The help banner that is printed when coffee is called without arguments.

BANNER = '''
  Usage: coffee [options] path/to/script.coffee -- [args]

  If called without options, `coffee` will run your script.
'''

                ¶

The list of all the valid option flags that coffee knows how to handle.

SWITCHES = [
  ['-b', '--bare',            'compile without a top-level function wrapper']
  ['-c', '--compile',         'compile to JavaScript and save as .js files']
  ['-e', '--eval',            'pass a string from the command line as input']
  ['-h', '--help',            'display this help message']
  ['-i', '--interactive',     'run an interactive CoffeeScript REPL']
  ['-j', '--join [FILE]',     'concatenate the source CoffeeScript before compiling']
  ['-l', '--lint',            'pipe the compiled JavaScript through JavaScript Lint']
  ['-m', '--map',             'generate source map and save as .map files']
  ['-n', '--nodes',           'print out the parse tree that the parser produces']
  [      '--nodejs [ARGS]',   'pass options directly to the "node" binary']
  ['-o', '--output [DIR]',    'set the output directory for compiled JavaScript']
  ['-p', '--print',           'print out the compiled JavaScript']
  ['-s', '--stdio',           'listen for and compile scripts over stdio']
  ['-t', '--tokens',          'print out the tokens that the lexer/rewriter produce']
  ['-v', '--version',         'display the version number']
  ['-w', '--watch',           'watch scripts for changes and rerun commands']
]

                ¶

Top-level objects shared by all the functions.

opts         = {}
sources      = []
sourceCode   = []
notSources   = {}
watchers     = {}
optionParser = null

                ¶

Run coffee by parsing passed options and determining what action to take.
Many flags cause us to divert before compiling anything. Flags passed after
-- will be passed verbatim to your script as arguments in process.argv

exports.run = ->
  parseOptions()
  return forkNode()                      if opts.nodejs
  return usage()                         if opts.help
  return version()                       if opts.version
  return require('./repl').start()       if opts.interactive
  if opts.watch and !fs.watch
    return printWarn "The --watch feature depends on Node v0.6.0+. You are running #{process.version}."
  return compileStdio()                  if opts.stdio
  return compileScript null, sources[0]  if opts.eval
  return require('./repl').start()       unless sources.length
  literals = if opts.run then sources.splice 1 else []
  process.argv = process.argv[0..1].concat literals
  process.argv[0] = 'coffee'
  for source in sources
    compilePath source, yes, path.normalize source

                ¶

Compile a path, which could be a script or a directory. If a directory
is passed, recursively compile all '.coffee', '.litcoffee', and '.coffee.md'
extension source files in it and all subdirectories.

compilePath = (source, topLevel, base) ->
  fs.stat source, (err, stats) ->
    throw err if err and err.code isnt 'ENOENT'
    if err?.code is 'ENOENT'
      console.error "File not found: #{source}"
      process.exit 1
    if stats.isDirectory() and path.dirname(source) isnt 'node_modules'
      watchDir source, base if opts.watch
      fs.readdir source, (err, files) ->
        throw err if err and err.code isnt 'ENOENT'
        return if err?.code is 'ENOENT'
        index = sources.indexOf source
        files = files.filter (file) -> not hidden file
        sources[index..index] = (path.join source, file for file in files)
        sourceCode[index..index] = files.map -> null
        files.forEach (file) ->
          compilePath (path.join source, file), no, base
    else if topLevel or helpers.isCoffee source
      watch source, base if opts.watch
      fs.readFile source, (err, code) ->
        throw err if err and err.code isnt 'ENOENT'
        return if err?.code is 'ENOENT'
        compileScript(source, code.toString(), base)
    else
      notSources[source] = yes
      removeSource source, base

                ¶

Compile a single source script, containing the given code, according to the
requested options. If evaluating the script directly sets __filename,
__dirname and module.filename to be correct relative to the script's path.

compileScript = (file, input, base=null) ->
  o = opts
  options = compileOptions file, base
  try
    t = task = {file, input, options}
    CoffeeScript.emit 'compile', task
    if      o.tokens      then printTokens CoffeeScript.tokens t.input, t.options
    else if o.nodes       then printLine CoffeeScript.nodes(t.input, t.options).toString().trim()
    else if o.run         then CoffeeScript.run t.input, t.options
    else if o.join and t.file isnt o.join
      t.input = helpers.invertLiterate t.input if helpers.isLiterate file
      sourceCode[sources.indexOf(t.file)] = t.input
      compileJoin()
    else
      compiled = CoffeeScript.compile t.input, t.options
      t.output = compiled
      if o.map
        t.output = compiled.js
        t.sourceMap = compiled.v3SourceMap

      CoffeeScript.emit 'success', task
      if o.print
        printLine t.output.trim()
      else if o.compile || o.map
        writeJs base, t.file, t.output, options.jsPath, t.sourceMap
      else if o.lint
        lint t.file, t.output
  catch err
    CoffeeScript.emit 'failure', err, task
    return if CoffeeScript.listeners('failure').length
    useColors = process.stdout.isTTY and not process.env.NODE_DISABLE_COLORS
    message = helpers.prettyErrorMessage err, file or '[stdin]', input, useColors
    if o.watch
      printLine message + '\x07'
    else
      printWarn message
      process.exit 1

                ¶

Attach the appropriate listeners to compile scripts incoming over stdin,
and write them back to stdout.

compileStdio = ->
  code = ''
  stdin = process.openStdin()
  stdin.on 'data', (buffer) ->
    code += buffer.toString() if buffer
  stdin.on 'end', ->
    compileScript null, code

                ¶

If all of the source files are done being read, concatenate and compile
them together.

joinTimeout = null
compileJoin = ->
  return unless opts.join
  unless sourceCode.some((code) -> code is null)
    clearTimeout joinTimeout
    joinTimeout = wait 100, ->
      compileScript opts.join, sourceCode.join('\n'), opts.join

                ¶

Watch a source CoffeeScript file using fs.watch, recompiling it every
time the file is updated. May be used in combination with other options,
such as --lint or --print.

watch = (source, base) ->

  prevStats = null
  compileTimeout = null

  watchErr = (e) ->
    if e.code is 'ENOENT'
      return if sources.indexOf(source) is -1
      try
        rewatch()
        compile()
      catch e
        removeSource source, base, yes
        compileJoin()
    else throw e

  compile = ->
    clearTimeout compileTimeout
    compileTimeout = wait 25, ->
      fs.stat source, (err, stats) ->
        return watchErr err if err
        return rewatch() if prevStats and stats.size is prevStats.size and
          stats.mtime.getTime() is prevStats.mtime.getTime()
        prevStats = stats
        fs.readFile source, (err, code) ->
          return watchErr err if err
          compileScript(source, code.toString(), base)
          rewatch()

  try
    watcher = fs.watch source, compile
  catch e
    watchErr e

  rewatch = ->
    watcher?.close()
    watcher = fs.watch source, compile

                ¶

Watch a directory of files for new additions.

watchDir = (source, base) ->
  readdirTimeout = null
  try
    watcher = fs.watch source, ->
      clearTimeout readdirTimeout
      readdirTimeout = wait 25, ->
        fs.readdir source, (err, files) ->
          if err
            throw err unless err.code is 'ENOENT'
            watcher.close()
            return unwatchDir source, base
          for file in files when not hidden(file) and not notSources[file]
            file = path.join source, file
            continue if sources.some (s) -> s.indexOf(file) >= 0
            sources.push file
            sourceCode.push null
            compilePath file, no, base
  catch e
    throw e unless e.code is 'ENOENT'

unwatchDir = (source, base) ->
  prevSources = sources[..]
  toRemove = (file for file in sources when file.indexOf(source) >= 0)
  removeSource file, base, yes for file in toRemove
  return unless sources.some (s, i) -> prevSources[i] isnt s
  compileJoin()

                ¶

Remove a file from our source list, and source code cache. Optionally remove
the compiled JS version as well.

removeSource = (source, base, removeJs) ->
  index = sources.indexOf source
  sources.splice index, 1
  sourceCode.splice index, 1
  if removeJs and not opts.join
    jsPath = outputPath source, base
    exists jsPath, (itExists) ->
      if itExists
        fs.unlink jsPath, (err) ->
          throw err if err and err.code isnt 'ENOENT'
          timeLog "removed #{source}"

                ¶

Get the corresponding output JavaScript path for a source file.

outputPath = (source, base, extension=".js") ->
  basename  = helpers.baseFileName source, yes, path.sep
  srcDir    = path.dirname source
  baseDir   = if base is '.' then srcDir else srcDir.substring base.length
  dir       = if opts.output then path.join opts.output, baseDir else srcDir
  path.join dir, basename + extension

                ¶

Write out a JavaScript source file with the compiled code. By default, files
are written out in cwd as .js files with the same name, but the output
directory can be customized with --output.

If generatedSourceMap is provided, this will write a .map file into the
same directory as the .js file.

writeJs = (base, sourcePath, js, jsPath, generatedSourceMap = null) ->
  sourceMapPath = outputPath sourcePath, base, ".map"
  jsDir  = path.dirname jsPath
  compile = ->
    if opts.compile
      js = ' ' if js.length <= 0
      if generatedSourceMap then js = "#{js}\n/*\n//@ sourceMappingURL=#{helpers.baseFileName sourceMapPath, no, path.sep}\n*/\n"
      fs.writeFile jsPath, js, (err) ->
        if err
          printLine err.message
        else if opts.compile and opts.watch
          timeLog "compiled #{sourcePath}"
    if generatedSourceMap
      fs.writeFile sourceMapPath, generatedSourceMap, (err) ->
        if err
          printLine "Could not write source map: #{err.message}"
  exists jsDir, (itExists) ->
    if itExists then compile() else exec "mkdir -p #{jsDir}", compile

                ¶

Convenience for cleaner setTimeouts.

wait = (milliseconds, func) -> setTimeout func, milliseconds

                ¶

When watching scripts, it's useful to log changes with the timestamp.

timeLog = (message) ->
  console.log "#{(new Date).toLocaleTimeString()} - #{message}"

                ¶

Pipe compiled JS through JSLint (requires a working jsl command), printing
any errors or warnings that arise.

lint = (file, js) ->
  printIt = (buffer) -> printLine file + ':\t' + buffer.toString().trim()
  conf = __dirname + '/../../extras/jsl.conf'
  jsl = spawn 'jsl', ['-nologo', '-stdin', '-conf', conf]
  jsl.stdout.on 'data', printIt
  jsl.stderr.on 'data', printIt
  jsl.stdin.write js
  jsl.stdin.end()

                ¶

Pretty-print a stream of tokens, sans location data.

printTokens = (tokens) ->
  strings = for token in tokens
    tag = token[0]
    value = token[1].toString().replace(/\n/, '\\n')
    "[#{tag} #{value}]"
  printLine strings.join(' ')

                ¶

Use the OptionParser module to extract all options from
process.argv that are specified in SWITCHES.

parseOptions = ->
  optionParser  = new optparse.OptionParser SWITCHES, BANNER
  o = opts      = optionParser.parse process.argv[2..]
  o.compile     or=  !!o.output
  o.run         = not (o.compile or o.print or o.lint or o.map)
  o.print       = !!  (o.print or (o.eval or o.stdio and o.compile))
  sources       = o.arguments
  sourceCode[i] = null for source, i in sources
  return

                ¶

The compile-time options to pass to the CoffeeScript compiler.

compileOptions = (filename, base) ->
  answer = {
    filename
    literate: helpers.isLiterate(filename)
    bare: opts.bare
    header: opts.compile
    sourceMap: opts.map
  }
  if filename
    if base
      cwd = process.cwd()
      jsPath = outputPath filename, base
      jsDir = path.dirname jsPath
      answer = helpers.merge answer, {
        jsPath
        sourceRoot: path.relative jsDir, cwd
        sourceFiles: [path.relative cwd, filename]
        generatedFile: helpers.baseFileName(jsPath, no, path.sep)
      }
    else
      answer = helpers.merge answer,
        sourceRoot: ""
        sourceFiles: [helpers.baseFileName filename, no, path.sep]
        generatedFile: helpers.baseFileName(filename, yes, path.sep) + ".js"
  answer

                ¶

Start up a new Node.js instance with the arguments in --nodejs passed to
the node binary, preserving the other options.

forkNode = ->
  nodeArgs = opts.nodejs.split /\s+/
  args     = process.argv[1..]
  args.splice args.indexOf('--nodejs'), 2
  spawn process.execPath, nodeArgs.concat(args),
    cwd:        process.cwd()
    env:        process.env
    customFds:  [0, 1, 2]

                ¶

Print the --help usage message and exit. Deprecated switches are not
shown.

usage = ->
  printLine (new optparse.OptionParser SWITCHES, BANNER).help()

                ¶

Print the --version message and exit.

version = ->
  printLine "CoffeeScript version #{CoffeeScript.VERSION}"


text:
A plugin for [Reveal.js](https://github.com/hakimel/reveal.js) allowing to easily add charts using [Chart.js v2.3](http://www.chartjs.org/).

[Check out the live demo](http://courses.telematique.eu/reveal.js-plugins/chart-demo.html)

## Installation

Copy the files ```Chart.min.js``` and ```csv2chart.js``` into the plugin folder of your reveal.js presentation, i.e. ```plugin/chart```.

Add the plugins to the dependencies in your presentation, as below.

```javascript
Reveal.initialize({
	// ...
	dependencies: [
		// ...
		{ src: 'plugin/chart/Chart.min.js' },
		{ src: 'plugin/chart/csv2chart.js' },
		// ...
	]
});
```
## Configuration

The plugin has several parameters that you can set for your presentation by providing an ```chart``` option in the reveal.js initialization options.
Note that all configuration parameters are optional and the defaults of [Chart.js 2.3](http://nnnick.github.io/Chart.js/docs-v2/) will be used for parameters that are not specified.

```javascript
Reveal.initialize({
	// ...
  chart: {
	  defaults: {
		  global: {
			  title: { fontColor: "#FFF" },
		  },
			legend: {
				labels: { fontColor: "#FFF" },
			},
			scale: {
				scaleLabel: { fontColor: "#FFF" },
				gridLines: { color: "#FFF", zeroLineColor: "#FFF" },
				ticks: { fontColor: "#FFF" },
			}
		},
		line: { borderColor: [ "rgba(20,220,220,.8)" , "rgba(220,120,120,.8)", "rgba(20,120,220,.8)" ], "borderDash": [ [5,10], [0,0] ]},
		bar: { backgroundColor: [ "rgba(20,220,220,.8)" , "rgba(220,120,120,.8)", "rgba(20,120,220,.8)" ]},
		pie: { backgroundColor: [ ["rgba(0,0,0,.8)" , "rgba(220,20,20,.8)", "rgba(20,220,20,.8)", "rgba(220,220,20,.8)", "rgba(20,20,220,.8)"] ]},
		radar: { borderColor: [ "rgba(20,220,220,.8)" , "rgba(220,120,120,.8)", "rgba(20,120,220,.8)" ]},
	},
	// ...
});
```
The ```defaults``` parameter  will overwrite ```Chart.defaults```. Furthermore, for any chart type, e.g. line, bar, etc., the parameters for the individual datasets can be specified. Where Chart.js allows to specify a single parameter for a particular dataset, the plugin allows to specify an array of values for this parameter, which will automatically be assigned to the different datasets. Note that if there are more datasets than elements in the array, the plugin will start again with the first value in the array.

## Usage

A chart can be included in a slide by adding a ```canvas``` element with the ```data-chart``` attribute set to the desired chart type.

The chart can be configured within the canvas body by a JSON string embedded into an HTML comment.

```html
<canvas data-chart="line">
<!--
{
 "data": {
  "labels": ["January"," February"," March"," April"," May"," June"," July"],
  "datasets": [
   {
    "data":[65,59,80,81,56,55,40],
    "label":"My first dataset","backgroundColor":"rgba(20,220,220,.8)"
   },
   {
    "data":[28,48,40,19,86,27,90],
    "label":"My second dataset","backgroundColor":"rgba(220,120,120,.8)"
   }
  ]
 },
 "options": { "responsive": "true" }
}
-->
</canvas>
```
It is possible to provide the chart data by comma separated values and use the JSON string within the HTML comment to configure the chart layout.

```html
<canvas class="stretch" data-chart="line">
My first dataset, 65, 59, 80, 81, 56, 55, 40
<!-- This is a comment that will be ignored -->
My second dataset, 28, 48, 40, 19, 86, 27, 90
<!--
{
 "data" : {
  "labels" : ["Enero", "Febrero", "Marzo", "Avril", "Mayo", "Junio", "Julio"],
  "datasets" : [{ "borderColor": "#0f0", "borderDash": ["5","10"] }, { "borderColor": "#0ff" } ]
 }
}
-->
</canvas>
```

The layout configuration provided in ```chart``` parameter (see Configuration) will be used by default and only those parameters that are specified in a JSON string are used to overwrite the default values. If no JSON string is provided to configure the chart layout the default configuration is used. Note, that if no labels for the data points are provided by a JSON string, the plugin expects that the first row provides table headers.

```html
<canvas data-chart="line">
Month, January, February, March, April, May, June, July
My first dataset, 65, 59, 80, 81, 56, 55, 40
My second dataset, 28, 48, 40, 19, 86, 27, 90
</canvas>
```

The chart data can also be provided in an external CSV file. To include external data, the filename must be specified using the ```data-chart-src``` attribute of the ```canvas``` element. The CSV file is expected to only contain data values, whereas options for drawing the chart can be given as described above.

```html
<canvas data-chart="bar" data-chart-src="data.csv">
<!--
{
"data" : {
"datasets" : [{ "backgroundColor": "#0f0" }, { "backgroundColor": "#0ff" } ]
},
"options": { "responsive": true, "scales": { "xAxes": [{ "stacked": true }], "yAxes": [{ "stacked": true }] } }
}
-->
</canvas>
```

## License

MIT licensed

Copyright (C) 2016 Asvin Goel


text:
module MultiXml
  VERSION = "0.5.3" unless defined?(MultiXML::VERSION)
end


text:
<?php

declare(strict_types=1);

/*
 * This file is part of PHP CS Fixer.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *     Dariusz Rumiński <dariusz.ruminski@gmail.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace PhpCsFixer\Tests\AutoReview;

use PhpCsFixer\Preg;
use PhpCsFixer\Tests\TestCase;
use PhpCsFixer\Tokenizer\Tokens;
use PHPUnit\Framework\Constraint\TraversableContainsIdentical;
use Symfony\Component\Yaml\Yaml;

/**
 * @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
 *
 * @internal
 *
 * @coversNothing
 * @group auto-review
 * @group covers-nothing
 */
final class CiConfigurationTest extends TestCase
{
    public function testTestJobsRunOnEachPhp(): void
    {
        $supportedVersions = [];
        $supportedMinPhp = (float) $this->getMinPhpVersionFromEntryFile();
        $supportedMaxPhp = (float) $this->getMaxPhpVersionFromEntryFile();

        if ($supportedMaxPhp >= 8) {
            $supportedVersions = array_merge(
                $supportedVersions,
                self::generateMinorVersionsRange($supportedMinPhp, 7.4)
            );

            $supportedMinPhp = 8;
        }

        $supportedVersions = array_merge(
            $supportedVersions,
            self::generateMinorVersionsRange($supportedMinPhp, $supportedMaxPhp)
        );

        $ciVersions = $this->getAllPhpVersionsUsedByCiForTests();

        static::assertGreaterThanOrEqual(1, \count($ciVersions));

        self::assertSupportedPhpVersionsAreCoveredByCiJobs($supportedVersions, $ciVersions);
        self::assertUpcomingPhpVersionIsCoveredByCiJob(end($supportedVersions), $ciVersions);
    }

    public function testDeploymentJobsRunOnLatestStablePhpThatIsSupportedByTool(): void
    {
        $ciVersionsForDeployments = $this->getAllPhpVersionsUsedByCiForDeployments();
        $ciVersions = $this->getAllPhpVersionsUsedByCiForTests();
        $expectedPhp = $this->getMaxPhpVersionFromEntryFile();

        if (\in_array($expectedPhp.'snapshot', $ciVersions, true)) {
            // last version of used PHP is snapshot. we should test against previous one, that is stable
            $expectedPhp = (string) ((float) $expectedPhp - 0.1);
        }

        static::assertGreaterThanOrEqual(1, \count($ciVersionsForDeployments));
        static::assertGreaterThanOrEqual(1, \count($ciVersions));

        foreach ($ciVersionsForDeployments as $ciVersionsForDeployment) {
            static::assertTrue(
                version_compare($expectedPhp, $ciVersionsForDeployment, 'eq'),
                sprintf('Expects %s to be %s', $ciVersionsForDeployment, $expectedPhp)
            );
        }
    }

    private static function generateMinorVersionsRange(float $from, float $to): array
    {
        $range = [];

        for ($version = $from; $version <= $to; $version += 0.1) {
            $range[] = sprintf('%.1f', $version);
        }

        return $range;
    }

    private static function ensureTraversableContainsIdenticalIsAvailable(): void
    {
        if (!class_exists(TraversableContainsIdentical::class)) {
            static::markTestSkipped('TraversableContainsIdentical not available.');
        }
    }

    private static function assertUpcomingPhpVersionIsCoveredByCiJob(string $lastSupportedVersion, array $ciVersions): void
    {
        if ('8.1' === $lastSupportedVersion) {
            return; // no further releases available yet
        }

        self::ensureTraversableContainsIdenticalIsAvailable();

        static::assertThat($ciVersions, static::logicalOr(
            // if `$lastsupportedVersion` is already a snapshot version
            new TraversableContainsIdentical(sprintf('%.1fsnapshot', $lastSupportedVersion)),
            // if `$lastsupportedVersion` is not snapshot version, expect CI to run snapshot of next PHP version
            new TraversableContainsIdentical('nightly'),
            new TraversableContainsIdentical(sprintf('%.1fsnapshot', $lastSupportedVersion + 0.1)),
            // GitHub CI uses just versions, without suffix, e.g. 8.1 for 8.1snapshot as of writing
            new TraversableContainsIdentical(sprintf('%.1f', $lastSupportedVersion + 0.1)),
            new TraversableContainsIdentical(sprintf('%.1f', round($lastSupportedVersion + 1.0)))
        ));
    }

    private static function assertSupportedPhpVersionsAreCoveredByCiJobs(array $supportedVersions, array $ciVersions): void
    {
        $lastSupportedVersion = array_pop($supportedVersions);

        foreach ($supportedVersions as $expectedVersion) {
            static::assertContains($expectedVersion, $ciVersions);
        }

        self::ensureTraversableContainsIdenticalIsAvailable();

        static::assertThat($ciVersions, static::logicalOr(
            new TraversableContainsIdentical($lastSupportedVersion),
            new TraversableContainsIdentical(sprintf('%.1fsnapshot', $lastSupportedVersion))
        ));
    }

    /**
     * @return string[]
     */
    private function getAllPhpVersionsUsedByCiForDeployments(): array
    {
        $jobs = array_filter($this->getGitHubJobs(), static function (array $job): bool {
            return isset($job['execute-deployment']) && 'yes' === $job['execute-deployment'];
        });

        return array_map(static function ($job): string {
            return \is_string($job['php-version']) ? $job['php-version'] : sprintf('%.1f', $job['php-version']);
        }, $jobs);
    }

    /**
     * @return string[]
     */
    private function getAllPhpVersionsUsedByCiForTests(): array
    {
        return $this->getPhpVersionsUsedByGitHub();
    }

    private function convertPhpVerIdToNiceVer(string $verId): string
    {
        $matchResult = Preg::match('/^(?<major>\d{1,2})(?<minor>\d{2})(?<patch>\d{2})$/', $verId, $capture);
        if (1 !== $matchResult) {
            throw new \LogicException(sprintf('Can\'t parse version "%s" id.', $verId));
        }

        return sprintf('%d.%d', $capture['major'], $capture['minor']);
    }

    private function getMaxPhpVersionFromEntryFile(): string
    {
        $tokens = Tokens::fromCode(file_get_contents(__DIR__.'/../../php-cs-fixer'));
        $sequence = $tokens->findSequence([
            [T_STRING, 'PHP_VERSION_ID'],
            [T_IS_GREATER_OR_EQUAL],
            [T_LNUMBER],
        ]);

        if (null === $sequence) {
            throw new \LogicException("Can't find version - perhaps entry file was modified?");
        }

        $phpVerId = (int) end($sequence)->getContent();

        return $this->convertPhpVerIdToNiceVer((string) ($phpVerId - 100));
    }

    private function getMinPhpVersionFromEntryFile(): string
    {
        $tokens = Tokens::fromCode(file_get_contents(__DIR__.'/../../php-cs-fixer'));
        $sequence = $tokens->findSequence([
            [T_STRING, 'PHP_VERSION_ID'],
            '<',
            [T_LNUMBER],
        ]);

        if (null === $sequence) {
            throw new \LogicException("Can't find version - perhaps entry file was modified?");
        }

        $phpVerId = end($sequence)->getContent();

        return $this->convertPhpVerIdToNiceVer($phpVerId);
    }

    private function getGitHubJobs(): array
    {
        $yaml = Yaml::parse(file_get_contents(__DIR__.'/../../.github/workflows/ci.yml'));

        return $yaml['jobs']['tests']['strategy']['matrix']['include'];
    }

    /**
     * @return string[]
     */
    private function getPhpVersionsUsedByGitHub(): array
    {
        $yaml = Yaml::parse(file_get_contents(__DIR__.'/../../.github/workflows/ci.yml'));

        $phpVersions = $yaml['jobs']['tests']['strategy']['matrix']['php-version'] ?? [];

        foreach ($yaml['jobs']['tests']['strategy']['matrix']['include'] as $job) {
            $phpVersions[] = $job['php-version'];
        }

        return $phpVersions;
    }
}


text:
copyright:
  years: 2015, 2016

---

{:shortdesc: .shortdesc}
{:new_window: target="_blank"}
{:codeblock: .codeblock}

# Options pour l'envoi par commande push d'applications Liberty
{: #options_for_pushing}

*Dernière mise à jour : 10 juin 2016*
{: .last-updated}

Le comportement du serveur Liberty dans Bluemix est contrôlé par le pack de construction Liberty. Les packs de construction peuvent fournir un environnement d'exécution complet pour une classe d'applications spécifique. Ils sont cruciaux pour assurer la portabilité entre les clouds et une contribution à une architecture de cloud ouverte. Le
pack de construction Liberty fournit un conteneur WebSphere Liberty capable d'exécuter des applications Java EE 7 et OSGi. Il prend en charge les
infrastructures populaires telles que Spring et inclut l'environnement d'exécution Java IBM JRE. WebSphere Liberty permet un développement d'application rapide qui est adapté au cloud. Le pack de construction Liberty prend en charge plusieurs applications déployées sur un même serveur Liberty. Dans le cadre de l'intégration du pack de construction Liberty  dans Bluemix, celui-ci fait en sorte que les variables d'environnement pour la liaison de services soient indiquées sous forme de variables de configuration sur le serveur Liberty.

Vous pouvez utiliser les méthodes suivantes pour déployer vos applications Liberty sur Bluemix :

* Envoi par commande push d'une application autonome
* Envoi par commande push d'un répertoire de serveur
* Envoi par commande push d'un package de serveur

Important : quand vous déployez une application avec le pack de construction Liberty, attribuez une valeur d'au moins 512 Mo comme limite de mémoire pour vos applications. Pour plus d'informations, voir [Limites mémoire et pack de construction Liberty](memoryLimits.html).

## Applications autonomes
{: #stand_alone_apps}

Les applications autonomes, par exemple, des fichiers WAR ou EAR, peuvent être déployées sur Liberty dans Bluemix.

Pour déployer une application autonome, exécutez la commande cf push avec le paramètre -p qui indique le fichier WAR ou EAR.
Par exemple :

```
    $ cf push <yourappname> -p myapp.war
```
{: codeblock}

Lorsqu'une application autonome est déployée, une configuration Liberty par
défaut est fournie pour l'application. Cette configuration par défaut active
les fonctions Liberty suivantes :

* beanValidation-1.1
* [cdi-1.2](optionsForPushing.html#cdi12)
* ejbLite-3.2
* el-3.0
* jaxrs-2.0
* jdbc-4.1
* jndi-1.0
* jpa-2.1
* jsf-2.2
* jsonp-1.0
* jsp-2.3
* managedBeans-1.0
* servlet-3.1
* websocket-1.1
* icap:managementConnector-1.0
* appstate-1.0

Ces fonctions correspondent aux fonctions du profil Web Java EE 7. Vous pouvez spécifier un autre jeu de fonctions Liberty en définissant la variable d'environnement
JBP_CONFIG_LIBERTY. Par exemple, pour n'activer que les fonctions jsp-2.3 et websocket-1.1, exécutez la commande suivante et
reconstituez l'application :

```
    $ cf set-env myapp JBP_CONFIG_LIBERTY "app_archive: {features: [jsp-2.3, websocket-1.1]}"
```
{: codeblock}

Remarque : Pour optimiser vos résultats, définissez les fonctions Liberty avec la variable d'environnement JBP_CONFIG_LIBERTY ou déployez votre application en tant que [répertoire de serveur](optionsForPushing.html#server_directory) ou [package de serveur](optionsForPushing.html#packaged_server) avec un fichier server.xml personnalisé. La définition de cette variable d'environnement garantit que votre application n'utilisera que la fonction dont elle a besoin et qu'elle ne sera pas
affectée par les modifications apportées
au jeu de fonctions Liberty par défaut du pack de construction. Si vous devez fournir une configuration Liberty supplémentaire en plus du jeu de fonctions,
utilisez l'option de [répertoire de serveur](optionsForPushing.html#server_directory) ou de
[package de serveur](optionsForPushing.html#packaged_server) pour déployer votre application.

Si vous avez déployé un fichier WAR, l'application Web est accessible sous la racine de contexte, telle que définie dans le fichier ibm-web-ext.xml imbriqué. Si le fichier ibm-web-ext.xml n'existe pas ou ne spécifie pas de racine de contexte, l'application est accessible sous le contexte racine. Exemple :

```
    http://<nom_de_votre_app>.mybluemix.net/
```
{: codeblock}

Si vous avez déployé un fichier EAR, l'application Web imbriquée est accessible
sous la racine de contexte comme indiqué dans le descripteur de déploiement du
fichier EAR. Exemple :

```
    http://<yourappname>.mybluemix.net/acme/
```
{: codeblock}

Le fichier de configuration Liberty par défaut
server.xml complet est le suivant :
```
    <server>
       <featureManager>
          <feature>beanValidation-1.1</feature>
          <feature>cdi-1.2</feature>
          <feature>ejbLite-3.2</feature>
          <feature>el-3.0</feature>
          <feature>jaxrs-2.0</feature>
          <feature>jdbc-4.1</feature>
          <feature>jndi-1.0</feature>
          <feature>jpa-2.1</feature>
          <feature>jsf-2.2</feature>
          <feature>jsonp-1.0</feature>
          <feature>jsp-2.3</feature>
          <feature>managedBeans-1.0</feature>
          <feature>servlet-3.1</feature>
          <feature>websocket-1.1</feature>
          <feature>icap:managementConnector-1.0</feature>
          <feature>appstate-1.0</feature>
       </featureManager>

       <application name='myapp' location='myapp.war' type='war' context-root='/'/>
       <httpEndpoint id='defaultHttpEndpoint' host='*' httpPort='${port}'/>
       <webContainer trustHostHeaderPort='true' extractHostHeaderPort='true'/>
       <include location='runtime-vars.xml'/>
       <logging logDirectory='${application.log.dir}' consoleLogLevel='INFO'/>
       <httpDispatcher enableWelcomePage='false'/>
       <applicationMonitor dropinsEnabled='false' updateTrigger='mbean'/>
       <config updateTrigger='mbean'/>
       <cdi12 enableImplicitBeanArchives='false'/>
       <appstate appName='myapp' markerPath='${home}/../.liberty.state'/>
    </server>
```
{: codeblock}

### CDI 1.2
{: #cdi12}

Pour des raisons de performance, lors du déploiement des fichiers WAR et EAR seulement,
l'[examen
des archives de bean implicites CDI 1.2](https://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.wlp.nd.doc/ae/cwlp_cdi_behavior.html) est désactivé par défaut. L'examen des archives de bean implicites peut être activé avec la variable d'environnement JBP_CONFIG_LIBERTY.
Par exemple :

```
    $ cf set-env myapp JBP_CONFIG_LIBERTY "app_archive: { implicit_cdi: true }"
```
{: codeblock}

Important : Pour que les modifications que vous apportez aux variables d'environnement soient appliquées, vous devez reconstituer votre
application :

```
    $ cf restage myapp
```
{: codeblock}

## Répertoire de serveur
{: #server_directory}

Dans certains cas, vous devez fournir une configuration de serveur Liberty personnalisée avec votre application. Cette configuration personnalisée peut s'avérer nécessaire lorsque vous déployez un fichier EAR ou WAR et que le fichier server.xml par défaut ne comporte pas certains des paramètres requis par votre application.

Si vous avez installé le profil Liberty sur votre poste de travail et que vous avez déjà créé un serveur Liberty avec votre application, vous pouvez envoyer par commande push le contenu de ce répertoire à Bluemix.
Par exemple, si votre serveur Liberty se nomme defaultServer, exécutez la commande suivante :

```
    $ cf push <yourappname> -p wlp/usr/servers/defaultServer
```
{: codeblock}

Si aucun profil Liberty n'est
installé sur votre poste de travail, vous pouvez suivre la procédure ci-après pour créer un répertoire de serveur avec votre application :

1. Créez un répertoire nommé defaultServer.
2. Créez un répertoire apps dans le répertoire defaultServer.
3. Copiez le fichier WAR ou EAR dans le répertoire defaultServer/apps.
4. Dans le répertoire defaultServer, créez un fichier server.xml avec l'exemple de contenu exemple ci-après.  De plus :
  * Prenez soin de mettre à jour l'attribut location ou type de l'élément d'application afin de le faire
correspondre au nom de fichier et au type de votre application.
  * Le fichier server.xml dans le diagramme affiche un jeu minimal de fonctions. Vous devrez ajuster le jeu de fonctions en fonction des besoins de
votre application.

```
    <server>
        <featureManager>
            <feature>jsp-2.3</feature>
        </featureManager>

        <httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="8080" />

        <application name="myapp" context-root="/" type="war" location="myapp.war"/>
    </server>
```
{: codeblock}

Lorsque le répertoire de serveur est prêt, vous pouvez le déployer sur Bluemix.

```
    $ cf push <yourappname> -p defaultServer
```
{: codeblock}

Remarque : Les
applications Web déployées avec le répertoire de serveur sont accessibles sous la [racine de contexte, comme spécifié par le profil Liberty](http://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.wlp.nd.doc/ae/twlp_dep_war.html?cp=SSAW57_8.5.5%2F1-3-11-0-5-6). Par exemple :

```
    http://<yourappname>.mybluemix.net/acme/
```
{: codeblock}

## Package de serveur
{: #packaged_server}

Vous pouvez également envoyer par commande push un fichier de package de serveur à Bluemix. Pour créer le fichier de package de serveur, utilisez la commande server
package de Liberty. Outre les fichiers de l'application et de configuration, le
fichier de package de serveur peut contenir des ressources partagées et les
fonctions utilisateur Liberty requises par l'application.

Pour conditionner un serveur Liberty, utilisez la commande ./bin/server package à partir du répertoire d'installation de Liberty. Indiquez le nom de votre serveur et précisez l'option '––include=usr' option.
Par exemple, si le serveur Liberty se nomme defaultServer, exécutez la commande suivante :

```
    $ wlp/bin/server package defaultServer --include=usr
```
{: codeblock}

Cette commande génère un fichier serverName.zip dans le répertoire du serveur. Vous pouvez ensuite envoyer par commande push le fichier
compressé à Bluemix à l'aide de la commande cf push.
Par exemple :

```
    $ cf push <yourappname> -p wlp/usr/servers/defaultServer/defaultServer.zip
```
{: codeblock}

Remarque : Les applications Web déployées avec le package de serveur sont accessibles sous la
racine
de contexte, comme spécifié par le profil Liberty.

### Modification du fichier server.xml
{: #modifications_of_serverxml}

Lors de l'envoi par commande push d'un package de serveur ou d'un répertoire de serveur
Liberty, le pack de construction Liberty détecte le fichier server.xml, en même temps que votre application. Le pack de construction Liberty apporte les modifications suivantes au fichier server.xml.

* Le pack de construction vérifie que le fichier contient exactement un élément httpEndpoint.
* Le pack de construction vérifie que l'attribut httpPort dans l'élément httpEndpoint pointe sur une variable système qui se nomme ${port}. Le
pack de construction remplace également l'attribut host.
* Le pack de construction définit l'attribut logDirectory de l'élément logging de telle sorte qu'il pointe sur un répertoire de journal système.
* Le pack de construction fait en sorte qu'un fichier runtime-vars.xml soit fusionné sur une base logique avec votre fichier server.xml. Plus spécifiquement, il ajoute la ligne *<include location="runtime-vars.xml" />* à votre fichier server.xml.

### Variables référençables
{: #referenceable_variables}

Les variables suivantes sont définies dans le fichier runtime-vars.xml et référencées depuis un fichier server.xml envoyé par commande push. Toutes les variables sont sensibles à la casse.

* ${port} : port HTTP sur lequel le serveur Liberty est à l'écoute.
* ${vcap_console_port} : port sur lequel la console vcap s'exécute (généralement identique à ${port}).
* ${vcap_app_port} : port sur lequel le serveur app est à l'écoute (généralement identique à ${port}).
* ${vcap_console_ip} : adresse IP de la console vcap (généralement, adresse IP sur laquelle le serveur Liberty est à l'écoute).
* ${application_name} : nom de l'application, tel que défini via les options de la commande cf push.
* ${application_version} : version de cette instance de l'application, représentée par un UUID (identificateur unique universel), tel que b687ea75-49f0-456e-b69d-e36e8a854caa. Cette variable est actualisée avec chaque envoi par commande push successif de l'application contenant du nouveau code ou des modifications des artefacts de l'application.
* ${host} : adresse IP de l'agent DEA qui exécute l'application (généralement, identique à ${vcap_console_ip}).
* ${application_uris}: matrice JSON des noeuds finaux pouvant être utilisés pour accéder à cette application, par exemple : myapp.mydomain.com.
* ${start} : date et heure de démarrage de l'application, sous un format similaire à 2013-08-22 10:10:18 -0400.

### Accès aux informations des services liés
{: #accessing_info_of_bound_services}

Si vous voulez lier un service à votre application, des informations sur le service, notamment les données d'identification de connexion,
sont incluses dans
la [variable
d'environnement VCAP_SERVICES](http://docs.run.pivotal.io/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES) que Cloud Foundry définit pour l'application. Pour les [services configurés
automatiquement](autoConfig.html), le pack de construction Liberty génère ou met à jour des entrées de liaison de service dans le fichier server.xml. Le contenu des
entrées de liaison de service peuvent être dans l'un des formats suivants :

* cloud.services.<service-name>.<property>, qui décrit les informations telles que le nom, le type et le plan du service.
* cloud.services.<service-name>.connection.<property>, qui décrit les informations de connexion du service.

L'ensemble d'informations habituel est le suivant :
* name : Nom du service. Par exemple, mysql-e3abd.
label: Type de service créé. Par exemple, mysql-5.5.
* plan : Plan de service, tel qu'indiqué par l'identificateur unique de ce plan. Par exemple, 100.
connection.name : Identificateur unique de la connexion, prend la forme d'un identificateur unique universel (UUID). Par exemple, d01af3a5fabeb4d45bb321fe114d652ee.
* connection.hostname : Nom d'hôte du serveur qui exécute le service. Par exemple, mysql-server.mydomain.com.
* connection.host : Adresse IP du serveur qui exécute le service. Par exemple, 9.37.193.2.
* connection.port : Port sur lequel le service est à l'écoute de connexions entrantes. Par exemple, 3306,3307.
* connection.user : Nom d'utilisateur employé pour authentifier cette application auprès du service. Le nom d'utilisateur est généré automatiquement par Cloud Foundry. Par exemple :unHwANpjAG5wT.
* connection.username : Alias de connection.user.
* connection.password : Mot de passe utilisé pour authentification de cette application auprès du service. Le mot de passe est généré automatiquement par Cloud Foundry. Par exemple :pvyCY0YzX9pu5.

Pour les services liés qui ne sont pas configurés automatiquement par le pack de construction
Liberty, l'application doit gérer elle-même l'accès à la ressource back end.

# rellinks
{: #rellinks}
## general
{: #general}
* [Environnement d'exécution Liberty](index.html)
* [Présentation de Liberty Profile](http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.wlp.nd.doc/ae/cwlp_about.html)


text:
@class NSMutableArray, NSString;

@interface EmoticonDesc : MMObject <PBCoding>
{
    NSString *m_md5;
    NSMutableArray *m_LangList;
}

+ (void)initialize;
@property(retain, nonatomic) NSMutableArray *m_LangList; // @synthesize m_LangList;
@property(retain, nonatomic) NSString *m_md5; // @synthesize m_md5;
- (void).cxx_destruct;
- (_Bool)hasTheSameMd5WithDesc:(id)arg1;
- (const map_0e718273 *)getValueTagIndexMap;
- (id)getValueTypeTable;

// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;

@end


text:
import '../../common'

const accordion = require('../../accordion')
const browser = require('../../browser')
const location = require('../../location/locationSelector')

const initLocations = function (currentLocation) {
  const ui = {
    form: document.querySelector('.js-change-location-form'),
    select: document.querySelector('.js-change-location-select')
  }
  ui.form.addEventListener('submit', function (e) {
    e.preventDefault()
    const reqLocation = ui.select.value
    if (reqLocation) {
      location.setCurrent(reqLocation)
      browser.redirect(`/${reqLocation}/advice`)
    }
  })

  if (currentLocation) {
    Array.from(document.querySelector('.js-change-location-select'))
      .filter((t) => t.tagName === 'OPTION')
      .find((o) => o.value === currentLocation.id)
      .setAttribute('selected', 'selected')
  }
}

location
  .getPreviouslySetPostcode()
  .then((result) => {
    accordion.init(false, -1)
    initLocations(result)
  })


text:
package db

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestStoreWorker(t *testing.T) {
	c, err := NewConnection()
	assert.Nil(t, err)

	worker1 := &Worker{
		DockerImage: "ubuntu:14.04",
	}
	err = worker1.Store(c)
	assert.Nil(t, err)
	assert.NotNil(t, worker1.ID)

	worker2, err := GetWorker(c, worker1.ID)
	assert.Nil(t, err)
	assert.Equal(t, worker1.ID, worker2.ID)
	assert.Equal(t, worker1.DockerImage, worker2.DockerImage)
}


text:
using System;
using Gwen.Control;
using OpenTK.Input;
using System.Collections.Generic;

namespace Sharp.Editor.Views
{
	public abstract class View //sceneview, editorview, assetview, inspectorview
	{
		public static HashSet<View> views=new HashSet<View>();

		public Base panel;
		public Action makeContextCurrent;

		protected View ()
		{
			views.Add (this);
		}

		public virtual void Initialize (){
			//canvas.ShouldDrawBackground = true;
			//canvas.BackgroundColor = Color.FromArgb(255, 150, 170, 170);
		}
		public virtual void OnContextCreated(int width, int height){}
		public virtual void Render (){
			if (panel != null) {
				var absPos =panel.LocalPosToCanvas (new System.Drawing.Point (panel.X, panel.Y));
				SceneView.backendRenderer.Scissor (panel.Margin.Left+panel.Parent.X, panel.Margin.Bottom, panel.Width,panel.Height);
				}
			else
				SceneView.backendRenderer.Scissor (0, 0, MainEditorView.canvas.Width,MainEditorView.canvas.Height);
		}
		public virtual void OnResize (int width, int height){

			if (panel != null) {
			//	var absPos =MainEditorView.canvas.CanvasPosToLocal (new System.Drawing.Point (panel.X, panel.Y));
				//panel.SetSize (width, height);
			} else {
				MainEditorView.canvas.SetSize (width,height);
			}
			MainEditorView.renderer.Resize (width,height);

		}
		public virtual void OnMouseMove(MouseMoveEventArgs evnt){
		}
		public virtual void OnMouseUp(MouseButtonEventArgs evnt){
		}
		public virtual void OnMouseDown(MouseButtonEventArgs evnt){
		}
		public virtual void OnKeyPressEvent (ref KeyboardState evnt){
		}
	}
}


text:
ACCEPTED

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

#### Published in
in Gams, Kleine Kryptogamenflora (Stuttgart), Edn 3 2b/2: 306 (1967)

#### Original name
Phlegmacium odoratum Joguet ex M.M. Moser, 1960

### Remarks
null


text:
from pydojo import *
# CREATE GAME DISPLAY
screen(800, 600)

# Create an Actor object
gobo = Actor('example_asset/characters/gobo.png')

# MAIN LOOP
while True:

    # Actor movement
    gobo.goto(MOUSE)
    gobo.stamp()
    gobo.right(5)

    # Keyboard keys behaviour
    if keydown(C):
        # Clear the screen
        clear()
    if keydown(L):
        # Color the background
        fill(LAVENDER)
    if keydown(P):
        fill(PINK)
    if key(SPACE):
        fill(colorscale(5))

    # UPDATE SCREEN
    update()


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<meta charset="utf-8">
<title>PHPMailer version 5.2.4</title>
<meta name="author" content="Mike van Riel">
<meta name="description" content="">
<link href="css/template.css" rel="stylesheet" media="all">
<link rel="shortcut icon" href="img/favicon.ico">
<link rel="apple-touch-icon" href="img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="img/apple-touch-icon-114x114.png">

PHPMailer version 5.2.4

                                    API Documentation

                                    Charts

 Class hierarchy diagram

                                    Reports

 Errors
                22

 Markers

todo
                2

 Deprecated elements
                0

Back to top

                            Javascript is disabled; several features are only available
                            if Javascript is enabled.

Filter type

<button class="btn critical">Critical</button><button class="btn error">Error</button><button class="btn notice">Notice</button>

Navigation

class.phpmailer.php

class.pop3.php

class.smtp.php

\

Compilation Errors

class.phpmailer.php16

Type
Line
Description

critical
405
No short description for property $smtp

critical
410
No short description for property $to

critical
415
No short description for property $cc

critical
420
No short description for property $bcc

critical
425
No short description for property $ReplyTo

critical
430
No short description for property $all_recipients

critical
435
No short description for property $attachment

critical
440
No short description for property $CustomHeader

critical
445
No short description for property $message_type

critical
450
No short description for property $boundary

critical
455
No short description for property $language

critical
460
No short description for property $error_count

critical
465
No short description for property $sign_cert_file

critical
470
No short description for property $sign_key_file

critical
475
No short description for property $sign_key_pass

critical
480
No short description for property $exceptions

class.pop3.php3

Type
Line
Description

critical
124
No short description for property $pop_conn

critical
128
No short description for property $connected

critical
132
No short description for property $error

class.smtp.php3

Type
Line
Description

critical
100
No short description for property $smtp_conn

critical
104
No short description for property $error

critical
108
No short description for property $helo_rply

            Template is built using Twitter Bootstrap 2 and icons provided by Glyphicons.

            Documentation is powered by phpDocumentor 2.0.0a8 and

            generated on 2013-02-19T10:09:26-05:00.


text:
'use strict';

angular.module('de.stekoe.nfp')
    .constant('MenstruationTypes', [
        'mens.none',
        'mens.spotting',
        'mens.light',
        'mens.normal',
        'mens.strong'
    ]);


text:
module.exports = {
  title: 'Search Result Objects',
  label: 'Search Result Objects',
  context: {
    title: 'title that flows on for more than 2 lines',
    credit: 'A name that is, very very long',
    image: 'https://vanda-production-assets.s3.amazonaws.com/2017/02/15/12/55/45/01a67413-3cca-454a-ab54-c56b4b62afbb/lockwood-kipling-hero.jpg'
  }
};


text:
package org.springframework.security.saml2.provider.service.authentication;

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

import org.springframework.lang.Nullable;
import org.springframework.security.core.AuthenticatedPrincipal;
import org.springframework.util.CollectionUtils;

/**
 * Saml2 representation of an {@link AuthenticatedPrincipal}.
 *
 * @author Clement Stoquart
 * @since 5.2.2
 */
public interface Saml2AuthenticatedPrincipal extends AuthenticatedPrincipal {

	/**
	 * Get the first value of Saml2 token attribute by name
	 * @param name the name of the attribute
	 * @param <A> the type of the attribute
	 * @return the first attribute value or {@code null} otherwise
	 * @since 5.4
	 */
	@Nullable
	default <A> A getFirstAttribute(String name) {
		List<A> values = getAttribute(name);
		return CollectionUtils.firstElement(values);
	}

	/**
	 * Get the Saml2 token attribute by name
	 * @param name the name of the attribute
	 * @param <A> the type of the attribute
	 * @return the attribute or {@code null} otherwise
	 * @since 5.4
	 */
	@Nullable
	default <A> List<A> getAttribute(String name) {
		return (List<A>) getAttributes().get(name);
	}

	/**
	 * Get the Saml2 token attributes
	 * @return the Saml2 token attributes
	 * @since 5.4
	 */
	default Map<String, List<Object>> getAttributes() {
		return Collections.emptyMap();
	}

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>objconfig.reader.readerinterface — ObjConfig 1.2.0 documentation</title>

    <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />

    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" />

Navigation

          index

          modules |

ObjConfig 1.2.0 documentation »

Module code »

objconfig »

Source code for objconfig.reader.readerinterface

r"""
This is a port of zend-config to Python

Some idioms of PHP are still employed, but where possible I have Pythonized it

IGNORE:
    Author: Asher Wolfstein Copyright 2017
    Blog: http://wunk.me/
    E-Mail: asherwunk@gmail.com
    Twitter: https://twitter.com/asherwolfstein Send Me Some Love!
    Package Homepage: http://wunk.me/programming-projects/objconfig-python/
    GitHub: http://github.com/asherwunk/objconfig for the source repository
    DevPost: https://devpost.com/software/objconfig
    Buy Me A Coffee: https://ko-fi.com/A18224XC
    Support Me On Patreon: https://www.patreon.com/asherwolfstein
IGNORE

Following is the header as given in zend-config::

"""

from objconfig.exception import RuntimeException

[docs]class ReaderInterface():
    r"""
    The following is an 'interface' (abstraction) to be implemented
    by all configuration readers
    """

[docs]    def fromFile(self, filename):
        """Initialize configuration object from file."""

        raise RuntimeException("ReaderInterface: fromFile not implemented in child class")

[docs]    def fromString(self, string):
        """Initialize configuration object from a string."""

        raise RuntimeException("ReaderInterface: fromString not implemented in child class")

Quick search

    <form class="search" action="../../../search.html" method="get">

<input type="text" name="q" />

<input type="submit" value="Go" />

      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

Navigation

          index

          modules |

ObjConfig 1.2.0 documentation »

Module code »

objconfig »

        © Copyright 2017, Asher Wolfstein.
      Created using Sphinx 1.6.2.


text:
<?php

use phpcassa\UUID;

require_once(__DIR__.'/ObjectFormatSuperCFTest.php');

class ObjectFormatCounterSuperCFTest extends ObjectFormatSuperCFTest {

    protected static $CF = "SuperCounter1";

    protected static $cfattrs = array(
        "column_type" => "Super",
        "subcomparator_type" => "TimeUUIDType",
        "default_validation_class" => "CounterColumnType"
    );

    public function setUp() {
        parent::setUp();
        $this->subcols = array(array(UUID::uuid1(), 'val1'),
                               array(UUID::uuid1(), 'val2'));
    }
}


text:
function initCoverImageUploader(buttonId,contatinerId,maxFileSize,url,csrfToken,pathPre){

    var uploader = new plupload.Uploader({
        runtimes : 'html5,flash,silverlight,html4',
        browse_button :buttonId, // you can pass an id...
        container: contatinerId, // ... or DOM Element itself
        url : url+'?path='+pathPre,
        flash_swf_url : '@vendor/moxiecode/plupload/js/Moxie.swf',
        silverlight_xap_url : '@vendor/moxiecode/plupload//js/Moxie.xap',

        filters : {
            max_file_size : maxFileSize,
            mime_types: [
                {title : "Image files", extensions : "jpg,gif,png"},
                {title : "Zip files", extensions : "zip"}
            ]
        },
        multipart_params:{
            '_csrf':csrfToken
        },
        init: {
            FilesAdded: function(up, files) {
                uploader.start();
            },
            UploadProgress: function(up, file) {
                $('#'+contatinerId+' p').text('已上传:'+file.percent+'%');
            },
            FileUploaded:function (up, file, result) {
                result =  $.parseJSON(result.response);
                if(result.code == 0){
                    $('#'+buttonId).html('<img src="'+result.path+'" height="50" />');
                    $('#hidden_input').val(result.path);
                    console.log(result.message);
                }
            },
            Error: function(up, err) {
                document.getElementById('console').appendChild(document.createTextNode("\nError #" + err.code + ": " + err.message));
            }
        }
    });

    uploader.init();
}


text:
package com.github.ambry.cloud.azure;

import com.azure.core.http.HttpClient;
import com.azure.core.http.ProxyOptions;
import com.azure.core.http.netty.NettyAsyncHttpClientBuilder;
import com.azure.identity.ClientSecretCredential;
import com.azure.identity.ClientSecretCredentialBuilder;
import java.net.InetSocketAddress;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Utils for working with various Azure services
 */
class AzureUtils {
  private static final Logger logger = LoggerFactory.getLogger(AzureUtils.class);

  /**
   * Check that required configs are present for constructing a {@link ClientSecretCredential}.
   * @param azureCloudConfig the configs.
   */
  static void validateAzureIdentityConfigs(AzureCloudConfig azureCloudConfig) {
    if (azureCloudConfig.azureIdentityTenantId.isEmpty() || azureCloudConfig.azureIdentityClientId.isEmpty()
        || azureCloudConfig.azureIdentitySecret.isEmpty()) {
      throw new IllegalArgumentException(
          String.format("One of the required configs for using ClientSecretCredential (%s, %s, %s) is missing",
              AzureCloudConfig.AZURE_IDENTITY_TENANT_ID, AzureCloudConfig.AZURE_IDENTITY_CLIENT_ID,
              AzureCloudConfig.AZURE_IDENTITY_SECRET));
    }
  }

  /**
   * @param azureCloudConfig the {@link AzureCloudConfig} to source credential configs from.
   * @return the {@link ClientSecretCredential}.
   */
  static ClientSecretCredential getClientSecretCredential(AzureCloudConfig azureCloudConfig) {
    ClientSecretCredentialBuilder builder =
        new ClientSecretCredentialBuilder().tenantId(azureCloudConfig.azureIdentityTenantId)
            .clientId(azureCloudConfig.azureIdentityClientId)
            .clientSecret(azureCloudConfig.azureIdentitySecret);
    if (!azureCloudConfig.azureIdentityProxyHost.isEmpty()) {
      logger.info("Using proxy for ClientSecretCredential: {}:{}", azureCloudConfig.azureIdentityProxyHost,
          azureCloudConfig.azureIdentityProxyPort);
      ProxyOptions proxyOptions = new ProxyOptions(ProxyOptions.Type.HTTP,
          new InetSocketAddress(azureCloudConfig.azureIdentityProxyHost, azureCloudConfig.azureIdentityProxyPort));
      HttpClient httpClient = new NettyAsyncHttpClientBuilder().proxy(proxyOptions).build();
      builder.httpClient(httpClient);
    }
    return builder.build();
  }
}


text:
package org.apache.nifi.processors.azure.storage;

import com.azure.core.util.Context;
import com.azure.storage.blob.BlobClient;
import com.azure.storage.blob.BlobContainerClient;
import com.azure.storage.blob.BlobServiceClient;
import com.azure.storage.blob.models.BlobErrorCode;
import com.azure.storage.blob.models.BlobRequestConditions;
import com.azure.storage.blob.models.BlobStorageException;
import com.azure.storage.blob.options.BlobParallelUploadOptions;
import org.apache.nifi.annotation.behavior.InputRequirement;
import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
import org.apache.nifi.annotation.behavior.WritesAttribute;
import org.apache.nifi.annotation.behavior.WritesAttributes;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.SeeAlso;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.flowfile.FlowFile;
import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processor.ProcessSession;
import org.apache.nifi.processor.exception.ProcessException;
import org.apache.nifi.processor.util.StandardValidators;
import org.apache.nifi.processors.azure.AbstractAzureBlobProcessor_v12;
import org.apache.nifi.processors.azure.storage.utils.AzureStorageUtils;
import org.apache.nifi.services.azure.storage.AzureStorageConflictResolutionStrategy;

import java.io.InputStream;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import static com.azure.core.util.FluxUtil.toFluxByteBuffer;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_DESCRIPTION_BLOBNAME;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_DESCRIPTION_BLOBTYPE;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_DESCRIPTION_CONTAINER;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_DESCRIPTION_ERROR_CODE;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_DESCRIPTION_ETAG;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_DESCRIPTION_IGNORED;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_DESCRIPTION_LANG;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_DESCRIPTION_LENGTH;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_DESCRIPTION_MIME_TYPE;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_DESCRIPTION_PRIMARY_URI;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_DESCRIPTION_TIMESTAMP;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_NAME_BLOBNAME;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_NAME_BLOBTYPE;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_NAME_CONTAINER;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_NAME_ERROR_CODE;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_NAME_ETAG;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_NAME_IGNORED;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_NAME_LANG;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_NAME_LENGTH;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_NAME_MIME_TYPE;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_NAME_PRIMARY_URI;
import static org.apache.nifi.processors.azure.storage.utils.BlobAttributes.ATTR_NAME_TIMESTAMP;

@Tags({"azure", "microsoft", "cloud", "storage", "blob"})
@SeeAlso({ListAzureBlobStorage_v12.class, FetchAzureBlobStorage_v12.class, DeleteAzureBlobStorage_v12.class})
@CapabilityDescription("Puts content into a blob on Azure Blob Storage. The processor uses Azure Blob Storage client library v12.")
@InputRequirement(Requirement.INPUT_REQUIRED)
@WritesAttributes({@WritesAttribute(attribute = ATTR_NAME_CONTAINER, description = ATTR_DESCRIPTION_CONTAINER),
        @WritesAttribute(attribute = ATTR_NAME_BLOBNAME, description = ATTR_DESCRIPTION_BLOBNAME),
        @WritesAttribute(attribute = ATTR_NAME_PRIMARY_URI, description = ATTR_DESCRIPTION_PRIMARY_URI),
        @WritesAttribute(attribute = ATTR_NAME_ETAG, description = ATTR_DESCRIPTION_ETAG),
        @WritesAttribute(attribute = ATTR_NAME_BLOBTYPE, description = ATTR_DESCRIPTION_BLOBTYPE),
        @WritesAttribute(attribute = ATTR_NAME_MIME_TYPE, description = ATTR_DESCRIPTION_MIME_TYPE),
        @WritesAttribute(attribute = ATTR_NAME_LANG, description = ATTR_DESCRIPTION_LANG),
        @WritesAttribute(attribute = ATTR_NAME_TIMESTAMP, description = ATTR_DESCRIPTION_TIMESTAMP),
        @WritesAttribute(attribute = ATTR_NAME_LENGTH, description = ATTR_DESCRIPTION_LENGTH),
        @WritesAttribute(attribute = ATTR_NAME_ERROR_CODE, description = ATTR_DESCRIPTION_ERROR_CODE),
        @WritesAttribute(attribute = ATTR_NAME_IGNORED, description = ATTR_DESCRIPTION_IGNORED)})
public class PutAzureBlobStorage_v12 extends AbstractAzureBlobProcessor_v12 {

    public static final PropertyDescriptor CREATE_CONTAINER = new PropertyDescriptor.Builder()
            .name("create-container")
            .displayName("Create Container")
            .expressionLanguageSupported(ExpressionLanguageScope.NONE)
            .required(true)
            .addValidator(StandardValidators.BOOLEAN_VALIDATOR)
            .allowableValues("true", "false")
            .defaultValue("false")
            .description("Specifies whether to check if the container exists and to automatically create it if it does not. " +
                    "Permission to list containers is required. If false, this check is not made, but the Put operation " +
                    "will fail if the container does not exist.")
            .build();

    public static final PropertyDescriptor CONFLICT_RESOLUTION = new PropertyDescriptor.Builder()
            .name("conflict-resolution-strategy")
            .displayName("Conflict Resolution Strategy")
            .expressionLanguageSupported(ExpressionLanguageScope.NONE)
            .required(true)
            .allowableValues(AzureStorageConflictResolutionStrategy.class)
            .defaultValue(AzureStorageConflictResolutionStrategy.FAIL_RESOLUTION.getValue())
            .description("Specifies whether an existing blob will have its contents replaced upon conflict.")
            .build();

    private static final List<PropertyDescriptor> PROPERTIES = Collections.unmodifiableList(Arrays.asList(
            STORAGE_CREDENTIALS_SERVICE,
            AzureStorageUtils.CONTAINER,
            CREATE_CONTAINER,
            CONFLICT_RESOLUTION,
            BLOB_NAME,
            AzureStorageUtils.PROXY_CONFIGURATION_SERVICE
    ));

    @Override
    protected List<PropertyDescriptor> getSupportedPropertyDescriptors() {
        return PROPERTIES;
    }

    public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException {
        FlowFile flowFile = session.get();
        if (flowFile == null) {
            return;
        }

        final String containerName = context.getProperty(AzureStorageUtils.CONTAINER).evaluateAttributeExpressions(flowFile).getValue();
        final boolean createContainer = context.getProperty(CREATE_CONTAINER).asBoolean();
        final String blobName = context.getProperty(BLOB_NAME).evaluateAttributeExpressions(flowFile).getValue();
        final AzureStorageConflictResolutionStrategy conflictResolution = AzureStorageConflictResolutionStrategy.valueOf(context.getProperty(CONFLICT_RESOLUTION).getValue());

        long startNanos = System.nanoTime();
        try {
            BlobServiceClient storageClient = getStorageClient();
            BlobContainerClient containerClient = storageClient.getBlobContainerClient(containerName);
            if (createContainer && !containerClient.exists()) {
                containerClient.create();
            }

            BlobClient blobClient = containerClient.getBlobClient(blobName);
            final BlobRequestConditions blobRequestConditions = new BlobRequestConditions();
            Map<String, String> attributes = new HashMap<>();
            applyStandardBlobAttributes(attributes, blobClient);
            final boolean ignore = conflictResolution == AzureStorageConflictResolutionStrategy.IGNORE_RESOLUTION;

            try {
                if (conflictResolution != AzureStorageConflictResolutionStrategy.REPLACE_RESOLUTION) {
                    blobRequestConditions.setIfNoneMatch("*");
                }

                try (InputStream rawIn = session.read(flowFile)) {
                    final BlobParallelUploadOptions blobParallelUploadOptions = new BlobParallelUploadOptions(toFluxByteBuffer(rawIn));
                    blobParallelUploadOptions.setRequestConditions(blobRequestConditions);
                    blobClient.uploadWithResponse(blobParallelUploadOptions, null, Context.NONE);
                    applyBlobMetadata(attributes, blobClient);
                    if (ignore) {
                        attributes.put(ATTR_NAME_IGNORED, "false");
                    }
                }
            } catch (BlobStorageException e) {
                final BlobErrorCode errorCode = e.getErrorCode();
                flowFile = session.putAttribute(flowFile, ATTR_NAME_ERROR_CODE, e.getErrorCode().toString());

                if (errorCode == BlobErrorCode.BLOB_ALREADY_EXISTS && ignore) {
                    getLogger().info("Blob already exists: remote blob not modified. Transferring {} to success", flowFile);
                    attributes.put(ATTR_NAME_IGNORED, "true");
                } else {
                    throw e;
                }
            }

            flowFile = session.putAllAttributes(flowFile, attributes);
            session.transfer(flowFile, REL_SUCCESS);

            long transferMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNanos);
            String transitUri = attributes.get(ATTR_NAME_PRIMARY_URI);
            session.getProvenanceReporter().send(flowFile, transitUri, transferMillis);
        } catch (Exception e) {
            getLogger().error("Failed to create blob on Azure Blob Storage", e);
            flowFile = session.penalize(flowFile);
            session.transfer(flowFile, REL_FAILURE);
        }
    }
}


text:
import { expect } from 'chai';
import * as React from 'react';
import { createRenderer, describeConformance } from 'test/utils';
import Skeleton, { skeletonClasses as classes } from '@mui/material/Skeleton';

describe('<Skeleton />', () => {
  const { render } = createRenderer();

  describeConformance(<Skeleton />, () => ({
    classes,
    inheritComponent: 'span',
    render,
    refInstanceof: window.HTMLSpanElement,
    muiName: 'MuiSkeleton',
    testVariantProps: { variant: 'circular', animation: 'wave' },
    skip: ['componentsProp'],
  }));

  it('should render', () => {
    const { container } = render(<Skeleton />);

    expect(container.firstChild).to.have.class(classes.root);
  });

  it('should get withChildren class when passed children', () => {
    const { container } = render(
      <Skeleton>

      </Skeleton>,
    );

    expect(container.firstChild).to.have.class(classes.withChildren);
  });

  it('should get fitContent class when passed children and no width', () => {
    const { container: containerWithoutWidth } = render(
      <Skeleton>

      </Skeleton>,
    );

    expect(containerWithoutWidth.firstChild).to.have.class(classes.fitContent);

    const { container: containerWithWidth } = render(
      <Skeleton width="100">

      </Skeleton>,
    );

    expect(containerWithWidth.firstChild).not.to.have.class(classes.fitContent);
  });

  it('should get heightAuto class when passed children and no height', () => {
    const { container: containerWithoutHeight } = render(
      <Skeleton>

      </Skeleton>,
    );

    expect(containerWithoutHeight.firstChild).to.have.class(classes.heightAuto);

    const { container: containerWithHeight } = render(
      <Skeleton height="100">

      </Skeleton>,
    );

    expect(containerWithHeight.firstChild).not.to.have.class(classes.heightAuto);
  });
});


text:
<?php

namespace FOD\Instruct\Context;

use FOD\Instruct\Event\EventInterface;

/**
 * Builder class for instruct' context objects.
 */
interface ContextBuilderInterface
{
    /**
     * Add a new event to this context.
     *
     * @param EventInterface $event
     *
     * @return ContextBuilder
     */
    public function addEvent(EventInterface $event);

    /**
     * Get all added events.
     *
     * @return EventCollection
     */
    public function getEvents();

    /**
     * Creates the context.
     *
     * @return ContextInterface
     */
    public function getContext();
}


text:
<?php echo form_open('admin/users/edit_groups', array('class' => 'user-group-row-form')); ?>

            Groups
            <?php echo form_multiselect('group_id[]', $user_groups_options,[],"id='multi_select' class='multi_select'"); ?>
            <?php echo form_error('user_groups'); ?>

        <input type="hidden" name="user_ids" value="<?php echo $user_ids?>"/>

            <button type="submit" name="remove" value="TRUE"><?php echo lang('admin_button_label_remove'); ?></button>
            <button type="submit" name="overwrite" value="TRUE"><?php echo lang('admin_button_label_overwrite'); ?></button>
            <button type="submit" name="add" value="TRUE"><?php echo lang('admin_button_label_add'); ?></button>
            <?php echo lang('admin_button_label_cancel'); ?>

<?php echo form_close();?>


text:
<!doctype html>

    <title>Coded Homes</title>
    <link rel="stylesheet" href="css/bootstrap.css" type="text/css" />

A fictitious identity used by Craig Shoemaker in various Pluralsight courses.


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="{{STATIC_URL}}css/normalize.css">
        <link rel="stylesheet" href="{{STATIC_URL}}css/main.css">
        <link href="{{STATIC_URL}}css/bootstrap.min.css" rel="stylesheet">

{% include "top_navbar.html" %}
{% block "content" %}{% endblock %}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Philipp. J. Sci. , C, Bot. 56(1): 74 (1935)

#### Original name
Meliola barringtoniicola F. Stevens & Roldan

### Remarks
null


text:
module Garfio
  class Bash < Git
    def changed_files
      @changed_files ||= begin
        data = run('git diff --cached --name-only --diff-filter=AM HEAD', true)
        data.split("\n").map(&:chomp)
      end
    end
  end
end


text:
#include <string>

#include "tensorflow/core/framework/register_types.h"
#include "tensorflow/core/framework/type_index.h"
#include "tensorflow/core/framework/variant.h"
#include "tensorflow/core/framework/variant_op_registry.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/public/version.h"

namespace tensorflow {

// static
UnaryVariantOpRegistry* UnaryVariantOpRegistry::Global() {
  static UnaryVariantOpRegistry* global_unary_variant_op_registry =
      new UnaryVariantOpRegistry;
  return global_unary_variant_op_registry;
}

UnaryVariantOpRegistry::VariantShapeFn* UnaryVariantOpRegistry::GetShapeFn(
    const string& type_name) {
  auto found = shape_fns.find(type_name);
  if (found == shape_fns.end()) return nullptr;
  return &found->second;
}

void UnaryVariantOpRegistry::RegisterShapeFn(const string& type_name,
                                             const VariantShapeFn& shape_fn) {
  CHECK(!type_name.empty()) << "Need a valid name for UnaryVariantShape";
  VariantShapeFn* existing = GetShapeFn(type_name);
  CHECK_EQ(existing, nullptr)
      << "Unary VariantShapeFn for type_name: " << type_name
      << " already registered";
  shape_fns.insert(std::pair<string, VariantShapeFn>(type_name, shape_fn));
}

Status GetUnaryVariantShape(const Tensor& variant_tensor, TensorShape* shape) {
  CHECK_EQ(variant_tensor.dtype(), DT_VARIANT);
  CHECK_EQ(variant_tensor.dims(), 0);
  // Use a mutable Variant because shape_fn will first call
  // MaybeDecodeAndGet, which in turn may mutate the underlying object
  // (if a Decode is called).
  const Variant& v = variant_tensor.scalar<Variant>()();
  UnaryVariantOpRegistry::VariantShapeFn* shape_fn =
      UnaryVariantOpRegistry::Global()->GetShapeFn(v.TypeName());
  if (shape_fn == nullptr) {
    return errors::Internal(
        "No unary variant shape function found for Variant type_name: ",
        v.TypeName());
  }
  return (*shape_fn)(v, shape);
}

UnaryVariantOpRegistry::VariantDecodeFn* UnaryVariantOpRegistry::GetDecodeFn(
    const string& type_name) {
  auto found = decode_fns.find(type_name);
  if (found == decode_fns.end()) return nullptr;
  return &found->second;
}

void UnaryVariantOpRegistry::RegisterDecodeFn(
    const string& type_name, const VariantDecodeFn& decode_fn) {
  CHECK(!type_name.empty()) << "Need a valid name for UnaryVariantDecode";
  VariantDecodeFn* existing = GetDecodeFn(type_name);
  CHECK_EQ(existing, nullptr)
      << "Unary VariantDecodeFn for type_name: " << type_name
      << " already registered";
  decode_fns.insert(std::pair<string, VariantDecodeFn>(type_name, decode_fn));
}

bool DecodeUnaryVariant(Variant* variant) {
  UnaryVariantOpRegistry::VariantDecodeFn* decode_fn =
      UnaryVariantOpRegistry::Global()->GetDecodeFn(variant->TypeName());
  if (decode_fn == nullptr) {
    return false;
  }
  const string type_name = variant->TypeName();
  bool decoded = (*decode_fn)(variant);
  if (!decoded) return false;
  if (variant->TypeName() != type_name) {
    LOG(ERROR) << "DecodeUnaryVariant: Variant type_name before decoding was: "
               << type_name
               << " but after decoding was: " << variant->TypeName()
               << ".  Treating this as a failure.";
    return false;
  }
  return true;
}

// Add some basic registrations for use by others, e.g., for testing.

namespace {
string MaybeRemoveTFPrefix(const StringPiece& str) {
  return str.starts_with("::tensorflow::") ? str.substr(14).ToString()
                                           : str.ToString();
}
}  // namespace

#define REGISTER_VARIANT_DECODE_TYPE(T) \
  REGISTER_UNARY_VARIANT_DECODE_FUNCTION(T, TF_STR(T));

// No encode/decode registered for std::complex<> and Eigen::half
// objects yet.
REGISTER_VARIANT_DECODE_TYPE(int);
REGISTER_VARIANT_DECODE_TYPE(float);
REGISTER_VARIANT_DECODE_TYPE(bool);
REGISTER_VARIANT_DECODE_TYPE(double);

#undef REGISTER_VARIANT_DECODE_TYPE

// Special casing ZerosLikeFn per device.
UnaryVariantOpRegistry::VariantZerosLikeFn*
UnaryVariantOpRegistry::GetZerosLikeFn(const string& device,
                                       const string& type_name) {
  auto found = zeros_like_fns.find(std::make_pair(device, type_name));
  if (found == zeros_like_fns.end()) return nullptr;
  return &found->second;
}

void UnaryVariantOpRegistry::RegisterZerosLikeFn(
    const string& device, const string& type_name,
    const VariantZerosLikeFn& zeros_like_fn) {
  CHECK(!type_name.empty()) << "Need a valid name for UnaryVariantZerosLike";
  VariantZerosLikeFn* existing = GetZerosLikeFn(device, type_name);
  CHECK_EQ(existing, nullptr)
      << "Unary VariantZerosLikeFn for type_name: " << type_name
      << " already registered for device type: " << device;
  zeros_like_fns.insert(
      std::pair<std::pair<string, string>, VariantZerosLikeFn>(
          std::make_pair(device, type_name), zeros_like_fn));
}

namespace {

template <typename T>
Status ZerosLikeVariantPrimitiveType(OpKernelContext* ctx, const T& t,
                                     T* t_out) {
  *t_out = T(0);
  return Status::OK();
}
}  // namespace

#define REGISTER_VARIANT_ZEROS_LIKE_TYPE(T)   \
  REGISTER_UNARY_VARIANT_ZEROS_LIKE_FUNCTION( \
      DEVICE_CPU, T, TF_STR(T), ZerosLikeVariantPrimitiveType<T>);

// No zeros_like registered for std::complex<> or Eigen::half objects yet.
REGISTER_VARIANT_ZEROS_LIKE_TYPE(int);
REGISTER_VARIANT_ZEROS_LIKE_TYPE(float);
REGISTER_VARIANT_ZEROS_LIKE_TYPE(double);
REGISTER_VARIANT_ZEROS_LIKE_TYPE(bool);

#undef REGISTER_VARIANT_ZEROS_LIKE_TYPE

}  // namespace tensorflow


text:
"""
Tripit OAuth2 backend, docs at:
    http://psa.matiasaguirre.net/docs/backends/tripit.html
"""
from xml.dom import minidom

from social.backends.oauth import BaseOAuth1

class TripItOAuth(BaseOAuth1):
    """TripIt OAuth authentication backend"""
    name = 'tripit'
    AUTHORIZATION_URL = 'https://www.tripit.com/oauth/authorize'
    REQUEST_TOKEN_URL = 'https://api.tripit.com/oauth/request_token'
    ACCESS_TOKEN_URL = 'https://api.tripit.com/oauth/access_token'
    EXTRA_DATA = [('screen_name', 'screen_name')]

    def get_user_details(self, response):
        """Return user details from TripIt account"""
        fullname, first_name, last_name = self.get_user_names(response['name'])
        return {'username': response['screen_name'],
                'email': response['email'],
                'fullname': fullname,
                'first_name': first_name,
                'last_name': last_name}

    def user_data(self, access_token, *args, **kwargs):
        """Return user data provided"""
        dom = minidom.parseString(self.oauth_request(
            access_token,
            'https://api.tripit.com/v1/get/profile'
        ).content)
        return {
            'id': dom.getElementsByTagName('Profile')[0].getAttribute('ref'),
            'name': dom.getElementsByTagName('public_display_name')[0]
                                    .childNodes[0].data,
            'screen_name': dom.getElementsByTagName('screen_name')[0]
                                    .childNodes[0].data,
            'email': dom.getElementsByTagName('is_primary')[0]
                                    .parentNode
                                        .getElementsByTagName('address')[0]
                                            .childNodes[0].data
        }


text:
using System;
using System.ComponentModel;

namespace Azure.ResourceManager.Logic.Models
{
    /// <summary> The workflow status. </summary>
    public readonly partial struct LogicWorkflowStatus : IEquatable<LogicWorkflowStatus>
    {
        private readonly string _value;

        /// <summary> Initializes a new instance of <see cref="LogicWorkflowStatus"/>. </summary>
        /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception>
        public LogicWorkflowStatus(string value)
        {
            _value = value ?? throw new ArgumentNullException(nameof(value));
        }

        private const string NotSpecifiedValue = "NotSpecified";
        private const string PausedValue = "Paused";
        private const string RunningValue = "Running";
        private const string WaitingValue = "Waiting";
        private const string SucceededValue = "Succeeded";
        private const string SkippedValue = "Skipped";
        private const string SuspendedValue = "Suspended";
        private const string CancelledValue = "Cancelled";
        private const string FailedValue = "Failed";
        private const string FaultedValue = "Faulted";
        private const string TimedOutValue = "TimedOut";
        private const string AbortedValue = "Aborted";
        private const string IgnoredValue = "Ignored";

        /// <summary> NotSpecified. </summary>
        public static LogicWorkflowStatus NotSpecified { get; } = new LogicWorkflowStatus(NotSpecifiedValue);
        /// <summary> Paused. </summary>
        public static LogicWorkflowStatus Paused { get; } = new LogicWorkflowStatus(PausedValue);
        /// <summary> Running. </summary>
        public static LogicWorkflowStatus Running { get; } = new LogicWorkflowStatus(RunningValue);
        /// <summary> Waiting. </summary>
        public static LogicWorkflowStatus Waiting { get; } = new LogicWorkflowStatus(WaitingValue);
        /// <summary> Succeeded. </summary>
        public static LogicWorkflowStatus Succeeded { get; } = new LogicWorkflowStatus(SucceededValue);
        /// <summary> Skipped. </summary>
        public static LogicWorkflowStatus Skipped { get; } = new LogicWorkflowStatus(SkippedValue);
        /// <summary> Suspended. </summary>
        public static LogicWorkflowStatus Suspended { get; } = new LogicWorkflowStatus(SuspendedValue);
        /// <summary> Cancelled. </summary>
        public static LogicWorkflowStatus Cancelled { get; } = new LogicWorkflowStatus(CancelledValue);
        /// <summary> Failed. </summary>
        public static LogicWorkflowStatus Failed { get; } = new LogicWorkflowStatus(FailedValue);
        /// <summary> Faulted. </summary>
        public static LogicWorkflowStatus Faulted { get; } = new LogicWorkflowStatus(FaultedValue);
        /// <summary> TimedOut. </summary>
        public static LogicWorkflowStatus TimedOut { get; } = new LogicWorkflowStatus(TimedOutValue);
        /// <summary> Aborted. </summary>
        public static LogicWorkflowStatus Aborted { get; } = new LogicWorkflowStatus(AbortedValue);
        /// <summary> Ignored. </summary>
        public static LogicWorkflowStatus Ignored { get; } = new LogicWorkflowStatus(IgnoredValue);
        /// <summary> Determines if two <see cref="LogicWorkflowStatus"/> values are the same. </summary>
        public static bool operator ==(LogicWorkflowStatus left, LogicWorkflowStatus right) => left.Equals(right);
        /// <summary> Determines if two <see cref="LogicWorkflowStatus"/> values are not the same. </summary>
        public static bool operator !=(LogicWorkflowStatus left, LogicWorkflowStatus right) => !left.Equals(right);
        /// <summary> Converts a string to a <see cref="LogicWorkflowStatus"/>. </summary>
        public static implicit operator LogicWorkflowStatus(string value) => new LogicWorkflowStatus(value);

        /// <inheritdoc />
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override bool Equals(object obj) => obj is LogicWorkflowStatus other && Equals(other);
        /// <inheritdoc />
        public bool Equals(LogicWorkflowStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);

        /// <inheritdoc />
        [EditorBrowsable(EditorBrowsableState.Never)]
        public override int GetHashCode() => _value?.GetHashCode() ?? 0;
        /// <inheritdoc />
        public override string ToString() => _value;
    }
}