text:
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("Clappr"), require("shaka"));
	else if(typeof define === 'function' && define.amd)
		define(["Clappr", "shaka"], factory);
	else if(typeof exports === 'object')
		exports["DashShakaPlayback"] = factory(require("Clappr"), require("shaka"));
	else
		root["DashShakaPlayback"] = factory(root["Clappr"], root["shaka"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;
/******/
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	Object.defineProperty(exports, '__esModule', {
	  value: true
	});

	var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

	var _get = function get(_x2, _x3, _x4) { var _again = true; _function: while (_again) { var object = _x2, property = _x3, receiver = _x4; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x2 = parent; _x3 = property; _x4 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };

	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

	function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

	function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

	var _clappr = __webpack_require__(1);

	var _shakaPlayer = __webpack_require__(2);

	var _shakaPlayer2 = _interopRequireDefault(_shakaPlayer);

	var SEND_STATS_INTERVAL_MS = 30 * 1e3;
	var DEFAULT_LEVEL_AUTO = -1;

	var DashShakaPlayback = (function (_HTML5Video) {
	  _inherits(DashShakaPlayback, _HTML5Video);

	  _createClass(DashShakaPlayback, [{
	    key: 'name',
	    get: function get() {
	      return 'dash_shaka_playback';
	    }
	  }, {
	    key: 'shakaVersion',
	    get: function get() {
	      return _shakaPlayer2['default'].player.Player.version;
	    }
	  }, {
	    key: 'shakaPlayerInstance',
	    get: function get() {
	      return this._player;
	    }
	  }, {
	    key: 'levels',
	    get: function get() {
	      return this._levels;
	    }
	  }, {
	    key: 'currentLevel',
	    set: function set(id) {
	      var _this = this;

	      this._currentLevelId = id;
	      var isAuto = this._currentLevelId === DEFAULT_LEVEL_AUTO;

	      this._player.configure({ abr: { enable: !isAuto } });
	      this.trigger(_clappr.Events.PLAYBACK_LEVEL_SWITCH_START);
	      if (!isAuto) {
	        this.selectTrack(this.videoTracks.filter(function (t) {
	          return t.id === _this._currentLevelId;
	        })[0]);
	      }
	      this.trigger(_clappr.Events.PLAYBACK_LEVEL_SWITCH_END);
	    },
	    get: function get() {
	      return this._currentLevelId || DEFAULT_LEVEL_AUTO;
	    }
	  }], [{
	    key: 'canPlay',
	    value: function canPlay(resource) {
	      var mimeType = arguments.length <= 1 || arguments[1] === undefined ? '' : arguments[1];

	      _shakaPlayer2['default'].polyfill.installAll();
	      var browserSupported = _shakaPlayer2['default'].Player.isBrowserSupported();
	      var resourceParts = resource.split('?')[0].match(/.*\.(.*)$/) || [];
	      return browserSupported && (resourceParts[1] === 'mpd' || mimeType.indexOf('application/dash+xml') > -1);
	    }
	  }, {
	    key: 'Events',
	    get: function get() {
	      return {
	        SHAKA_READY: 'shaka:ready'
	      };
	    }
	  }]);

	  function DashShakaPlayback(options) {
	    _classCallCheck(this, DashShakaPlayback);

	    _get(Object.getPrototypeOf(DashShakaPlayback.prototype), 'constructor', this).call(this, options);
	    this._levels = [];
	    options.autoPlay && this.play();
	  }

	  _createClass(DashShakaPlayback, [{
	    key: 'play',
	    value: function play() {
	      if (!this._player) {
	        this._setup();
	      }

	      if (!this.isReady) {
	        this.once(DashShakaPlayback.Events.SHAKA_READY, this.play);
	        return;
	      }

	      this._src = this.el.src;
	      _get(Object.getPrototypeOf(DashShakaPlayback.prototype), 'play', this).call(this);
	    }

	    // skipping setup `setupSrc` on tag video
	  }, {
	    key: 'setupSrc',
	    value: function setupSrc() {}

	    // skipping ready event on video tag in favor of ready on shaka
	  }, {
	    key: '_ready',
	    value: function _ready() {}
	  }, {
	    key: 'error',

	    // skipping error handling on video tag in favor of error on shaka
	    value: function error(event) {
	      _clappr.Log.error('an error was raised by the video tag', event, this.el.error);
	    }
	  }, {
	    key: 'isHighDefinitionInUse',
	    value: function isHighDefinitionInUse() {
	      return !!this.highDefinition;
	    }
	  }, {
	    key: 'stop',
	    value: function stop() {
	      var _this2 = this;

	      clearInterval(this.sendStatsId);
	      this._sendStats();

	      this._player.unload().then(function () {
	        _get(Object.getPrototypeOf(DashShakaPlayback.prototype), 'stop', _this2).call(_this2);
	        _this2._player = null;
	        _this2._isShakaReadyState = false;
	      })['catch'](function () {
	        _clappr.Log.error('shaka could not be unloaded');
	      });
	    }
	  }, {
	    key: 'getPlaybackType',
	    value: function getPlaybackType() {
	      return (this._player && this._player.isLive() ? 'live' : 'vod') || '';
	    }
	  }, {
	    key: 'selectTrack',
	    value: function selectTrack(track) {
	      this._player.selectTrack(track);
	      this._onAdaptation();
	    }
	  }, {
	    key: 'destroy',
	    value: function destroy() {
	      var _this3 = this;

	      clearInterval(this.sendStatsId);

	      if (this._player) {
	        this._destroy();
	      } else {
	        this._player.destroy().then(function () {
	          return _this3._destroy();
	        })['catch'](function () {
	          _this3._destroy();
	          _clappr.Log.error('shaka could not be destroyed');
	        });
	      }
	    }
	  }, {
	    key: '_setup',
	    value: function _setup() {
	      var _this4 = this;

	      this._isShakaReadyState = false;
	      this._player = this._createPlayer();
	      this._options.shakaConfiguration && this._player.configure(this._options.shakaConfiguration);
	      this._options.shakaOnBeforeLoad && this._options.shakaOnBeforeLoad(this._player);

	      var playerLoaded = this._player.load(this._options.src);
	      playerLoaded.then(function () {
	        return _this4._loaded();
	      })['catch'](function (e) {
	        return _this4._setupError(e);
	      });
	    }
	  }, {
	    key: '_createPlayer',
	    value: function _createPlayer() {
	      var player = new _shakaPlayer2['default'].Player(this.el);
	      player.addEventListener('error', this._onError.bind(this));
	      player.addEventListener('adaptation', this._onAdaptation.bind(this));
	      player.addEventListener('buffering', this._onBuffering.bind(this));
	      return player;
	    }
	  }, {
	    key: '_onBuffering',
	    value: function _onBuffering(e) {
	      var event = e.buffering ? _clappr.Events.PLAYBACK_BUFFERING : _clappr.Events.PLAYBACK_BUFFERFULL;
	      this.trigger(event);
	    }
	  }, {
	    key: '_loaded',
	    value: function _loaded() {
	      this._isShakaReadyState = true;
	      this.trigger(DashShakaPlayback.Events.SHAKA_READY);
	      _get(Object.getPrototypeOf(DashShakaPlayback.prototype), '_ready', this).call(this);
	      this._startToSendStats();
	      this._fillLevels();
	    }
	  }, {
	    key: '_fillLevels',
	    value: function _fillLevels() {
	      if (this._levels.length === 0) {
	        this._levels = this.videoTracks.map(function (videoTrack) {
	          return { id: videoTrack.id, label: videoTrack.height + 'p' };
	        }).reverse();
	        this.trigger(_clappr.Events.PLAYBACK_LEVELS_AVAILABLE, this.levels);
	      }
	    }
	  }, {
	    key: '_startToSendStats',
	    value: function _startToSendStats() {
	      var _this5 = this;

	      var intervalMs = this._options.shakaSendStatsInterval || SEND_STATS_INTERVAL_MS;
	      this.sendStatsId = setInterval(function () {
	        return _this5._sendStats();
	      }, intervalMs);
	    }
	  }, {
	    key: '_sendStats',
	    value: function _sendStats() {
	      this.trigger(_clappr.Events.PLAYBACK_STATS_ADD, this._player.getStats());
	    }
	  }, {
	    key: '_setupError',
	    value: function _setupError(err) {
	      this._onError(err);
	    }
	  }, {
	    key: '_onError',
	    value: function _onError(err) {
	      _clappr.Log.error('Shaka error event:', err);
	      this.trigger(_clappr.Events.PLAYBACK_ERROR, err, this.name);
	    }
	  }, {
	    key: '_onAdaptation',
	    value: function _onAdaptation() {
	      var activeVideo = this.videoTracks.filter(function (t) {
	        return t.active === true;
	      })[0];

	      this._fillLevels();

	      _clappr.Log.debug('an adaptation has happened:', activeVideo);
	      this.highDefinition = activeVideo.height >= 720;
	      this.trigger(_clappr.Events.PLAYBACK_HIGHDEFINITIONUPDATE, this.highDefinition);
	      this.trigger(_clappr.Events.PLAYBACK_BITRATE, {
	        bandwidth: activeVideo.bandwidth,
	        width: activeVideo.width,
	        height: activeVideo.height,
	        level: activeVideo.id
	      });
	    }
	  }, {
	    key: '_destroy',
	    value: function _destroy() {
	      _get(Object.getPrototypeOf(DashShakaPlayback.prototype), 'destroy', this).call(this);
	      this._isShakaReadyState = false;
	      _clappr.Log.debug('shaka was destroyed');
	    }
	  }, {
	    key: 'isReady',
	    get: function get() {
	      return this._isShakaReadyState;
	    }
	  }, {
	    key: 'textTracks',
	    get: function get() {
	      return this._player && this._player.getTextTracks();
	    }
	  }, {
	    key: 'audioTracks',
	    get: function get() {
	      return this._player && this._player.getVariantTracks().filter(function (t) {
	        return t.mimeType.startsWith('audio/');
	      });
	    }
	  }, {
	    key: 'videoTracks',
	    get: function get() {
	      return this._player && this._player.getVariantTracks().filter(function (t) {
	        return t.mimeType.startsWith('video/');
	      });
	    }
	  }]);

	  return DashShakaPlayback;
	})(_clappr.HTML5Video);

	exports['default'] = DashShakaPlayback;
	module.exports = exports['default'];

/***/ }),
/* 1 */
/***/ (function(module, exports) {

	module.exports = __WEBPACK_EXTERNAL_MODULE_1__;

/***/ }),
/* 2 */
/***/ (function(module, exports) {

	module.exports = __WEBPACK_EXTERNAL_MODULE_2__;

/***/ })
/******/ ])
});
;
//# sourceMappingURL=dash-shaka-playback.js.map


text:
<?php

namespace AppBundle\Controller;

use AppBundle\Entity\Flight;
use AppBundle\Form\FlightFilters;
use AppBundle\Form\FlightStepOneType;
use AppBundle\Form\FlightStepTwoType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;

/**
 * Class FlightController
 *
 * @package AppBundle\Controller
 * @author Boris MALEZYK <contact@borismalezyk.com>
 * @Route("/vols")
 */
class FlightController extends Controller
{
    /**
     * @Route("/nouveau", name="new_flight")
     */
    public function newAction()
    {
        $user = $this->getUser();
        if (($airport = $user->getAirport()) == null) {
            return $this->redirect('flights');
        }

        $em     = $this->getDoctrine()->getManager();
        $flight = new Flight();
        $flight->setDepartureAirport($airport);
        $em->persist($flight);
        $em->flush();
        $em->refresh($flight);

        return $this->redirect($this->generateUrl('edit_step_one_flight', ['id' => $flight->getId()]));
    }

    /**
     * @param                                           $id
     * @param \Symfony\Component\HttpFoundation\Request $request
     *
     * @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
     *
     * @Route(path="/editer/etape-1/{id}", name="edit_step_one_flight")
     */
    public function editStepOneAction(Request $request, $id)
    {

        /** @var \UserBundle\Entity\User $user */
        $user = $this->getUser();
        $em   = $this->getDoctrine()->getManager();
        /** @var \AppBundle\Entity\Flight $flight */
        $flight = $em->getRepository('AppBundle:Flight')->find($id);

        if ($flight == null || $user->getAirport()->getId() != $flight->getDepartureAirport()->getId()) {
            return $this->redirect('flights');
        }

        $form = $this->createForm(FlightStepOneType::class, $flight);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {

            $em->persist($form->getData());
            $em->flush();

            return $this->redirect($this->generateUrl('edit_step_two_flight', ['id' => $id]));
        }

        return $this->render('Flight\form_step_one.html.twig', ['form' => $form->createView()]);
    }

    /**
     * @param                                           $id
     * @param \Symfony\Component\HttpFoundation\Request $request
     *
     * @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
     *
     * @Route(path="/editer/etape-2/{id}", name="edit_step_two_flight")
     */
    public function editStepTwoAction(Request $request, $id)
    {

        /** @var \UserBundle\Entity\User $user */
        $user = $this->getUser();
        $em   = $this->getDoctrine()->getManager();
        /** @var \AppBundle\Entity\Flight $flight */
        $flight = $em->getRepository('AppBundle:Flight')->find($id);

        if ($flight == null || $user->getAirport()->getId() != $flight->getDepartureAirport()->getId()) {
            return $this->redirect($this->generateUrl('flights'));
        }

        $form = $this->createForm(FlightStepTwoType::class, $flight);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {

            /** @var Flight$ $flight */
            $flight = $form->getData();
            $flight->setDraft(true);
            $em->persist($form->getData());
            $em->flush();

            return $this->redirect($this->generateUrl('flights'));
        }

        return $this->render('Flight\form_step_two.html.twig', ['form' => $form->createView()]);
    }

    /**
     * @param                                           $id
     *
     * @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
     *
     * @Route(path="/suppression/{id}", name="delete_flight")
     */
    public function deleteAction($id)
    {

        /** @var \UserBundle\Entity\User $user */
        $user = $this->getUser();
        $em   = $this->getDoctrine()->getManager();
        /** @var \AppBundle\Entity\Flight $flight */
        $flight = $em->getRepository('AppBundle:Flight')->find($id);

        if ($flight != null && $user->getAirport()->getId() == $flight->getDepartureAirport()->getId()) {
            $em->remove($flight);
            $em->flush();
        }

        return $this->redirect($this->generateUrl('flights'));
    }

    /**
     * @param \Symfony\Component\HttpFoundation\Request $request
     *
     * @return \Symfony\Component\HttpFoundation\Response
     *
     * @Route("/", name="flights")
     */
    public function listAction(Request $request)
    {
        $airport = $this->getUser()->getAirport();

        $form = $this->createForm(FlightFilters::class, null, [
            'method' => 'GET',
            'action' => $this->generateUrl('flights'),
        ]);

        $form->handleRequest($request);
        $filters        = array_merge(($form->getData()) ? $form->getData() : [], ['departureAirport' => $airport]);
        $flightSearcher = $this->get('component.flight_searcher');

        return $this->render('Flight\list.html.twig', [
            'flights' => $flightSearcher->getFlightsByFilters($filters),
            'form'    => $form->createView(),
        ]);
    }
}

redpajama_set_name: RedPajamaGithub


text:
/**
 * \file gpsposition.h
 * \brief Arduino library for modeling a position as GPS location.
 *
 * \author Marco Boeris Frusca
 *
 */
#ifndef GPSPOSITION_H_
#define GPSPOSITION_H_

#include "Arduino.h"

namespace sdp
{
  namespace sensor
  {

    /**
     * The class GPSPosition models a GPS location. A GPS location (position) has three component: latitude,
     * longitude and altitude. Latitude and longitude are in decimal degree format (where
     * positive value means North for latitude and West for longitude).
     * Altitude value is an integer and its unit is meter.
     *
     */
    class GPSPosition
    {
      public:
        /**
         * \enum    _gps_error
         *
         * Error code used to signal an invalid coordinate
         */
        enum _gps_error
        {
          /// No errors
          NO_ERROR = 0,
          //! Invalid coordinate length
          INVALID_COORD_LEN = -1,

          //! Invalid format of the coordinate
          INVALID_COORD_STRING_FORMAT = -2,

          //! Invalid value of the coordinate
          INVALID_COORD_VALUE = -3,
        };

        /**
         * \enum    _gps_attributes
         *
         * Length of the GPS class attributes (internal buffer of chars)
         */
        enum _gps_attributes
        {
          //! Length of internal buffer where coordinate (latitude or longitude) is stored
          COODINATE_LENGTH = 0x12,

          //! Length of internal buffer where altitude is stored
          ALTITUDE_LENGTH = 0x08,
        };

        /**
         * Default Constructor
         *
         */
        GPSPosition();

        /**
         * Copy Constructor
         *
         */
        GPSPosition(const GPSPosition& p);

        /**
         * Destructor
         *
         */
        virtual ~GPSPosition();

        /**
         * Sets latitude to a given value. Value have to be in decimal degree. Positive
         * values represent North coordinate and negative ones represent South coordinate.
         *
         * \param[in] coord latitude value (in decimal degree)
         *
         * \return NO_ERROR: if no errors, code errors #_gps_error otherwise
         */
        int setLatitude(const char *coord);

        /**
         * Sets longitude to a given value. Value have to be in decimal degree. Positive
         * values represent West coordinate and negative ones represent East coordinate.
         *
         * \param[in] coord longitude value (in decimal degree)
         *
         * \return NO_ERROR: if no errors, code errors #_gps_error otherwise
         */
        int setLongitude(const char *coord);

        /**
         * Sets altitude to a given value. Value have to be an integer value (in meters).
         *
         * \param[in] coord altitude value (meters)
         *
         * \return NO_ERROR: if no errors, code errors #_gps_error otherwise
         */
        int setAltitude(const char *coord);

        /**
         * Gets latitude in decimal degree as a string.
         *
         * \return coordinate value in decimal degree
         */
        const char* latitude() const;

        /**
         * Gets longitude in decimal degree as a string.
         *
         * \return coordinate value in decimal degree
         */
        const char* longitude() const;

        /**
         * Gets altitude in meters as a string.
         *
         * \return altitude value in meters
         */
        const char* altitude() const;

        /**
         * Overload operator = . It copies latitude, longitude and altitude values
         *
         */
        GPSPosition& operator=(const GPSPosition& p);

      private:
        /**
         * Sets a GPS component (latitude or longitude) to a given coordinate.
         * This function is the same for latitude and longitude and checks the format and the
         * value of the coordinate (it must be between -180 and 180)
         *
         * \param[in] coord coordinate value
         *
         * \return NO_ERROR: if no errors, #_gps_error code errors otherwise
         */
        int setCoordinate(const char *coord, char *dest);

        //! Latitude
        char m_latitude[COODINATE_LENGTH];

        //! Longitude
        char m_longitude[COODINATE_LENGTH];

        //! Altitude
        char m_altitude[ALTITUDE_LENGTH];

    };

    inline const char* GPSPosition::latitude() const
    {
      return m_latitude;
    }

    inline const char* GPSPosition::longitude() const
    {
      return m_longitude;
    }

    inline const char* GPSPosition::altitude() const
    {
      return m_altitude;
    }
  }
}
#endif /* GPSPOSITION_H_ */


text:
var mongoose = require('mongoose')
  , config = require('../config') // application configuration
;

var imageSchema = new mongoose.Schema({
  url: { type: String, required: true },
  personKey: { type: String, required: true }, // person.providerKey + '/' + person.key
  etag: String, // ETag
  size: Number, // image contents size
  //lastModified: String, // last modified tag
  basename: String, // image file base name
  dateOfFirstSync: { type: Date, default: Date.now }, // date of first sync
  //dateOfLastSync: { type: Date, default: Date.now }, // date of last sync
  signature: String, // 64) binary ([0-1])bytes signature (perceptual hash)
  //hasDuplicate: Boolean, // this image has a duplicate
  isShowcase: Boolean, // this image is showcase for person
  isTruthful: Boolean, // this image is to be considered thruthful
  isAvaliable: { type: Boolean, default: true } // this image is publicly available on it's url
},
{
  autoIndex: config.env === 'development'
});
imageSchema.index({ url: 1 }, { unique: false }); // for some provider issue, more persons could share same image url

/*
imageSchema.methods.Save = function(callback) {
  return this.model('Image').savefind({ type: this.type }, callback);
};
*/

/*
// expose collection methods
imageSchema.statics.findAndModify = function(query, sort, doc, options, callback) {
  return this.collection.findAndModify(query, sort, doc, options, callback);
};
*/

module.exports = mongoose.model('Image', imageSchema);


text:
namespace Skiwy.Wpf.Pages.Sites
{
	/// <summary>
	///   Interaction logic for ListPage1.xaml
	/// </summary>
	public partial class Overview
	{
		public Overview()
		{
			this.InitializeComponent();
		}
	}
}


text:
package ru.pravvich.jdbc.actions;

import ru.pravvich.jdbc.PropertiesLoader;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * Deleter users from database.
 */
public class UserDeleter extends Action {
    /**
     * Default constructor for all actions with database.
     *
     * @param connection to database.
     * @param scripts    which extract from properties file.
     */
    public UserDeleter(final Connection connection, final PropertiesLoader scripts) {
        super(connection, scripts);
    }

    public void deleteUserBy(final int id) {

        try (final PreparedStatement statement =

                     connection.prepareStatement(

                             scripts.get("del_user_by_id"))) {

            statement.setInt(1, id);

            statement.executeUpdate();

        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    public void deleteUserBy(final String login, final String password) {

        try (final PreparedStatement statement =

                    connection.prepareStatement(

                            scripts.get("del_user_by_log_pas"))
        ) {

            statement.setString(1, login);

            statement.setString(2, password);

            statement.executeUpdate();

        } catch (SQLException e) {
            e.printStackTrace();
        }

    }
}


text:
.. _tutor_lib:

Libraries
=========

This section provides tutorials for HydraTK libraries.

.. toctree::
   :maxdepth: 1

   lib/numeric/numeric.rst


text:
module Language.Xi.Base.Syntax where

-- | Syntactic representation of constants.
data Constant
    = ConstBool Bool        -- ^ Boolean.
    | ConstInt Int          -- ^ Integer.
    | ConstChar Char        -- ^ Character.
    | ConstString String    -- ^ String literal.
    | ConstUnit             -- ^ Unit (void).

-- | Operations over booleans.
data BoolOperation
    = BoolAnd       -- ^ Logical AND.
    | BoolOr        -- ^ Logical OR.
    | BoolNot       -- ^ Logical NOT.

-- | Operations over integers.
data IntOperation
    = IntPlus       -- ^ Integer addition.
    | IntMinus      -- ^ Integer subtraction.
    | IntMult       -- ^ Integer multiplication.
    | IntDiv        -- ^ Integer division.
    | IntMod        -- ^ Integer reminder.

-- | Operations over strings.
data StringOperation
    = StringPlus    -- ^ String concatenation.

-- | Comparison operations.
data ComparisonOperation
    = CompLT    -- ^ Less than.
    | CompLE    -- ^ Less than or equal.
    | CompEQ    -- ^ Equal.
    | CompNE    -- ^ Not equal.
    | CompGE    -- ^ Greater than or equal.
    | CompGT    -- ^ Greater than.

-- | Syntactic expression.
data Expression
    = ExprBool      BoolExpression      -- ^ Boolean expression.
    | ExprInt       IntExpression       -- ^ Integer expression.
    | ExprChar      CharExpression      -- ^ Character expression.
    | ExprString    StringExpression    -- ^ String expression.
    | ExprUnit      UnitExpression      -- ^ Unit expression.

-- | Boolean expressions.
data BoolExpression
    = BoolExprConst      ConstBool                              -- ^ Boolean literal.
    | BoolExprOp         BoolOperation [BoolExpression]         -- ^ Operation over booleans.
    | BoolExprCompInt    ComparisonOperation [IntExpression]    -- ^ Integer comparison.
    | BoolExprCompChar   ComparisonOperation [CharExpression]   -- ^ Character comparison.
    | BoolExprCompString ComparisonOperation [StringExpression] -- ^ String comparison.

-- | Integer expressions.
data IntExpression
    = IntExprConst  ConstInt                        -- ^ Integer literal.
    | IntExprOp     IntOperation [IntExpression]    -- ^ Operation over integers.

-- | Character expressions.
data CharExpression
    = CharExprConst ConstChar

-- | String expressions.
data StringExpression
    = StringExprConst ConstString                           -- ^ String literal.
    | StringExprOp    StringOperation [StringExpression]    -- ^ Operation over strings.

-- | Unit (void) expressions.
data UnitExpression
    = UnitExprConst ConstUnit   -- ^ Unit literal.


text:
NSString *QKTestDatabaseName = @"test_database";
NSString *QKTestTableName    = @"test_table";

NSString *QKTestFieldOne   = @"test_field1";
NSString *QKTestFieldTwo   = @"test_field2";
NSString *QKTestFieldThree = @"test_field3";
NSString *QKTestFieldFour  = @"test_field4";

NSString *QKTestUpdateValueOne = @"update_one";
NSString *QKTestUpdateValueTwo = @"update_two";

NSUInteger QKTestParameterOne = 10;
NSString *QKTestParameterTwo = @"test_value";


text:
from django_bdd_engine.toplevel import *  # database preparation

import os
import tempfile
import time
import datetime
import pytz  # timezone support: datetime.datetime.now(pytz.utc)
import shutil
import logging
import traceback

from django_bdd_engine.utility.cloudwatch import put_metric_data, METRIC_ENGINE_TEST_RUN_DURATION

from django.conf import settings
from django.db import connection

from s3util.s3util import S3Util
from django_bdd.models import NEW, RUNNING, FAILED, PASSED, SKIPPED, TestRun, TestRunStep
from django_bdd.notifications import notify
from mobilebdd.runner import goh_behave
from mobilebdd.listener import Listener  # defines a set of hooks that behave calls

log = logging.getLogger(u'django-bdd')

SCREENSHOT_FOLDER = u'bdd/results/{test_id}/{run_id}/{example_row_num}'
SCREENSHOT_NAME_TEMPLATE = SCREENSHOT_FOLDER + u'/{filename}'

def ensure_connection():
    """This is a hack to make sure that the django db connection wil be available
    before any query or save that has had too much time pass before it.
    """
    # HACK django db connections sometimes time out
    connection.close()

class TestDriver(Listener):
    """Takes a test_run to use for saving results, and defines hooks for
    Behave to call in order to save the results to the db.
    """

    def __init__(self, engine, test_run_id, endpoint, webdriver_processor=None):
        """
        :param test_run_id: the test_run id
        :param endpoint: the endpoint to run the test against
        :param webdriver_processor: a class (or None) implementing hooks like a
            cabability filter, allowing outside users to have the final say on
            capabilities
        """
        super(Listener, self).__init__()
        log.debug(u'running against endpoint "{}"'.format(endpoint))

        self.s3_util = S3Util(settings.AWS_ACCESS_KEY, settings.AWS_SECRET_ACCESS_KEY, s3_bucket=settings.AWS_BUCKET)

        log.debug(u'getting test run {}'.format(test_run_id))
        ensure_connection()
        self.test_run = TestRun.objects.get(pk=test_run_id)
        self.endpoint = endpoint
        self.webdriver_processor = webdriver_processor
        self.example_row_num = 1  # keep track of which permutation row number of the scenario we're on
        self.test_step_num = 1  # keep track of which test step number we're on within a permutation

        # create a feature file and the necessary folders
        log.debug(u'creating temp folders and files')
        self.feature_dir = tempfile.mkdtemp()
        self.result_dir = tempfile.mkdtemp()
        self.feature_file_text = u''
        self.feature_file = tempfile.NamedTemporaryFile(suffix=u'.feature', dir=self.feature_dir)

        # pull the steps out of the test run's test object
        steps = self.test_run.test.steps

        # if the feature has not been explicitly defined, create a Feature: entry at the top of the file
        if 'Feature:' not in steps:
            self.feature_file_text += u'Feature: {}\r\n'.format(self.test_run.test.name)

        # if it's a scenario, there are no examples
        # if it's a scenario outline, Examples: should be present
        # http://jenisys.github.io/behave.example/tutorials/tutorial04.html

        # if the user has not explicitly defined a Scenario: or Scenario Outline section, detect which one should be created
        if 'Scenario:' not in steps and 'Scenario Outline:' not in steps:
            if 'Examples:' in steps:
                log.debug('examples detected in steps, writing scenario outline to feature file')
                scenario_header = u'Scenario Outline: {}\r\n'
            elif self.test_run.example_text:
                log.debug('examples detected in test run example_text, writing scenario outline to feature file')
                scenario_header = u'Scenario Outline: {}\r\n'
            else:
                log.debug('writing normal scenario to feature file')
                scenario_header = u'Scenario: {}\r\n'

            # write the scenario header to the feature file text
            self.feature_file_text += scenario_header.format(self.test_run.test.name)

        self.feature_file_text += steps
        self.feature_file_text += u'\r\n\r\n'  # add some space at the end of the file

        # if example text exists in the test run, write an 'Examples:' section
        # with the text that is present in the db
        if self.test_run.example_text:
            self.feature_file_text += u'Examples:\r\n'
            self.feature_file_text += self.test_run.example_text

        log.debug(u'writing to feature file:\r\n{}'.format(self.feature_file_text))
        self.feature_file.write(self.feature_file_text.encode(u'utf8'))

        log.debug(u'flushing feature file')
        self.feature_file.file.flush()

    def start(self):
        # measure elapsed time in case the test run throws an exception
        start_time = time.time()

        step_dirs = []
        try:
            log.debug(u'calling goh_behave')
            goh_behave(
                feature_dirs=[self.feature_dir],
                step_dirs=step_dirs,
                test_artifact_dir=self.result_dir,
                listeners=[self],
                webdriver_url=self.endpoint,
                webdriver_processor=self.webdriver_processor
            )

            # report the test run duration metric
            log.debug(u'completed running test run {} in {} seconds, reporting metric'.format(self.test_run.id, self.test_run.duration))
            put_metric_data(METRIC_ENGINE_TEST_RUN_DURATION, value=self.test_run.duration)
        except Exception as e:
            # there's a chance that an exception might be thrown. if so, then
            # there's also a chance that the callbacks didnt get reached, so we
            # catch here and report failure
            log.debug(u'goh_behave threw an exception: {}'.format(unicode(e)))
            self.test_run.status = FAILED

            # add the exception text as well as the traceback
            self.test_run.text += u'Exception:\n' + unicode(e) + u'\n\nTraceback:\n' + unicode(traceback.format_exc())

            self.test_run.duration = time.time() - start_time
            ensure_connection()
            self.test_run.save()
        finally:
            # always cleanup
            log.debug(u'cleaning temp directories')
            shutil.rmtree(self.feature_dir)
            shutil.rmtree(self.result_dir)

    """Behave Hooks"""
    def before_feature(self, feature):
        """Inspect the feature. Here, we create pre-create every step that is
        going to be necessary in the db so that we can start recording results.
        """
        log.debug(u'before_feature')

        # set the test to running immediately
        self.test_run.status = RUNNING
        ensure_connection()
        self.test_run.save()

        # the Behave 'Example' row number - the way this works is Behave generates a Scenario for
        # each row in the example tables, regardless of how many tables there are. all of the
        # tables must conform to the same structure, so we just need to have one set of step results
        # per now in these tables. to think of it another way, per scenario generated by walk_scenarios()
        # as we call below. walk_scenarios() will only return 1 result if it's a regular Scenario as
        # opposed to a ScenarioOutline object, which is fine
        example_row_num = 1
        for scenario in feature.walk_scenarios():
            log.debug(u'creating step result entries in db for "Example" row number {}'.format(example_row_num))

            # run through all background steps and create them in the db
            start = 1
            for num, step in enumerate(scenario.background_steps, start=start):
                self.test_run.testrunstep_set.create(
                    num=num,
                    example_row_num=example_row_num,
                    text=u'{} {}'.format(step.keyword, step.name),
                    status=NEW
                )
                start += 1

            # run through all normal steps and create them in the db
            for num, step in enumerate(scenario.steps, start=start):
                self.test_run.testrunstep_set.create(
                    num=num,
                    example_row_num=example_row_num,
                    text=u'{} {}'.format(step.keyword, step.name),
                    status=NEW
                )
            example_row_num += 1

    def before_scenario(self, scenario):
        self.test_step_num = 1  # reset the test step number we're on

    def before_step(self, step):
        log.debug(u'before_step: test_step_num = {}'.format(self.test_step_num))
        # mark the step was running in the db
        try:
            ensure_connection()
            test_step = self.test_run.testrunstep_set.get(
                num=self.test_step_num,
                example_row_num=self.example_row_num,
                text=u'{} {}'.format(step.keyword, step.name)
            )
        except TestRunStep.DoesNotExist:
            # don't care, if not found, then likely this is a substep that
            # doesnt need to be reported in the ui
            pass
        else:
            log.debug(u'setting step {} to running'.format(test_step.id))
            test_step.status = RUNNING
            test_step.timestamp_start = datetime.datetime.now(pytz.utc)
            test_step.save()

    def after_step(self, step):
        log.debug(u'after_step')

        if step.error_message:
            log.debug(u'adding step error message to test run text: {}'.format(step.error_message))
            self.test_run.text += step.error_message
            ensure_connection()
            self.test_run.save()

        screenshot_key = None
        # save a screenshot if the test result step got one
        if step.screenshot_path:
            # put in s3
            filename = os.path.basename(step.screenshot_path)
            screenshot_key = SCREENSHOT_NAME_TEMPLATE.format(
                test_id=self.test_run.test.id,
                run_id=self.test_run.id,
                example_row_num=self.example_row_num,
                filename=filename
            )
            log.debug(u'saving screenshot at "{}" to s3 with key "{}"'.format(filename, screenshot_key))
            with open(step.screenshot_path) as f:
                self.s3_util.save_screenshot(screenshot_key, f)
            log.debug(u'done saving screenshot to s3')

        # update our db stuff
        # try to get the appropriate step
        # we query instead of caching locally because bdd steps might have
        # substeps, which will still trigger this callback and throw off our
        # counting/step mapping.
        step_text = u'{} {}'.format(step.keyword, step.name)
        try:
            # use both num and text, because any of these steps could 'expand' via substeps
            log.debug(u'getting test_step with {}'.format(
                    {u'num': self.test_step_num, u'example_row_num': self.example_row_num, u'text': step_text}
                )
            )
            ensure_connection()
            test_step = self.test_run.testrunstep_set.get(
                num=self.test_step_num,
                example_row_num=self.example_row_num,
                text=step_text
            )
        except TestRunStep.DoesNotExist:
            # do nothing, because it's a step that wasn't in the original test
            # ie. a substep.
            log.warn(u'after_step: test run step "{}" does not exist, could be a real error or a "substep"'.format(step_text))
        else:
            test_step.status = step.status
            test_step.timestamp_end = datetime.datetime.now(pytz.utc)
            test_step.duration = step.duration
            test_step.screenshot_s3_key = screenshot_key
            ensure_connection()
            test_step.save()

            # incr test step cuz we found the 'real' step
            self.test_step_num += 1

        log.debug(u'after_step: test_step_num is now {}'.format(self.test_step_num))

    def after_scenario(self, scenario):
        log.debug(u'after_scenario')

        # increment the 'Example' row number we're on
        self.example_row_num += 1

        log.debug(u'after_scenario: example_row_num is now {}'.format(self.example_row_num))

    def after_feature(self, feature):
        log.debug(u'after_feature - feature status: {}'.format(feature.status))

        # update the test run status based on the feature's final status
        if feature.status == u'skipped':
            self.test_run.status = SKIPPED
        elif feature.status == u'passed':
            self.test_run.status = PASSED
        elif feature.status == u'failed':
            self.test_run.status = FAILED

        self.test_run.duration = feature.duration
        ensure_connection()
        self.test_run.save()

        # try sending an email about the test run
        log.debug(u'sending notification email to test run user: {}'.format(self.test_run.user))
        notify(self.test_run)
        log.debug(u'done sending email')


text:
This is a pod file

=head1 Title of the article

this really rocks
OMG this is another line

=cut

fuck :)


text:
<?php
namespace PayPal\PayPalAPI;
use PayPal\EBLBaseComponents\AbstractResponseType;
/**
 *
 */
class InitiateRecoupResponseType  extends AbstractResponseType
  {

}


text:
// <copyright file="AbsoluteRiskStatistics.cs" company="Math.NET">
// Math.NET Numerics, part of the Math.NET Project
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
// Copyright (c) 2009-2013 Math.NET
//
// 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.
// </copyright>

using System;
using System.Collections.Generic;
using System.Linq;
using MathNet.Numerics.Statistics;

namespace MathNet.Numerics.Financial
{
    public static class AbsoluteRiskMeasures
    {
        // Note: The following statistics would be considered an absolute risk statistic in the finance realm as well.
        // Standard Deviation
        // Annualized Standard Deviation = Math.Sqrt(Monthly Standard Deviation x ( 12 ))
        // Skewness
        // Kurtosis

        /// <summary>
        /// Calculation is similar to Standard Deviation , except it calculates an average (mean) return only for periods with a gain
        /// and measures the variation of only the gain periods around the gain mean. Measures the volatility of upside performance.
        /// © Copyright 1996, 1999 Gary L.Gastineau. First Edition. © 1992 Swiss Bank Corporation.
        /// </summary>
        public static double GainStandardDeviation(this IEnumerable<double> data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            return data.Where(x => x >= 0).StandardDeviation();
        }

        /// <summary>
        /// Similar to standard deviation, except this statistic calculates an average (mean) return for only the periods with a loss and then
        /// measures the variation of only the losing periods around this loss mean. This statistic measures the volatility of downside performance.
        /// </summary>
        /// <remarks>http://www.offshore-library.com/kb/statistics.php</remarks>
        public static double LossStandardDeviation(this IEnumerable<double> data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            return data.Where(x => x < 0).StandardDeviation();
        }

        /// <summary>
        /// This measure is similar to the loss standard deviation except the downside deviation
        /// considers only returns that fall below a defined minimum acceptable return (MAR) rather than the arithmetic mean.
        /// For example, if the MAR is 7%, the downside deviation would measure the variation of each period that falls below
        /// 7%. (The loss standard deviation, on the other hand, would take only losing periods, calculate an average return for
        /// the losing periods, and then measure the variation between each losing return and the losing return average).
        /// </summary>
        public static double DownsideDeviation(this IEnumerable<double> data, double minimalAcceptableReturn)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            return data.Where(x => x < minimalAcceptableReturn).StandardDeviation();
        }

        /// <summary>
        /// A measure of volatility in returns below the mean. It's similar to standard deviation, but it only
        /// looks at periods where the investment return was less than average return.
        /// </summary>
        public static double SemiDeviation(this IEnumerable<double> data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            var mean = data.Mean();
            var belowMeanData = data.Where(x => x < mean);
            return belowMeanData.StandardDeviation();
        }

        /// <summary>
        /// Measures a fund's average gain in a gain period divided by the fund's average loss in a losing
        /// period. Periods can be monthly or quarterly depending on the data frequency.
        /// </summary>
        public static double GainLossRatio(this IEnumerable<double> data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            var gains = data.Where(x => x >= 0);
            var losses = data.Where(x => x < 0);
            return Math.Abs(gains.Mean() / losses.Mean());
        }
    }
}


text:
package org.snowstorm.plugin;

public enum PluginState
{
	KNOWN, ENABLED, DISABLED
}


text:
title: "Abseil Python Docs are Here!"
layout: blog
sidenav: side-nav-blog.html
published: true
permalink: blog/20180831-python-docs
type: markdown
category: blog
excerpt_separator: <!--break-->
---

By [Junjay Tan](mailto:junjay@junjaytan.com)

Abseil Python now includes a documentation set on abseil.io!

<!--break-->

Abseil Python provides various libraries for building Python applications. This
code is collected from Google's internal Python code base and has been
extensively tested and used in production. They provide features for application
startup, distributed command line flags, custom logging, and testing.

Until now, the only documentation for Abseil Python has been in the source code.
This was comprehensive but did not always provide information for new users in
an easy-to-read format.

We're happy to announce an Abseil
[Python Quickstart Guide](/docs/python/quickstart) and module-specific
[programming guides](/docs/python/guides/)  similar to those for Abseil C++.
These guides are patterned after those used internally at Google to onboard new
Googlers (nooglers), and we hope they will be similarly helpful to you!


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
//*****************************************************************************
// File: gdbjit.h
//

//
// Header file for GDB JIT interface implemenation.
//
//*****************************************************************************

#ifndef __GDBJIT_H__
#define __GDBJIT_H__

#include <stdint.h>
#include "method.hpp"
#include "dbginterface.h"
#include "../inc/llvm/ELF.h"
#include "../inc/llvm/Dwarf.h"

#if defined(_TARGET_X86_) || defined(_TARGET_ARM_)
    typedef Elf32_Ehdr  Elf_Ehdr;
    typedef Elf32_Shdr  Elf_Shdr;
    typedef Elf32_Sym   Elf_Sym;
#define ADDRESS_SIZE 4
#elif defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
    typedef Elf64_Ehdr  Elf_Ehdr;
    typedef Elf64_Shdr  Elf_Shdr;
    typedef Elf64_Sym   Elf_Sym;
#define ADDRESS_SIZE 8
#else
#error "Target is not supported"
#endif

static constexpr const int CorElementTypeToDWEncoding[] =
{
/* ELEMENT_TYPE_END */          0,
/* ELEMENT_TYPE_VOID */         DW_ATE_address,
/* ELEMENT_TYPE_BOOLEAN */      DW_ATE_boolean,
/* ELEMENT_TYPE_CHAR */         DW_ATE_UTF,
/* ELEMENT_TYPE_I1 */           DW_ATE_signed,
/* ELEMENT_TYPE_U1 */           DW_ATE_unsigned,
/* ELEMENT_TYPE_I2 */           DW_ATE_signed,
/* ELEMENT_TYPE_U2 */           DW_ATE_unsigned,
/* ELEMENT_TYPE_I4 */           DW_ATE_signed,
/* ELEMENT_TYPE_U4 */           DW_ATE_unsigned,
/* ELEMENT_TYPE_I8 */           DW_ATE_signed,
/* ELEMENT_TYPE_U8 */           DW_ATE_unsigned,
/* ELEMENT_TYPE_R4 */           DW_ATE_float,
/* ELEMENT_TYPE_R8 */           DW_ATE_float,
/* ELEMENT_TYPE_STRING */       DW_ATE_address,
/* ELEMENT_TYPE_PTR */          DW_ATE_address,
/* ELEMENT_TYPE_BYREF */        DW_ATE_address,
/* ELEMENT_TYPE_VALUETYPE */    DW_ATE_address,
/* ELEMENT_TYPE_CLASS */        DW_ATE_address,
/* ELEMENT_TYPE_VAR */          DW_ATE_address,
/* ELEMENT_TYPE_ARRAY */        DW_ATE_address,
/* ELEMENT_TYPE_GENERICINST */  DW_ATE_address,
/* ELEMENT_TYPE_TYPEDBYREF */   DW_ATE_address,
/* SKIP 17 */                   DW_ATE_address,
/* ELEMENT_TYPE_I */            DW_ATE_signed,
/* ELEMENT_TYPE_U */            DW_ATE_unsigned,
/* SKIP 1a */                   DW_ATE_address,
/* ELEMENT_TYPE_FNPTR */        DW_ATE_address,
/* ELEMENT_TYPE_OBJECT */       DW_ATE_address,
/* ELEMENT_TYPE_SZARRAY */      DW_ATE_address,
/* ELEMENT_TYPE_MVAR */         DW_ATE_address,
/* ELEMENT_TYPE_CMOD_REQD */    DW_ATE_address,
/* ELEMENT_TYPE_CMOD_OPT */     DW_ATE_address,
/* ELEMENT_TYPE_INTERNAL */     DW_ATE_address,
/* ELEMENT_TYPE_MAX */          DW_ATE_address,
};

struct __attribute__((packed)) DwarfCompUnit
{
    uint32_t m_length;
    uint16_t m_version;
    uint32_t m_abbrev_offset;
    uint8_t m_addr_size;
};

struct __attribute__((packed)) DwarfPubHeader
{
    uint32_t m_length;
    uint16_t m_version;
    uint32_t m_debug_info_off;
    uint32_t m_debug_info_len;
};

#define DW_LNS_MAX DW_LNS_set_isa

struct __attribute__((packed)) DwarfLineNumHeader
{
    uint32_t m_length;
    uint16_t m_version;
    uint32_t m_hdr_length;
    uint8_t m_min_instr_len;
    uint8_t m_def_is_stmt;
    int8_t m_line_base;
    uint8_t m_line_range;
    uint8_t m_opcode_base;
    uint8_t m_std_num_arg[DW_LNS_MAX];
};

struct SymbolsInfo
{
    int lineNumber, ilOffset, nativeOffset, fileIndex;
    char fileName[2*MAX_PATH_FNAME];
};

class DwarfDumpable
{
public:
    // writes all string literals this type needs to ptr
    virtual void DumpStrings(char* ptr, int& offset) = 0;

    virtual void DumpDebugInfo(char* ptr, int& offset) = 0;
};

class LocalsInfo
{
public:
    int size;
    char** localsName;
    ULONG32 countVars;
    ICorDebugInfo::NativeVarInfo *pVars;
};

class TypeMember;

class TypeInfoBase : public DwarfDumpable
{
public:
    TypeInfoBase(TypeHandle typeHandle)
        : m_type_name(nullptr),
          m_type_name_offset(0),
          m_type_size(0),
          m_type_offset(0),
          typeHandle(typeHandle),
          typeKey(typeHandle.GetTypeKey())
    {
    }

    virtual ~TypeInfoBase()
    {
        if (m_type_name != nullptr)
        {
            delete[] m_type_name;
        }
    }

    virtual void DumpStrings(char* ptr, int& offset) override;
    void CalculateName();
    void SetTypeHandle(TypeHandle handle);
    TypeHandle GetTypeHandle();
    TypeKey* GetTypeKey();

    char* m_type_name;
    int m_type_name_offset;
    ULONG m_type_size;
    int m_type_offset;
private:
    TypeHandle typeHandle;
    TypeKey typeKey;
};

class PrimitiveTypeInfo: public TypeInfoBase
{
public:
    PrimitiveTypeInfo(TypeHandle typeHandle, int encoding)
        : TypeInfoBase(typeHandle),
          m_type_encoding(encoding)
    {
    }

    void DumpDebugInfo(char* ptr, int& offset) override;

    int m_type_encoding;
};

class RefTypeInfo: public TypeInfoBase
{
public:
    RefTypeInfo(TypeHandle typeHandle, TypeInfoBase *value_type)
        : TypeInfoBase(typeHandle),
          m_value_type(value_type)
    {
    }
    void DumpStrings(char* ptr, int& offset) override;
    void DumpDebugInfo(char* ptr, int& offset) override;
    TypeInfoBase *m_value_type;
};

class ClassTypeInfo: public TypeInfoBase
{
public:
    ClassTypeInfo(TypeHandle typeHandle, int num_members);
    ~ClassTypeInfo();

    void DumpStrings(char* ptr, int& offset) override;
    void DumpDebugInfo(char* ptr, int& offset) override;

    int m_num_members;
    TypeMember* members;
};

class TypeMember: public DwarfDumpable
{
public:
    TypeMember()
        : m_member_name(nullptr),
          m_member_name_offset(0),
          m_member_offset(0),
          m_static_member_address(0),
          m_member_type(nullptr)
    {
    }

    ~TypeMember()
    {
        if (m_member_name != nullptr)
        {
            delete[] m_member_name;
        }
    }

    void DumpStrings(char* ptr, int& offset) override;
    void DumpDebugInfo(char* ptr, int& offset) override;
    void DumpStaticDebugInfo(char* ptr, int& offset);

    char* m_member_name;
    int m_member_name_offset;
    int m_member_offset;
    TADDR m_static_member_address;
    TypeInfoBase *m_member_type;
};

class ArrayTypeInfo: public TypeInfoBase
{
public:
    ArrayTypeInfo(TypeHandle typeHandle, int countOffset, TypeInfoBase* elemType)
        : TypeInfoBase(typeHandle),
          m_count_offset(countOffset),
          m_elem_type(elemType)
    {
    }

    ~ArrayTypeInfo()
    {
        if (m_elem_type != nullptr)
        {
            delete m_elem_type;
        }
    }

    void DumpDebugInfo(char* ptr, int& offset) override;

    int m_count_offset;
    TypeInfoBase *m_elem_type;
};

class VarDebugInfo: public DwarfDumpable
{
public:
    VarDebugInfo(int abbrev)
        : m_var_name(nullptr),
          m_var_abbrev(abbrev),
          m_var_name_offset(0),
          m_il_index(0),
          m_native_offset(0),
          m_var_type(nullptr)
    {
    }

    VarDebugInfo()
        : m_var_name(nullptr),
          m_var_abbrev(6),
          m_var_name_offset(0),
          m_il_index(0),
          m_native_offset(0),
          m_var_type(nullptr)
    {
    }

    virtual ~VarDebugInfo()
    {
        delete[] m_var_name;
    }

    void DumpStrings(char* ptr, int& offset) override;
    void DumpDebugInfo(char* ptr, int& offset) override;

    char* m_var_name;
    int m_var_abbrev;
    int m_var_name_offset;
    int m_il_index;
    int m_native_offset;
    TypeInfoBase *m_var_type;
};

class NotifyGdb
{
public:
    static void MethodCompiled(MethodDesc* MethodDescPtr);
    static void MethodDropped(MethodDesc* MethodDescPtr);
    template <typename PARENT_TRAITS>
    class DeleteValuesOnDestructSHashTraits : public PARENT_TRAITS
    {
    public:
        static inline void OnDestructPerEntryCleanupAction(typename PARENT_TRAITS::element_t e)
        {
            delete e.Value();
        }
        static const bool s_DestructPerEntryCleanupAction = true;
    };

    template <typename VALUE>
    class TypeKeyHashTraits : public DefaultSHashTraits< KeyValuePair<TypeKey*,VALUE> >
    {
    public:
        // explicitly declare local typedefs for these traits types, otherwise
        // the compiler may get confused
        typedef typename DefaultSHashTraits< KeyValuePair<TypeKey*,VALUE> >::element_t element_t;
        typedef typename DefaultSHashTraits< KeyValuePair<TypeKey*,VALUE> >::count_t count_t;
        typedef TypeKey* key_t;

        static key_t GetKey(element_t e)
        {
            LIMITED_METHOD_CONTRACT;
            return e.Key();
        }
        static BOOL Equals(key_t k1, key_t k2)
        {
            LIMITED_METHOD_CONTRACT;
            return k1->Equals(k2);
        }
        static count_t Hash(key_t k)
        {
            LIMITED_METHOD_CONTRACT;
            return k->ComputeHash();
        }

        static const element_t Null() { LIMITED_METHOD_CONTRACT; return element_t(key_t(),VALUE()); }
        static const element_t Deleted() { LIMITED_METHOD_CONTRACT; return element_t(key_t(-1), VALUE()); }
        static bool IsNull(const element_t &e) { LIMITED_METHOD_CONTRACT; return e.Key() == key_t(); }
        static bool IsDeleted(const element_t &e) { return e.Key() == key_t(-1); }
    };

    typedef MapSHash<TypeKey*, TypeInfoBase*, DeleteValuesOnDestructSHashTraits<TypeKeyHashTraits<TypeInfoBase*>>> TK_TypeInfoMap;
    typedef TK_TypeInfoMap* PTK_TypeInfoMap;

private:

    struct MemBuf
    {
        NewArrayHolder<char> MemPtr;
        unsigned MemSize;
        MemBuf() : MemPtr(0), MemSize(0)
        {}
    };

    static bool BuildELFHeader(MemBuf& buf);
    static bool BuildSectionNameTable(MemBuf& buf);
    static bool BuildSectionTable(MemBuf& buf);
    static bool BuildSymbolTableSection(MemBuf& buf, PCODE addr, TADDR codeSize);
    static bool BuildStringTableSection(MemBuf& strTab);
    static bool BuildDebugStrings(MemBuf& buf, PTK_TypeInfoMap pTypeMap);
    static bool BuildDebugAbbrev(MemBuf& buf);
    static bool BuildDebugInfo(MemBuf& buf, PTK_TypeInfoMap pTypeMap);
    static bool BuildDebugPub(MemBuf& buf, const char* name, uint32_t size, uint32_t dieOffset);
    static bool BuildLineTable(MemBuf& buf, PCODE startAddr, TADDR codeSize, SymbolsInfo* lines, unsigned nlines);
    static bool BuildFileTable(MemBuf& buf, SymbolsInfo* lines, unsigned nlines);
    static bool BuildLineProg(MemBuf& buf, PCODE startAddr, TADDR codeSize, SymbolsInfo* lines, unsigned nlines);
    static bool FitIntoSpecialOpcode(int8_t line_shift, uint8_t addr_shift);
    static void IssueSetAddress(char*& ptr, PCODE addr);
    static void IssueEndOfSequence(char*& ptr);
    static void IssueSimpleCommand(char*& ptr, uint8_t command);
    static void IssueParamCommand(char*& ptr, uint8_t command, char* param, int param_len);
    static void IssueSpecialCommand(char*& ptr, int8_t line_shift, uint8_t addr_shift);
    static void SplitPathname(const char* path, const char*& pathName, const char*& fileName);
    static bool CollectCalledMethods(CalledMethod* pCM);
#ifdef _DEBUG
    static void DumpElf(const char* methodName, const MemBuf& buf);
#endif
};

class FunctionMember: public TypeMember
{
public:
    FunctionMember(MethodDesc *md, int num_locals, int num_args)
        : TypeMember(),
          md(md),
          m_file(1),
          m_line(1),
          m_sub_low_pc(0),
          m_sub_high_pc(0),
          m_sub_loc(),
          m_num_args(num_args),
          m_num_locals(num_locals),
          m_num_vars(num_args + num_locals),
          m_entry_offset(0),
          vars(new VarDebugInfo[m_num_vars]),
          dumped(false)
    {
        m_sub_loc[0] = 1;
#if defined(_TARGET_AMD64_)
        m_sub_loc[1] = DW_OP_reg6;
#elif defined(_TARGET_ARM_)
        m_sub_loc[1] = DW_OP_reg11;
#else
#error Unsupported platform!
#endif
    }

    virtual ~FunctionMember()
    {
        delete[] vars;
    }

    void DumpStrings(char* ptr, int& offset) override;
    void DumpDebugInfo(char* ptr, int& offset) override;
    HRESULT GetLocalsDebugInfo(NotifyGdb::PTK_TypeInfoMap pTypeMap,
                           LocalsInfo& locals,
                           int startNativeOffset);
    BOOL IsDumped()
    {
        return dumped;
    }

    MethodDesc *md;
    uint8_t m_file, m_line;
    uintptr_t m_sub_low_pc, m_sub_high_pc;
    uint8_t m_sub_loc[2];
    uint8_t m_num_args;
    uint8_t m_num_locals;
    uint16_t m_num_vars;
    int m_entry_offset;
    VarDebugInfo* vars;
private:
    int GetArgsAndLocalsLen();
    BOOL dumped;
};
#endif // #ifndef __GDBJIT_H__


text:
{{error}}

      {{album.status}}

    <form role="form" name="albumValidation">

      <fieldset class="form-group"  ng-class="{ 'has-error': albumValidation.id.$invalid }">
        URL концовка (одно слово на английском)
        <input class="form-control"
               id="id"
               name="id"
               ng-model="album.id"
               ng-pattern="/^[A-z,0-9,\-,_]+$/"
               ng-required />
      </fieldset>

      <fieldset class="form-group"  ng-class="{ 'has-error': albumValidation.title.$invalid }">
        Название альбома
        <input class="form-control"
               id="title"
               name="title"
               ng-model="album.title"
               ng-required />
      </fieldset>

      <fieldset class="form-group"  ng-class="{ 'has-error': albumValidation.cover.$invalid }">
        Обложка альбома
        <input class="form-control"
               id="cover"
               name="cover"
               ng-model="album.cover"
               type="url"
               ng-required />
      </fieldset>

                {{album.title}}

      <fieldset class="form-group "  ng-class="{ 'has-error': albumValidation.date.$invalid }">
        Дата фото
        <input class="form-control"
               id="date"
               name="date"
               ng-model="album.date"
               type="date"
               ng-required />
      </fieldset>

      <fieldset class="form-group"  ng-class="{ 'has-error': albumValidation.picasaLink.$invalid }">
        Ссылка на альбом picasa
        <input class="form-control"
               id="picasaLink"
               name="picasaLink"
               ng-model="album.picasaLink"
               type="url"
               ng-required />
      </fieldset>

      <button type="submit" class="btn btn-danger"
              ng-class="{ 'disabled': albumValidation.$invalid }"
              ng-click="updateAlbum(album)"
              ng-disabled="album.updating">{{album.updating ? 'Saving...' : 'Save'}}
      </button>
      <button type="submit" class="btn btn-danger"
              ng-click="removeAlbum()"
              ng-disabled="album.removing">{{album.removing ? 'Deleting...' : 'Delete'}}
      </button>
    </form>


text:
package java.io;

public interface Externalizable {
  public void readExternal(ObjectInput in);
  public void writeExternal(ObjectOutput out);
}


text:
<?php

namespace CampaignChain\Location\EZPlatformBundle\Controller\REST;

use CampaignChain\CoreBundle\Controller\REST\BaseModuleController;
use CampaignChain\CoreBundle\Entity\Location;
use FOS\RestBundle\Controller\Annotations as REST;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use FOS\RestBundle\Request\ParamFetcher;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;

/**
 * @REST\NamePrefix("campaignchain_location_ezplatform_rest_")
 *
 * Class LocationController
 * @package CampaignChain\Location\EZPlatformBundle\Controller\REST
 */
class LocationController extends BaseModuleController
{
    const MODULE_URI = 'campaignchain/location-ezplatform/campaignchain-ezplatform-object';

    /**
     * Get a list of eZ Platform content object Locations.
     *
     * Example Request
     * ===============
     *
     *      GET /api/{version}/p/campaignchain/location-ezplatform/objects
     *
     * Example Response
     * ================
    {
        "response": [
            {
                "id": 108,
                "identifier": "62",
                "name": "eZ Publish Tutorials",
                "status": "unpublished",
                "createdDate": "2015-12-01T09:37:39+0000",
                "operationId": "92",
                "channelId": "8"
            }
        ]
    }
     *
     * @ApiDoc(
     *  section="Packages: eZ Platform"
     * )
     */
    public function getObjectsAction()
    {
        $qb = $this->getQueryBuilder();
        $qb->select(\CampaignChain\CoreBundle\Controller\REST\LocationController::SELECT_STATEMENT);
        $qb->from('CampaignChain\CoreBundle\Entity\Location', 'l');
        $qb->where('l.channel IS NULL');
        $qb->orderBy('l.name');
        $qb = $this->getModuleRelation($qb, 'l.locationModule', self::MODULE_URI);
        $qb = $this->getLocationChannelId($qb);
        $query = $qb->getQuery();

        return $this->response(
            $query->getResult(\Doctrine\ORM\Query::HYDRATE_ARRAY)
        );
    }
}


text:
require 'chef/provisioning/aws_driver/aws_provider'

class Chef::Provider::AwsRdsInstance < Chef::Provisioning::AWSDriver::AWSProvider
  provides :aws_rds_instance

  REQUIRED_OPTIONS = %i(db_instance_identifier allocated_storage engine
                        db_instance_class master_username master_user_password)

  OTHER_OPTIONS = %i(engine_version multi_az iops publicly_accessible db_name port db_subnet_group_name)

  def update_aws_object(instance)
    Chef::Log.warn("aws_rds_instance does not support modifying a started instance")
    # There are required optiosn (like `allocated_storage`) that the use may not
    # specify on a resource to perform an update.  For example, they may want to
    # only specify iops to modify that attribute on an update after initial
    # creation.  In this case we need to load the required options from the existing
    # aws_object and only override it if the user has specified a value in the
    # resource.  Ideally, it would be nice to mark values as required on the
    # resource but right now there is not a `required_on_create`.  This would
    # also be different if chef-provisioning performed resource cloning, which
    # it does not.
  end

  def create_aws_object
    converge_by "create RDS instance #{new_resource.db_instance_identifier} in #{region}" do
      new_resource.driver.rds.client.create_db_instance(options_hash)
    end
    # TODO need to wait for state?
  end

  def destroy_aws_object(instance)
    converge_by "delete RDS instance #{new_resource.db_instance_identifier} in #{region}" do
      instance.delete(skip_final_snapshot: true)
    end
    # Wait up to 10 minutes for the db instance to shutdown
    converge_by "waited until RDS instance #{new_resource.name} was deleted" do
      wait_for(
        aws_object: instance,
        query_method: :exists?,
        expected_responses: [false],
        acceptable_errors: [AWS::RDS::Errors::DBInstanceNotFound],
        tries: 60,
        sleep: 10
      )
    end
  end

  # Sets the additional options then overrides it with all required options from
  # the resource as well as optional options
  def options_hash
    @options_hash ||= begin
      opts = Hash[new_resource.additional_options.map{|(k,v)| [k.to_sym,v]}]
      REQUIRED_OPTIONS.each do |opt|
        opts[opt] = new_resource.send(opt)
      end
      OTHER_OPTIONS.each do |opt|
        opts[opt] = new_resource.send(opt) if ! new_resource.send(opt).nil?
      end
      AWSResource.lookup_options(opts, resource: new_resource)
      opts
    end
  end

end


text:
/* @form header
----------------------------------- */
.smart-forms .header-black {
	background-color:#34495e;
	border-top:1px solid #7C9AB8;
	border-bottom:5px solid #2c3e50;
}

.smart-forms .header-lite{ border-top-color:#7C9AB8; }
.smart-forms .header-lite:before{ background-color:#34495e;   }
.smart-forms .header-black h4{ color:#fff; }

/* @form tagline
--------------------------------- */
.smart-forms .theme-black .tagline span{ color:#34495e; }
.smart-forms .theme-black .smart-link{ color:#34495e; }

/* @hover | focus
--------------------------------- */
.smart-forms .theme-black .gui-input:hover,
.smart-forms .theme-black .gui-textarea:hover,
.smart-forms .theme-black .select > select:hover,
.smart-forms .theme-black .select-multiple select:hover,
.smart-forms .theme-black .gui-input:hover ~ .input-hint,
.smart-forms .theme-black .file .gui-file:hover + .gui-input,
.smart-forms .theme-black .gui-textarea:hover ~ .input-hint{ border-color: #415b76; }
.smart-forms .theme-black .gui-input:focus,
.smart-forms .theme-black .gui-textarea:focus,
.smart-forms .theme-black .select > select:focus,
.smart-forms .theme-black .select-multiple select:focus{ border-color: #34495e; color: #3C3C3C; }
.smart-forms .theme-black .gui-textarea:focus{  height: 120px; }
.smart-forms .theme-black .select > select:focus { z-index:10; z-index:20\9; }
.smart-forms .theme-black .gui-input:focus ~ .field-icon i,
.smart-forms .theme-black .gui-textarea:focus ~ .field-icon i{ color:#34495e; }
.smart-forms .theme-black .select-multiple select:focus,
.smart-forms .theme-black .gui-input:focus ~ .input-hint,
.smart-forms .theme-black .gui-textarea:focus ~ .input-hint,
.smart-forms .theme-black .file .gui-file:focus + .gui-input{ border-color: #34495e; }
.smart-forms .theme-black .select > select:focus + .arrow{ color:#34495e; }

/* @star rating
--------------------------------------------------------------- */
.smart-forms .theme-black .rating:hover .rating-star:hover,
.smart-forms .theme-black .rating:hover .rating-star:hover ~ .rating-star,
.smart-forms .theme-black .rating-input:checked ~ .rating-star { color: #2c3e50;	}
.smart-forms .theme-black .rating-star,
.smart-forms .theme-black .rating:hover .rating-star {	color: #B5C1C7;	 }

/* @check + radio black
---------------------------------------------------------------- */
.smart-forms .option-black input:hover + .checkbox,
.smart-forms .option-black input:hover + .radio{ border-color: #415b76; }
.smart-forms .option-black input:checked + .checkbox,
.smart-forms .option-black input:focus + .checkbox,
.smart-forms .option-black input:checked + .radio,
.smart-forms .option-black input:focus + .radio{ border-color: #34495e; }
.smart-forms .option-black input:checked + .radio:before,
.smart-forms .option-black input:focus + .radio:before{  background: #34495e; }
.smart-forms .option-black input:checked + .checkbox:before,
.smart-forms .option-black input:focus + .checkbox:before{ border-color: #34495e; }

/* @toggle-switch black
------------------------------------------------------------ */
.smart-forms .switch-black > input:checked + .switch-label { background: #34495e; border-color: #34495e; }
.smart-forms .switch-black > input:checked + .switch-label:after { color:#34495e; }
.smart-forms .switch-black > input:checked:focus + .switch-label { background: #2c3e50; border-color: #2c3e50; }

/* @button black
------------------------------------------------------------- */
.smart-forms .btn-black { background-color: #34495e; }
.smart-forms .btn-black:hover,
.smart-forms .btn-black:focus{ background-color: #415b76; }
.smart-forms .btn-black:active{ background-color: #2c3e50; }
.smart-forms .btn-black,
.smart-forms .btn-black:hover,
.smart-forms .btn-black:focus,
.smart-forms .btn-black:active{ color: #fff; text-shadow: 0 1px rgba(0, 0, 0, 0.08); }

/* @datepicker overides
----------------------------------------------------------- */
.ui-datepicker { border:5px solid #34495e; }
.ui-datepicker:before{
	border-color:transparent transparent #34495e transparent;
	border-color:rgba(255,255,255,0) rgba(255,255,255,0) #34495e rgba(255,255,255,0);
}
.ui-timepicker-div .ui-widget-header,
.ui-datepicker .ui-datepicker-header { background:#34495e; }
.ui-datepicker-today a,
.ui-datepicker-today a:hover,
.ui-datepicker .ui-state-highlight { background:#34495e!important; }

/* @price-box
------------------------------------------------------------- */
.smart-forms .theme-black .selected-box h4{ color:#34495e; }
.smart-forms .ribbon-inner{ background:#34495e; }
.smart-forms .ribbon-inner:before,
.smart-forms .ribbon-inner:after{ border-top-color:#2c3e50; }


text:
#ifndef _VL53L0X_API_CORE_H_
#define _VL53L0X_API_CORE_H_

#include "vl53l0x_def.h"
#include "vl53l0x_platform.h"

#ifdef __cplusplus
extern "C" {
#endif

VL53L0X_Error VL53L0X_reverse_bytes(uint8_t *data, uint32_t size);

VL53L0X_Error VL53L0X_measurement_poll_for_completion(VL53L0X_DEV Dev);

uint8_t VL53L0X_encode_vcsel_period(uint8_t vcsel_period_pclks);

uint8_t VL53L0X_decode_vcsel_period(uint8_t vcsel_period_reg);

uint32_t VL53L0X_isqrt(uint32_t num);

uint32_t VL53L0X_quadrature_sum(uint32_t a, uint32_t b);

VL53L0X_Error VL53L0X_get_info_from_device(VL53L0X_DEV Dev, uint8_t option);

VL53L0X_Error VL53L0X_set_vcsel_pulse_period(VL53L0X_DEV Dev,
	VL53L0X_VcselPeriod VcselPeriodType, uint8_t VCSELPulsePeriodPCLK);

VL53L0X_Error VL53L0X_get_vcsel_pulse_period(VL53L0X_DEV Dev,
	VL53L0X_VcselPeriod VcselPeriodType, uint8_t *pVCSELPulsePeriodPCLK);

uint32_t VL53L0X_decode_timeout(uint16_t encoded_timeout);

VL53L0X_Error get_sequence_step_timeout(VL53L0X_DEV Dev,
			VL53L0X_SequenceStepId SequenceStepId,
			uint32_t *pTimeOutMicroSecs);

VL53L0X_Error set_sequence_step_timeout(VL53L0X_DEV Dev,
			VL53L0X_SequenceStepId SequenceStepId,
			uint32_t TimeOutMicroSecs);

VL53L0X_Error VL53L0X_set_measurement_timing_budget_micro_seconds(VL53L0X_DEV Dev,
	uint32_t MeasurementTimingBudgetMicroSeconds);

VL53L0X_Error VL53L0X_get_measurement_timing_budget_micro_seconds(VL53L0X_DEV Dev,
		uint32_t *pMeasurementTimingBudgetMicroSeconds);

VL53L0X_Error VL53L0X_load_tuning_settings(VL53L0X_DEV Dev,
		uint8_t *pTuningSettingBuffer);

VL53L0X_Error VL53L0X_calc_sigma_estimate(VL53L0X_DEV Dev,
		VL53L0X_RangingMeasurementData_t *pRangingMeasurementData,
		FixPoint1616_t *pSigmaEstimate, uint32_t *pDmax_mm);

VL53L0X_Error VL53L0X_get_total_xtalk_rate(VL53L0X_DEV Dev,
	VL53L0X_RangingMeasurementData_t *pRangingMeasurementData,
	FixPoint1616_t *ptotal_xtalk_rate_mcps);

VL53L0X_Error VL53L0X_get_total_signal_rate(VL53L0X_DEV Dev,
	VL53L0X_RangingMeasurementData_t *pRangingMeasurementData,
	FixPoint1616_t *ptotal_signal_rate_mcps);

VL53L0X_Error VL53L0X_get_pal_range_status(VL53L0X_DEV Dev,
		 uint8_t DeviceRangeStatus,
		 FixPoint1616_t SignalRate,
		 uint16_t EffectiveSpadRtnCount,
		 VL53L0X_RangingMeasurementData_t *pRangingMeasurementData,
		 uint8_t *pPalRangeStatus);

uint32_t VL53L0X_calc_timeout_mclks(VL53L0X_DEV Dev,
	uint32_t timeout_period_us, uint8_t vcsel_period_pclks);

uint16_t VL53L0X_encode_timeout(uint32_t timeout_macro_clks);

#ifdef __cplusplus
}
#endif

#endif /* _VL53L0X_API_CORE_H_ */


text:
<?php

class ResponseBuilder {
    private $element;

    function __construct() {
        $this->element = new SimpleXMLElement("<Response/>");
    }

    /**
     * @param $group
     * @return string
     */
    function buildForwardToAdministratorsResponse($group) {
        $dialElement = $this->element->addChild("Dial");
        foreach ($group->getAdministrators() as $phone) {
            $dialElement->addChild("Number", $phone);
        }

        $this->element->addChild("Say", "Sorry, nobody could be reached at this time. Please try again later.");

        return $this->element->asXML();
    }

    /**
     * @param $group
     * @param $digits
     * @return string
     */
    function buildDialOutgoingCallResponse($group, $digits) {
        $dialElement = $this->element->addChild("Dial", $digits);
        $dialElement->addAttribute("timeout", 30);
        $dialElement->addAttribute("callerId", $group->getPhone());

        return $this->element->asXML();
    }

    /**
     * @return string
     */
    function buildInvalidDigitsResponse() {
        $this->element->addChild("Say", "You must provide a valid 10-digit phone number to dial.");
        $this->element->addChild("Redirect", SCRIPT_URL);

        return $this->element->asXML();
    }

    /**
     * @return string
     */
    function buildGatherDigitsResponse() {
        $gatherElement = $this->element->addChild("Gather");
        $gatherElement->addAttribute("action", SCRIPT_URL);
        $gatherElement->addAttribute("timeout", 2);

        $gatherElement->addChild("Say", "Enter outgoing number.");

        $pauseElement = $gatherElement->addChild("Pause");
        $pauseElement->addAttribute("length", 8);

        $this->element->addChild("Say", "Sorry, I didn't get your input.");
        $this->element->addChild("Redirect", SCRIPT_URL);

        return $this->element->asXML();
    }

    /**
     * @return mixed
     */
    function buildRejectCallResponse() {
        $this->element->addChild('Reject')->addAttribute("reason", "busy");
        return $this->element->asXML();
    }

}


text:
import urllib2
import time

class Utils:

    def __init__(self):
        pass

    __base_download_url = "https://dist.xebialabs.com"

    @staticmethod
    def build_product_label(_version):
        return 'xl-deploy' if int(_version.split()[0][0]) >= 4 else 'deployit'

    @staticmethod
    def build_server_zip_name(_version):
        return "{server_dir_name}.zip". \
            format(server_dir_name=Utils.build_server_dir_name(_version))

    @staticmethod
    def build_cli_zip_name(_version):
        return "%s.zip" % Utils.build_cli_dir_name(_version)

    @staticmethod
    def build_cli_zip_url(_version):
        return "%s/". \
            format(server_dir_name=Utils.build_cli_dir_name(_version))

    @staticmethod
    def build_server_dir_name(_version):
        return "{product_label}-{version}-server". \
            format(version=_version, product_label=Utils.build_product_label(_version))

    @staticmethod
    def build_cli_dir_name(_version):
        return "{product_label}-{version}-cli". \
            format(version=_version, product_label=Utils.build_product_label(_version))

    @staticmethod
    def build_plugin_name(_version, _plugin_name):
        return "{plugin_name}-plugin-{version}.jar". \
            format(version=_version, plugin_name=_plugin_name)

    @staticmethod
    def build_url(_version, _xltype, _plugin_short_name=''):
        if _xltype == "server":
            return "{base_url}/{product_label}/{version}/{zip_name}" \
                .format(
                base_url=Utils.__base_download_url,
                version=_version,
                product_label=Utils.build_product_label(_version),
                zip_name=Utils.build_server_zip_name(_version)
            )

        elif _xltype == 'cli':
            return "{base_url}/{product_label}/{version}/{zip_name}" \
                .format(
                base_url=Utils.__base_download_url,
                version=_version,
                product_label=Utils.build_product_label(_version),
                zip_name=Utils.build_cli_zip_name(_version)
            )

        elif _xltype == "plugin":
            return "{base_url}/plugins/{short_plugin_name}-plugin/{version}/{plugin_name}". \
                format(base_url=Utils.__base_download_url, version=_version, short_plugin_name=_plugin_short_name,
                       plugin_name=Utils.build_plugin_name(_version, _plugin_short_name))

        else:
            raise Exception("Unknown artifact type %s for building URL" % _xltype)

    @staticmethod
    def post(method, req):
        # by default method is GET, to make it POST add_data to be called.
        if method == 'POST':
            req.add_data('')

    @staticmethod
    def open_url(url, method, handler=None):

        if handler is None:
            opener = urllib2.build_opener()
        else:
            opener = urllib2.build_opener(handler)

        req = urllib2.Request(url)
        Utils.post(method, req)
        opener.open(req)

        return opener

    @staticmethod
    def auth_and_open_url(url, method, user, password):
        password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
        password_mgr.add_password(None, url, user, password)
        handler = urllib2.HTTPBasicAuthHandler(password_mgr)
        return Utils.open_url(url, method, handler)

    @staticmethod
    def download(url, target, username=None, password=None):
        print "Downloading {url} is being started".format(url=url)

        if username is not None:
            print "Authenticating with username %s" % username

        opener = Utils.auth_and_open_url(url, 'GET', username, password)
        urllib2.install_opener(opener)

        file_name = url.split('/')[-1]
        u = urllib2.urlopen(url)
        target_file = (target + '/' + file_name, target + file_name)[target.endswith('/')]

        with open(target_file, 'wb') as f:
            block_size = 8192

            counter = 0

            while True:
                counter += 1
                if counter % 10 == 0:
                    Utils.print_no_newline(".")
                file_buffer = u.read(block_size)
                if not file_buffer:
                    break

                f.write(file_buffer)

            f.close()

        print ""

        return target_file

    @staticmethod
    def print_no_newline(text):
        import sys

        sys.stdout.write(text)
        sys.stdout.flush()

    @staticmethod
    def wait_until(some_predicate, timeout=30, period=1, tick=False):
        must_end = time.time() + timeout
        while time.time() < must_end:
            if some_predicate():
                return True
            if tick:
                print ' ... tick ... '
            time.sleep(period)

        raise Exception("The expected event hasn't happened within %s sec." % timeout)


text:
<!DOCTYPE html>

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

detectFlowGraph.js

                ¶

define([], function () {
  return function (callback){

                ¶

Keeps track of which lambdas have been seen.

    var nodes = {},
        links = [];

    function propertyNode(name) {
      return nodes[name] || (nodes[name] = {
        type: 'property',
        name: name
      });
    }

                ¶

Records a collection of nodes and edges in the
flow graph created by a single "when" callback.

    recordLambda = function (dependencies, changedProperties) {
      var key = dependencies.join(',') + '|' + changedProperties.join(','),
          lambda = nodes[key];
      if(!lambda && changedProperties.length > 0){
        lambda = nodes[key] = { type: 'lambda' };
        dependencies.forEach(function (property) {
          links.push({
            source: propertyNode(property),
            target: lambda
          });
        });
        changedProperties.forEach(function (property) {
          links.push({
            source: lambda,
            target: propertyNode(property)
          });
        });
      }
    };

    setTimeout(function () {
      callback({
        nodes: Object.keys(nodes).map(function (key, i) {
          var node = nodes[key];
          node.index = i;
          return node;
        }),
        links: links.map(function (link) {
          return {
            source: link.source.index,
            target: link.target.index
          };
        })
      });
    }, 500);
  };
});


text:
package com.amazonaws.services.ec2.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.Request;
import com.amazonaws.DefaultRequest;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.ec2.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.StringUtils;

/**
 * ModifyVpcEndpointRequest Marshaller
 */

@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ModifyVpcEndpointRequestMarshaller implements Marshaller<Request<ModifyVpcEndpointRequest>, ModifyVpcEndpointRequest> {

    public Request<ModifyVpcEndpointRequest> marshall(ModifyVpcEndpointRequest modifyVpcEndpointRequest) {

        if (modifyVpcEndpointRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        Request<ModifyVpcEndpointRequest> request = new DefaultRequest<ModifyVpcEndpointRequest>(modifyVpcEndpointRequest, "AmazonEC2");
        request.addParameter("Action", "ModifyVpcEndpoint");
        request.addParameter("Version", "2016-11-15");
        request.setHttpMethod(HttpMethodName.POST);

        if (modifyVpcEndpointRequest.getVpcEndpointId() != null) {
            request.addParameter("VpcEndpointId", StringUtils.fromString(modifyVpcEndpointRequest.getVpcEndpointId()));
        }

        if (modifyVpcEndpointRequest.getResetPolicy() != null) {
            request.addParameter("ResetPolicy", StringUtils.fromBoolean(modifyVpcEndpointRequest.getResetPolicy()));
        }

        if (modifyVpcEndpointRequest.getPolicyDocument() != null) {
            request.addParameter("PolicyDocument", StringUtils.fromString(modifyVpcEndpointRequest.getPolicyDocument()));
        }

        com.amazonaws.internal.SdkInternalList<String> modifyVpcEndpointRequestAddRouteTableIdsList = (com.amazonaws.internal.SdkInternalList<String>) modifyVpcEndpointRequest
                .getAddRouteTableIds();
        if (!modifyVpcEndpointRequestAddRouteTableIdsList.isEmpty() || !modifyVpcEndpointRequestAddRouteTableIdsList.isAutoConstruct()) {
            int addRouteTableIdsListIndex = 1;

            for (String modifyVpcEndpointRequestAddRouteTableIdsListValue : modifyVpcEndpointRequestAddRouteTableIdsList) {
                if (modifyVpcEndpointRequestAddRouteTableIdsListValue != null) {
                    request.addParameter("AddRouteTableId." + addRouteTableIdsListIndex,
                            StringUtils.fromString(modifyVpcEndpointRequestAddRouteTableIdsListValue));
                }
                addRouteTableIdsListIndex++;
            }
        }

        com.amazonaws.internal.SdkInternalList<String> modifyVpcEndpointRequestRemoveRouteTableIdsList = (com.amazonaws.internal.SdkInternalList<String>) modifyVpcEndpointRequest
                .getRemoveRouteTableIds();
        if (!modifyVpcEndpointRequestRemoveRouteTableIdsList.isEmpty() || !modifyVpcEndpointRequestRemoveRouteTableIdsList.isAutoConstruct()) {
            int removeRouteTableIdsListIndex = 1;

            for (String modifyVpcEndpointRequestRemoveRouteTableIdsListValue : modifyVpcEndpointRequestRemoveRouteTableIdsList) {
                if (modifyVpcEndpointRequestRemoveRouteTableIdsListValue != null) {
                    request.addParameter("RemoveRouteTableId." + removeRouteTableIdsListIndex,
                            StringUtils.fromString(modifyVpcEndpointRequestRemoveRouteTableIdsListValue));
                }
                removeRouteTableIdsListIndex++;
            }
        }

        com.amazonaws.internal.SdkInternalList<String> modifyVpcEndpointRequestAddSubnetIdsList = (com.amazonaws.internal.SdkInternalList<String>) modifyVpcEndpointRequest
                .getAddSubnetIds();
        if (!modifyVpcEndpointRequestAddSubnetIdsList.isEmpty() || !modifyVpcEndpointRequestAddSubnetIdsList.isAutoConstruct()) {
            int addSubnetIdsListIndex = 1;

            for (String modifyVpcEndpointRequestAddSubnetIdsListValue : modifyVpcEndpointRequestAddSubnetIdsList) {
                if (modifyVpcEndpointRequestAddSubnetIdsListValue != null) {
                    request.addParameter("AddSubnetId." + addSubnetIdsListIndex, StringUtils.fromString(modifyVpcEndpointRequestAddSubnetIdsListValue));
                }
                addSubnetIdsListIndex++;
            }
        }

        com.amazonaws.internal.SdkInternalList<String> modifyVpcEndpointRequestRemoveSubnetIdsList = (com.amazonaws.internal.SdkInternalList<String>) modifyVpcEndpointRequest
                .getRemoveSubnetIds();
        if (!modifyVpcEndpointRequestRemoveSubnetIdsList.isEmpty() || !modifyVpcEndpointRequestRemoveSubnetIdsList.isAutoConstruct()) {
            int removeSubnetIdsListIndex = 1;

            for (String modifyVpcEndpointRequestRemoveSubnetIdsListValue : modifyVpcEndpointRequestRemoveSubnetIdsList) {
                if (modifyVpcEndpointRequestRemoveSubnetIdsListValue != null) {
                    request.addParameter("RemoveSubnetId." + removeSubnetIdsListIndex, StringUtils.fromString(modifyVpcEndpointRequestRemoveSubnetIdsListValue));
                }
                removeSubnetIdsListIndex++;
            }
        }

        com.amazonaws.internal.SdkInternalList<String> modifyVpcEndpointRequestAddSecurityGroupIdsList = (com.amazonaws.internal.SdkInternalList<String>) modifyVpcEndpointRequest
                .getAddSecurityGroupIds();
        if (!modifyVpcEndpointRequestAddSecurityGroupIdsList.isEmpty() || !modifyVpcEndpointRequestAddSecurityGroupIdsList.isAutoConstruct()) {
            int addSecurityGroupIdsListIndex = 1;

            for (String modifyVpcEndpointRequestAddSecurityGroupIdsListValue : modifyVpcEndpointRequestAddSecurityGroupIdsList) {
                if (modifyVpcEndpointRequestAddSecurityGroupIdsListValue != null) {
                    request.addParameter("AddSecurityGroupId." + addSecurityGroupIdsListIndex,
                            StringUtils.fromString(modifyVpcEndpointRequestAddSecurityGroupIdsListValue));
                }
                addSecurityGroupIdsListIndex++;
            }
        }

        com.amazonaws.internal.SdkInternalList<String> modifyVpcEndpointRequestRemoveSecurityGroupIdsList = (com.amazonaws.internal.SdkInternalList<String>) modifyVpcEndpointRequest
                .getRemoveSecurityGroupIds();
        if (!modifyVpcEndpointRequestRemoveSecurityGroupIdsList.isEmpty() || !modifyVpcEndpointRequestRemoveSecurityGroupIdsList.isAutoConstruct()) {
            int removeSecurityGroupIdsListIndex = 1;

            for (String modifyVpcEndpointRequestRemoveSecurityGroupIdsListValue : modifyVpcEndpointRequestRemoveSecurityGroupIdsList) {
                if (modifyVpcEndpointRequestRemoveSecurityGroupIdsListValue != null) {
                    request.addParameter("RemoveSecurityGroupId." + removeSecurityGroupIdsListIndex,
                            StringUtils.fromString(modifyVpcEndpointRequestRemoveSecurityGroupIdsListValue));
                }
                removeSecurityGroupIdsListIndex++;
            }
        }

        if (modifyVpcEndpointRequest.getPrivateDnsEnabled() != null) {
            request.addParameter("PrivateDnsEnabled", StringUtils.fromBoolean(modifyVpcEndpointRequest.getPrivateDnsEnabled()));
        }

        return request;
    }

}


text:
public class Arithmetic {
    /** Computes product of two ints */

    public static int product(int a, int b) {
        return a * b;
    }

    /** Computes sum of two ints (incorrectly) */

    public static int sum(int a, int b) {
        return a * b;
    }
}


text:
var theAnswerToTheUltimateQuestionOfLifeTheUniverseAndEverything = function() { return 42; };

module.exports = theAnswerToTheUltimateQuestionOfLifeTheUniverseAndEverything;


text:
<!DOCTYPE html>

    <title>Плагин Карты - Документация Rapid SCADA</title>
    <meta charset="utf-8" />
    <link href="../../../../css/scadadoc.min.css" rel="stylesheet" type="text/css" />
    <link href="../../../../lib/prism/prism.css" rel="stylesheet" />

Плагин Карты

Обзор

Плагин Карты отображает состояние и параметры автоматизированных объектов на интерактивных картах OpenStreetMap. Плагин позволяет наглядно контролировать географически распределённые системы и в случае необходимости переходить на страницу детальной информации по интересующему объекту.

Установка

Сначала необходимо выполнить общую последовательность установки плагина, которая описана по ссылке. А затем выполнить несколько дополнительных действий:

Перейти на страницу Главное меню > Регистрация > Карты.

Зарегистрировать плагин, используя гиперссылки, размещённые на странице.

Добавить регистрационный ключ в проект, скачав настройки Вебстанции с помощью приложения Администратор.

Создание карты

Карта является представлением в терминах Rapid SCADA. Создание и редактирование карт выполняется по аналогии со схемами и табличными представлениями.

Файл карты

Параметры отображения и объекты карты хранятся в файле с расширением map. Файл карты должен располагаться в директории интерфейса или её поддиректории внутри проекта.

Дистрибутив плагина содержит пример файла карты SCADA\Interface\Map\MapExample.map. Для редактирования файлов карты используйте любой удобный текстовый редактор, например, Notepad++. Чтобы создать свою карту, необходимо скопировать файл примера под новым именем, а затем отредактировать. Имя файла карты – произвольное, расширение файла – map.

Секция Tiling содержит параметры подключению к серверу тайлов (плиток), из которых состоит подложка карты. Можно использовать сервера тайлов от различных поставщиков, как платные, так и бесплатные.

<Tiling>
  <UrlTemplate>https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png</UrlTemplate>
</Tiling>

Секция InitialView задаёт начальные координаты и масштаб карты. Масштаб - это целое число от 0 до 18.

<InitialView>
    <Lat>48.861111</Lat>
    <Lon>2.336389</Lon>
    <Zoom>13</Zoom>
</InitialView>

Секция Locations описывает набор расположений, которые отображаются на карте. Рассмотрим пример:

<Locations>
  <Location>
    <Lat>48.858222</Lat>
    <Lon>2.2945</Lon>
    <Name>Eiffel Tower</Name>
    <Descr>Avenue Anatole France, Paris, France</Descr>
    <StatusCnlNum>0</StatusCnlNum>
    <Data>
      <DataItem cnlNum="101" />
      <DataItem cnlNum="115">Avg. temp</DataItem>
    </Data>
    <Link viewID="2" />
  </Location>
  ...

        Lat и Lon - широта и долгота объекта на карте,

        Name - наименование объекта,

        Descr - дополнительное описание,

        StatusCnlNum - номер входного канала, который означает статус данного объекта; 0 - канал не задан; положительное значение канала - объект в норме, иначе - объект требует внимания,

        DataItem - отображаемый элемент данных, связанных с входным каналом,

        Link - ссылка на представление, которое содержит детализированную информацию по объекту.

Добавление карты в базу конфигурации

Чтобы карта появилась в дереве представлений, её нужно прописать в таблице Интерфейс с помощью программы Администратор. Необходимо указать путь к файлу карты относительно директории интерфейса и ввести заголовок - текст узла дерева (см. рис.).

Чтобы изменения отобразились в веб-приложении Вебстанция, необходимо передать проект на сервер и выполнить повторный вход в веб-приложение. Результат: