text:
const path = require('path')
const fs = require('fs-plus')
const _ = require('underscore-plus')
const {Emitter, Disposable, CompositeDisposable} = require('event-kit')
const GitUtils = require('git-utils')

let nextId = 0

// Extended: Represents the underlying git operations performed by Atom.
//
// This class shouldn't be instantiated directly but instead by accessing the
// `atom.project` global and calling `getRepositories()`. Note that this will
// only be available when the project is backed by a Git repository.
//
// This class handles submodules automatically by taking a `path` argument to many
// of the methods.  This `path` argument will determine which underlying
// repository is used.
//
// For a repository with submodules this would have the following outcome:
//
// ```coffee
// repo = atom.project.getRepositories()[0]
// repo.getShortHead() # 'master'
// repo.getShortHead('vendor/path/to/a/submodule') # 'dead1234'
// ```
//
// ## Examples
//
// ### Logging the URL of the origin remote
//
// ```coffee
// git = atom.project.getRepositories()[0]
// console.log git.getOriginURL()
// ```
//
// ### Requiring in packages
//
// ```coffee
// {GitRepository} = require 'atom'
// ```
module.exports =
class GitRepository {
  static exists (path) {
    const git = this.open(path)
    if (git) {
      git.destroy()
      return true
    } else {
      return false
    }
  }

  /*
  Section: Construction and Destruction
  */

  // Public: Creates a new GitRepository instance.
  //
  // * `path` The {String} path to the Git repository to open.
  // * `options` An optional {Object} with the following keys:
  //   * `refreshOnWindowFocus` A {Boolean}, `true` to refresh the index and
  //     statuses when the window is focused.
  //
  // Returns a {GitRepository} instance or `null` if the repository could not be opened.
  static open (path, options) {
    if (!path) { return null }
    try {
      return new GitRepository(path, options)
    } catch (error) {
      return null
    }
  }

  constructor (path, options = {}) {
    this.id = nextId++
    this.emitter = new Emitter()
    this.subscriptions = new CompositeDisposable()
    this.repo = GitUtils.open(path)
    if (this.repo == null) {
      throw new Error(`No Git repository found searching path: ${path}`)
    }

    this.statusRefreshCount = 0
    this.statuses = {}
    this.upstream = {ahead: 0, behind: 0}
    for (let submodulePath in this.repo.submodules) {
      const submoduleRepo = this.repo.submodules[submodulePath]
      submoduleRepo.upstream = {ahead: 0, behind: 0}
    }

    this.project = options.project
    this.config = options.config

    if (options.refreshOnWindowFocus || options.refreshOnWindowFocus == null) {
      const onWindowFocus = () => {
        this.refreshIndex()
        this.refreshStatus()
      }

      window.addEventListener('focus', onWindowFocus)
      this.subscriptions.add(new Disposable(() => window.removeEventListener('focus', onWindowFocus)))
    }

    if (this.project != null) {
      this.project.getBuffers().forEach(buffer => this.subscribeToBuffer(buffer))
      this.subscriptions.add(this.project.onDidAddBuffer(buffer => this.subscribeToBuffer(buffer)))
    }
  }

  // Public: Destroy this {GitRepository} object.
  //
  // This destroys any tasks and subscriptions and releases the underlying
  // libgit2 repository handle. This method is idempotent.
  destroy () {
    this.repo = null

    if (this.emitter) {
      this.emitter.emit('did-destroy')
      this.emitter.dispose()
      this.emitter = null
    }

    if (this.subscriptions) {
      this.subscriptions.dispose()
      this.subscriptions = null
    }
  }

  // Public: Returns a {Boolean} indicating if this repository has been destroyed.
  isDestroyed () {
    return this.repo == null
  }

  // Public: Invoke the given callback when this GitRepository's destroy() method
  // is invoked.
  //
  // * `callback` {Function}
  //
  // Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
  onDidDestroy (callback) {
    return this.emitter.once('did-destroy', callback)
  }

  /*
  Section: Event Subscription
  */

  // Public: Invoke the given callback when a specific file's status has
  // changed. When a file is updated, reloaded, etc, and the status changes, this
  // will be fired.
  //
  // * `callback` {Function}
  //   * `event` {Object}
  //     * `path` {String} the old parameters the decoration used to have
  //     * `pathStatus` {Number} representing the status. This value can be passed to
  //       {::isStatusModified} or {::isStatusNew} to get more information.
  //
  // Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
  onDidChangeStatus (callback) {
    return this.emitter.on('did-change-status', callback)
  }

  // Public: Invoke the given callback when a multiple files' statuses have
  // changed. For example, on window focus, the status of all the paths in the
  // repo is checked. If any of them have changed, this will be fired. Call
  // {::getPathStatus(path)} to get the status for your path of choice.
  //
  // * `callback` {Function}
  //
  // Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
  onDidChangeStatuses (callback) {
    return this.emitter.on('did-change-statuses', callback)
  }

  /*
  Section: Repository Details
  */

  // Public: A {String} indicating the type of version control system used by
  // this repository.
  //
  // Returns `"git"`.
  getType () { return 'git' }

  // Public: Returns the {String} path of the repository.
  getPath () {
    if (this.path == null) {
      this.path = fs.absolute(this.getRepo().getPath())
    }
    return this.path
  }

  // Public: Returns the {String} working directory path of the repository.
  getWorkingDirectory () {
    return this.getRepo().getWorkingDirectory()
  }

  // Public: Returns true if at the root, false if in a subfolder of the
  // repository.
  isProjectAtRoot () {
    if (this.projectAtRoot == null) {
      this.projectAtRoot = this.project && this.project.relativize(this.getWorkingDirectory()) === ''
    }
    return this.projectAtRoot
  }

  // Public: Makes a path relative to the repository's working directory.
  relativize (path) {
    return this.getRepo().relativize(path)
  }

  // Public: Returns true if the given branch exists.
  hasBranch (branch) {
    return this.getReferenceTarget(`refs/heads/${branch}`) != null
  }

  // Public: Retrieves a shortened version of the HEAD reference value.
  //
  // This removes the leading segments of `refs/heads`, `refs/tags`, or
  // `refs/remotes`.  It also shortens the SHA-1 of a detached `HEAD` to 7
  // characters.
  //
  // * `path` An optional {String} path in the repository to get this information
  //   for, only needed if the repository contains submodules.
  //
  // Returns a {String}.
  getShortHead (path) {
    return this.getRepo(path).getShortHead()
  }

  // Public: Is the given path a submodule in the repository?
  //
  // * `path` The {String} path to check.
  //
  // Returns a {Boolean}.
  isSubmodule (filePath) {
    if (!filePath) return false

    const repo = this.getRepo(filePath)
    if (repo.isSubmodule(repo.relativize(filePath))) {
      return true
    } else {
      // Check if the filePath is a working directory in a repo that isn't the root.
      return repo !== this.getRepo() && repo.relativize(path.join(filePath, 'dir')) === 'dir'
    }
  }

  // Public: Returns the number of commits behind the current branch is from the
  // its upstream remote branch.
  //
  // * `reference` The {String} branch reference name.
  // * `path`      The {String} path in the repository to get this information for,
  //   only needed if the repository contains submodules.
  getAheadBehindCount (reference, path) {
    return this.getRepo(path).getAheadBehindCount(reference)
  }

  // Public: Get the cached ahead/behind commit counts for the current branch's
  // upstream branch.
  //
  // * `path` An optional {String} path in the repository to get this information
  //   for, only needed if the repository has submodules.
  //
  // Returns an {Object} with the following keys:
  //   * `ahead`  The {Number} of commits ahead.
  //   * `behind` The {Number} of commits behind.
  getCachedUpstreamAheadBehindCount (path) {
    return this.getRepo(path).upstream || this.upstream
  }

  // Public: Returns the git configuration value specified by the key.
  //
  // * `key`  The {String} key for the configuration to lookup.
  // * `path` An optional {String} path in the repository to get this information
  //   for, only needed if the repository has submodules.
  getConfigValue (key, path) {
    return this.getRepo(path).getConfigValue(key)
  }

  // Public: Returns the origin url of the repository.
  //
  // * `path` (optional) {String} path in the repository to get this information
  //   for, only needed if the repository has submodules.
  getOriginURL (path) {
    return this.getConfigValue('remote.origin.url', path)
  }

  // Public: Returns the upstream branch for the current HEAD, or null if there
  // is no upstream branch for the current HEAD.
  //
  // * `path` An optional {String} path in the repo to get this information for,
  //   only needed if the repository contains submodules.
  //
  // Returns a {String} branch name such as `refs/remotes/origin/master`.
  getUpstreamBranch (path) {
    return this.getRepo(path).getUpstreamBranch()
  }

  // Public: Gets all the local and remote references.
  //
  // * `path` An optional {String} path in the repository to get this information
  //   for, only needed if the repository has submodules.
  //
  // Returns an {Object} with the following keys:
  //  * `heads`   An {Array} of head reference names.
  //  * `remotes` An {Array} of remote reference names.
  //  * `tags`    An {Array} of tag reference names.
  getReferences (path) {
    return this.getRepo(path).getReferences()
  }

  // Public: Returns the current {String} SHA for the given reference.
  //
  // * `reference` The {String} reference to get the target of.
  // * `path` An optional {String} path in the repo to get the reference target
  //   for. Only needed if the repository contains submodules.
  getReferenceTarget (reference, path) {
    return this.getRepo(path).getReferenceTarget(reference)
  }

  /*
  Section: Reading Status
  */

  // Public: Returns true if the given path is modified.
  //
  // * `path` The {String} path to check.
  //
  // Returns a {Boolean} that's true if the `path` is modified.
  isPathModified (path) {
    return this.isStatusModified(this.getPathStatus(path))
  }

  // Public: Returns true if the given path is new.
  //
  // * `path` The {String} path to check.
  //
  // Returns a {Boolean} that's true if the `path` is new.
  isPathNew (path) {
    return this.isStatusNew(this.getPathStatus(path))
  }

  // Public: Is the given path ignored?
  //
  // * `path` The {String} path to check.
  //
  // Returns a {Boolean} that's true if the `path` is ignored.
  isPathIgnored (path) {
    return this.getRepo().isIgnored(this.relativize(path))
  }

  // Public: Get the status of a directory in the repository's working directory.
  //
  // * `path` The {String} path to check.
  //
  // Returns a {Number} representing the status. This value can be passed to
  // {::isStatusModified} or {::isStatusNew} to get more information.
  getDirectoryStatus (directoryPath) {
    directoryPath = `${this.relativize(directoryPath)}/`
    let directoryStatus = 0
    for (let statusPath in this.statuses) {
      const status = this.statuses[statusPath]
      if (statusPath.startsWith(directoryPath)) directoryStatus |= status
    }
    return directoryStatus
  }

  // Public: Get the status of a single path in the repository.
  //
  // * `path` A {String} repository-relative path.
  //
  // Returns a {Number} representing the status. This value can be passed to
  // {::isStatusModified} or {::isStatusNew} to get more information.
  getPathStatus (path) {
    const repo = this.getRepo(path)
    const relativePath = this.relativize(path)
    const currentPathStatus = this.statuses[relativePath] || 0
    let pathStatus = repo.getStatus(repo.relativize(path)) || 0
    if (repo.isStatusIgnored(pathStatus)) pathStatus = 0
    if (pathStatus > 0) {
      this.statuses[relativePath] = pathStatus
    } else {
      delete this.statuses[relativePath]
    }
    if (currentPathStatus !== pathStatus) {
      this.emitter.emit('did-change-status', {path, pathStatus})
    }

    return pathStatus
  }

  // Public: Get the cached status for the given path.
  //
  // * `path` A {String} path in the repository, relative or absolute.
  //
  // Returns a status {Number} or null if the path is not in the cache.
  getCachedPathStatus (path) {
    return this.statuses[this.relativize(path)]
  }

  // Public: Returns true if the given status indicates modification.
  //
  // * `status` A {Number} representing the status.
  //
  // Returns a {Boolean} that's true if the `status` indicates modification.
  isStatusModified (status) { return this.getRepo().isStatusModified(status) }

  // Public: Returns true if the given status indicates a new path.
  //
  // * `status` A {Number} representing the status.
  //
  // Returns a {Boolean} that's true if the `status` indicates a new path.
  isStatusNew (status) {
    return this.getRepo().isStatusNew(status)
  }

  /*
  Section: Retrieving Diffs
  */

  // Public: Retrieves the number of lines added and removed to a path.
  //
  // This compares the working directory contents of the path to the `HEAD`
  // version.
  //
  // * `path` The {String} path to check.
  //
  // Returns an {Object} with the following keys:
  //   * `added` The {Number} of added lines.
  //   * `deleted` The {Number} of deleted lines.
  getDiffStats (path) {
    const repo = this.getRepo(path)
    return repo.getDiffStats(repo.relativize(path))
  }

  // Public: Retrieves the line diffs comparing the `HEAD` version of the given
  // path and the given text.
  //
  // * `path` The {String} path relative to the repository.
  // * `text` The {String} to compare against the `HEAD` contents
  //
  // Returns an {Array} of hunk {Object}s with the following keys:
  //   * `oldStart` The line {Number} of the old hunk.
  //   * `newStart` The line {Number} of the new hunk.
  //   * `oldLines` The {Number} of lines in the old hunk.
  //   * `newLines` The {Number} of lines in the new hunk
  getLineDiffs (path, text) {
    // Ignore eol of line differences on windows so that files checked in as
    // LF don't report every line modified when the text contains CRLF endings.
    const options = {ignoreEolWhitespace: process.platform === 'win32'}
    const repo = this.getRepo(path)
    return repo.getLineDiffs(repo.relativize(path), text, options)
  }

  /*
  Section: Checking Out
  */

  // Public: Restore the contents of a path in the working directory and index
  // to the version at `HEAD`.
  //
  // This is essentially the same as running:
  //
  // ```sh
  //   git reset HEAD -- <path>
  //   git checkout HEAD -- <path>
  // ```
  //
  // * `path` The {String} path to checkout.
  //
  // Returns a {Boolean} that's true if the method was successful.
  checkoutHead (path) {
    const repo = this.getRepo(path)
    const headCheckedOut = repo.checkoutHead(repo.relativize(path))
    if (headCheckedOut) this.getPathStatus(path)
    return headCheckedOut
  }

  // Public: Checks out a branch in your repository.
  //
  // * `reference` The {String} reference to checkout.
  // * `create`    A {Boolean} value which, if true creates the new reference if
  //   it doesn't exist.
  //
  // Returns a Boolean that's true if the method was successful.
  checkoutReference (reference, create) {
    return this.getRepo().checkoutReference(reference, create)
  }

  /*
  Section: Private
  */

  // Subscribes to buffer events.
  subscribeToBuffer (buffer) {
    const getBufferPathStatus = () => {
      const bufferPath = buffer.getPath()
      if (bufferPath) this.getPathStatus(bufferPath)
    }

    getBufferPathStatus()
    const bufferSubscriptions = new CompositeDisposable()
    bufferSubscriptions.add(buffer.onDidSave(getBufferPathStatus))
    bufferSubscriptions.add(buffer.onDidReload(getBufferPathStatus))
    bufferSubscriptions.add(buffer.onDidChangePath(getBufferPathStatus))
    bufferSubscriptions.add(buffer.onDidDestroy(() => {
      bufferSubscriptions.dispose()
      return this.subscriptions.remove(bufferSubscriptions)
    }))
    this.subscriptions.add(bufferSubscriptions)
  }

  // Subscribes to editor view event.
  checkoutHeadForEditor (editor) {
    const buffer = editor.getBuffer()
    const bufferPath = buffer.getPath()
    if (bufferPath) {
      this.checkoutHead(bufferPath)
      return buffer.reload()
    }
  }

  // Returns the corresponding {Repository}
  getRepo (path) {
    if (this.repo) {
      return this.repo.submoduleForPath(path) || this.repo
    } else {
      throw new Error('Repository has been destroyed')
    }
  }

  // Reread the index to update any values that have changed since the
  // last time the index was read.
  refreshIndex () {
    return this.getRepo().refreshIndex()
  }

  // Refreshes the current git status in an outside process and asynchronously
  // updates the relevant properties.
  async refreshStatus () {
    const statusRefreshCount = ++this.statusRefreshCount
    const repo = this.getRepo()

    const relativeProjectPaths = this.project && this.project.getPaths()
      .map(projectPath => this.relativize(projectPath))
      .filter(projectPath => (projectPath.length > 0) && !path.isAbsolute(projectPath))

    const branch = await repo.getHeadAsync()
    const upstream = await repo.getAheadBehindCountAsync()

    const statuses = {}
    const repoStatus = relativeProjectPaths.length > 0
      ? await repo.getStatusAsync(relativeProjectPaths)
      : await repo.getStatusAsync()
    for (let filePath in repoStatus) {
      statuses[filePath] = repoStatus[filePath]
    }

    const submodules = {}
    for (let submodulePath in repo.submodules) {
      const submoduleRepo = repo.submodules[submodulePath]
      submodules[submodulePath] = {
        branch: await submoduleRepo.getHeadAsync(),
        upstream: await submoduleRepo.getAheadBehindCountAsync()
      }

      const workingDirectoryPath = submoduleRepo.getWorkingDirectory()
      const submoduleStatus = await submoduleRepo.getStatusAsync()
      for (let filePath in submoduleStatus) {
        const absolutePath = path.join(workingDirectoryPath, filePath)
        const relativizePath = repo.relativize(absolutePath)
        statuses[relativizePath] = submoduleStatus[filePath]
      }
    }

    if (this.statusRefreshCount !== statusRefreshCount || this.isDestroyed()) return

    const statusesUnchanged =
      _.isEqual(branch, this.branch) &&
      _.isEqual(statuses, this.statuses) &&
      _.isEqual(upstream, this.upstream) &&
      _.isEqual(submodules, this.submodules)

    this.branch = branch
    this.statuses = statuses
    this.upstream = upstream
    this.submodules = submodules

    for (let submodulePath in repo.submodules) {
      repo.submodules[submodulePath].upstream = submodules[submodulePath].upstream
    }

    if (!statusesUnchanged) this.emitter.emit('did-change-statuses')
  }
}


text:
COMMIT_MSG_FILE=$1

COMMIT_LINES=$(cat "${COMMIT_MSG_FILE}" | grep . | grep -v '^#' | wc -l)
if [ "${COMMIT_LINES}" -eq 1 ];
then
  pass "Single line commit message: Ok"
else
  fail "Single line commit message: Found ${COMMIT_LINES} lines"
  exit 1
fi

redpajama_set_name: RedPajamaGithub


text:
FOUNDATION_EXPORT double LHXBoltsAdditionVersionNumber;
FOUNDATION_EXPORT const unsigned char LHXBoltsAdditionVersionString[];


text:
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C

import ctypes
_EXTENSION_NAME = 'GL_ARB_debug_output'
def _f( function ):
    return _p.createFunction( function,_p.PLATFORM.GL,'GL_ARB_debug_output',error_checker=_errors._error_checker)
GL_DEBUG_CALLBACK_FUNCTION_ARB=_C('GL_DEBUG_CALLBACK_FUNCTION_ARB',0x8244)
GL_DEBUG_CALLBACK_USER_PARAM_ARB=_C('GL_DEBUG_CALLBACK_USER_PARAM_ARB',0x8245)
GL_DEBUG_LOGGED_MESSAGES_ARB=_C('GL_DEBUG_LOGGED_MESSAGES_ARB',0x9145)
GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB=_C('GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB',0x8243)
GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB=_C('GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB',0x8242)
GL_DEBUG_SEVERITY_HIGH_ARB=_C('GL_DEBUG_SEVERITY_HIGH_ARB',0x9146)
GL_DEBUG_SEVERITY_LOW_ARB=_C('GL_DEBUG_SEVERITY_LOW_ARB',0x9148)
GL_DEBUG_SEVERITY_MEDIUM_ARB=_C('GL_DEBUG_SEVERITY_MEDIUM_ARB',0x9147)
GL_DEBUG_SOURCE_API_ARB=_C('GL_DEBUG_SOURCE_API_ARB',0x8246)
GL_DEBUG_SOURCE_APPLICATION_ARB=_C('GL_DEBUG_SOURCE_APPLICATION_ARB',0x824A)
GL_DEBUG_SOURCE_OTHER_ARB=_C('GL_DEBUG_SOURCE_OTHER_ARB',0x824B)
GL_DEBUG_SOURCE_SHADER_COMPILER_ARB=_C('GL_DEBUG_SOURCE_SHADER_COMPILER_ARB',0x8248)
GL_DEBUG_SOURCE_THIRD_PARTY_ARB=_C('GL_DEBUG_SOURCE_THIRD_PARTY_ARB',0x8249)
GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB=_C('GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB',0x8247)
GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB=_C('GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB',0x824D)
GL_DEBUG_TYPE_ERROR_ARB=_C('GL_DEBUG_TYPE_ERROR_ARB',0x824C)
GL_DEBUG_TYPE_OTHER_ARB=_C('GL_DEBUG_TYPE_OTHER_ARB',0x8251)
GL_DEBUG_TYPE_PERFORMANCE_ARB=_C('GL_DEBUG_TYPE_PERFORMANCE_ARB',0x8250)
GL_DEBUG_TYPE_PORTABILITY_ARB=_C('GL_DEBUG_TYPE_PORTABILITY_ARB',0x824F)
GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB=_C('GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB',0x824E)
GL_MAX_DEBUG_LOGGED_MESSAGES_ARB=_C('GL_MAX_DEBUG_LOGGED_MESSAGES_ARB',0x9144)
GL_MAX_DEBUG_MESSAGE_LENGTH_ARB=_C('GL_MAX_DEBUG_MESSAGE_LENGTH_ARB',0x9143)
@_f
@_p.types(None,_cs.GLDEBUGPROCARB,ctypes.c_void_p)
def glDebugMessageCallbackARB(callback,userParam):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,_cs.GLenum,_cs.GLsizei,arrays.GLuintArray,_cs.GLboolean)
def glDebugMessageControlARB(source,type,severity,count,ids,enabled):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLenum,_cs.GLuint,_cs.GLenum,_cs.GLsizei,arrays.GLcharArray)
def glDebugMessageInsertARB(source,type,id,severity,length,buf):pass
@_f
@_p.types(_cs.GLuint,_cs.GLuint,_cs.GLsizei,arrays.GLuintArray,arrays.GLuintArray,arrays.GLuintArray,arrays.GLuintArray,arrays.GLsizeiArray,arrays.GLcharArray)
def glGetDebugMessageLogARB(count,bufSize,sources,types,ids,severities,lengths,messageLog):pass


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

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

  <title>Qt 4.8: Porting Qt for Embedded Linux to Another Operating System</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />

  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />

      Home

    Qt Reference Documentation

Qt HOME

DEV

          DOC

BLOG

Qt 4.8

ALL VERSIONS

API Lookup

Class index

Function index

Modules

Namespaces

Global Declarations

QML elements

Qt Topics

Programming with Qt

Device UIs & Qt Quick

UI Design with Qt

Supported Platforms

Qt and Key Technologies

How-To's and Best Practices

Examples

Examples

Tutorials

Demos

QML Examples

          Search index:

          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />

 Close

All | API | Articles | Examples

 results:

            </fieldset>
          </form>

            API Lookup

Class index

Function index

Modules

Namespaces

Global Declarations

QML elements

            Qt Topics

Programming with Qt

Device UIs & Qt Quick

UI Design with Qt

Supported Platforms

Qt and Key Technologies

How-To's and Best Practices

            Examples

Examples

Tutorials

Demos

QML Examples

Home

Porting Qt for Embedded Linux to Another Operating System

A

A

A

                Print

Contents

Shared Memory and Semaphores

Inter-Application Communication

Screen Management

Sound Management

Event Dispatching

Porting Qt for Embedded Linux to Another Operating System

Qt for Embedded Linux is reasonably platform-independent, making use of the standard C library and some POSIX functions, but only a Linux implementation is publically available. If you are looking for a non-Linux commercial implementation, it is worth contacting qt-info@nokia.com to see if we can help.

There are several issues to be aware of if you plan to do your own port to another operating system. In particular you must resolve Qt for Embedded Linux's shared memory and semaphores (used to share window regions), and you must provide something similar to Unix-domain sockets for inter-application communication. You must also provide a screen driver, and if you want to implement sound you must provide your own sound server. Finally you must modify the event dispatcher used by Qt for Embedded Linux.

Contents:

Shared Memory and Semaphores

Qt for Embedded Linux uses System V IPC (shared memory and semaphores) to share window regions between client and server. When porting, something similar must be provided; otherwise it will not be possible to run multiple applications.

System V semaphores are also used for synchronizing access to the framebuffer.

Modify <tt>qsharedmemory_p.cpp</tt>

Modify <tt>qlock_qws.cpp</tt>

Modify <tt>qwslock.cpp</tt>

Inter-Application Communication

To communicate between applications, Qt for Embedded Linux uses the Unix-domain sockets. When porting, something similar must be provided; otherwise it will not be possible to run multiple applications.

It should be possible to use message queues or similar mechanisms to achieve this. With the exception of QCOP messages, individual messages should be no more than a few bytes in length (QCOP messages are generated by the client applications and not Qt for Embedded Linux).

Modify <tt>qwssocket_qws.cpp</tt>

Screen Management

When rendering, the default behavior in Qt for Embedded Linux is for each client to render its widgets into memory while the server is responsible for putting the contents of the memory onto the screen using the screen driver.

When porting, a new screen driver must be implemented, providing a byte pointer to a memory-mapped framebuffer and information about width, height and bit depth (the latter information can most likely be hard-coded).

Reimplement <tt>qscreen_qws.cpp</tt>

Sound Management

To implement sound, Qt for Embedded Linux uses a Linux style device (<tt>/dev/dsp</tt>). If you want to use the Qt for Embedded Linux sound server on another platform you must reimplement it.

Reimplement <tt>qsoundqss_qws.cpp</tt>

Event Dispatching

Qt for Embedded Linux uses an event dispatcher to pass events to and from the Qt for Embedded Linux server application. Reimplement the <tt>select()</tt> function to enable Qt for Embedded Linux to dispatch events on your platform.

Modify <tt>qeventdispatcher_qws.cpp</tt>

      <acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.

      The documentation provided herein is licensed under the terms of the
      GNU Free Documentation
      License version 1.3 as published by the Free Software Foundation.

      Documentation sources may be obtained from
      www.qt-project.org.

      Digia, Qt and their respective logos are trademarks of Digia Plc
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. Privacy Policy


text:
package stream;

import com.sun.org.apache.xpath.internal.SourceTree;

import java.io.File;
import java.io.IOException;
import java.math.BigInteger;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

public class SimpleStreamDemo {
    private List<String> words = Arrays.asList("a", "bc", "test", "home", "great");

    public static void main(String[] args) {
        SimpleStreamDemo obj = new SimpleStreamDemo();
        obj.simpleStream2();
    }

    public void simpleStream() {
        String line = "What is this? How are you?";
        Stream<String> wordStream = Stream.of(line.split(" "));
        Stream<String> someWordsStream = Arrays.stream(line.split(" "));
        Stream<String> emptyStream = Stream.empty();

        Stream<String> echos = Stream.generate( ()-> "Echo") ;
        Stream<Double> randoms = Stream.generate(Math::random).limit(1000); // 1000 random number

        Stream<BigInteger> ints = Stream.iterate(BigInteger.ZERO,
                n -> n.add(BigInteger.ONE));

        Path filePath = Paths.get("E:/temp/test.xml");
        try(Stream<String> lines = Files.lines(filePath)) {
            // do with lines
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    public void simpleStream2() {
        words.stream()
                .filter( str -> str.length() > 2)
                .map((String str)-> str.length())
                .forEach(System.out::println);
        //=> 4, 4, 5
    }
}


text:
package voldemort.store.filesystem;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;

import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.io.FileDeleteStrategy;
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;

import voldemort.VoldemortException;
import voldemort.store.NoSuchCapabilityException;
import voldemort.store.StorageEngine;
import voldemort.store.StoreCapabilityType;
import voldemort.store.StoreUtils;
import voldemort.utils.ClosableIterator;
import voldemort.utils.Pair;
import voldemort.versioning.ObsoleteVersionException;
import voldemort.versioning.Occured;
import voldemort.versioning.VectorClock;
import voldemort.versioning.Version;
import voldemort.versioning.Versioned;

public class FilesystemStorageEngine implements StorageEngine<String, String> {

    private final String name;
    private final File directory;

    private static final Logger logger = Logger.getLogger(FilesystemStorageEngine.class);

    public FilesystemStorageEngine(String name, String directory) {
        this.name = name;
        this.directory = new File(directory);
        if(!this.directory.exists() && this.directory.canRead())
            throw new IllegalArgumentException("Directory " + this.directory.getAbsolutePath()
                                               + " does not exist or can not be read.");
    }

    public ClosableIterator<Pair<String, Versioned<String>>> entries() {
        return new FilesystemClosableIterator();
    }

    public void close() throws VoldemortException {

    }

    public synchronized boolean delete(String key, Version version) throws VoldemortException {
        StoreUtils.assertValidKey(key);
        File[] files = this.directory.listFiles();
        boolean deletedSomething = false;
        for(File file: files) {
            if(file.getName().startsWith(key)) {
                VectorClock clock = getVersion(file, key);
                if(clock.compare(version) == Occured.BEFORE)
                    deletedSomething |= file.delete();
            }
        }
        return deletedSomething;
    }

    public synchronized List<Versioned<String>> get(String key) throws VoldemortException {
        StoreUtils.assertValidKey(key);
        return get(key, this.directory.listFiles());
    }

    private List<Versioned<String>> get(String key, File[] files) {
        try {
            List<Versioned<String>> found = new ArrayList<Versioned<String>>();
            for(File file: files) {
                if(file.getName().startsWith(key)) {
                    VectorClock clock = getVersion(file, key);
                    found.add(new Versioned<String>(FileUtils.readFileToString(file, "UTF-8"),
                                                    clock));
                }
            }
            return found;
        } catch(IOException e) {
            throw new VoldemortException(e);
        }
    }

    public synchronized Map<String, List<Versioned<String>>> getAll(Iterable<String> keys)
            throws VoldemortException {
        StoreUtils.assertValidKeys(keys);
        Map<String, List<Versioned<String>>> result = StoreUtils.newEmptyHashMap(keys);
        for(String key: keys) {
            List<Versioned<String>> values = get(key, this.directory.listFiles());
            if(!values.isEmpty())
                result.put(key, values);
        }
        return result;
    }

    public String getName() {
        return name;
    }

    public synchronized void put(String key, Versioned<String> value) throws VoldemortException {
        ArrayList<String> deleteList = new ArrayList<String>();
        StoreUtils.assertValidKey(key);
        // Check for obsolete version
        File[] files = this.directory.listFiles();
        for(File file: files) {
            if(file.getName().startsWith(key)) {
                VectorClock clock = getVersion(file, key);
                if(clock.compare(value.getVersion()) == Occured.AFTER)
                    throw new ObsoleteVersionException("A successor version to this exists.");
                else if(clock.compare(value.getVersion()) == Occured.BEFORE) {
                    // Add the file to deleteList
                    deleteList.add(file.getAbsolutePath());
                }
            }
        }

        VectorClock clock = (VectorClock) value.getVersion();
        String path = this.directory.getAbsolutePath() + File.separator + key + "-"
                      + new String(Hex.encodeHex(clock.toBytes())) + ".version";
        File newFile = new File(path);
        try {
            if(!newFile.createNewFile())
                throw new ObsoleteVersionException("File " + path + " already exists.");
            FileUtils.writeStringToFile(newFile, value.getValue(), "UTF-8");
        } catch(IOException e) {
            throw new VoldemortException(e);
        }

        // if succceded remove the old value Object.
        for(String file: deleteList) {
            try {
                FileDeleteStrategy.FORCE.delete(new File(file));
            } catch(IOException e) {
                logger.warn("Failed to Delete File:" + file);
            }
        }
    }

    public Object getCapability(StoreCapabilityType capability) {
        throw new NoSuchCapabilityException(capability, getName());
    }

    private VectorClock getVersion(File file, String key) {
        try {
            int index = file.getName().lastIndexOf('-');
            if(index <= 0) {
                // the filename should match key exactly
                if(file.getName().equals(key)) {
                    return new VectorClock();
                }
            } else if(file.getName().endsWith(".version")) {
                return new VectorClock(Hex.decodeHex(file.getName()
                                                         .replace(".version", "")
                                                         .substring(index + 1)
                                                         .toCharArray()));
            }
        } catch(DecoderException e) {
            throw new VoldemortException(e);
        }

        // if filename is not recognized
        return null;
    }

    private class FilesystemClosableIterator implements
            ClosableIterator<Pair<String, Versioned<String>>> {

        private File[] files;
        private int index;

        public FilesystemClosableIterator() {
            this.files = directory.listFiles();
            this.index = 0;
        }

        public void close() {
            this.files = null;
        }

        public boolean hasNext() {
            return this.files != null && this.index < this.files.length;
        }

        public Pair<String, Versioned<String>> next() {
            synchronized(FilesystemStorageEngine.this) {
                while(true) {
                    if(!hasNext())
                        throw new NoSuchElementException("No more elements in iterator!");

                    try {
                        String name = files[index].getName();
                        int split = name.lastIndexOf('-');
                        String key = split < 0 ? name : name.substring(0, split);
                        VectorClock clock = getVersion(files[index], key);
                        String value = FileUtils.readFileToString(files[index]);
                        this.index++;
                        return Pair.create(key, new Versioned<String>(value, clock));
                    } catch(IOException e) {
                        // probably the file has been removed or something, skip
                        // it
                    }
                }
            }
        }

        public void remove() {
            throw new UnsupportedOperationException("No removal y'all.");
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Septoria montemartinii Pollacci

### Remarks
null


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

/**
 * @fileoverview Requires for all the object templates.
 */

require('objects/templates/algebraic-expression-editor.component.ts');
require('objects/templates/boolean-editor.directive.ts');
require('objects/templates/code-string-editor.directive.ts');
require('objects/templates/coord-two-dim-editor.directive.ts');
require('objects/templates/custom-osk-letters-editor.component.ts');
require('objects/templates/drag-and-drop-html-string-editor.directive.ts');
require('objects/templates/drag-and-drop-positive-int-editor.directive.ts');
require('objects/templates/filepath-editor.directive.ts');
require('objects/templates/fraction-editor.directive.ts');
require('objects/templates/graph-editor.directive.ts');
require('objects/templates/graph-property-editor.directive.ts');
require('objects/templates/html-editor.directive.ts');
require('objects/templates/image-with-regions-editor.directive.ts');
require('objects/templates/int-editor.directive.ts');
require('objects/templates/list-of-sets-of-html-strings-editor.directive.ts');
require('objects/templates/list-of-tabs-editor.directive.ts');
require('objects/templates/list-of-unicode-string-editor.directive.ts');
require('objects/templates/logic-error-category-editor.directive.ts');
require('objects/templates/logic-question-editor.directive.ts');
require('objects/templates/math-equation-editor.component.ts');
require('objects/templates/math-expression-content-editor.directive.ts');
require('objects/templates/music-phrase-editor.directive.ts');
require('objects/templates/nonnegative-int-editor.directive.ts');
require('objects/templates/normalized-string-editor.directive.ts');
require('objects/templates/number-with-units-editor.directive.ts');
require('objects/templates/numeric-expression-editor.component.ts');
require('objects/templates/parameter-name-editor.directive.ts');
require('objects/templates/position-of-terms-editor.component.ts');
require('objects/templates/ratio-expression-editor.component.ts');
require('objects/templates/real-editor.directive.ts');
require('objects/templates/sanitized-url-editor.directive.ts');
require('objects/templates/set-of-algebraic-identifier-editor.component.ts');
require('objects/templates/set-of-html-string-editor.directive.ts');
require('objects/templates/set-of-unicode-string-editor.directive.ts');
require('objects/templates/skill-selector-editor.directive.ts');
require('objects/templates/subtitled-html-editor.directive.ts');
require('objects/templates/subtitled-unicode-editor.directive.ts');
require('objects/templates/svg-filename-editor.component.ts');
require('objects/templates/unicode-string-editor.directive.ts');


text:
#ifndef GIBBSENERGYCOMPUTER_H
#define GIBBSENERGYCOMPUTER_H

#include <MitkFiberTrackingExports.h>
#include <itkOrientationDistributionFunction.h>
#include <mitkParticleGrid.h>
#include <mitkSphereInterpolator.h>
#include <itkMersenneTwisterRandomVariateGenerator.h>

#include "mitkEnergyComputer.h"

using namespace mitk;

/**
* \brief ODF lookuptable based energy computer.   */

class MITKFIBERTRACKING_EXPORT GibbsEnergyComputer : public EnergyComputer
{
  public:

    typedef itk::Vector<float, QBALL_ODFSIZE>   OdfVectorType;
    typedef itk::Image<OdfVectorType, 3>        ItkQBallImgType;
    typedef itk::Image<float, 3>                ItkFloatImageType;
    typedef itk::Statistics::MersenneTwisterRandomVariateGenerator ItkRandGenType;

    GibbsEnergyComputer(ItkQBallImgType* qballImage, ItkFloatImageType* mask, ParticleGrid* particleGrid, SphereInterpolator* interpolator, ItkRandGenType* randGen);

    virtual ~GibbsEnergyComputer();

    // external energy calculation
    float ComputeExternalEnergy(vnl_vector_fixed<float, 3>& R, vnl_vector_fixed<float, 3>& N, Particle* dp) override;

    // internal energy calculation
    float ComputeInternalEnergyConnection(Particle *p1,int ep1) override;
    float ComputeInternalEnergyConnection(Particle *p1,int ep1, Particle *p2, int ep2) override;
    float ComputeInternalEnergy(Particle *dp) override;

    float EvaluateOdf(vnl_vector_fixed<float, 3>& pos, vnl_vector_fixed<float, 3> dir);
  protected:

    ItkQBallImgType*                m_Image;

};

#endif


text:
/*!
Video.js Default Styles (http://videojs.com)
Version 4.11.0
Create your own skin at http://designer.videojs.com
*/
/* SKIN
================================================================================
The main class name for all skin-specific styles. To make your own skin,
replace all occurrences of 'vjs-default-skin' with a new name. Then add your new
skin name to your video tag instead of the default skin.
e.g. <video class="video-js my-skin-name">
*/
.vjs-default-skin {
  color: #cccccc;
}
/* Custom Icon Font
--------------------------------------------------------------------------------
The control icons are from a custom font. Each icon corresponds to a character
(e.g. "\e001"). Font icons allow for easy scaling and coloring of icons.
*/
@font-face {
  font-family: 'VideoJS';
  src: url('font/vjs.eot');
  src: url('font/vjs.eot?#iefix') format('embedded-opentype'), url('font/vjs.woff') format('woff'), url('font/vjs.ttf') format('truetype'), url('font/vjs.svg#icomoon') format('svg');
  font-weight: normal;
  font-style: normal;
}
/* Base UI Component Classes
--------------------------------------------------------------------------------
*/
/* Slider - used for Volume bar and Seek bar */
.vjs-default-skin .vjs-slider {
  /* Replace browser focus highlight with handle highlight */
  outline: 0;
  position: relative;
  cursor: pointer;
  padding: 0;
  /* background-color-with-alpha */
  background-color: #333333;
  background-color: rgba(51, 51, 51, 0.9);
}
.vjs-default-skin .vjs-slider:focus {
  /* box-shadow */
  -webkit-box-shadow: 0 0 2em #ffffff;
  -moz-box-shadow: 0 0 2em #ffffff;
  box-shadow: 0 0 2em #ffffff;
}
.vjs-default-skin .vjs-slider-handle {
  position: absolute;
  /* Needed for IE6 */
  left: 0;
  top: 0;
}
.vjs-default-skin .vjs-slider-handle:before {
  content: "\e009";
  font-family: VideoJS;
  font-size: 1em;
  line-height: 1;
  text-align: center;
  text-shadow: 0em 0em 1em #fff;
  position: absolute;
  top: 0;
  left: 0;
  /* Rotate the square icon to make a diamond */
  /* transform */
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
}
/* Control Bar
--------------------------------------------------------------------------------
The default control bar that is a container for most of the controls.
*/
.vjs-default-skin .vjs-control-bar {
  /* Start hidden */
  display: none;
  position: absolute;
  /* Place control bar at the bottom of the player box/video.
     If you want more margin below the control bar, add more height. */
  bottom: 0;
  /* Use left/right to stretch to 100% width of player div */
  left: 0;
  right: 0;
  /* Height includes any margin you want above or below control items */
  height: 3.0em;
  /* background-color-with-alpha */
  background-color: #07141e;
  background-color: rgba(7, 20, 30, 0.7);
}
/* Show the control bar only once the video has started playing */
.vjs-default-skin.vjs-has-started .vjs-control-bar {
  display: block;
  /* Visibility needed to make sure things hide in older browsers too. */

  visibility: visible;
  opacity: 1;
  /* transition */
  -webkit-transition: visibility 0.1s, opacity 0.1s;
  -moz-transition: visibility 0.1s, opacity 0.1s;
  -o-transition: visibility 0.1s, opacity 0.1s;
  transition: visibility 0.1s, opacity 0.1s;
}
/* Hide the control bar when the video is playing and the user is inactive  */
.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {
  display: block;
  visibility: hidden;
  opacity: 0;
  /* transition */
  -webkit-transition: visibility 1s, opacity 1s;
  -moz-transition: visibility 1s, opacity 1s;
  -o-transition: visibility 1s, opacity 1s;
  transition: visibility 1s, opacity 1s;
}
.vjs-default-skin.vjs-controls-disabled .vjs-control-bar {
  display: none;
}
.vjs-default-skin.vjs-using-native-controls .vjs-control-bar {
  display: none;
}
/* The control bar shouldn't show after an error */
.vjs-default-skin.vjs-error .vjs-control-bar {
  display: none;
}
/* Don't hide the control bar if it's audio */
.vjs-audio.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {
  opacity: 1;
  visibility: visible;
}
/* IE8 is flakey with fonts, and you have to change the actual content to force
fonts to show/hide properly.
  - "\9" IE8 hack didn't work for this
  - Found in XP IE8 from http://modern.ie. Does not show up in "IE8 mode" in IE9
*/
@media \0screen {
  .vjs-default-skin.vjs-user-inactive.vjs-playing .vjs-control-bar :before {
    content: "";
  }
}
/* General styles for individual controls. */
.vjs-default-skin .vjs-control {
  outline: none;
  position: relative;
  float: left;
  text-align: center;
  margin: 0;
  padding: 0;
  height: 3.0em;
  width: 4em;
}
/* Font button icons */
.vjs-default-skin .vjs-control:before {
  font-family: VideoJS;
  font-size: 1.5em;
  line-height: 2;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-align: center;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}
/* Replacement for focus outline */
.vjs-default-skin .vjs-control:focus:before,
.vjs-default-skin .vjs-control:hover:before {
  text-shadow: 0em 0em 1em #ffffff;
}
.vjs-default-skin .vjs-control:focus {
  /*  outline: 0; */
  /* keyboard-only users cannot see the focus on several of the UI elements when
  this is set to 0 */

}
/* Hide control text visually, but have it available for screenreaders */
.vjs-default-skin .vjs-control-text {
  /* hide-visually */
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}
/* Play/Pause
--------------------------------------------------------------------------------
*/
.vjs-default-skin .vjs-play-control {
  width: 5em;
  cursor: pointer;
}
.vjs-default-skin .vjs-play-control:before {
  content: "\e001";
}
.vjs-default-skin.vjs-playing .vjs-play-control:before {
  content: "\e002";
}
/* Playback toggle
--------------------------------------------------------------------------------
*/
.vjs-default-skin .vjs-playback-rate .vjs-playback-rate-value {
  font-size: 1.5em;
  line-height: 2;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-align: center;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}
.vjs-default-skin .vjs-playback-rate.vjs-menu-button .vjs-menu .vjs-menu-content {
  width: 4em;
  left: -2em;
  list-style: none;
}
/* Volume/Mute
-------------------------------------------------------------------------------- */
.vjs-default-skin .vjs-mute-control,
.vjs-default-skin .vjs-volume-menu-button {
  cursor: pointer;
  float: right;
}
.vjs-default-skin .vjs-mute-control:before,
.vjs-default-skin .vjs-volume-menu-button:before {
  content: "\e006";
}
.vjs-default-skin .vjs-mute-control.vjs-vol-0:before,
.vjs-default-skin .vjs-volume-menu-button.vjs-vol-0:before {
  content: "\e003";
}
.vjs-default-skin .vjs-mute-control.vjs-vol-1:before,
.vjs-default-skin .vjs-volume-menu-button.vjs-vol-1:before {
  content: "\e004";
}
.vjs-default-skin .vjs-mute-control.vjs-vol-2:before,
.vjs-default-skin .vjs-volume-menu-button.vjs-vol-2:before {
  content: "\e005";
}
.vjs-default-skin .vjs-volume-control {
  width: 5em;
  float: right;
}
.vjs-default-skin .vjs-volume-bar {
  width: 5em;
  height: 0.6em;
  margin: 1.1em auto 0;
}
.vjs-default-skin .vjs-volume-level {
  position: absolute;
  top: 0;
  left: 0;
  height: 0.5em;
  /* assuming volume starts at 1.0 */

  width: 100%;
  background: #66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat;
}
.vjs-default-skin .vjs-volume-bar .vjs-volume-handle {
  width: 0.5em;
  height: 0.5em;
  /* Assumes volume starts at 1.0. If you change the size of the
     handle relative to the volume bar, you'll need to update this value
     too. */

  left: 4.5em;
}
.vjs-default-skin .vjs-volume-handle:before {
  font-size: 0.9em;
  top: -0.2em;
  left: -0.2em;
  width: 1em;
  height: 1em;
}
/* The volume menu button is like menu buttons (captions/subtitles) but works
    a little differently. It needs to be possible to tab to the volume slider
    without hitting space bar on the menu button. To do this we're not using
    display:none to hide the slider menu by default, and instead setting the
    width and height to zero. */
.vjs-default-skin .vjs-volume-menu-button .vjs-menu {
  display: block;
  width: 0;
  height: 0;
  border-top-color: transparent;
}
.vjs-default-skin .vjs-volume-menu-button .vjs-menu .vjs-menu-content {
  height: 0;
  width: 0;
}
.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu,
.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing {
  border-top-color: rgba(7, 40, 50, 0.5);
  /* Same as ul background */

}
.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu .vjs-menu-content,
.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing .vjs-menu-content {
  height: 2.9em;
  width: 10em;
}
/* Progress
--------------------------------------------------------------------------------
*/
.vjs-default-skin .vjs-progress-control {
  position: absolute;
  left: 0;
  right: 0;
  width: auto;
  font-size: 0.3em;
  height: 1em;
  /* Set above the rest of the controls. */
  top: -1em;
  /* Shrink the bar slower than it grows. */
  /* transition */
  -webkit-transition: all 0.4s;
  -moz-transition: all 0.4s;
  -o-transition: all 0.4s;
  transition: all 0.4s;
}
/* On hover, make the progress bar grow to something that's more clickable.
    This simply changes the overall font for the progress bar, and this
    updates both the em-based widths and heights, as wells as the icon font */
.vjs-default-skin:hover .vjs-progress-control {
  font-size: .9em;
  /* Even though we're not changing the top/height, we need to include them in
      the transition so they're handled correctly. */

  /* transition */
  -webkit-transition: all 0.2s;
  -moz-transition: all 0.2s;
  -o-transition: all 0.2s;
  transition: all 0.2s;
}
/* Box containing play and load progresses. Also acts as seek scrubber. */
.vjs-default-skin .vjs-progress-holder {
  height: 100%;
}
/* Progress Bars */
.vjs-default-skin .vjs-progress-holder .vjs-play-progress,
.vjs-default-skin .vjs-progress-holder .vjs-load-progress,
.vjs-default-skin .vjs-progress-holder .vjs-load-progress div {
  position: absolute;
  display: block;
  height: 100%;
  margin: 0;
  padding: 0;
  /* updated by javascript during playback */

  width: 0;
  /* Needed for IE6 */
  left: 0;
  top: 0;
}
.vjs-default-skin .vjs-play-progress {
  /*
    Using a data URI to create the white diagonal lines with a transparent
      background. Surprisingly works in IE8.
      Created using http://www.patternify.com
    Changing the first color value will change the bar color.
    Also using a paralax effect to make the lines move backwards.
      The -50% left position makes that happen.
  */

  background: #66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat;
}
.vjs-default-skin .vjs-load-progress {
  background: #646464 /* IE8- Fallback */;
  background: rgba(255, 255, 255, 0.2);
}
/* there are child elements of the load progress bar that represent the
   specific time ranges that have been buffered */
.vjs-default-skin .vjs-load-progress div {
  background: #787878 /* IE8- Fallback */;
  background: rgba(255, 255, 255, 0.1);
}
.vjs-default-skin .vjs-seek-handle {
  width: 1.5em;
  height: 100%;
}
.vjs-default-skin .vjs-seek-handle:before {
  padding-top: 0.1em /* Minor adjustment */;
}
/* Live Mode
--------------------------------------------------------------------------------
*/
.vjs-default-skin.vjs-live .vjs-time-controls,
.vjs-default-skin.vjs-live .vjs-time-divider,
.vjs-default-skin.vjs-live .vjs-progress-control {
  display: none;
}
.vjs-default-skin.vjs-live .vjs-live-display {
  display: block;
}
/* Live Display
--------------------------------------------------------------------------------
*/
.vjs-default-skin .vjs-live-display {
  display: none;
  font-size: 1em;
  line-height: 3em;
}
/* Time Display
--------------------------------------------------------------------------------
*/
.vjs-default-skin .vjs-time-controls {
  font-size: 1em;
  /* Align vertically by making the line height the same as the control bar */
  line-height: 3em;
}
.vjs-default-skin .vjs-current-time {
  float: left;
}
.vjs-default-skin .vjs-duration {
  float: left;
}
/* Remaining time is in the HTML, but not included in default design */
.vjs-default-skin .vjs-remaining-time {
  display: none;
  float: left;
}
.vjs-time-divider {
  float: left;
  line-height: 3em;
}
/* Fullscreen
--------------------------------------------------------------------------------
*/
.vjs-default-skin .vjs-fullscreen-control {
  width: 3.8em;
  cursor: pointer;
  float: right;
}
.vjs-default-skin .vjs-fullscreen-control:before {
  content: "\e000";
}
/* Switch to the exit icon when the player is in fullscreen */
.vjs-default-skin.vjs-fullscreen .vjs-fullscreen-control:before {
  content: "\e00b";
}
/* Big Play Button (play button at start)
--------------------------------------------------------------------------------
Positioning of the play button in the center or other corners can be done more
easily in the skin designer. http://designer.videojs.com/
*/
.vjs-default-skin .vjs-big-play-button {
  left: 0.5em;
  top: 0.5em;
  font-size: 3em;
  display: block;
  z-index: 2;
  position: absolute;
  width: 4em;
  height: 2.6em;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  opacity: 1;
  /* Need a slightly gray bg so it can be seen on black backgrounds */
  /* background-color-with-alpha */
  background-color: #07141e;
  background-color: rgba(7, 20, 30, 0.7);
  border: 0.1em solid #3b4249;
  /* border-radius */
  -webkit-border-radius: 0.8em;
  -moz-border-radius: 0.8em;
  border-radius: 0.8em;
  /* box-shadow */
  -webkit-box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);
  -moz-box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);
  box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);
  /* transition */
  -webkit-transition: all 0.4s;
  -moz-transition: all 0.4s;
  -o-transition: all 0.4s;
  transition: all 0.4s;
}
/* Optionally center */
.vjs-default-skin.vjs-big-play-centered .vjs-big-play-button {
  /* Center it horizontally */
  left: 50%;
  margin-left: -2.1em;
  /* Center it vertically */
  top: 50%;
  margin-top: -1.4000000000000001em;
}
/* Hide if controls are disabled */
.vjs-default-skin.vjs-controls-disabled .vjs-big-play-button {
  display: none;
}
/* Hide when video starts playing */
.vjs-default-skin.vjs-has-started .vjs-big-play-button {
  display: none;
}
/* Hide on mobile devices. Remove when we stop using native controls
    by default on mobile  */
.vjs-default-skin.vjs-using-native-controls .vjs-big-play-button {
  display: none;
}
.vjs-default-skin:hover .vjs-big-play-button,
.vjs-default-skin .vjs-big-play-button:focus {
  outline: 0;
  border-color: #fff;
  /* IE8 needs a non-glow hover state */
  background-color: #505050;
  background-color: rgba(50, 50, 50, 0.75);
  /* box-shadow */
  -webkit-box-shadow: 0 0 3em #ffffff;
  -moz-box-shadow: 0 0 3em #ffffff;
  box-shadow: 0 0 3em #ffffff;
  /* transition */
  -webkit-transition: all 0s;
  -moz-transition: all 0s;
  -o-transition: all 0s;
  transition: all 0s;
}
.vjs-default-skin .vjs-big-play-button:before {
  content: "\e001";
  font-family: VideoJS;
  /* In order to center the play icon vertically we need to set the line height
     to the same as the button height */

  line-height: 2.6em;
  text-shadow: 0.05em 0.05em 0.1em #000;
  text-align: center /* Needed for IE8 */;
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
}
.vjs-error .vjs-big-play-button {
  display: none;
}
/* Error Display
--------------------------------------------------------------------------------
*/
.vjs-error-display {
  display: none;
}
.vjs-error .vjs-error-display {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}
.vjs-error .vjs-error-display:before {
  content: 'X';
  font-family: Arial;
  font-size: 4em;
  color: #666666;
  /* In order to center the play icon vertically we need to set the line height
     to the same as the button height */

  line-height: 1;
  text-shadow: 0.05em 0.05em 0.1em #000;
  text-align: center /* Needed for IE8 */;
  vertical-align: middle;
  position: absolute;
  left: 0;
  top: 50%;
  margin-top: -0.5em;
  width: 100%;
}
.vjs-error-display div {
  position: absolute;
  bottom: 1em;
  right: 0;
  left: 0;
  font-size: 1.4em;
  text-align: center;
  padding: 3px;
  background: #000000;
  background: rgba(0, 0, 0, 0.5);
}
.vjs-error-display a,
.vjs-error-display a:visited {
  color: #F4A460;
}
/* Loading Spinner
--------------------------------------------------------------------------------
*/
.vjs-loading-spinner {
  /* Should be hidden by default */
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 4em;
  line-height: 1;
  width: 1em;
  height: 1em;
  margin-left: -0.5em;
  margin-top: -0.5em;
  opacity: 0.75;
}
/* Show the spinner when waiting for data and seeking to a new time */
.vjs-waiting .vjs-loading-spinner,
.vjs-seeking .vjs-loading-spinner {
  display: block;
  /* only animate when showing because it can be processor heavy */
  /* animation */
  -webkit-animation: spin 1.5s infinite linear;
  -moz-animation: spin 1.5s infinite linear;
  -o-animation: spin 1.5s infinite linear;
  animation: spin 1.5s infinite linear;
}
/* Errors are unrecoverable without user interaction so hide the spinner */
.vjs-error .vjs-loading-spinner {
  display: none;
  /* ensure animation doesn't continue while hidden */
  /* animation */
  -webkit-animation: none;
  -moz-animation: none;
  -o-animation: none;
  animation: none;
}
.vjs-default-skin .vjs-loading-spinner:before {
  content: "\e01e";
  font-family: VideoJS;
  position: absolute;
  top: 0;
  left: 0;
  width: 1em;
  height: 1em;
  text-align: center;
  text-shadow: 0em 0em 0.1em #000;
}
@-moz-keyframes spin {
  0% {
    -moz-transform: rotate(0deg);
  }
  100% {
    -moz-transform: rotate(359deg);
  }
}
@-webkit-keyframes spin {
  0% {
    -webkit-transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(359deg);
  }
}
@-o-keyframes spin {
  0% {
    -o-transform: rotate(0deg);
  }
  100% {
    -o-transform: rotate(359deg);
  }
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(359deg);
  }
}
/* Menu Buttons (Captions/Subtitles/etc.)
--------------------------------------------------------------------------------
*/
.vjs-default-skin .vjs-menu-button {
  float: right;
  cursor: pointer;
}
.vjs-default-skin .vjs-menu {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0em;
  /* (Width of vjs-menu - width of button) / 2 */

  width: 0em;
  height: 0em;
  margin-bottom: 3em;
  border-left: 2em solid transparent;
  border-right: 2em solid transparent;
  border-top: 1.55em solid #000000;
  /* Same width top as ul bottom */

  border-top-color: rgba(7, 40, 50, 0.5);
  /* Same as ul background */

}
/* Button Pop-up Menu */
.vjs-default-skin .vjs-menu-button .vjs-menu .vjs-menu-content {
  display: block;
  padding: 0;
  margin: 0;
  position: absolute;
  width: 10em;
  bottom: 1.5em;
  /* Same bottom as vjs-menu border-top */

  max-height: 15em;
  overflow: auto;
  left: -5em;
  /* Width of menu - width of button / 2 */

  /* background-color-with-alpha */
  background-color: #07141e;
  background-color: rgba(7, 20, 30, 0.7);
  /* box-shadow */
  -webkit-box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);
  -moz-box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);
  box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);
}
.vjs-default-skin .vjs-menu-button:hover .vjs-control-content .vjs-menu,
.vjs-default-skin .vjs-control-content .vjs-menu.vjs-lock-showing {
  display: block;
}
.vjs-default-skin .vjs-menu-button ul li {
  list-style: none;
  margin: 0;
  padding: 0.3em 0 0.3em 0;
  line-height: 1.4em;
  font-size: 1.2em;
  text-align: center;
  text-transform: lowercase;
}
.vjs-default-skin .vjs-menu-button ul li.vjs-selected {
  background-color: #000;
}
.vjs-default-skin .vjs-menu-button ul li:focus,
.vjs-default-skin .vjs-menu-button ul li:hover,
.vjs-default-skin .vjs-menu-button ul li.vjs-selected:focus,
.vjs-default-skin .vjs-menu-button ul li.vjs-selected:hover {
  outline: 0;
  color: #111;
  /* background-color-with-alpha */
  background-color: #ffffff;
  background-color: rgba(255, 255, 255, 0.75);
  /* box-shadow */
  -webkit-box-shadow: 0 0 1em #ffffff;
  -moz-box-shadow: 0 0 1em #ffffff;
  box-shadow: 0 0 1em #ffffff;
}
.vjs-default-skin .vjs-menu-button ul li.vjs-menu-title {
  text-align: center;
  text-transform: uppercase;
  font-size: 1em;
  line-height: 2em;
  padding: 0;
  margin: 0 0 0.3em 0;
  font-weight: bold;
  cursor: default;
}
/* Subtitles Button */
.vjs-default-skin .vjs-subtitles-button:before {
  content: "\e00c";
}
/* Captions Button */
.vjs-default-skin .vjs-captions-button:before {
  content: "\e008";
}
/* Chapters Button */
.vjs-default-skin .vjs-chapters-button:before {
  content: "\e00c";
}
.vjs-default-skin .vjs-chapters-button.vjs-menu-button .vjs-menu .vjs-menu-content {
  width: 24em;
  left: -12em;
}
/* Replacement for focus outline */
.vjs-default-skin .vjs-captions-button:focus .vjs-control-content:before,
.vjs-default-skin .vjs-captions-button:hover .vjs-control-content:before {
  /* box-shadow */
  -webkit-box-shadow: 0 0 1em #ffffff;
  -moz-box-shadow: 0 0 1em #ffffff;
  box-shadow: 0 0 1em #ffffff;
}
/*
REQUIRED STYLES (be careful overriding)
================================================================================
When loading the player, the video tag is replaced with a DIV,
that will hold the video tag or object tag for other playback methods.
The div contains the video playback element (Flash or HTML5) and controls,
and sets the width and height of the video.

** If you want to add some kind of border/padding (e.g. a frame), or special
positioning, use another containing element. Otherwise you risk messing up
control positioning and full window mode. **
*/
.video-js {
  background-color: #000;
  position: relative;
  padding: 0;
  /* Start with 10px for base font size so other dimensions can be em based and
     easily calculable. */

  font-size: 10px;
  /* Allow poster to be vertically aligned. */

  vertical-align: middle;
  /*  display: table-cell; */
  /*This works in Safari but not Firefox.*/

  /* Provide some basic defaults for fonts */

  font-weight: normal;
  font-style: normal;
  /* Avoiding helvetica: issue #376 */

  font-family: Arial, sans-serif;
  /* Turn off user selection (text highlighting) by default.
     The majority of player components will not be text blocks.
     Text areas will need to turn user selection back on. */

  /* user-select */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
/* Playback technology elements expand to the width/height of the containing div
    <video> or <object> */
.video-js .vjs-tech {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
/* Fix for Firefox 9 fullscreen (only if it is enabled). Not needed when
   checking fullScreenEnabled. */
.video-js:-moz-full-screen {
  position: absolute;
}
/* Fullscreen Styles */
body.vjs-full-window {
  padding: 0;
  margin: 0;
  height: 100%;
  /* Fix for IE6 full-window. http://www.cssplay.co.uk/layouts/fixed.html */
  overflow-y: auto;
}
.video-js.vjs-fullscreen {
  position: fixed;
  overflow: hidden;
  z-index: 1000;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  width: 100% !important;
  height: 100% !important;
  /* IE6 full-window (underscore hack) */
  _position: absolute;
}
.video-js:-webkit-full-screen {
  width: 100% !important;
  height: 100% !important;
}
.video-js.vjs-fullscreen.vjs-user-inactive {
  cursor: none;
}
/* Poster Styles */
.vjs-poster {
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: contain;
  cursor: pointer;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
.vjs-poster img {
  display: block;
  margin: 0 auto;
  max-height: 100%;
  padding: 0;
  width: 100%;
}
/* Hide the poster after the video has started playing */
.video-js.vjs-has-started .vjs-poster {
  display: none;
}
/* Don't hide the poster if we're playing audio */
.video-js.vjs-audio.vjs-has-started .vjs-poster {
  display: block;
}
/* Hide the poster when controls are disabled because it's clickable
    and the native poster can take over */
.video-js.vjs-controls-disabled .vjs-poster {
  display: none;
}
/* Hide the poster when native controls are used otherwise it covers them */
.video-js.vjs-using-native-controls .vjs-poster {
  display: none;
}
/* Text Track Styles */
/* Overall track holder for both captions and subtitles */
.video-js .vjs-text-track-display {
  text-align: center;
  position: absolute;
  bottom: 4em;
  /* Leave padding on left and right */
  left: 1em;
  right: 1em;
}
/* Move captions down when controls aren't being shown */
.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display {
  bottom: 1em;
}
/* Individual tracks */
.video-js .vjs-text-track {
  display: none;
  font-size: 1.4em;
  text-align: center;
  margin-bottom: 0.1em;
  /* Transparent black background, or fallback to all black (oldIE) */
  /* background-color-with-alpha */
  background-color: #000000;
  background-color: rgba(0, 0, 0, 0.5);
}
.video-js .vjs-subtitles {
  color: #ffffff /* Subtitles are white */;
}
.video-js .vjs-captions {
  color: #ffcc66 /* Captions are yellow */;
}
.vjs-tt-cue {
  display: block;
}
/* Increase font-size when fullscreen */
.video-js.vjs-fullscreen .vjs-text-track {
  font-size: 3em;
}
/* Hide disabled or unsupported controls */
.vjs-default-skin .vjs-hidden {
  display: none;
}
.vjs-lock-showing {
  display: block !important;
  opacity: 1;
  visibility: visible;
}
/*  In IE8 w/ no JavaScript (no HTML5 shim), the video tag doesn't register.
    The .video-js classname on the video tag also isn't considered.
    This optional paragraph inside the video tag can provide a message to users
    about what's required to play video. */
.vjs-no-js {
  padding: 20px;
  color: #ccc;
  background-color: #333;
  font-size: 18px;
  font-family: Arial, sans-serif;
  text-align: center;
  width: 300px;
  height: 150px;
  margin: 0px auto;
}
.vjs-no-js a,
.vjs-no-js a:visited {
  color: #F4A460;
}
/* -----------------------------------------------------------------------------
The original source of this file lives at
https://github.com/videojs/video.js/blob/master/src/css/video-js.less */


text:
<?php

namespace App\CoreBundle\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface as FormBuilder;

class ForgottenPassword extends AbstractType
{

    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder->add('email');
    }

    public function getDefaultOptions(array $options)
    {
        return array('required' => false);
    }

    public function getName()
    {
        return 'forgottenpassword';
    }
}


text:
package petablox.analyses.syntax;

import petablox.program.visitors.IExprVisitor;
import petablox.project.Petablox;
import petablox.project.analyses.ProgramRel;
import soot.SootClass;
import soot.SootMethod;
import soot.Unit;
import soot.Value;
import soot.jimple.NegExpr;

@Petablox(name = "NegExpr", sign = "EXPR0,EXPR1:EXPR0_EXPR1")
public class RelNegExpr extends ProgramRel implements IExprVisitor {

	@Override
	public void visit(Unit q) { }

	@Override
	public void visit(SootMethod m) { }

	@Override
	public void visit(SootClass c) { }

	@Override
	public void visit(Value e) {
		if (e instanceof NegExpr) {
			NegExpr ne = (NegExpr) e;
			add(e, ne.getOp());
		}
	}

}


text:
require "danger/plugin_support/plugin"

module Danger
  # Handles interacting with VSTS inside a Dangerfile. Provides a few functions which wrap `pr_json` and also
  # through a few standard functions to simplify your code.
  #
  # @example Warn when a PR is classed as work in progress
  #
  #          warn "PR is classed as Work in Progress" if vsts.pr_title.include? "[WIP]"
  #
  # @example Declare a PR to be simple to avoid specific Danger rules
  #
  #          declared_trivial = (vsts.pr_title + vsts.pr_body).include?("#trivial")
  #
  # @example Ensure there is a summary for a PR
  #
  #          failure "Please provide a summary in the Pull Request description" if vsts.pr_body.length < 5
  #
  # @example Only accept PRs to the develop branch
  #
  #          failure "Please re-submit this PR to develop, we may have already fixed your issue." if vsts.branch_for_base != "develop"
  #
  # @example Highlight when a celebrity makes a pull request
  #
  #          message "Welcome, Danger." if vsts.pr_author == "dangermcshane"
  #
  # @example Ensure that all PRs have an assignee
  #
  #          warn "This PR does not have any assignees yet." unless vsts.pr_json["reviewers"].length == 0
  #
  # @example Send a message with links to a collection of specific files
  #
  #          if git.modified_files.include? "config/*.js"
  #            config_files = git.modified_files.select { |path| path.include? "config/" }
  #            message "This PR changes #{ vsts.markdown_link(config_files) }"
  #          end
  #
  # @example Highlight with a clickable link if a Package.json is changed
  #
  #         warn "#{vsts.markdown_link("Package.json")} was edited." if git.modified_files.include? "Package.json"
  #
  # @example Note an issue with a particular line on a file using the #L[num] syntax, e.g. `#L23`
  #
  #         linter_json = `my_linter lint "file"`
  #         results = JSON.parse linter_json
  #         unless results.empty?
  #           file, line, warning = result.first
  #           warn "#{vsts.markdown_link("#{file}#L#{line}")} has linter issue: #{warning}."
  #         end
  #
  #
  # @see  danger/danger
  # @tags core, vsts
  #
  class DangerfileVSTSPlugin < Plugin
    # So that this init can fail.
    def self.new(dangerfile)
      return nil if dangerfile.env.request_source.class != Danger::RequestSources::VSTS
      super
    end

    # The instance name used in the Dangerfile
    # @return [String]
    #
    def self.instance_name
      "vsts"
    end

    def initialize(dangerfile)
      super(dangerfile)
      @source = dangerfile.env.request_source
    end

    # @!group VSTS Misc
    # The hash that represents the PR's JSON. For an example of what this looks like
    # see the [Danger Fixture'd one](https://raw.githubusercontent.com/danger/danger/master/spec/fixtures/vsts_api/pr_response.json).
    # @return [Hash]
    def pr_json
      @source.pr_json
    end

    # @!group PR Metadata
    # The title of the Pull Request.
    # @return [String]
    #
    def pr_title
      @source.pr_json[:title].to_s
    end

    # @!group PR Metadata
    # The body text of the Pull Request.
    # @return [String]
    #
    def pr_description
      @source.pr_json[:description].to_s
    end
    alias pr_body pr_description

    # @!group PR Metadata
    # The username of the author of the Pull Request.
    # @return [String]
    #
    def pr_author
      @source.pr_json[:createdBy][:displayName].to_s
    end

    # @!group PR Commit Metadata
    # The branch to which the PR is going to be merged into.
    # @return [String]
    #
    def branch_for_base
      branch_name(:targetRefName)
    end

    # @!group PR Commit Metadata
    # A href that represents the current PR
    # @return [String]
    #
    def pr_link
      repo_path = @source.pr_json[:repository][:remoteUrl].to_s
      pull_request_id = @source.pr_json[:pullRequestId].to_s

      "#{repo_path}/pullRequest/#{pull_request_id}"
    end

    # @!group PR Commit Metadata
    # The branch to which the PR is going to be merged from.
    # @return [String]
    #
    def branch_for_head
      branch_name(:sourceRefName)
    end

    # @!group PR Commit Metadata
    # The base commit to which the PR is going to be merged as a parent.
    # @return [String]
    #
    def base_commit
      @source.pr_json[:lastMergeTargetCommit][:commitId].to_s
    end

    # @!group PR Commit Metadata
    # The head commit to which the PR is requesting to be merged from.
    # @return [String]
    #
    def head_commit
      @source.pr_json[:lastMergeSourceCommit][:commitId].to_s
    end

    # @!group VSTS Misc
    # Returns a list of Markdown links for a file, or files in the head repository.
    # It returns a string of multiple links if passed an array.
    # @param    [String or Array<String>] paths
    #           A list of strings to convert to Markdown links
    # @param    [Bool] full_path
    #           Shows the full path as the link's text, defaults to `true`.
    #
    # @return [String]
    #
    def markdown_link(paths, full_path: true)
      paths = [paths] unless paths.kind_of?(Array)
      commit = head_commit
      repo = pr_json[:repository][:remoteUrl].to_s

      paths = paths.map do |path|
        path, line = path.split("#L")
        url_path = path.start_with?("/") ? path : "/#{path}"
        text = full_path ? path : File.basename(path)
        url_path.gsub!(" ", "%20")
        line_ref = line ? "&line=#{line}" : ""
        create_markdown_link("#{repo}/commit/#{commit}?path=#{url_path}&_a=contents#{line_ref}", text)
      end

      return paths.first if paths.count < 2
      paths.first(paths.count - 1).join(", ") + " & " + paths.last
    end

    private

    def create_markdown_link(href, text)
      "[#{text}](#{href})"
    end

    def branch_name(key)
      repo_matches = @source.pr_json[key].to_s.match(%r{refs\/heads\/(.*)})
      repo_matches[1] unless repo_matches.nil?
    end
  end
end


text:
package revert.util;

public enum Directions {

	Left,
	Right,
	Up,
	Down;

}