text:
// Bedework x-property functions

// ========================================================================
// Bedework specific x-properties
// ========================================================================

var bwXPropertyAlias = "X-BEDEWORK-ALIAS";
var bwXPropertyImage = "X-BEDEWORK-IMAGE";
var bwXPropertyThumbImage = "X-BEDEWORK-THUMB-IMAGE";
var bwXPropertySubmittedBy = "X-BEDEWORK-SUBMITTEDBY";
var bwXPropertyLocation = "X-BEDEWORK-LOCATION";
var bwXPropertyContact = "X-BEDEWORK-CONTACT";
var bwXPropertyCategories = "X-BEDEWORK-CATEGORIES";
var bwXPropertySubmitAlias = "X-BEDEWORK-SUBMIT-ALIAS";
var bwXPropertySubmitComment = "X-BEDEWORK-SUBMIT-COMMENT";
var bwXPropertySubmitStatus = "X-BEDEWORK-SUBMIT-STATUS";
var bwXPropertySubmitterEmail = "X-BEDEWORK-SUBMITTER-EMAIL";
var bwXPropertySubmissionClaimant = "X-BEDEWORK-SUBMISSION-CLAIMANT";
var bwXPropertyMaxTickets = "X-BEDEWORK-MAX-TICKETS";
var bwXPropertyMaxTicketsPerUser = "X-BEDEWORK-MAX-TICKETS-PER-USER";
var bwXPropertyMaxWaitList = "X-BEDEWORK-WAIT-LIST-LIMIT";

var bwXPropertyRegistrationStart = "X-BEDEWORK-REGISTRATION-START";
var bwXPropertyRegistrationEnd = "X-BEDEWORK-REGISTRATION-END";
var bwXPropertyRegistrationForm = "X-BEDEWORK-REGISTRATION-FORM";
var bwXPropertyInstanceOnly = "X-BEDEWORK-INSTANCE-ONLY";

var bwXParamDisplayName = "X-BEDEWORK-PARAM-DISPLAYNAME";
var bwXParamPath = "X-BEDEWORK-PARAM-PATH";
var bwXParamAliasPath = "X-BEDEWORK-PARAM-ALIASPATH";
var bwXParamDescription = "X-BEDEWORK-PARAM-DESCRIPTION";
var bwXParamAlt = "X-BEDEWORK-PARAM-ALT";
var bwXParamWidth = "X-BEDEWORK-PARAM-WIDTH";
var bwXParamHeight = "X-BEDEWORK-PARAM-HEIGHT";
var bwXParamSubAddress = "X-BEDEWORK-PARAM-SUBADDRESS";
var bwXParamURL = "X-BEDEWORK-PARAM-URL";
var bwXParamPhone = "X-BEDEWORK-PARAM-PHONE";
var bwXParamEmail = "X-BEDEWORK-PARAM-EMAIL";
var bwXParamClaimantUser = "X-BEDEWORK-SUBMISSION-CLAIMANT-USER";

// ========================================================================
// x-property functions
// ========================================================================

var bwXProps = new BwXProperties();

/* An xproperty
 * name:   String - name of x-property, e.g. "X-BEDEWORK-IMAGE"
 * params: 2-D Array of parameter name/value pairs,
 *         e.g. params[0] = ["X-BEDEWORK-PARAM-DESCRIPTION","a lovely image"]
 * value:  String - value of x-property
 */
function BwXProperty(name, params, value) {
  this.name = name;
  this.params = params;
  this.value = value;

  this.format = function() {
    var curXparams = "";
    if (this.params.length) {
      for (var i = 0; i < this.params.length; i++) {
        if (this.params[i][1] != "") {
          curXparams += ";" + this.params[i][0];
          // if parameter values contain ";" or ":" or "," they must be quoted
          if (this.params[i][1].indexOf(":") != -1 || this.params[i][1].indexOf(";") != -1 || this.params[i][1].indexOf(",") != -1) {
            curXparams += "=\"" + this.params[i][1] + "\"";
          } else {
            curXparams += "=" + this.params[i][1];
          }
        }
      }
    }
    return this.name + curXparams + ":" + this.value;
  }
}

function BwXProperties() {
  var xproperties = new Array();

  this.init = function(name, params, value) {
     var xprop = new BwXProperty(name, params, value);
     xproperties.push(xprop);
  }

  // update an xproperty
  // isUnique - only one xproperty of the given name should exist
  // isUniqueByValue - only one xproperty with name and value pair should exist
  this.update = function(name, params, value, isUnique, isUniqueByValue) {
    // strip out any double quotes in the parameter values:
    if (params.length) {
      for (var i = 0; i < params.length; i++) {
        var strippedParamValue = "";
        for (var j = 0; j < params[i][1].length; j++) {
          var currWord = params[i][1];
          var c = currWord.charAt(j); // Helps IE to get the desired character at the specified position.
          if (c != '"') {
            strippedParamValue += c;
          }
        }
        params[i][1] = strippedParamValue;
      }
    }

    // add or update the xproperty:
    var xprop = new BwXProperty(name, params, value);
    if (isUniqueByValue) {
      // If it doesn't exist add it.  If it already exists do nothing.
      index = this.getIndexByValue(name,value);
      if (index < 0) {
        xproperties.push(xprop);
      }
    } else if (isUnique) {
      // If it doesn't exist add it.  Otherwise, update it.
      index = this.getIndex(name);
      if (index < 0) {
        xproperties.push(xprop);
      } else {
        xproperties.splice(index,1,xprop);
      }
    } else {
      xproperties.push(xprop);
    }
  }

  this.remove = function(name) {
    index = this.getIndex(name);
    if (index > -1) {
      xproperties.splice(index,1);
    }
  }

  this.removeByValue = function(name, value) {
    index = this.getIndexByValue(name, value);
    if (index > -1) {
      xproperties.splice(index,1);
    }
  }

  this.getIndex = function(name) {
    for (var i = 0; i < xproperties.length; i++) {
      var curXprop = xproperties[i];
      if (curXprop.name == name) {
        return i;
      }
    }
    return -1;
  }

  this.getIndexByValue = function(name,value) {
    for (var i = 0; i < xproperties.length; i++) {
      var curXprop = xproperties[i];
      if (curXprop.name == name) {
        if (curXprop.value == value) {
          return i;
        }
      }
    }
    return -1;
  }

  this.display = function(formObj) { // for debugging
    var textOutput = '';
    for (var i = 0; i < xproperties.length; i++) {
      textOutput += xproperties[i].format() + "\n";
    }
    return textOutput;
  }

  this.generate = function(formObj) {
    for (var i = 0; i < xproperties.length; i++) {
      var xpropField = document.createElement("input");
      xpropField.type = "hidden"; // change type prior to appending to DOM
      formObj.appendChild(xpropField);
      xpropField.name = "xproperty";
      xpropField.value = xproperties[i].format();
    }
  }

}


text:
/*  Title:      Pure/General/file.scala
    Author:     Makarius

File-system operations.
*/

package isabelle

import java.io.{BufferedWriter, OutputStreamWriter, FileOutputStream, BufferedOutputStream,
  OutputStream, InputStream, FileInputStream, BufferedInputStream, BufferedReader,
  InputStreamReader, File => JFile, IOException}
import java.nio.file.{StandardOpenOption, StandardCopyOption, Path => JPath,
  Files, SimpleFileVisitor, FileVisitOption, FileVisitResult, FileSystemException}
import java.nio.file.attribute.BasicFileAttributes
import java.net.{URL, MalformedURLException}
import java.util.zip.{GZIPInputStream, GZIPOutputStream}
import java.util.regex.Pattern
import java.util.EnumSet

import org.tukaani.xz.{XZInputStream, XZOutputStream}

import scala.collection.mutable
import scala.util.matching.Regex

object File
{
  /* standard path (Cygwin or Posix) */

  def standard_path(path: Path): String = path.expand.implode

  def standard_path(platform_path: String): String =
    if (Platform.is_windows) {
      val Platform_Root = new Regex("(?i)" +
        Pattern.quote(Isabelle_System.cygwin_root()) + """(?:\\+|\z)(.*)""")
      val Drive = new Regex("""([a-zA-Z]):\\*(.*)""")

      platform_path.replace('/', '\\') match {
        case Platform_Root(rest) => "/" + rest.replace('\\', '/')
        case Drive(letter, rest) =>
          "/cygdrive/" + Word.lowercase(letter) +
            (if (rest == "") "" else "/" + rest.replace('\\', '/'))
        case path => path.replace('\\', '/')
      }
    }
    else platform_path

  def standard_path(file: JFile): String = standard_path(file.getPath)

  def standard_url(name: String): String =
    try {
      val url = new URL(name)
      if (url.getProtocol == "file" && Url.is_wellformed_file(name))
        standard_path(Url.parse_file(name))
      else name
    }
    catch { case _: MalformedURLException => standard_path(name) }

  /* platform path (Windows or Posix) */

  private val Cygdrive = new Regex("/cygdrive/([a-zA-Z])($|/.*)")
  private val Named_Root = new Regex("//+([^/]*)(.*)")

  def platform_path(standard_path: String): String =
    if (Platform.is_windows) {
      val result_path = new StringBuilder
      val rest =
        standard_path match {
          case Cygdrive(drive, rest) =>
            result_path ++= (Word.uppercase(drive) + ":" + JFile.separator)
            rest
          case Named_Root(root, rest) =>
            result_path ++= JFile.separator
            result_path ++= JFile.separator
            result_path ++= root
            rest
          case path if path.startsWith("/") =>
            result_path ++= Isabelle_System.cygwin_root()
            path
          case path => path
        }
      for (p <- space_explode('/', rest) if p != "") {
        val len = result_path.length
        if (len > 0 && result_path(len - 1) != JFile.separatorChar)
          result_path += JFile.separatorChar
        result_path ++= p
      }
      result_path.toString
    }
    else standard_path

  def platform_path(path: Path): String = platform_path(standard_path(path))
  def platform_file(path: Path): JFile = new JFile(platform_path(path))

  /* platform files */

  def absolute(file: JFile): JFile = file.toPath.toAbsolutePath.normalize.toFile
  def absolute_name(file: JFile): String = absolute(file).getPath

  def canonical(file: JFile): JFile = file.getCanonicalFile
  def canonical_name(file: JFile): String = canonical(file).getPath

  def path(file: JFile): Path = Path.explode(standard_path(file))
  def pwd(): Path = path(Path.current.absolute_file)

  /* relative paths */

  def relative_path(base: Path, other: Path): Option[Path] =
  {
    val base_path = base.file.toPath
    val other_path = other.file.toPath
    if (other_path.startsWith(base_path))
      Some(path(base_path.relativize(other_path).toFile))
    else None
  }

  def rebase_path(base: Path, other: Path): Option[Path] =
    relative_path(base, other).map(base + _)

  /* bash path */

  def bash_path(path: Path): String = Bash.string(standard_path(path))
  def bash_path(file: JFile): String = Bash.string(standard_path(file))

  /* directory entries */

  def check_dir(path: Path): Path =
    if (path.is_dir) path else error("No such directory: " + path)

  def check_file(path: Path): Path =
    if (path.is_file) path else error("No such file: " + path)

  /* directory content */

  def read_dir(dir: Path): List[String] =
  {
    if (!dir.is_dir) error("No such directory: " + dir.toString)
    val files = dir.file.listFiles
    if (files == null) Nil
    else files.toList.map(_.getName).sorted
  }

  def find_files(
    start: JFile,
    pred: JFile => Boolean = _ => true,
    include_dirs: Boolean = false,
    follow_links: Boolean = false): List[JFile] =
  {
    val result = new mutable.ListBuffer[JFile]
    def check(file: JFile) { if (pred(file)) result += file }

    if (start.isFile) check(start)
    else if (start.isDirectory) {
      val options =
        if (follow_links) EnumSet.of(FileVisitOption.FOLLOW_LINKS)
        else EnumSet.noneOf(classOf[FileVisitOption])
      Files.walkFileTree(start.toPath, options, Integer.MAX_VALUE,
        new SimpleFileVisitor[JPath] {
          override def preVisitDirectory(path: JPath, attrs: BasicFileAttributes): FileVisitResult =
          {
            if (include_dirs) check(path.toFile)
            FileVisitResult.CONTINUE
          }
          override def visitFile(path: JPath, attrs: BasicFileAttributes): FileVisitResult =
          {
            val file = path.toFile
            if (include_dirs || !file.isDirectory) check(file)
            FileVisitResult.CONTINUE
          }
        }
      )
    }

    result.toList
  }

  /* read */

  def read(file: JFile): String = Bytes.read(file).text
  def read(path: Path): String = read(path.file)

  def read_stream(reader: BufferedReader): String =
  {
    val output = new StringBuilder(100)
    var c = -1
    while ({ c = reader.read; c != -1 }) output += c.toChar
    reader.close
    output.toString
  }

  def read_stream(stream: InputStream): String =
    read_stream(new BufferedReader(new InputStreamReader(stream, UTF8.charset)))

  def read_gzip(file: JFile): String =
    read_stream(new GZIPInputStream(new BufferedInputStream(new FileInputStream(file))))
  def read_gzip(path: Path): String = read_gzip(path.file)

  def read_xz(file: JFile): String =
    read_stream(new XZInputStream(new BufferedInputStream(new FileInputStream(file))))
  def read_xz(path: Path): String = read_xz(path.file)

  /* read lines */

  def read_line(reader: BufferedReader): Option[String] =
  {
    val line =
      try { reader.readLine}
      catch { case _: IOException => null }
    if (line == null) None else Some(line)
  }

  def read_lines(reader: BufferedReader, progress: String => Unit): List[String] =
  {
    val result = new mutable.ListBuffer[String]
    var line: Option[String] = None
    while ({ line = read_line(reader); line.isDefined }) {
      progress(line.get)
      result += line.get
    }
    reader.close
    result.toList
  }

  /* write */

  def write_file(file: JFile, text: CharSequence, make_stream: OutputStream => OutputStream)
  {
    val stream = make_stream(new FileOutputStream(file))
    using(new BufferedWriter(new OutputStreamWriter(stream, UTF8.charset)))(_.append(text))
  }

  def write(file: JFile, text: CharSequence): Unit = write_file(file, text, s => s)
  def write(path: Path, text: CharSequence): Unit = write(path.file, text)

  def write_gzip(file: JFile, text: CharSequence): Unit =
    write_file(file, text, (s: OutputStream) => new GZIPOutputStream(new BufferedOutputStream(s)))
  def write_gzip(path: Path, text: CharSequence): Unit = write_gzip(path.file, text)

  def write_xz(file: JFile, text: CharSequence, options: XZ.Options): Unit =
    File.write_file(file, text, s => new XZOutputStream(new BufferedOutputStream(s), options))
  def write_xz(file: JFile, text: CharSequence): Unit = write_xz(file, text, XZ.options())
  def write_xz(path: Path, text: CharSequence, options: XZ.Options): Unit =
    write_xz(path.file, text, options)
  def write_xz(path: Path, text: CharSequence): Unit = write_xz(path, text, XZ.options())

  def write_backup(path: Path, text: CharSequence)
  {
    if (path.is_file) move(path, path.backup)
    write(path, text)
  }

  def write_backup2(path: Path, text: CharSequence)
  {
    if (path.is_file) move(path, path.backup2)
    write(path, text)
  }

  /* append */

  def append(file: JFile, text: CharSequence): Unit =
    Files.write(file.toPath, UTF8.bytes(text.toString),
      StandardOpenOption.APPEND, StandardOpenOption.CREATE)

  def append(path: Path, text: CharSequence): Unit = append(path.file, text)

  /* eq */

  def eq(file1: JFile, file2: JFile): Boolean =
    try { java.nio.file.Files.isSameFile(file1.toPath, file2.toPath) }
    catch { case ERROR(_) => false }

  def eq(path1: Path, path2: Path): Boolean = eq(path1.file, path2.file)

  /* eq_content */

  def eq_content(file1: JFile, file2: JFile): Boolean =
    if (eq(file1, file2)) true
    else if (file1.length != file2.length) false
    else Bytes.read(file1) == Bytes.read(file2)

  def eq_content(path1: Path, path2: Path): Boolean = eq_content(path1.file, path2.file)

  /* copy */

  def copy(src: JFile, dst: JFile)
  {
    val target = if (dst.isDirectory) new JFile(dst, src.getName) else dst
    if (!eq(src, target))
      Files.copy(src.toPath, target.toPath,
        StandardCopyOption.COPY_ATTRIBUTES,
        StandardCopyOption.REPLACE_EXISTING)
  }

  def copy(path1: Path, path2: Path): Unit = copy(path1.file, path2.file)

  /* move */

  def move(src: JFile, dst: JFile)
  {
    val target = if (dst.isDirectory) new JFile(dst, src.getName) else dst
    if (!eq(src, target))
      Files.move(src.toPath, target.toPath, StandardCopyOption.REPLACE_EXISTING)
  }

  def move(path1: Path, path2: Path): Unit = move(path1.file, path2.file)

  /* symbolic link */

  def link(src: Path, dst: Path, force: Boolean = false)
  {
    val src_file = src.file
    val dst_file = dst.file
    val target = if (dst_file.isDirectory) new JFile(dst_file, src_file.getName) else dst_file

    if (force) target.delete

    try { Files.createSymbolicLink(target.toPath, src_file.toPath) }
    catch {
      case _: UnsupportedOperationException if Platform.is_windows =>
        Cygwin.link(standard_path(src), target)
      case _: FileSystemException if Platform.is_windows =>
        Cygwin.link(standard_path(src), target)
    }
  }

  /* permissions */

  def is_executable(path: Path): Boolean =
  {
    if (Platform.is_windows) Isabelle_System.bash("test -x " + bash_path(path)).check.ok
    else path.file.canExecute
  }

  def set_executable(path: Path, flag: Boolean)
  {
    if (Platform.is_windows && flag) Isabelle_System.bash("chmod a+x " + bash_path(path)).check
    else if (Platform.is_windows) Isabelle_System.bash("chmod a-x " + bash_path(path)).check
    else path.file.setExecutable(flag, false)
  }
}

redpajama_set_name: RedPajamaGithub


text:
module LLT
  module Helpers
    module Functions

      # Objects that use this module must implement #functions,
      # which shall respond to #include?
      def has_function?(function)
        functions.include?(function)
      end

      def has_not_function? function
        ! has_function?(function)
      end

      # Shortcut methods
      def has_f?(function)
        # Do not alias or delegate.
        #
        # It's (slightly) faster that way and this method will usually
        # get lots of calls.
        functions.include?(function)
      end
      alias :has_not_f? :has_not_function?
    end
  end
end


text:
A boilerplate for Node.js web applications with Gulp.

**Live Demo:** [https://sean-boilerplate.herokuapp.com](https://sean-boilerplate.herokuapp.com)

---

Technologies
--------
- [Sequelize](http://docs.sequelizejs.com/en/latest/)
- [Express.js ](http://expressjs.com/)
- [AngularJS](https://angularjs.org/)
- [Node.js](https://nodejs.org/en/)
- Pure Javascript, HTML and CSS

Features
--------
- **Gulp automated workflow** based on the [generator-gulp-angular](https://github.com/Swiip/generator-gulp-angular)
 - Using Nodemon and Browsersync for live development
 - Fully optimized build process
 - Unit test with Karma and E2E test with Protractor
- **Token-based Authentication** using [Satellizer](https://github.com/sahat/satellizer)
 - Local Authentication using Email and Password
 - Support for Google, Facebook, Twitter and Github
 - **Account Management**
    - Profile
    - Change Password
    - Forgot Password (Not done yet)
    - Link multiple providers to one account
    - Delete Account
- **Postgres** is the default database

Usage
--------
* `gulp` or `gulp build` to build an optimized version of your application in `/dist`
* `gulp serve` to launch a browser sync server on your source files
* `gulp serve:dist` to launch a server on your optimized application
* `gulp test` to launch your unit tests with Karma
* `gulp test:auto` to launch your unit tests with Karma in watch mode
* `gulp protractor` to launch your e2e tests with Protractor on test env with seed
* `gulp protractor:dist` to launch your e2e tests with Protractor on the dist files on prod env with seed

License
-------

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
<?php

namespace Ares\CoreBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class UserTaskType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('chrono')
            ->add('user')
            ->add('task')
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Ares\CoreBundle\Entity\UserTask'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'ares_corebundle_usertask';
    }
}


text:
const Model = require('./model');

let _models = {};
let _adapter = null;

class ModelFactory {
    static model(name, schema, schemaOptions, indexes) {
        const key = name;

        if (!_models[key]) {
            _models[key] = new Model(name, schema, schemaOptions, indexes);
            _models[key].setAdapter(_adapter);
        }

        return _models[key];
    }

    static sync() {
        let promises = [];

        for (let key in _models) {
            promises.push(_models[key].sync());
        }

        return Promise.all(promises);
    }

    static setAdapter(adapter) {
        _adapter = adapter;

        for (let key in _models) {
            _models[key].setAdapter(_adapter);
        }
    }

    static clearInstances(){
        _models = {};
    }
}

module.exports = ModelFactory;


text:
from ciscoconfparse import CiscoConfParse

# Read cisco_ipsec.text file using CiscoConfParse
cisco_cfg = CiscoConfParse("cisco_ipsec.txt")

# Find all entries that begin with crypto map CRYPTO
crypto_map =  cisco_cfg.find_objects(r"^crypto map CRYPTO")

# Now print the CRYPTO map entries found
print "\nPrinting the crypto map CRYPTO entries found\n"
for i in crypto_map:
    print i.text
print "\n"

# Find all entries that are using pfs group2
crypto_PFS = cisco_cfg.find_objects_w_child(parentspec=r"^crypto map", childspec=r"pfs group2")

# Print all crypto map using pfs group2
print "\nPrinting the crypto map entries using pfs group2\n"
for i in crypto_PFS:
    print i.text
print "\n"

# Find all crypto maps that are not usind AES transform-set
crypto_noAES =  cisco_cfg.find_objects_wo_child(parentspec=r"^crypto map", childspec=r"set transform-set AES")

# Print all maps without AES and config under eact.
print "\nPrinting the crypto map entries using pfs group2\n"
for i in crypto_noAES:
    print i.text
    for j in i.children:
        print j.text


text:
/* 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.
 */

package org.flowable.rest.service.api.runtime.process;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.Authorization;
import org.flowable.engine.runtime.Execution;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author Frederik Heremans
 */
@RestController
@Api(tags = { "Process Instance Variables" }, description = "Manage Process Instances Variables", authorizations = { @Authorization(value = "basicAuth") })
public class ProcessInstanceVariableDataResource extends BaseExecutionVariableResource {

    @ApiOperation(value = "Get the binary data for a variable", tags = { "Process Instance Variables" }, nickname = "getProcessInstanceVariableData")
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Indicates the process instance was found and the requested variables are returned."),
            @ApiResponse(code = 404, message = "Indicates the requested task was not found or the task doesn't have a variable with the given name (in the given scope). Status message provides additional information.")
    })
    @ResponseBody
    @GetMapping(value = "/runtime/process-instances/{processInstanceId}/variables/{variableName}/data")
    public byte[] getVariableData(@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "variableName") @PathVariable("variableName") String variableName,
            @RequestParam(value = "scope", required = false) String scope,
            HttpServletRequest request, HttpServletResponse response) {

        Execution execution = getProcessInstanceFromRequest(processInstanceId);
        return getVariableDataByteArray(execution, variableName, scope, response);
    }
}


text:
using namespace std;

void printAdjacencyList(int** tree, const int amountOfVertexes);

int main()
{
    const char filename[] = "input.txt";
    Graph* myGraph = parseFile(filename);
    if (myGraph == nullptr) {
        printf("ERROR: \'%s\' cannot be opened", filename);
        return 1;
    }
    printf("\n\tADJACENCY MATRIX: \n\n");
    printGraph(myGraph);
    printf("\n");

    int** minCoveringTree = primAlgorithm(myGraph);
    int graphSize = getAmountOfVertexes(myGraph);
    printf("\n\tMINIMUM SPANNING TREE: \n\n");
    printAdjacencyList(minCoveringTree, graphSize);
    printf("(spanning tree is presented in adjacency list form) \n\n");

    for (int i = 0; i < graphSize - 1; ++i) {
        delete[] minCoveringTree[i];
    }
    delete[] minCoveringTree;
    deleteGraph(myGraph);
    return 0;
}

void printAdjacencyList(int** tree, const int amountOfVertexes)
{
    for (int j = 0; j < 2; ++j) {
        printf("|");
        for (int i = 0; i < amountOfVertexes - 1; ++i) {
            printf("%3d |", tree[i][j]);
        }
        printf("\n");
    }
    printf("\n");
}


text:
/*
 * File Name: tree.cpp
 *
 * Author: Evan Pete Walsh
 * Contact: epwalsh@iastate.edu
 *
 * Creation Date: 17-06-2015
 * Last Modified: Sun Jul 19 21:37:47 2015
 *
 * ==========================================================================
 */

#include <fstream>
#include <getopt.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <unistd.h>
#include <vector>

#include "utils.hpp"

#define ANSI_COLOR_RED     "\x1b[31m"
#define ANSI_COLOR_GREEN   "\x1b[32m"
#define ANSI_COLOR_YELLOW  "\x1b[33m"
#define ANSI_COLOR_BLUE    "\x1b[34m"
#define ANSI_COLOR_MAGENTA "\x1b[35m"
#define ANSI_COLOR_CYAN    "\x1b[36m"
#define ANSI_COLOR_BOLD    "\x1b[0;1m"
#define ANSI_COLOR_RESET   "\x1b[0m"

int main(int argc, char ** argv) {
    char *theme, *file_name, *color;
    int opt, optpos = 0;
    bool show_hidden, write_to_file, colorful;
    std::ofstream file;
    std::vector<std::string> all_files;
    std::vector<std::string> tree;
    std::string path;

    // Define options.
    static struct option optargs[] = {
        {"help",    no_argument,       NULL, 'h'},
        {"showall", no_argument,       NULL, 's'},
        {"outfile", required_argument, NULL, 'o'},
        {"theme",   required_argument, NULL, 't'},
        {"color",   required_argument, NULL, 'c'},
        {0, 0, 0, 0}
    };

    while((opt = getopt_long(argc, argv, "hst:o:c:", optargs, &optpos)) != -1) {
        switch(opt) {
            case 't':
                theme = optarg;
                fprintf(stderr, ANSI_COLOR_RED
                                "Warning: themes are currently not supported, "
                                "theme argument ignored.\n"
                                ANSI_COLOR_RESET);
                break;
            case 's':
                show_hidden = true;
                break;
            case 'o':
                write_to_file = true;
                file_name = optarg;
                break;
            case 'c':
                colorful = true;
                color = optarg;
                break;
            case 'h':
                fprintf(stderr,
                        "To nourish and grow your beautiful file tree, study the options below.\n"
                        "Usage: %s [-s] [-t theme] [-c color] [-o outfile] [directory]\n"
                        ANSI_COLOR_BOLD
                        "Option     Abbr.    Args.\n" ANSI_COLOR_RESET
                        "--showall  -s       N/A  \n"
                        "--theme    -t       theme\n"
                        "--color    -c       color\n"
                        "--outfile  -o       file \n"
                        "...                 directory\n", argv[0]);
                exit(EXIT_FAILURE);
            default:
                fprintf(stderr,
                        "Usage: %s [-s] [-t theme] [-c color] [-o outfile] [directory]\n",
                        argv[0]);
                exit(EXIT_FAILURE);
        }
    }

    /*
     * Arguments supplied without an option prefix will be left over. If this
     * the case, optind (which points to the next argument in argv) will be
     * pointing to the next left-over argument. The first argument that was
     * supplied without an option will be assumed to be a path. Of course,
     * we will check if the path is valid below.
     */

    // Check if user supplied a path.
    if (argc > optind) { /* user did supply a path */
        /* The path no longer has to be the last argument specified.
        // The path should be the last argument specified.
        if (optind != argc - 1) {
            fprintf(stderr,
                    ANSI_COLOR_RED
                    "Arguments are not recognized or are out of order.\n"
                    "Usage: %s [-s] [-t theme] [-o outfile] [directory]\n"
                    ANSI_COLOR_RESET,
                    argv[0]);
            exit(EXIT_FAILURE);
        }
        */
        char *path_pointer = argv[optind];
        path = path_pointer;
        // Check if the path is actually valid.
        if (!is_dir(path)) {
            fprintf(stderr,
                    ANSI_COLOR_RED
                    "Error: invalid argument, %s is not a directory.\n"
                    ANSI_COLOR_RESET,
                    argv[optind]);
            fprintf(stderr,
                    "Usage: %s [-s] [-t theme] [-c color] [-o outfile] [directory]\n",
                    argv[0]);
            exit(EXIT_FAILURE);
        }
    } else { /* user did not supply a path */
        path = pwd();
    }

    grow_files(all_files, path);
    grow_tree(tree, all_files, show_hidden);

    if (write_to_file) {
        // Write the tree to file.
        file.open(file_name);
        file << get_file_name(path) << std::endl;
        for (std::vector<std::string>::iterator i = tree.begin();
                                                i != tree.end();
                                                ++i) {
            file << *i;
        }
        file.close();
        if (colorful)
            fprintf(stderr,
                    ANSI_COLOR_RED
                    "Warning: --color argument ignored.\n"
                    ANSI_COLOR_RESET);
        fprintf(stdout,
                ANSI_COLOR_GREEN
                "Your lush file tree has been written to %s\n"
                ANSI_COLOR_RESET,
                file_name);
    } else {
        // Print the tree.
        if (colorful) {
            if (strcmp(color, "red") == 0)
                printf(ANSI_COLOR_RED);
            else if (strcmp(color, "green") == 0)
                printf(ANSI_COLOR_GREEN);
            else if (strcmp(color, "yellow") == 0)
                printf(ANSI_COLOR_YELLOW);
            else if (strcmp(color, "blue") == 0)
                printf(ANSI_COLOR_BLUE);
            else if (strcmp(color, "magenta") == 0)
                printf(ANSI_COLOR_MAGENTA);
            else if (strcmp(color, "cyan") == 0)
                printf(ANSI_COLOR_CYAN);
            else {
                fprintf(stderr, ANSI_COLOR_RED "Error: invalid color.\n"
                                ANSI_COLOR_RESET
                                "Colors are " ANSI_COLOR_RED
                                "red, "       ANSI_COLOR_GREEN
                                "green, "     ANSI_COLOR_YELLOW
                                "yellow, "    ANSI_COLOR_BLUE
                                "blue, "      ANSI_COLOR_MAGENTA
                                "magenta, "   ANSI_COLOR_RESET
                                "and "        ANSI_COLOR_CYAN
                                "cyan"        ANSI_COLOR_RESET ".\n");
                exit(EXIT_FAILURE);
            }
        }
        std::cout << get_file_name(path) << std::endl;
        for (std::vector<std::string>::iterator i = tree.begin();
                                                i != tree.end();
                                                ++i) {
            std::cout << *i;
        }
        // Don't forget to reset the color!
        if (colorful) printf(ANSI_COLOR_RESET);
    }

    return 0;
}


text:
package com.vaadin.addon.charts.themes;

import com.vaadin.addon.charts.model.style.*;

/**
 * The old default theme for Vaadin Charts 1.x
 */
@SuppressWarnings("serial")
public class VaadinTheme extends Theme {

    protected static final int BORDER_RADIUS = 2;
    protected final static SolidColor COLOR1 = new SolidColor(74, 112, 147);
    protected final static SolidColor COLOR2 = new SolidColor(73, 207, 229);
    protected final static SolidColor COLOR3 = new SolidColor(255, 188, 65);
    protected final static SolidColor COLOR4 = new SolidColor(194, 71, 88);
    protected final static SolidColor COLOR5 = new SolidColor(119, 170, 84);
    protected final static SolidColor COLOR6 = new SolidColor(112, 113, 200);
    protected final static SolidColor COLOR7 = new SolidColor(197, 143, 186);
    protected final static SolidColor COLOR8 = new SolidColor(181, 185, 198);

    protected final static SolidColor TITLE_COLOR = new SolidColor(68, 105, 139);
    protected final static SolidColor SUBTITLE_COLOR = new SolidColor(151, 151,
            151);
    protected final static SolidColor LINE_COLOR = new SolidColor(229, 229, 229);
    protected final static SolidColor TEXT_COLOR = new SolidColor(151, 151, 151);
    protected final static SolidColor GRID_COLOR = new SolidColor(151, 151, 151);
    protected final static SolidColor LABEL_COLOR = new SolidColor(151, 151,
            151);

    protected final static SolidColor BGCOLOR = new SolidColor(255, 255, 255);
    protected final static SolidColor BGCOLOR_LIGHT_GRAY = new SolidColor(0, 0,
            0, 0.02);
    protected final static SolidColor TRANSPARENT_COLOR = new SolidColor(255,
            255, 255, 0.0);

    protected final static String DEFAULT_FONT_FAMILIES = "Arial";
    protected static final Color LEGEND_TEXT_COLOR = new SolidColor(85, 85, 85);

    public VaadinTheme() {
        setColors(COLOR1, COLOR2, COLOR3, COLOR4, COLOR5, COLOR6, COLOR7,
                COLOR8);
        Style style = new Style();
        style.setFontFamily(DEFAULT_FONT_FAMILIES);
        style.setFontSize("12px");
        getChart().setStyle(style);

        getTitle().setColor(TITLE_COLOR);
        getTitle().setFontSize("16px");
        getTitle().setFontWeight(FontWeight.BOLD);

        getSubtitle().setColor(SUBTITLE_COLOR);
        getSubtitle().setFontWeight(FontWeight.NORMAL);

        getChart().setClassName("vaadin-chart");
        getChart().setPlotBackgroundImage("");
        getChart().setBackgroundColor(BGCOLOR);
        getChart().setPlotBackgroundColor(TRANSPARENT_COLOR);
        getChart().setPlotBorderWidth(0);
        getChart().setBorderRadius(0);
        getChart().setPlotShadow(false);

        setAxisDefaults(getxAxis());

        setAxisDefaults(getyAxis());

        getTooltip().setBackgroundColor(new SolidColor(255, 255, 255));
        getTooltip().setBorderWidth(1);
        getTooltip().setBorderRadius(BORDER_RADIUS);
        getTooltip().getStyle().setColor(TITLE_COLOR);

        getLegend().setItemStyle(new Style());
        getLegend().getItemStyle().setColor(LEGEND_TEXT_COLOR);
        Style itemHoverStyle = new Style();
        itemHoverStyle.setColor(new SolidColor(0, 0, 0));
        getLegend().setItemHoverStyle(itemHoverStyle);
        getLegend().setItemHiddenStyle(new Style());
        getLegend().getItemHiddenStyle()
                .setColor(new SolidColor(128, 128, 128));
        getLegend().setBorderRadius(BORDER_RADIUS);
        getLegend().setBorderColor(LINE_COLOR);
        getLegend().setBackgroundColor(BGCOLOR_LIGHT_GRAY);

        getLabels().setColor(TEXT_COLOR);

        getCredits().setStyle(new Style());
        getCredits().getStyle().setFontSize("10px");
        getCredits().getStyle().setColor(new SolidColor(128, 128, 128));
        getCredits().setText("");
        getCredits().setHref("");

        getyAxis().setMinorTickInterval(TickIntervalStyle.NONE);
        getyAxis().setAlternateGridColor(BGCOLOR_LIGHT_GRAY);
        getyAxis().setGridLineColor(LINE_COLOR);
        getyAxis().setLineWidth(0);
        getyAxis().setTickWidth(0);

        getxAxis().setLineColor(LINE_COLOR);
        getxAxis().setGridLineWidth(0);

        getPlotOptions().getLine().setLineWidth(1);
        /* Shadows on by default, off in range stuff */
        getPlotOptions().getArearange().setShadow(false);
        getPlotOptions().getAreasplinerange().setShadow(false);

        getPlotOptions().getLine().setShadow(true);
        getPlotOptions().getSpline().setShadow(true);
        getPlotOptions().getBar().setShadow(true);
        getPlotOptions().getColumn().setShadow(true);
        getPlotOptions().getArea().setShadow(true);
        getPlotOptions().getPie().setShadow(true);

    }

    protected void setAxisDefaults(AxisStyle style) {
        style.setGridLineColor(GRID_COLOR);
        style.setLineColor(GRID_COLOR);
        style.setLineWidth(1);
        style.setTickColor(GRID_COLOR);
        style.setAlternateGridColor(new SolidColor(255, 255, 255, 0.0));

        style.getTitle().setColor(TITLE_COLOR);
        style.getTitle().setFontWeight(FontWeight.BOLD);

        style.getSubtitle().setColor(SUBTITLE_COLOR);
        style.getSubtitle().setFontSize("10px");
        style.getSubtitle().setFontWeight(FontWeight.NORMAL);

        style.getLabels().setFontWeight(FontWeight.NORMAL);
        style.getLabels().setColor(LABEL_COLOR);
        style.getLabels().setFontSize("12px");

    }

}


text: A docker image used to smart contract tests with TestRPS


text:
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using Bivi.Business.Depots;
using Bivi.Domaine;
using Bivi.Data.Context;
using Bivi.Domaine.Results;
using Bivi.Infrastructure.Constant;

namespace Bivi.Data.Depots
{
    public partial class DepotRepriseEnMain : IDepotRepriseEnMain
    {
        private readonly IDepotParametre _parametres;
        private readonly IDepotUtilisateur _utilisateur;

        public DepotRepriseEnMain(IBiviDbContext dataContext, IDepotUtilisateur utilisateur, IDepotParametre parametres)
            : this(dataContext)
        {
            _parametres = parametres;
            _utilisateur = utilisateur;
        }
        public IEnumerable<dynamic> Search(bool mesREM, bool realise, long utilisateurID, string filtre, long? siteID)
        {
            var Parameters = new List<SqlParameter>();

            Parameters.Add(new SqlParameter("@MesRepriseEnMain", SqlDbType.Bit) { Value = mesREM });
            Parameters.Add(new SqlParameter("@Realise", SqlDbType.Bit) { Value = realise });
            Parameters.Add(new SqlParameter("@UtilisateurID", SqlDbType.BigInt) { Value = utilisateurID });
            Parameters.Add(new SqlParameter("@Filtre", SqlDbType.NVarChar) { Value = filtre });

            if (siteID.HasValue)
            {
                Parameters.Add(new SqlParameter("@SiteID", SqlDbType.BigInt) { Value = siteID });
            }

            return DbContext.ExecuteStoredProcedureDynamic("sp_SearchRepriseEnMain", Parameters);
        }

        public RepriseEnMainResult GetRepriseEnMainByID(long utilisateurID, long id)
        {
            var Parameters = new List<SqlParameter>();

            Parameters.Add(new SqlParameter("@UtilisateurID", SqlDbType.BigInt) { Value = utilisateurID });
            Parameters.Add(new SqlParameter("@RepriseEnMainID", SqlDbType.BigInt) { Value = id });

            return DbContext.ExecuteStoredProcedure<RepriseEnMainResult>("sp_GetRepriseEnMain", Parameters).FirstOrDefault();
        }

        public RepriseEnMain SaveRepriseEnMainInfosGenerales(RepriseEnMainDto repriseEnMain, int from)
        {
            RepriseEnMain _repriseEnMain;

            if (repriseEnMain.ID > 0)
            {
                _repriseEnMain = GetById(repriseEnMain.ID);
            }
            else
            {
                _repriseEnMain = new RepriseEnMain();
            }

            switch (from)
            {
                case (int)RepriseEnMainCreationExpediteurEnum.RepriseEnMain:

                    _repriseEnMain.SiteID = repriseEnMain.SiteID;

                    if (repriseEnMain.CreateurUtilisateurID > 0)
                    {
                        _repriseEnMain.CreateurUtilisateurID = repriseEnMain.CreateurUtilisateurID;
                        if (repriseEnMain.ID <= 0)
                        {
                            _repriseEnMain.DateCreation = repriseEnMain.DateCreation;
                        }
                    }

                    if (repriseEnMain.DestinataireUtilisateurID > 0)
                    {
                        _repriseEnMain.DestinataireUtilisateur = _utilisateur.GetById(repriseEnMain.DestinataireUtilisateurID);

                        _repriseEnMain.DateCible = repriseEnMain.DateCible;

                    }

                    if (repriseEnMain.Realisee)
                    {
                        _repriseEnMain.Realisee = true;
                        _repriseEnMain.RealisateurUtilisateur = _utilisateur.GetById(repriseEnMain.RealisateurUtilisateurID);
                        if (repriseEnMain.DateRealisation != null && repriseEnMain.DateRealisation != DateTime.MinValue)
                        {
                            _repriseEnMain.DateRealisation = repriseEnMain.DateRealisation;
                        }
                    }
                    else
                    {
                        _repriseEnMain.Realisee = false;
                    }

                    _repriseEnMain.Description = repriseEnMain.Description;

                    break;
                case (int)RepriseEnMainCreationExpediteurEnum.Selection:
                    //TODO
                    break;
                default :
                    throw new ArgumentException(string.Format("La valeur de l'argument 'from' est {0}, mais elle doit être entre {1} et {2}", from, RepriseEnMainCreationExpediteurEnum.RepriseEnMain, RepriseEnMainCreationExpediteurEnum.Selection));
            }

            if (repriseEnMain.ID > 0)
            {
                Update();
            }
            else
            {
                Add(_repriseEnMain);
            }

            return _repriseEnMain;
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2012 Facebook, Inc.

    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.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>io.airlift</groupId>
    <artifactId>airbase</artifactId>
    <version>36</version>
  </parent>

  <groupId>com.facebook.swift</groupId>
  <artifactId>swift-root</artifactId>
  <version>0.16.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>${project.artifactId}</name>
  <description>Annotation based Thrift implementation</description>

  <scm>
    <connection>scm:git:git://github.com/facebook/swift.git</connection>
    <developerConnection>scm:git:git@github.com:facebook/swift.git</developerConnection>
    <url>https://github.com/facebook/swift</url>
    <tag>HEAD</tag>
  </scm>

  <distributionManagement>
    <site>
      <id>github-project-site</id>
      <url>gitsite:git@github.com/facebook/swift.git</url>
    </site>
  </distributionManagement>

  <modules>
    <module>swift-annotations</module>
    <module>swift-codec</module>
    <module>swift-idl-parser</module>
    <module>swift-javadoc</module>
    <module>swift-service</module>
    <module>swift-generator</module>
    <module>swift-generator-cli</module>
    <module>swift-maven-plugin</module>
    <module>swift-load-generator</module>
    <module>swift2thrift-generator-cli</module>
  </modules>

  <inceptionYear>2012</inceptionYear>

  <developers>
    <developer>
      <id>dain</id>
      <name>Dain Sundstrom</name>
      <email>dain@fb.com</email>
    </developer>
  </developers>

  <properties>
    <!-- This actually wants to be fixed -->
    <air.check.skip-findbugs>true</air.check.skip-findbugs>
    <air.check.skip-pmd>true</air.check.skip-pmd>
    <air.check.skip-jacoco>true</air.check.skip-jacoco>

    <dep.airlift.version>0.106</dep.airlift.version>
    <dep.antlr.version>3.5</dep.antlr.version>
    <dep.maven-api.version>3.2.5</dep.maven-api.version>
    <dep.fb.nifty.version>0.15.0</dep.fb.nifty.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.facebook.swift</groupId>
        <artifactId>swift-annotations</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>com.facebook.swift</groupId>
        <artifactId>swift-codec</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>com.facebook.swift</groupId>
        <artifactId>swift-idl-parser</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>com.facebook.swift</groupId>
        <artifactId>swift-service</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>com.facebook.swift</groupId>
        <artifactId>swift-generator</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.thrift</groupId>
        <artifactId>libthrift</artifactId>
        <version>0.9.1</version>
      </dependency>

      <dependency>
        <groupId>org.ow2.asm</groupId>
        <artifactId>asm-all</artifactId>
        <version>4.1</version>
      </dependency>

      <dependency>
        <groupId>com.facebook.nifty</groupId>
        <artifactId>nifty-core</artifactId>
        <version>${dep.fb.nifty.version}</version>
      </dependency>

      <dependency>
        <groupId>com.facebook.nifty</groupId>
        <artifactId>nifty-client</artifactId>
        <version>${dep.fb.nifty.version}</version>
      </dependency>

      <dependency>
        <groupId>io.airlift</groupId>
        <artifactId>jmx</artifactId>
        <version>${dep.airlift.version}</version>
      </dependency>

      <dependency>
        <groupId>io.airlift</groupId>
        <artifactId>configuration</artifactId>
        <version>${dep.airlift.version}</version>
      </dependency>

      <dependency>
        <groupId>io.airlift</groupId>
        <artifactId>stats</artifactId>
        <version>${dep.airlift.version}</version>
      </dependency>

      <dependency>
        <groupId>io.airlift</groupId>
        <artifactId>units</artifactId>
        <version>${dep.airlift.version}</version>
      </dependency>

      <dependency>
        <groupId>io.airlift</groupId>
        <artifactId>bootstrap</artifactId>
        <version>${dep.airlift.version}</version>
      </dependency>

      <dependency>
        <groupId>io.airlift</groupId>
        <artifactId>node</artifactId>
        <version>${dep.airlift.version}</version>
      </dependency>

      <dependency>
        <groupId>io.airlift</groupId>
        <artifactId>log</artifactId>
        <version>${dep.airlift.version}</version>
      </dependency>

      <dependency>
        <groupId>io.airlift</groupId>
        <artifactId>testing</artifactId>
        <version>${dep.airlift.version}</version>
      </dependency>

      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty</artifactId>
        <version>3.7.0.Final</version>
      </dependency>

      <dependency>
        <groupId>com.thoughtworks.paranamer</groupId>
        <artifactId>paranamer</artifactId>
        <version>2.5.2</version>
      </dependency>

      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.2.5</version>
      </dependency>

      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.2.4</version>
      </dependency>

      <dependency>
        <groupId>org.antlr</groupId>
        <artifactId>antlr-runtime</artifactId>
        <version>${dep.antlr.version}</version>
      </dependency>

      <dependency>
        <groupId>org.antlr</groupId>
        <artifactId>stringtemplate</artifactId>
        <version>4.0.2</version>
      </dependency>

      <!-- maven -->
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>${dep.maven-api.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-model</artifactId>
        <version>${dep.maven-api.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-artifact</artifactId>
        <version>${dep.maven-api.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>${dep.maven-api.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>3.4</version>
      </dependency>

      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-utils</artifactId>
        <version>3.0.22</version>
      </dependency>

      <dependency>
        <groupId>org.easytesting</groupId>
        <artifactId>fest-assert</artifactId>
        <version>1.4</version>
      </dependency>

      <dependency>
        <groupId>args4j</groupId>
        <artifactId>args4j</artifactId>
        <version>2.0.22</version>
      </dependency>

      <dependency>
        <groupId>com.beust</groupId>
        <artifactId>jcommander</artifactId>
        <version>1.30</version>
      </dependency>

      <dependency>
        <groupId>io.takari.maven.plugins</groupId>
        <artifactId>takari-plugin-testing</artifactId>
        <version>2.2.0</version>
      </dependency>

      <dependency>
        <groupId>io.takari.maven.plugins</groupId>
        <artifactId>takari-plugin-integration-testing</artifactId>
        <version>2.2.0</version>
        <type>pom</type>
      </dependency>

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.plexus</groupId>
                    <artifactId>plexus-maven-plugin</artifactId>
                    <versionRange>[0,)</versionRange>
                    <goals>
                      <goal>descriptor</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.antlr</groupId>
          <artifactId>antlr3-maven-plugin</artifactId>
          <version>${dep.antlr.version}</version>
          <executions>
            <execution>
              <id>default</id>
              <phase>generate-sources</phase>
              <goals>
                <goal>antlr</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-maven-plugin</artifactId>
          <version>1.3.8</version>
          <executions>
            <execution>
              <goals>
                <goal>descriptor</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>3.4</version>
          <executions>
            <execution>
              <id>help-mojo</id>
              <goals>
                <goal>helpmojo</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>2.1</version>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>shade</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>io.takari.maven.plugins</groupId>
          <artifactId>takari-lifecycle-plugin</artifactId>
          <version>1.11.3</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <properties>
            <inceptionYear>${project.inceptionYear}</inceptionYear>
            <year>2013</year>
          </properties>
          <excludes combine.children="append">
            <exclude>**/*.g</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


text:
uint64_t GetNowUs (){
    uint64_t now = std::chrono::system_clock::now ().time_since_epoch ().count ();
    return now;
}

uint64_t GetNowMs (){
    uint64_t now = std::chrono::system_clock::now ().time_since_epoch ().count ();
    return now/1000;
}


text:
//  (C) Copyright Gennadiy Rozental 2001-2014.
//  Distributed under the Boost Software License, Version 1.0.
//  (See accompanying file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt)

//  See http://www.boost.org/libs/test for the library home page.
//
//!@file
//!@brief algorithms for comparing floating point values
// ***************************************************************************

#ifndef BOOST_TEST_FLOATING_POINT_COMPARISON_HPP_071894GER
#define BOOST_TEST_FLOATING_POINT_COMPARISON_HPP_071894GER

// Boost.Test
#include <boost/test/detail/global_typedef.hpp>
#include <boost/test/tools/assertion_result.hpp>

// Boost
#include <boost/limits.hpp>  // for std::numeric_limits
#include <boost/static_assert.hpp>
#include <boost/assert.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/conditional.hpp>
#include <boost/utility/enable_if.hpp>

// STL
#include <iosfwd>

#include <boost/test/detail/suppress_warnings.hpp>

//____________________________________________________________________________//

namespace boost {
namespace math {
namespace fpc {

// ************************************************************************** //
// **************              fpc::tolerance_based            ************** //
// ************************************************************************** //

//! @internal
//! Protects the instanciation of std::numeric_limits from non-supported types (eg. T=array)
template <typename T, bool enabled>
struct tolerance_based_delegate;

template <typename T>
struct tolerance_based_delegate<T, false> : mpl::false_ {};

template <typename T>
struct tolerance_based_delegate<T, true>
: mpl::bool_<
    is_floating_point<T>::value ||
    (!std::numeric_limits<T>::is_integer && std::numeric_limits<T>::is_specialized && !std::numeric_limits<T>::is_exact)>
{};

/*!@brief Indicates if a type can be compared using a tolerance scheme
 *
 * This is a metafunction that should evaluate to @c mpl::true_ if the type
 * @c T can be compared using a tolerance based method, typically for floating point
 * types.
 *
 * This metafunction can be specialized further to declare user types that are
 * floating point (eg. boost.multiprecision).
 */
template <typename T>
struct tolerance_based : tolerance_based_delegate<T, !is_array<T>::value >::type {};

// ************************************************************************** //
// **************                 fpc::strength                ************** //
// ************************************************************************** //

//! Method for comparing floating point numbers
enum strength {
    FPC_STRONG, //!< "Very close"   - equation 2' in docs, the default
    FPC_WEAK    //!< "Close enough" - equation 3' in docs.
};

// ************************************************************************** //
// **************         tolerance presentation types         ************** //
// ************************************************************************** //

template<typename FPT>
struct percent_tolerance_t {
    explicit    percent_tolerance_t( FPT v ) : m_value( v ) {}

    FPT m_value;
};

//____________________________________________________________________________//

template<typename FPT>
inline std::ostream& operator<<( std::ostream& out, percent_tolerance_t<FPT> t )
{
    return out << t.m_value;
}

//____________________________________________________________________________//

template<typename FPT>
inline percent_tolerance_t<FPT>
percent_tolerance( FPT v )
{
    return percent_tolerance_t<FPT>( v );
}

//____________________________________________________________________________//

// ************************************************************************** //
// **************                    details                   ************** //
// ************************************************************************** //

namespace fpc_detail {

// FPT is Floating-Point Type: float, double, long double or User-Defined.
template<typename FPT>
inline FPT
fpt_abs( FPT fpv )
{
    return fpv < static_cast<FPT>(0) ? -fpv : fpv;
}

//____________________________________________________________________________//

template<typename FPT>
struct fpt_specialized_limits
{
  static FPT    min_value() { return (std::numeric_limits<FPT>::min)(); }
  static FPT    max_value() { return (std::numeric_limits<FPT>::max)(); }
};

template<typename FPT>
struct fpt_non_specialized_limits
{
  static FPT    min_value() { return static_cast<FPT>(0); }
  static FPT    max_value() { return static_cast<FPT>(1000000); } // for our purposes it doesn't really matter what value is returned here
};

template<typename FPT>
struct fpt_limits : boost::conditional<std::numeric_limits<FPT>::is_specialized,
                                       fpt_specialized_limits<FPT>,
                                       fpt_non_specialized_limits<FPT>
                                      >::type
{};

//____________________________________________________________________________//

// both f1 and f2 are unsigned here
template<typename FPT>
inline FPT
safe_fpt_division( FPT f1, FPT f2 )
{
    // Avoid overflow.
    if( (f2 < static_cast<FPT>(1))  && (f1 > f2*fpt_limits<FPT>::max_value()) )
        return fpt_limits<FPT>::max_value();

    // Avoid underflow.
    if( (f1 == static_cast<FPT>(0)) ||
        ((f2 > static_cast<FPT>(1)) && (f1 < f2*fpt_limits<FPT>::min_value())) )
        return static_cast<FPT>(0);

    return f1/f2;
}

//____________________________________________________________________________//

template<typename FPT, typename ToleranceType>
inline FPT
fraction_tolerance( ToleranceType tolerance )
{
  return static_cast<FPT>(tolerance);
}

//____________________________________________________________________________//

template<typename FPT2, typename FPT>
inline FPT2
fraction_tolerance( percent_tolerance_t<FPT> tolerance )
{
    return FPT2(tolerance.m_value)*FPT2(0.01);
}

//____________________________________________________________________________//

} // namespace fpc_detail

// ************************************************************************** //
// **************             close_at_tolerance               ************** //
// ************************************************************************** //

/*!@brief Predicate for comparing floating point numbers
 *
 * This predicate is used to compare floating point numbers. In addition the comparison produces maximum
 * related differnce, which can be used to generate detailed error message
 * The methods for comparing floating points are detailed in the documentation. The method is chosen
 * by the @ref boost::math::fpc::strength given at construction.
 */
template<typename FPT>
class close_at_tolerance {
public:
    // Public typedefs
    typedef bool result_type;

    // Constructor
    template<typename ToleranceType>
    explicit    close_at_tolerance( ToleranceType tolerance, fpc::strength fpc_strength = FPC_STRONG )
    : m_fraction_tolerance( fpc_detail::fraction_tolerance<FPT>( tolerance ) )
    , m_strength( fpc_strength )
    , m_tested_rel_diff( 0 )
    {
        BOOST_ASSERT_MSG( m_fraction_tolerance >= FPT(0), "tolerance must not be negative!" ); // no reason for tolerance to be negative
    }

    // Access methods
    //! Returns the tolerance
    FPT                 fraction_tolerance() const  { return m_fraction_tolerance; }

    //! Returns the comparison method
    fpc::strength       strength() const            { return m_strength; }

    //! Returns the failing fraction
    FPT                 tested_rel_diff() const     { return m_tested_rel_diff; }

    /*! Compares two floating point numbers a and b such that their "left" relative difference |a-b|/a and/or
     * "right" relative difference |a-b|/b does not exceed specified relative (fraction) tolerance.
     *
     *  @param[in] left first floating point number to be compared
     *  @param[in] right second floating point number to be compared
     *
     * What is reported by @c tested_rel_diff in case of failure depends on the comparison method:
     * - for @c FPC_STRONG: the max of the two fractions
     * - for @c FPC_WEAK: the min of the two fractions
     * The rationale behind is to report the tolerance to set in order to make a test pass.
     */
    bool                operator()( FPT left, FPT right ) const
    {
        FPT diff              = fpc_detail::fpt_abs<FPT>( left - right );
        FPT fraction_of_right = fpc_detail::safe_fpt_division( diff, fpc_detail::fpt_abs( right ) );
        FPT fraction_of_left  = fpc_detail::safe_fpt_division( diff, fpc_detail::fpt_abs( left ) );

        FPT max_rel_diff = (std::max)( fraction_of_left, fraction_of_right );
        FPT min_rel_diff = (std::min)( fraction_of_left, fraction_of_right );

        m_tested_rel_diff = m_strength == FPC_STRONG ? max_rel_diff : min_rel_diff;

        return m_tested_rel_diff <= m_fraction_tolerance;
    }

private:
    // Data members
    FPT                 m_fraction_tolerance;
    fpc::strength       m_strength;
    mutable FPT         m_tested_rel_diff;
};

// ************************************************************************** //
// **************            small_with_tolerance              ************** //
// ************************************************************************** //

/*!@brief Predicate for comparing floating point numbers against 0
 *
 * Serves the same purpose as boost::math::fpc::close_at_tolerance, but used when one
 * of the operand is null.
 */
template<typename FPT>
class small_with_tolerance {
public:
    // Public typedefs
    typedef bool result_type;

    // Constructor
    explicit    small_with_tolerance( FPT tolerance ) // <= absolute tolerance
    : m_tolerance( tolerance )
    {
        BOOST_ASSERT( m_tolerance >= FPT(0) ); // no reason for the tolerance to be negative
    }

    // Action method
    bool        operator()( FPT fpv ) const
    {
        return fpc::fpc_detail::fpt_abs( fpv ) < m_tolerance;
    }

private:
    // Data members
    FPT         m_tolerance;
};

// ************************************************************************** //
// **************                  is_small                    ************** //
// ************************************************************************** //

template<typename FPT>
inline bool
is_small( FPT fpv, FPT tolerance )
{
    return small_with_tolerance<FPT>( tolerance )( fpv );
}

//____________________________________________________________________________//

} // namespace fpc
} // namespace math
} // namespace boost

#include <boost/test/detail/enable_warnings.hpp>

#endif // BOOST_FLOATING_POINT_COMAPARISON_HPP_071894GER


text:
/* */
"format cjs";
module.exports = process.env.COV
  ? require('./lib-cov/mocha')
  : require('./lib/mocha');


text:
/
OsiReturnVal_e osi_InterruptRegister(int iIntrNum,P_OSI_INTR_ENTRY pEntry,unsigned char ucPriority)
{
	MAP_IntRegister(iIntrNum,(void(*)(void))pEntry);
	MAP_IntPrioritySet(iIntrNum, ucPriority);
	MAP_IntEnable(iIntrNum);
	return OSI_OK;
}

/*!
	\brief 	This function De registers an interrupt in NVIC table

	\param	iIntrNum	-	Interrupt number to De register

	\return 	none
	\note
	\warning
*/

void osi_InterruptDeRegister(int iIntrNum)
{
	MAP_IntDisable(iIntrNum);
	MAP_IntUnregister(iIntrNum);
}

/*!
	\brief 	This function creates a sync object

	The sync object is used for synchronization between different thread or ISR and
	a thread.

	\param	pSyncObj	-	pointer to the sync object control block

	\return upon successful creation the function should return 0
			Otherwise, a negative value indicating the error code shall be returned
	\note
	\warning
*/
OsiReturnVal_e osi_SyncObjCreate(OsiSyncObj_t* pSyncObj)
{
    SemaphoreHandle_t *pl_SyncObj = (SemaphoreHandle_t *)pSyncObj;

    *pl_SyncObj = xSemaphoreCreateBinary();

    ASSERT (*pSyncObj != NULL);

    return OSI_OK;
}

/*!
	\brief 	This function deletes a sync object

	\param	pSyncObj	-	pointer to the sync object control block

	\return upon successful deletion the function should return 0
			Otherwise, a negative value indicating the error code shall be returned
	\note
	\warning
*/
OsiReturnVal_e osi_SyncObjDelete(OsiSyncObj_t* pSyncObj)
{
    vSemaphoreDelete(*pSyncObj );
    return OSI_OK;
}

/*!
	\brief 		This function generates a sync signal for the object.

	All suspended threads waiting on this sync object are resumed

	\param		pSyncObj	-	pointer to the sync object control block

	\return 	upon successful signaling the function should return 0
				Otherwise, a negative value indicating the error code shall be returned
	\note		the function could be called from ISR context
	\warning
*/
OsiReturnVal_e osi_SyncObjSignal(OsiSyncObj_t* pSyncObj)
{
    xSemaphoreGive( *pSyncObj );
    return OSI_OK;
}
/*!
	\brief 		This function generates a sync signal for the object
				from ISR context.

	All suspended threads waiting on this sync object are resumed

	\param		pSyncObj	-	pointer to the sync object control block

	\return 	upon successful signalling the function should return 0
				Otherwise, a negative value indicating the error code shall be returned
	\note		the function is called from ISR context
	\warning
*/
OsiReturnVal_e osi_SyncObjSignalFromISR(OsiSyncObj_t* pSyncObj)
{
	xHigherPriorityTaskWoken = pdFALSE;
	if(pdTRUE == xSemaphoreGiveFromISR( *pSyncObj, &xHigherPriorityTaskWoken ))
	{
		if( xHigherPriorityTaskWoken )
		{
			taskYIELD ();
		}
	}
	return OSI_OK;
}

/*!
	\brief 	This function waits for a sync signal of the specific sync object

	\param	pSyncObj	-	pointer to the sync object control block
	\param	Timeout		-	numeric value specifies the maximum number of mSec to
							stay suspended while waiting for the sync signal
							Currently, the simple link driver uses only two values:
								- OSI_WAIT_FOREVER
								- OSI_NO_WAIT

	\return upon successful reception of the signal within the timeout window return 0
			Otherwise, a negative value indicating the error code shall be returned
	\note
	\warning
*/
OsiReturnVal_e osi_SyncObjWait(OsiSyncObj_t* pSyncObj , OsiTime_t Timeout)
{
    if(pdTRUE == xSemaphoreTake( (SemaphoreHandle_t)*pSyncObj, ( TickType_t )Timeout))
    {
        return OSI_OK;
    }
    else
    {
        return OSI_OPERATION_FAILED;
    }
}

/*!
	\brief 	This function clears a sync object

	\param	pSyncObj	-	pointer to the sync object control block

	\return upon successful clearing the function should return 0
			Otherwise, a negative value indicating the error code shall be returned
	\note
	\warning
*/
OsiReturnVal_e osi_SyncObjClear(OsiSyncObj_t* pSyncObj)
{
    if (OSI_OK == osi_SyncObjWait(pSyncObj,0) )
    {
        return OSI_OK;
    }
    else
    {
        return OSI_OPERATION_FAILED;
    }
}

/*!
	\brief 	This function creates a locking object.

	The locking object is used for protecting a shared resources between different
	threads.

	\param	pLockObj	-	pointer to the locking object control block

	\return upon successful creation the function should return 0
			Otherwise, a negative value indicating the error code shall be returned
	\note
	\warning
*/
OsiReturnVal_e osi_LockObjCreate(OsiLockObj_t* pLockObj)
{
    SemaphoreHandle_t *pl_LockObj = (SemaphoreHandle_t *)pLockObj;

    vSemaphoreCreateBinary(*pl_LockObj);

    ASSERT (*pLockObj != NULL);

    return OSI_OK;
}

/*!
	\brief 	This function creates a Task.

	Creates a new Task and add it to the last of tasks that are ready to run

	\param	pEntry	-	pointer to the Task Function
	\param	pcName	-	Task Name String
	\param	usStackDepth	-	Stack Size in bytes
	\param	pvParameters	-	pointer to structure to be passed to the Task Function
	\param	uxPriority	-	Task Priority

	\return upon successful creation the function should return 0
			Otherwise, a negative value indicating the error code shall be returned
	\note
	\warning
*/
__attribute__ ((section (".boot")))
OsiReturnVal_e osi_TaskCreate(P_OSI_TASK_ENTRY pEntry,const signed char * const pcName,
                              unsigned short usStackDepth, void *pvParameters,
                              unsigned long uxPriority,OsiTaskHandle* pTaskHandle)
{
	ASSERT (pdPASS == xTaskCreate( pEntry, (char const*)pcName,
                                (usStackDepth/(sizeof( portSTACK_TYPE ))),
                                pvParameters,(unsigned portBASE_TYPE)uxPriority,
                                (TaskHandle_t*)pTaskHandle ));
	return OSI_OK;
}

/*!
	\brief 	This function Deletes a Task.

	Deletes a  Task and remove it from list of running task

	\param	pTaskHandle	-	Task Handle

	\note
	\warning
*/
void osi_TaskDelete(OsiTaskHandle* pTaskHandle)
{
	vTaskDelete((TaskHandle_t)*pTaskHandle);
}

/*!
	\brief 	This function deletes a locking object.

	\param	pLockObj	-	pointer to the locking object control block

	\return upon successful deletion the function should return 0
			Otherwise, a negative value indicating the error code shall be returned
	\note
	\warning
*/
OsiReturnVal_e _osi_LockObjDelete(OsiLockObj_t* pLockObj)
{
    vSemaphoreDelete((SemaphoreHandle_t)*pLockObj );
    return OSI_OK;
}

/*!
	\brief 	This function locks a locking object.

	All other threads that call this function before this thread calls
	the osi_LockObjUnlock would be suspended

	\param	pLockObj	-	pointer to the locking object control block
	\param	Timeout		-	numeric value specifies the maximum number of mSec to
							stay suspended while waiting for the locking object
							Currently, the simple link driver uses only two values:
								- OSI_WAIT_FOREVER
								- OSI_NO_WAIT

	\return upon successful reception of the locking object the function should return 0
			Otherwise, a negative value indicating the error code shall be returned
	\note
	\warning
*/
OsiReturnVal_e _osi_LockObjLock(OsiLockObj_t* pLockObj , OsiTime_t Timeout)
{
    //Take Semaphore
    if(pdTRUE == xSemaphoreTake( *pLockObj, ( TickType_t ) Timeout ))
    {
        return OSI_OK;
    }
    else
    {
        return OSI_OPERATION_FAILED;
    }
}

/*!
	\brief 	This function unlock a locking object.

	\param	pLockObj	-	pointer to the locking object control block

	\return upon successful unlocking the function should return 0
			Otherwise, a negative value indicating the error code shall be returned
	\note
	\warning
*/
OsiReturnVal_e _osi_LockObjUnlock(OsiLockObj_t* pLockObj)
{
	//Release Semaphore
    if(pdTRUE == xSemaphoreGive( *pLockObj ))
    {
    	return OSI_OK;
    }
    else
    {
    	return OSI_OPERATION_FAILED;
    }
}

/*!
	\brief 	This function call the pEntry callback from a different context

	\param	pEntry		-	pointer to the entry callback function

	\param	pValue		- 	pointer to any type of memory structure that would be
							passed to pEntry callback from the execution thread.

	\param	flags		- 	execution flags - reserved for future usage

	\return upon successful registration of the spawn the function should return 0
			(the function is not blocked till the end of the execution of the function
			and could be returned before the execution is actually completed)
			Otherwise, a negative value indicating the error code shall be returned
	\note
	\warning
*/

OsiReturnVal_e osi_Spawn(P_OSI_SPAWN_ENTRY pEntry , void* pValue , unsigned long flags)
{

	tSimpleLinkSpawnMsg Msg;
	Msg.pEntry = pEntry;
	Msg.pValue = pValue;
	xHigherPriorityTaskWoken = pdFALSE;

	if(pdTRUE == xQueueSendFromISR( xSimpleLinkSpawnQueue, &Msg, &xHigherPriorityTaskWoken ))
	{
		if( xHigherPriorityTaskWoken )
		{
			taskYIELD ();
		}
		return OSI_OK;
	}
	return OSI_OPERATION_FAILED;
}

/*!
	\brief 	This is the simplelink spawn task to call SL callback from a different context

	\param	pvParameters		-	pointer to the task parameter

	\return void
	\note
	\warning
*/
void vSimpleLinkSpawnTask(void *pvParameters)
{
	tSimpleLinkSpawnMsg Msg;
	portBASE_TYPE ret;

	for(;;)
	{
		ret = xQueueReceive( xSimpleLinkSpawnQueue, &Msg, SL_SPAWN_MAX_WAIT_MS);
		if(ret == pdPASS)
		{
				Msg.pEntry(Msg.pValue);
		}
        // set the alive flag for the wdt
        pybwdt_sl_alive();
	}
}

/*!
	\brief 	This is the API to create SL spawn task and create the SL queue

	\param	uxPriority		-	task priority

	\return void
	\note
	\warning
*/
__attribute__ ((section (".boot")))
OsiReturnVal_e VStartSimpleLinkSpawnTask(unsigned portBASE_TYPE uxPriority)
{
    xSimpleLinkSpawnQueue = xQueueCreate( slQUEUE_SIZE, sizeof( tSimpleLinkSpawnMsg ) );
    ASSERT (xSimpleLinkSpawnQueue != NULL);

    ASSERT (pdPASS == xTaskCreate( vSimpleLinkSpawnTask, ( portCHAR * ) "SLSPAWN",\
                                   896 / sizeof(portSTACK_TYPE), NULL, uxPriority, &xSimpleLinkSpawnTaskHndl ));

    return OSI_OK;
}

/*!
	\brief 	This is the API to delete SL spawn task and delete the SL queue

	\param	none

	\return void
	\note
	\warning
*/
void VDeleteSimpleLinkSpawnTask( void )
{
	if(xSimpleLinkSpawnTaskHndl)
	{
		vTaskDelete( xSimpleLinkSpawnTaskHndl );
		xSimpleLinkSpawnTaskHndl = 0;
	}

	if(xSimpleLinkSpawnQueue)
	{
		vQueueDelete( xSimpleLinkSpawnQueue );
		xSimpleLinkSpawnQueue = 0;
	}
}

/*!
	\brief 	This function is used to create the MsgQ

	\param	pMsgQ	-	pointer to the message queue
	\param	pMsgQName	-	msg queue name
	\param	MsgSize	-	size of message on the queue
	\param	MaxMsgs	-	max. number of msgs that the queue can hold

	\return - OsiReturnVal_e
	\note
	\warning
*/
OsiReturnVal_e osi_MsgQCreate(OsiMsgQ_t* 		pMsgQ ,
			      char*			pMsgQName,
			      unsigned long 		MsgSize,
			      unsigned long		MaxMsgs)
{
	QueueHandle_t handle;

	//Create Queue
	handle = xQueueCreate( MaxMsgs, MsgSize );
	ASSERT (handle != NULL);

	*pMsgQ = (OsiMsgQ_t)handle;
	return OSI_OK;
}
/*!
	\brief 	This function is used to delete the MsgQ

	\param	pMsgQ	-	pointer to the message queue

	\return - OsiReturnVal_e
	\note
	\warning
*/
OsiReturnVal_e osi_MsgQDelete(OsiMsgQ_t* pMsgQ)
{
	vQueueDelete((QueueHandle_t) *pMsgQ );
    return OSI_OK;
}
/*!
	\brief 	This function is used to write data to the MsgQ

	\param	pMsgQ	-	pointer to the message queue
	\param	pMsg	-	pointer to the Msg strut to read into
	\param	Timeout	-	timeout to wait for the Msg to be available

	\return - OsiReturnVal_e
	\note
	\warning
*/

OsiReturnVal_e osi_MsgQWrite(OsiMsgQ_t* pMsgQ, void* pMsg , OsiTime_t Timeout)
{
	xHigherPriorityTaskWoken = pdFALSE;
    if(pdPASS == xQueueSendFromISR((QueueHandle_t) *pMsgQ, pMsg, &xHigherPriorityTaskWoken ))
    {
		taskYIELD ();
		return OSI_OK;
    }
	else
	{
		return OSI_OPERATION_FAILED;
	}
}
/*!
	\brief 	This function is used to read data from the MsgQ

	\param	pMsgQ	-	pointer to the message queue
	\param	pMsg	-	pointer to the Msg strut to read into
	\param	Timeout	-	timeout to wait for the Msg to be available

	\return - OsiReturnVal_e
	\note
	\warning
*/

OsiReturnVal_e osi_MsgQRead(OsiMsgQ_t* pMsgQ, void* pMsg , OsiTime_t Timeout)
{
	//Receive Item from Queue
	if( pdTRUE  == xQueueReceive((QueueHandle_t)*pMsgQ,pMsg,Timeout) )
	{
		return OSI_OK;
	}
	else
	{
		return OSI_OPERATION_FAILED;
	}
}

/*!
	\brief 	This function to call the memory de-allocation function of the FREERTOS

	\param	Size	-	size of memory to alloc in bytes

	\return - void *
	\note
	\warning
*/

void * mem_Malloc(unsigned long Size)
{
    return ( void * ) pvPortMalloc( (size_t)Size );
}

/*!
	\brief 	This function to call the memory de-allocation function of the FREERTOS

	\param	pMem		-	pointer to the memory which needs to be freed

	\return - void
	\note
	\warning
*/
void mem_Free(void *pMem)
{
    vPortFree( pMem );
}

/*!
	\brief 	This function call the memset function
	\param	pBuf	     -	 pointer to the memory to be fill
        \param  Val          -   Value to be fill
        \param  Size         -   Size of the memory which needs to be fill
	\return - void
	\note
	\warning
*/

void  mem_set(void *pBuf,int Val,size_t Size)
{
    memset( pBuf,Val,Size);
}

/*!
      \brief 	This function call the memcopy function
      \param	pDst	-	pointer to the destination
      \param pSrc     -   pointer to the source
      \param Size     -   Size of the memory which needs to be copy

      \return - void
      \note
      \warning
*/
void  mem_copy(void *pDst, void *pSrc,size_t Size)
{
    memcpy(pDst,pSrc,Size);
}

/*!
	\brief 	This function use to entering into critical section
	\param	void
	\return - void
	\note
	\warning
*/

void osi_EnterCritical(void)
{
    vPortEnterCritical();
}

/*!
	\brief 	This function use to exit critical section
	\param	void
	\return - void
	\note
	\warning
*/

void osi_ExitCritical(void)
{
    vPortExitCritical();
}
/*!
	\brief 	This function used to start the scheduler
	\param	void
	\return - void
	\note
	\warning
*/
__attribute__ ((section (".boot")))
void osi_start()
{
    vTaskStartScheduler();
}
/*!
	\brief 	This function used to suspend the task for the specified number of milli secs
	\param	MilliSecs	-	Time in millisecs to suspend the task
	\return - void
	\note
	\warning
*/
void osi_Sleep(unsigned int MilliSecs)
{
	vTaskDelay(MilliSecs);
}

/*!
	\brief 	This function used to disable the tasks
	\param	- void
	\return - Key with the suspended tasks
	\note
	\warning
*/
void osi_TaskDisable(void)
{
   vTaskSuspendAll();
}

/*!
	\brief 	This function used to resume all the tasks
	\param	key	-	returned from suspend tasks
	\return - void
	\note
	\warning
*/
void osi_TaskEnable(void)
{
   xTaskResumeAll();
}

/*!
	\brief 	This function used to save the OS context before sleep
	\param	void
	\return - void
	\note
	\warning
*/
void osi_ContextSave()
{

}
/*!
	\brief 	This function used to restore the OS context after sleep
	\param	void
	\return - void
	\note
	\warning
*/
void osi_ContextRestore()
{

}


text:
import unittest
import os
from splitwise import Splitwise
from splitwise.group import Group
from splitwise.exception import SplitwiseUnauthorizedException

class GroupTestCase(unittest.TestCase):

    def setUp(self):
        consumer_key = os.environ['CONSUMER_KEY']
        consumer_secret = os.environ['CONSUMER_SECRET']
        oauth_token = os.environ['OAUTH_TOKEN']
        oauth_token_secret = os.environ['OAUTH_TOKEN_SECRET']

        self.sObj = Splitwise(consumer_key, consumer_secret)
        self.sObj.setAccessToken({'oauth_token': oauth_token, 'oauth_token_secret': oauth_token_secret})

    def test_group_flow(self):
        group = Group()
        group.setName("Splitwise_test_case")
        # Create Group
        group, error = self.sObj.createGroup(group)
        self.assertIsNotNone(group.getId())
        # Delete Group
        self.sObj.deleteGroup(group.getId())

    def test_group_invalidkeys_fail(self):
        sObj = Splitwise('consumerkey', 'consumersecret', {"oauth_token": "sdsd", "oauth_token_secret": "sdsdd"})
        group = Group()
        with self.assertRaises(SplitwiseUnauthorizedException):
            sObj.createGroup(group)


text:
import React from 'react';
import { connect } from 'react-redux';
import { fetchMovies } from './../actions';

import MoviesListing from './../components/MoviesListing';

@connect((store) => {
    return {
        error: store.moviesListing.error,
        movies: store.moviesListing.movies,
        moviesFetched: store.moviesListing.moviesFetched
    };
})
class MoviesListingContainer extends React.Component {

    constructor() {
        super();

        this.initialNumMoviesToFetch = 60;
    }

    componentDidMount() {
        this.props.dispatch(fetchMovies(this.initialNumMoviesToFetch));
    }

    render() {
        const { error, movies, moviesFetched } = this.props;

        return (
            <div>
                <MoviesListing error={error} initialNumMoviesToFetch={this.initialNumMoviesToFetch} movies={movies} loaded={moviesFetched} />
            </div>
        );
    }
}

export default MoviesListingContainer;


text:
package ee.cone.c4actor_s3_minio

trait MinioS3AppBase


text:
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.ibm.odm.ondocker</groupId>
        <artifactId>odm-standalone-samples</artifactId>
        <version>1.0</version>
    </parent>

    <name>odm-standalone-samples/miniloan-xom</name>
    <groupId>com.ibm.odm.ondocker</groupId>
    <artifactId>miniloan-xom</artifactId>
    <packaging>jar</packaging>

    <properties>
        <xom.path>${odm.installation.path}/studio/tutorials/decisionservice/answer/loan-validation-xom</xom.path>
    </properties>

    <build>
        <plugins>
            <!-- Cleanup src directory if exists -->
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>src</directory>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                        <fileset>
                            <directory>lib</directory>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <!-- Copy xom source code from ODM installation directory -->
                    <execution>
                        <id>copy-xom-sources</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/src/main/java</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${xom.path}/src</directory>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;

/*
 * Needs some more work. The sound doesn't update when the objects move. Meaning the sound will sound the same even though
 * the object move away. Tough to explain in text.
 */
namespace CorvEngine.Audio
{
    /// <summary>
    /// A class for handling sound effects. Supports 3D Attenuation.
    /// </summary>
    public class CorvSoundEffectCue : CorvCue
    {
        private AudioEmitter _Emitter;
        private AudioListener _Listener;

        /// <summary>
        /// Creates a new instance of CorvSoundEffectCue without any attenuation.
        /// </summary>
        public CorvSoundEffectCue(Cue cue)
            : base(cue)
        { }

        /// <summary>
        /// Creates a new instance of CorvSoundEffectCue with attenuation.
        /// </summary>
        public CorvSoundEffectCue(Cue cue, Vector2 listenerPosition, Vector2 emitterPosition)
            : base(cue)
        {
            this._Listener = new AudioListener();
            this._Listener.Position = new Vector3(listenerPosition, 0);
            this._Emitter = new AudioEmitter();
            this._Emitter.Position = new Vector3(emitterPosition, 0);

            Cue.Apply3D(this._Listener, this._Emitter);
        }

        /// <summary>
        /// Plays the Cue.
        /// </summary>
        public void Play()
        {
            Cue.Play();
        }

    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.shypl.biser</groupId>
		<artifactId>biser-io</artifactId>
		<version>1.1.0-SNAPSHOT</version>
	</parent>

	<artifactId>biser-io-flash</artifactId>
	<packaging>swc</packaging>

	<name>Biser IO Flash</name>

	<dependencies>
		<dependency>
			<groupId>com.adobe.flash.framework</groupId>
			<artifactId>playerglobal</artifactId>
			<type>swc</type>
		</dependency>
		<dependency>
			<groupId>org.apache.flex</groupId>
			<artifactId>framework</artifactId>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>org.shypl.common</groupId>
			<artifactId>common-flash</artifactId>
			<type>swc</type>
		</dependency>
	</dependencies>

	<build>
		<sourceDirectory>src/main/actionscript</sourceDirectory>
		<plugins>
			<plugin>
				<groupId>net.flexmojos.oss</groupId>
				<artifactId>flexmojos-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
</project>


text:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ShopItem : MonoBehaviour
{
    public string Name
    {
        set
        {
            nameText.text = value;
        }

        get
        {
            return nameText.text;
        }
    }
    public int Cost
    {
        set
        {
            costText.text = value.ToString();
        }

        get
        {
            return Convert.ToInt32(costText.text);
        }

    }
    public Sprite Image
    {
        set
        {
            previewImage.sprite = value;
        }
    }
    public Color CostColor
    {
        set
        {
            costText.color = value;
        }

        get
        {
            return costText.color;
        }
    }
    public Item Data { get; set; }

    private Text costText;
    private Text nameText;
    private Image previewImage;

    public Text GoldText;

    void Awake()
    {
        nameText = transform.GetChild(0).GetComponent<Text>();
        costText = transform.GetChild(1).GetComponent<Text>();
        previewImage = transform.GetChild(2).GetComponent<Image>();
    }

    public void OnClick()
    {
        ItemsShop.UpdateItems();

        if(PlayerGold.Gold >= Cost)
        {
            ItemsShop.BuyItem(gameObject);
        }
    }
}


text:
(* ::Package:: *)

autoencoder={
   FullyConnected1DTo1DInit[28*28,28*28],
   Logistic,
   Sparse[.01,.05],
   FullyConnected1DTo1DInit[28*28,28*28],
   Logistic
};

wl=autoencoder;
TrainingHistory={};
ValidationHistory={};
\[Lambda]=.01;

flat=Map[Flatten,TrainingImages];

Train:=MiniBatchGradientDescent[
   wl,flat[[1;;59000]],flat[[1;;59000]],
   NNGrad,CrossEntropyLoss,
     {MaxEpoch->20000,
      ValidationInputs->flat[[59001;;59500]],
      ValidationTargets->flat[[59001;;59500]],
      StepMonitor->ScreenMonitor,
      InitialLearningRate->\[Lambda]}];