text:
"""User management endpoints."""
import re
import string

from flask import jsonify
from flask_restplus import Namespace, Resource

import api
from api import PicoException, rate_limit, require_admin

from .schemas import user_req, user_delete_req, user_search_req

ns = Namespace("users", description="User management")

@ns.route("")
class UserList(Resource):
    """Get the full list of users, or add a new user."""

    @ns.response(200, "Success")
    @ns.response(401, "Not logged in")
    @ns.response(403, "Not authorized")
    @require_admin
    def get(self):
        """Get the full list of users."""
        return jsonify(api.user.get_all_users())

    @rate_limit(limit=5, duration=15, by_ip=True)
    @ns.response(201, "Successfully created user")
    @ns.response(400, "Error parsing request")
    @ns.response(409, "Username not available")
    @ns.response(429, "Too many requests, slow down!")
    @ns.expect(user_req)
    def post(self):
        """Register a new user."""
        req = user_req.parse_args(strict=True)

        # Do additional validation on request, due to RequestParser
        # limitations (@TODO handle w/ Marshmallow)
        if "age" not in req["demo"] or req["demo"]["age"] not in ["13-17", "18+"]:
            raise PicoException(
                "'age' must be specified in the 'demo' object. Valid values "
                + "are: ['13-17', '18+']",
                status_code=400,
            )
        if (
            api.config.get_settings()["email"]["parent_verification_email"]
            and req["demo"]["age"] != "18+"
            and (
                "parentemail" not in req["demo"]
                or not re.match(r".+@.+\..{2,}", req["demo"]["parentemail"])
            )
        ):
            raise PicoException(
                "Must provide a valid parent email address under the key "
                + "'demo.parentemail'.",
                status_code=400,
            )
        accepted_genders = ["male", "female", "nb/gf", "nl/no"]
        if "gender" in req["demo"] and req["demo"]["gender"] not in accepted_genders:
            raise PicoException(
                f"'demo.gender' must be one of: {str(accepted_genders)}", 400
            )
        if not all(
            [
                c in string.digits + string.ascii_lowercase
                for c in req["username"].lower()
            ]
        ):
            raise PicoException("Usernames must be alphanumeric.", status_code=400)

        # Clean up input data
        req["affiliation"] = req["affiliation"].strip()

        # Attempt to create the user
        uid = api.user.add_user(req)

        res = jsonify({"success": True, "uid": uid})
        res.status_code = 201
        return res

@ns.response(200, "Success")
@ns.response(401, "Not logged in")
@ns.response(403, "Not authorized")
@ns.response(404, "User not found")
@ns.route("/<string:user_id>")
class User(Resource):
    """Get a specific user."""

    @require_admin
    def get(self, user_id):
        """Retrieve a specific user."""
        res = api.user.get_user(uid=user_id)
        if not res:
            raise PicoException("User not found", status_code=404)
        return res, 200

@ns.route("/<string:user_id>/delete")
class UserDeleteResponse(Resource):
    """Delete a specific user with an optional reason"""

    @require_admin
    @ns.expect(user_delete_req)
    def post(self, user_id):
        """Disable a specific user."""
        req = user_delete_req.parse_args(strict=True)
        user = api.user.get_user(uid=user_id)
        if not user:
            raise PicoException("User not found", status_code=404)
        api.user.disable_account(user_id, req["reason"])
        return jsonify({"success": True})

@ns.response(200, "Success")
@ns.response(401, "Not logged in")
@ns.response(403, "Not authorized")
@ns.response(404, "User not found")
@ns.route("/<string:user_id>/export")
class UserDataExport(Resource):
    """Export all data of a given user."""

    @require_admin
    def get(self, user_id):
        """Export all data of a given user."""
        user_data = api.user.get_user(uid=user_id)
        if not user_data:
            raise PicoException("User not found", status_code=404)
        submissions = api.submissions.get_submissions(uid=user_id)
        feedbacks = api.problem_feedback.get_problem_feedback(uid=user_id)
        return jsonify(
            {"user": user_data, "submissions": submissions, "feedback": feedbacks}
        )

@ns.response(200, "Success")
@ns.response(401, "Not logged in")
@ns.response(403, "Not authorized")
@ns.response(404, "User not found")
@ns.route("/search")
class UserSearch(Resource):
    """Search for a given user."""

    @require_admin
    @ns.expect(user_search_req)
    def post(self):
        """Search for a given user."""
        req = user_search_req.parse_args(strict=True)

        if req["field"] == "Email":
            user_data = api.user.get_users(email=req["query"])
        elif req["field"] == "Parent Email":
            user_data = api.user.get_users(parentemail=req["query"])
        elif req["field"] == "User Name":
            user_data = api.user.get_users(username=req["query"])

        if not user_data:
            raise PicoException("User not found", status_code=404)
        return jsonify(user_data)


text:
#include <folly/experimental/logging/Init.h>
#include <folly/experimental/logging/xlog.h>
#include <folly/init/Init.h>
#include <folly/portability/Stdlib.h>

DEFINE_string(logging, "", "Logging category configuration string");

DEFINE_string(
    category,
    "",
    "Crash with a message to this category instead of the default");
DEFINE_bool(crash, true, "Crash with a fatal log message.");

using folly::LogLevel;

namespace {
/**
 * Helper class to optionally log a fatal message during static initialization
 * or destruction.
 *
 * Since command line arguments have not been processed during static
 * initialization, we check an environment variable.
 */
class InitChecker {
 public:
  InitChecker() : value_{getenv("CRASH_DURING_INIT")} {
    if (value_ && strcmp(value_, "shutdown") != 0) {
      XLOG(FATAL) << "crashing during static initialization";
    }
  }
  ~InitChecker() {
    if (value_) {
      XLOG(FATAL) << "crashing during static destruction";
    }
  }

  const char* value_{nullptr};
};

static InitChecker initChecker;
} // namespace

namespace {
int runHelper() {
  if (!FLAGS_category.empty()) {
    folly::Logger logger{FLAGS_category};
    FB_LOG(logger, FATAL, "crashing to category ", FLAGS_category);
  }

  if (!FLAGS_crash) {
    return 0;
  }

  XLOG(FATAL) << "test program crashing!";
  // Even though this function is defined to return an integer, the compiler
  // should be able to detect that XLOG(FATAL) never returns.  It shouldn't
  // complain that we don't return an integer here.
}
} // namespace

std::string fbLogFatalCheck() {
  folly::Logger logger("some.category");
  FB_LOG(logger, FATAL) << "we always crash";
  // This function mostly exists to make sure the compiler does not warn
  // about a missing return statement here.
}

/*
 * This is a simple helper program to exercise the LOG(FATAL) functionality.
 */
int main(int argc, char* argv[]) {
  // Call folly::init() and then initialize log levels and handlers
  folly::init(&argc, &argv);
  folly::initLoggingOrDie(FLAGS_logging);

  // Do most of the work in a separate helper function.
  //
  // The main reason for putting this in a helper function is to ensure that
  // the compiler does not warn about missing return statements on XLOG(FATAL)
  // code paths.  Unfortunately it appears like some compilers always suppress
  // this warning for main().
  return runHelper();
}

redpajama_set_name: RedPajamaGithub


text:
"""
The :py:mod:`thrustcurve` module contains functions and objects designed to
be useful to those parsing rocket motor thrust curve files.

"""
import contextlib
import codecs
import io
import xml.etree.ElementTree as ET

import numpy as np
import pandas
from past.types import basestring

class ParseError(RuntimeError):
    """Raised when an input file could not be parsed."""

def load(fn_or_fobj):
    """Load a RockSim (.rse) format engine database.

    Args:
        fn_or_fobj (str or file like object): file containing .rse format data

    Returns:
        A list of :py:class:`Engine` instances, one per engine in the file.

    Raises:
        ParseError: if the file is of the wrong format

    """
    with _as_file_obj(fn_or_fobj) as f:
        tree = ET.parse(f)
    root = tree.getroot()
    _assert_tag(root, 'engine-database')
    engine_list = _find_or_throw(root, 'engine-list')

    return [
        _engine_from_element(e) for e in engine_list.iter('engine')
    ]

def loads(string):
    """Load engine data from string.

    Like :py:func:`load` except that the parameter is the textual content of the
    file as a string.

    """
    return load(io.BytesIO(codecs.encode(string, 'utf8')))

_ENGINE_DF_COLUMNS = ['time', 'force', 'mass']

class Engine(object):
    """Class representing a rocket engine.

    The rocket engine thrust curve is contained within the *data* attribute.
    This is a :py:class:`pandas.DataFrame` instance with the columns "time"
    (seconds), "force" (Newtons) and mass (kg).

    See also: the `Pandas documentation`_.

    .. _Pandas documentation: http://pandas.pydata.org/pandas-docs/stable/10min.html

    Attributes:
        manufacturer (str or None): manufacture of rocket
        code (str or None): manufacturer's code for this engine
        comments (str or None): additional comments
        data (pandas.DataFrame): thrust curve data

    """
    def __init__(self, manufacturer=None, code=None):
        self.manufacturer = manufacturer
        self.code = code
        self.comments = None
        self.data = None

def _engine_from_element(elem):
    engine = Engine(
        manufacturer=elem.get('mfg', None),
        code=elem.get('code', None)
    )
    engine.comments = elem.findtext('comments', None).strip()
    data = _find_or_throw(elem, 'data')

    data_items = []
    for eng_data in data.iter('eng-data'):
        data_items.append(tuple(
            np.float(eng_data.get(k, np.nan)) for k in ['t', 'f', 'm']
        ))
    engine.data = pandas.DataFrame.from_records(
        data_items, columns=_ENGINE_DF_COLUMNS
    )

    return engine

@contextlib.contextmanager
def _as_file_obj(fn_or_fobj, mode='rb'):
    if isinstance(fn_or_fobj, basestring):
        f = open(fn_or_fobj, mode)
        yield f
        f.close()
    else:
        yield fn_or_fobj

def _assert_tag(e, name):
    if e.tag != name:
        raise ParseError('Expected tag {} to be {}'.format(e, name))

def _find_or_throw(e, name):
    f = e.find(name)
    if f is None:
        raise ParseError(
            'Could not find expected child {} of {}'.format(name, e)
        )
    return f


text:
@interface MNCalendarViewLayout : UICollectionViewFlowLayout

@end


text:
ACCEPTED

#### According to
Interim Register of Marine and Nonmarine Genera

#### Published in
Bibl. Zool. , No. 12, 115.

#### Original name
null

### Remarks
null


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Catalog extends CI_Controller {

	public function index()
	{
		$this->home1();
	}
	public function home1()
	{
		$data['searchval'] ="no_search_query";
		$data['filter'] ="default";

		$this->load->model('catalog_m');
		$query_results=$this->catalog_m->fetch_latest_prods();
		$data['resultsForLatestProd']=$query_results;

		$this->load->view('includes/header_loggedin');
		$this->load->view('catalog_v',$data);
		$this->load->view('includes/footer');
	}
	public function execute_search($sort_by='price', $sort_order='asc',$filter='abcde', $offset=0)
	{
		$limit=8;

		$search_term = 'no_search_query'; // default when no term in session or POST
		if ($this->input->post('search_query'))
		{
    		// use the term from POST and set it to session
    		$search_term = $this->input->post('search_query');
    		$this->session->set_userdata('search_term', $search_term);
		}
		elseif ($this->session->userdata('search_term'))
		{
    		// if term is not in POST use existing term from session
    		$search_term = $this->session->userdata('search_term');
		}

		$data['searchval']=$search_term;

		$this->load->model('catalog_m');
		$query_results=$this->catalog_m->fetch_results($search_term,$limit,$offset,$sort_by,$sort_order,$filter);
		$data['results']=$query_results['query'];
		$data['results_num']=$query_results['num_rows'];

		//pagination
		$this->load->library('pagination');
		$conf = array();
		$conf['base_url']=base_url("catalog/execute_search/$sort_by/$sort_order/$filter");
		if($data['results']!=NULL)
		{
			$conf['total_rows']=$data['results_num'];
		}
		$conf['per_page']=$limit;
		$conf['uri_segment']=6;
		$this->pagination->initialize($conf);
		$data['pagination']=$this->pagination->create_links();

		$data['sort_by']=$sort_by;
 		$data['sort_order']=$sort_order;
		$data['filter']=$filter;

		$this->load->view('includes/header_loggedin');
		$this->load->view('catalog_v',$data);
		$this->load->view('includes/footer');

	}

	public function product_display($id)
	{
	echo "rohin";
	  $this->load->model('catalog_m');
	  $query=$this->catalog_m->fetch_prod_details($id);
	  $data['prod_details']=$query['prod_details'];
	  $data['minSP']=$query['minSP'];
	  $data['maxSP']=$query['maxSP'];
	  $data['add_details']=$query['specific_details'];

	  //print_r($query['q1']);
	  //echo nl2br("\n\n");
	  //print_r($query['prod_details']);
	  //if($this->session->flashdata('order_not_placed1')=='no')
	//	{
	//	$data['order_placed1']='no';
	//	}

	  $this->load->model('membership_model');
	  $result = $this->membership_model->retreiveUserDetails();
	  $data['vwBalance'] = $result->vw_balance;

	  $this->load->view('includes/header_loggedin');
	  $this->load->view('product_display_v',$data);
	  $this->load->view('includes/footer');
	}
	public function product_buy($pid,$price)
	{
	  $this->load->model('catalog_m');
	  $query=$this->catalog_m->order_product($pid,$price);

	  if($query==TRUE)
	  {
	  	$newOrder=1;
	  	redirect('myaccount/boughtHistory/'.$newOrder);
	  }
	 /* else
	  {
		$this->session->set_flashdata('order_not_placed1','no');
		redirect('catalog/product_display/'.$pid);
	  }*/
	}
}


text:
angular.module('n52.core.metadata')
    .component('swcSosUrl', {
        bindings: {
            timeseries: '<'
        },
        templateUrl: 'n52.core.metadata.sos-url',
        controller: 'SwcSosUrlCtrl'
    })
    .controller('SwcSosUrlCtrl', ['sosUrlSrv', '$window',
        function(sosUrlSrv, $window) {
            this.sos = {};
            this.openCapabilities = function() {
                $window.open(this.sos.url + '?request=GetCapabilities&service=SOS');
            };
            this.$onInit = function() {
                sosUrlSrv.getSosUrl(this.timeseries, this.sos);
            };
        }
    ]);


text:
class Other(object):

    def override(self):
        print "OTHER override()"

    def implicit(self):
        print "OTHER implicit()"

    def altered(self):
        print "OTHER altered()"

class Child(object):

    def __init__(self):
        self.other = Other()

    def implicit(self):
        self.other.implicit()

    def override(self):
        print "CHILD override()"

    def altered(self):
        print "CHILD, BEFORE OTHER altered()"
        self.other.altered()
        print "CHILD, AFTER OTHER altered()"

def main():
    """Composition"""
    son = Child() # Creates an object

    son.implicit()
    son.override()
    son.altered()

if __name__ == "__main__":
    main()


text:
/*

LCS implementation that supports arrays or strings

reference: http://en.wikipedia.org/wiki/Longest_common_subsequence_problem

*/

const defaultMatch = function(array1, array2, index1, index2) {
  return array1[ index1 ] === array2[ index2 ];
};

const lengthMatrix = function(array1, array2, match, context) {
  const len1 = array1.length;
  const len2 = array2.length;
  let x, y;

  // initialize empty matrix of len1+1 x len2+1
  let matrix = [ len1 + 1 ];
  for (x = 0; x < len1 + 1; x++) {
    matrix[ x ] = [ len2 + 1 ];
    for (y = 0; y < len2 + 1; y++) {
      matrix[ x ][ y ] = 0;
    }
  }
  matrix.match = match;
  // save sequence lengths for each coordinate
  for (x = 1; x < len1 + 1; x++) {
    for (y = 1; y < len2 + 1; y++) {
      if (match(array1, array2, x - 1, y - 1, context)) {
        matrix[ x ][ y ] = matrix[ x - 1 ][ y - 1 ] + 1;
      } else {
        matrix[ x ][ y ] = Math.max(matrix[ x - 1 ][ y ], matrix[ x ][ y - 1 ]);
      }
    }
  }
  return matrix;
};

const backtrack = function(matrix, array1, array2, context) {
  let index1 = array1.length;
  let index2 = array2.length;
  const subsequence = {
    sequence: [],
    indices1: [],
    indices2: [],
  };

  while (index1 !== 0 && index2 !== 0) {
    const sameLetter =
      matrix.match(array1, array2, index1 - 1, index2 - 1, context);
    if (sameLetter) {
      subsequence.sequence.unshift(array1[ index1 - 1 ]);
      subsequence.indices1.unshift(index1 - 1);
      subsequence.indices2.unshift(index2 - 1);
      --index1;
      --index2;
    } else {
      const valueAtMatrixAbove = matrix[ index1 ][ index2 - 1 ];
      const valueAtMatrixLeft = matrix[ index1 - 1 ][ index2 ];
      if (valueAtMatrixAbove > valueAtMatrixLeft) {
        --index2;
      } else {
        --index1;
      }
    }
  }
  return subsequence;
};

const get = function(array1, array2, match, context) {
  const innerContext = context || {};
  const matrix = lengthMatrix(
    array1,
    array2,
    match || defaultMatch,
    innerContext
  );
  const result = backtrack(
    matrix,
    array1,
    array2,
    innerContext
  );
  if (typeof array1 === 'string' && typeof array2 === 'string') {
    result.sequence = result.sequence.join('');
  }
  return result;
};

export default {
  get: get,
};


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" >

    <item
        android:showAsAction="ifRoom"
        android:id="@+id/action_settings"
        android:title="@string/action_settings"
        android:actionLayout="@layout/roundbar"/>

</menu>


text:
package com.linecorp.armeria.internal.common.stream;

import static com.linecorp.armeria.internal.common.stream.StreamMessageUtil.touchOrCopyAndClose;

import java.util.List;

import com.google.common.collect.ImmutableList;

import com.linecorp.armeria.common.annotation.Nullable;
import com.linecorp.armeria.common.annotation.UnstableApi;

import io.netty.util.concurrent.EventExecutor;

/**
 * A {@link FixedStreamMessage} that publishes two objects.
 */
@UnstableApi
public class TwoElementFixedStreamMessage<T> extends FixedStreamMessage<T> {

    @Nullable
    private T obj1;
    @Nullable
    private T obj2;

    private boolean inOnNext;
    private boolean requested;

    /**
     * Constructs a new {@link TwoElementFixedStreamMessage} for the given objects.
     */
    public TwoElementFixedStreamMessage(T obj1, T obj2) {
        this.obj1 = obj1;
        this.obj2 = obj2;
    }

    @Override
    public long demand() {
        // Since the objects is drained as soon as it is requested, The demand will be zero in most cases.
        // But the demand could be one if a subscriber calls `subscription.request(n)` while receiving a object
        // via 'onNext(t)'
        return requested ? 1 : 0;
    }

    @Override
    final void cleanupObjects(@Nullable Throwable cause) {
        if (obj1 != null) {
            StreamMessageUtil.closeOrAbort(obj1, cause);
            obj1 = null;
        }
        if (obj2 != null) {
            StreamMessageUtil.closeOrAbort(obj2, cause);
            obj2 = null;
        }
    }

    @Override
    final List<T> drainAll(boolean withPooledObjects) {
        assert obj1 != null;
        final List<T> objs = ImmutableList.of(touchOrCopyAndClose(obj1, withPooledObjects),
                                              touchOrCopyAndClose(obj2, withPooledObjects));
        obj1 = obj2 = null;
        return objs;
    }

    @Override
    public void request(long n) {
        final EventExecutor executor = executor();
        if (executor.inEventLoop()) {
            request0(n);
        } else {
            executor.execute(() -> request0(n));
        }
    }

    private void request0(long n) {
        if (obj2 == null) {
            return;
        }

        if (n <= 0) {
            onError(new IllegalArgumentException(
                    "n: " + n + " (expected: > 0, see Reactive Streams specification rule 3.9)"));
            return;
        }

        if (inOnNext) {
            // Do not let Subscriber.onNext() reenter, because it can lead to weird-looking event ordering
            // for a Subscriber implemented like the following:
            //
            //   public void onNext(Object e) {
            //       subscription.request(1);
            //       ... Handle 'e' ...
            //   }
            //
            // Note that we do not call this method again, because we are already in the notification loop
            // and it will consume the element we've just added in addObjectOrEvent() from the queue as
            // expected.
            //
            // We do not need to worry about synchronizing the access to 'inOnNext' because the subscriber
            // methods must be on the same thread, or synchronized, according to Reactive Streams spec.
            requested = true;
            return;
        }

        if (n >= 2) {
            // All elements will be consumed. No need to restore inOnNext
            inOnNext = true;
            if (obj1 != null) {
                final T item = obj1;
                obj1 = null;
                onNext(item);
            }

            if (obj2 != null) {
                final T item = obj2;
                obj2 = null;
                onNext(item);
                onComplete();
            }
        } else {
            if (obj1 != null) {
                final T item = obj1;
                obj1 = null;
                inOnNext = true;
                onNext(item);
                inOnNext = false;
                n--;
            }

            if ((n > 0 || requested) && obj2 != null) {
                final T item = obj2;
                obj2 = null;
                onNext(item);
                onComplete();
            }
        }
    }

    @Override
    public void cancel() {
        if (obj2 == null) {
            return;
        }
        super.cancel();
    }

    @Override
    public void abort() {
        if (obj2 == null) {
            return;
        }
        super.abort();
    }

    @Override
    public void abort(Throwable cause) {
        if (obj2 == null) {
            return;
        }
        super.abort(cause);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar" />

</resources>


text:
// @flow

/**
  Provides details of changing model value
  @param {Object} [details]
  @param {string} [details.inserted] - Inserted symbols
  @param {boolean} [details.skip] - Can skip chars
  @param {number} [details.removeCount] - Removed symbols count
  @param {number} [details.tailShift] - Additional offset if any changes occurred before tail
*/
export default
class ChangeDetails {
  /** Inserted symbols */
  inserted: string;
  /** Can skip chars */
  skip: boolean;
  /** Additional offset if any changes occurred before tail */
  tailShift: number;
  /** Raw inserted is used by dynamic mask */
  rawInserted: string;

  constructor (details?: {
    inserted?: $PropertyType<ChangeDetails, 'inserted'>,
    rawInserted?: $PropertyType<ChangeDetails, 'rawInserted'>,
    skip?: $PropertyType<ChangeDetails, 'skip'>,
    tailShift?: $PropertyType<ChangeDetails, 'tailShift'>,
  }) {
    Object.assign(this, {
      inserted: '',
      rawInserted: '',
      skip: false,
      tailShift: 0,
    }, details);
  }

  /**
    Aggregate changes
    @returns {ChangeDetails} `this`
  */
  aggregate (details: ChangeDetails): ChangeDetails {
    this.rawInserted += details.rawInserted;
    this.skip = this.skip || details.skip;
    this.inserted += details.inserted;
    this.tailShift += details.tailShift;
    return this;
  }

  /** Total offset considering all changes */
  get offset (): number {
    return this.tailShift + this.inserted.length;
  }
}


text:
require "colorscheme/version"
require "colorscheme/colorscheme"
module Colorscheme
end


text:
let firebase = require('./../server/util/db/firebase');
//const config = require('./../server/config'); // load config

// firebase.js already read this config.
// firebase.setConfig() is used if you did not load the config in  process.env

let firebaseConfig = {
    "type": "",
    "project_id": "",
    "private_key_id": "",
    "private_key": "",
    "client_email": "",
    "client_id": "",
    "auth_uri": "",
    "token_uri": "",
    "auth_provider_x509_cert_url": "",
    "client_x509_cert_url": ""
};

let databaseURL = "https://xxxxxxxxxxxxxxxx.firebaseio.com";

firebase.setConfig(firebaseConfig, databaseURL);

// get user object by email
firebase.getUserByEmail('test1@live.com')
    .then((user) => {
        console.log(user);
    });

// get data from firebase

// use promise
firebase.get('/test')
    .then((data) => {
        console.log(data);
    });

// use callback
firebase.get('/test', (data) => {
    console.log(data);
});

// set data from firebase  (it is destructive)
let data = {
    '-KoNv05kwD57XzaKoBZD': {
        d: 'dsd',
        a: 'qqq'
    }
};

firebase.set('/test', data)


text:
package com.shorrockin.cascal.model

import java.nio.ByteBuffer

/**
 * a type of column container which holds standard columns.
 *
 * @author Chris Shorrock
 */
trait StandardColumnContainer[ColumnType, SliceType, ValueType] extends ColumnContainer[ColumnType, SliceType] {
  def \(name:ByteBuffer):ColumnType
  def \(name:ByteBuffer, value:ValueType):ColumnType
}


text:
namespace principia {
namespace interface {

using geometry::Bivector;
using quantities::Force;
using quantities::Torque;
using ksp_plugin::PartId;
using quantities::si::Kilo;
using quantities::si::Newton;
using quantities::si::Metre;
using quantities::si::Radian;

void __cdecl principia__PartApplyIntrinsicForce(
    Plugin* const plugin,
    PartId const part_id,
    XYZ const force_in_kilonewtons) {
  journal::Method<journal::PartApplyIntrinsicForce> m(
      {plugin, part_id, force_in_kilonewtons});
  CHECK_NOTNULL(plugin)->ApplyPartIntrinsicForce(
      part_id,
      Vector<Force, World>(FromXYZ(force_in_kilonewtons) * Kilo(Newton)));
  return m.Return();
}

void __cdecl principia__PartApplyIntrinsicForceAtPosition(
    Plugin* const plugin,
    PartId const part_id,
    XYZ const force_in_kilonewtons,
    XYZ const lever_arm) {
  journal::Method<journal::PartApplyIntrinsicForceAtPosition> m(
      {plugin,
       part_id,
       force_in_kilonewtons,
       lever_arm});
  CHECK_NOTNULL(plugin)->ApplyPartIntrinsicForceAtPosition(
      part_id,
      Vector<Force, World>(FromXYZ(force_in_kilonewtons) * Kilo(Newton)),
      Displacement<World>(FromXYZ(lever_arm) * Metre));
  return m.Return();
}

void __cdecl principia__PartApplyIntrinsicTorque(
    Plugin* const plugin,
    PartId const part_id,
    XYZ const torque_in_kilonewton_metre) {
  journal::Method<journal::PartApplyIntrinsicTorque> m(
      {plugin, part_id, torque_in_kilonewton_metre});
  CHECK_NOTNULL(plugin)->ApplyPartIntrinsicTorque(
      part_id,
      Bivector<Torque, World>(FromXYZ(torque_in_kilonewton_metre) *
                              Kilo(Newton) * Metre * Radian));
  return m.Return();
}

QPRW __cdecl principia__PartGetActualRigidMotion(
    Plugin const* const plugin,
    PartId const part_id,
    Origin const origin) {
  journal::Method<journal::PartGetActualRigidMotion> m(
      {plugin, part_id, origin});
  CHECK_NOTNULL(plugin);
  RigidMotion<EccentricPart, World> const part_motion =
      plugin->GetPartActualMotion(
          part_id,
          plugin->BarycentricToWorld(
              origin.reference_part_is_unmoving,
              origin.reference_part_id,
              origin.reference_part_is_at_origin
                  ? std::nullopt
                  : std::make_optional(FromXYZ<Position<World>>(
                        origin.main_body_centre_in_world))));
  DegreesOfFreedom<World> const part_dof =
      part_motion({EccentricPart::origin, EccentricPart::unmoving});
  Rotation<EccentricPart, World> const part_orientation =
      part_motion.orthogonal_map().AsRotation();
  AngularVelocity<World> const part_angular_velocity =
      part_motion.angular_velocity_of<EccentricPart>();
  return m.Return(
      {ToQP(part_dof),
       ToWXYZ(part_orientation.quaternion()),
       ToXYZ(part_angular_velocity.coordinates() / (Radian / Second))});
}

bool __cdecl principia__PartIsTruthful(
    Plugin const* const plugin,
    uint32_t const part_id) {
  journal::Method<journal::PartIsTruthful> m({plugin, part_id});
  CHECK_NOTNULL(plugin);
  return m.Return(plugin->PartIsTruthful(part_id));
}

void __cdecl principia__PartSetApparentRigidMotion(
    Plugin* const plugin,
    PartId const part_id,
    QP const degrees_of_freedom,
    WXYZ const rotation,
    XYZ const angular_velocity) {
  journal::Method<journal::PartSetApparentRigidMotion> m(
      {plugin,
       part_id,
       degrees_of_freedom,
       rotation,
       angular_velocity});
  CHECK_NOTNULL(plugin);
  plugin->SetPartApparentRigidMotion(
      part_id,
      MakePartApparentRigidMotion(
          degrees_of_freedom, rotation, angular_velocity));
  return m.Return();
}

}  // namespace interface
}  // namespace principia


text:
root_group = value_for_platform(
  ["openbsd", "freebsd", "mac_os_x"] => { "default" => "wheel" },
  "default" => "root"
)

# COOK-635 account for alternate gem paths
# try to use the bin provided by the node attribute
if ::File.executable?(node["chef_client"]["bin"])
  client_bin = node["chef_client"]["bin"]
# search for the bin in some sane paths
elsif (chef_in_sane_path=Chef::Client::SANE_PATHS.map{|p| p="#{p}/chef-client";p if ::File.executable?(p)}.compact.first) && chef_in_sane_path
  client_bin = chef_in_sane_path
# last ditch search for a bin in PATH
elsif (chef_in_path=%x{which chef-client}.chomp) && ::File.executable?(chef_in_path)
  client_bin = chef_in_path
else
  raise "Could not locate the chef-client bin in any known path. Please set the proper path by overriding node['chef_client']['bin'] in a role."
end

%w{run_path cache_path backup_path log_dir}.each do |key|
  directory node["chef_client"][key] do
    recursive true
    owner "root"
    group root_group
    mode 0755
  end
end

case node["chef_client"]["init_style"]
when "init"

  dist_dir, conf_dir = value_for_platform(
    ["ubuntu", "debian"] => { "default" => ["debian", "default"] },
    ["redhat", "centos", "fedora", "scientific", "amazon"] => { "default" => ["redhat", "sysconfig"]}
  )

  template "/etc/init.d/chef-client" do
    source "#{dist_dir}/init.d/chef-client.erb"
    mode 0755
    variables(
      :client_bin => client_bin
    )
    notifies :restart, "service[chef-client]", :delayed
  end

  template "/etc/#{conf_dir}/chef-client" do
    source "#{dist_dir}/#{conf_dir}/chef-client.erb"
    mode 0644
    notifies :restart, "service[chef-client]", :delayed
  end

  service "chef-client" do
    supports :status => true, :restart => true
    action :enable
  end

when "upstart"

  case node["platform"]
  when "ubuntu"
    if (8.04..9.04).include?(node["platform_version"].to_f)
      upstart_job_dir = "/etc/event.d"
      upstart_job_suffix = ""
    else
      upstart_job_dir = "/etc/init"
      upstart_job_suffix = ".conf"
    end
  end

  template "#{upstart_job_dir}/chef-client#{upstart_job_suffix}" do
    source "debian/init/chef-client.conf.erb"
    mode 0644
    variables(
      :client_bin => client_bin
    )
    notifies :restart, "service[chef-client]", :delayed
  end

  service "chef-client" do
    provider Chef::Provider::Service::Upstart
    action [:enable,:start]
  end

when "arch"

  template "/etc/rc.d/chef-client" do
    source "rc.d/chef-client.erb"
    mode 0755
    variables(
      :client_bin => client_bin
    )
    notifies :restart, "service[chef-client]", :delayed
  end

  template "/etc/conf.d/chef-client.conf" do
    source "conf.d/chef-client.conf.erb"
    mode 0644
    notifies :restart, "service[chef-client]", :delayed
  end

  service "chef-client" do
    action [:enable, :start]
  end

when "runit"

  include_recipe "runit"
  runit_service "chef-client"

when "bluepill"

  directory node["chef_client"]["run_path"] do
    recursive true
    owner "root"
    group root_group
    mode 0755
  end

  include_recipe "bluepill"

  template "#{node["bluepill"]["conf_dir"]}/chef-client.pill" do
    source "chef-client.pill.erb"
    mode 0644
    notifies :restart, "bluepill_service[chef-client]", :delayed
  end

  bluepill_service "chef-client" do
    action [:enable,:load,:start]
  end

when "daemontools"

  include_recipe "daemontools"

  directory "/etc/sv/chef-client" do
    recursive true
    owner "root"
    group root_group
    mode 0755
  end

  daemontools_service "chef-client" do
    directory "/etc/sv/chef-client"
    template "chef-client"
    action [:enable,:start]
    log true
  end

when "bsd"
  log "You specified service style 'bsd'. You will need to set up your rc.local file."
  log "Hint: chef-client -i #{node["chef_client"]["client_interval"]} -s #{node["chef_client"]["client_splay"]}"
else
  log "Could not determine service init style, manual intervention required to start up the chef-client service."
end


text:
+++

categories="article"
date="2017-10-02T00:09:00+03:00"
issue="2017-03"
issue_name="2017 - #03"
issue_id="3"
number="15"
file = "https://static.nuclear-power-engineering.ru/articles/2017/03/15.pdf"
first_page="162"
last_page="170"
udc="621.039"
title="Experience of commissioning the V-392M reactor plant passive heat removal system"
original_title="Опыт ввода в эксплуатацию системы пассивного отвода тепла реакторной установки В-392М"
authors=["GalievKF", "YaurovSV", "GoncharovYeV", "VolnovAS"]
tags=["AES-2006 design", "V-392M", "VVER-1200", "passive heat removal system", "air valve", "regulator", "pre-commissioning"]
rubric = "nuclearpowerplants"
rubric_name = "Nuclear power plants"
outputs=["HTML", "DOI"]
doi="https://doi.org/10.26583/npe.2017.3.15"

+++

Structural features of components in the passive heat removal system (PHRS), first used in Russia in the VVER-1200 reactor, are considered. Structural deficiencies of the system's air valves and regulators, revealed in the process of pre-commissioning activities and hampering the performance by the system of its design functions, are described. The causes for the deficiencies are unpredictable effects of the fluid thermodynamic processes on moving components. The equipment deficiencies were eliminated through the installation of additional equipment retainer units responding to the system actuation, and by additional adjustment of components. The retainer design allows the air valves to stay fully opened and prevents them from closing uncontrollably under the action of a rapidly ascending hot air flow inside the PHRS shell.

During the commissioning stage of Novovoronezh NPP II's unit 1, following the equipment design update, the PHRS confirmed to be indispensible as the means of the reactor heat removal in conditions of an unexpected reactor scram, and proved to be efficient as part of an integrated PHRS test at the reactor plant power of 75%. The PHRS heat exchanger's total heat removal capacity was over 100 MW, with the ambient air temperature being –13°C, and the time for the PHRS rise to power was not more than 90 seconds, which meets the system's design performance.

### References

1. Safety assessment report. Novovoronezh NPP-2 Power unit No. 1. Chapter 12. Safety systems. Moscow. JSC Atomenergoproect Publ., 2013, 240 p. (in Russian).
2. Andrushechko S.A., Afrov A.M., Vasilyev B.Yu., Generalov V.N., Kosourov K.B., Semchenkov Yu.M., Ukraintsev V.F. NPP with VVER-1000 type reactor. From physical basics of exploitation to evolution design. Moscow. Logos Publ., 2010. 604 p. (in Russian).
3. Afrov A.M., Andrushechko S.A., Ukraintsev V.F., Vasilyev B.Yu., Kosourov K.B., Semchenkov Yu.M., Kokosadze E.L., Ivanov E.A. VVER-1000: physical basics of exploitation, nuclear fuel, safety. Moscow. University book, Logos Publ., 2006, 488 p. (in Russian).
4. Equipment of passive heat removal system. Explanatory note (392M.19 PZ). Podol'sk. OKB «GIDROPRESS» Publ., 2008, 33 p. (in Russian).
5. Equipment of passive heat removal system. Technological regulation of operation (392M.19 D4). Podol'sk. OKB «GIDROPRESS» Publ., 2010, 25 p. (in Russian).
6. Act No. 1009 on the identified non-compliance. Novovoronezh. Novovoronezh NPP Publ., 2015, 2 p. (in Russian).
7. Act No. 61/2017-РЦ6/06-02 of checking operability of air shutters PHRS. Novovoronezh. Novovoronezh NPP Publ., 2017, 6 p. (in Russian).
8. Operating instruction of passive heat removal system 1 JNB50-80. Novovoronezh. Novovoronezh NPP Publ., 2015, 99 p. (in Russian).
9. Act No. 640/2016-РЦ6/06-02 of checking condition of regulating devices PHRS. Novovoronezh. Novovoronezh NPP Publ., 2016, 5 p. (in Russian).
10. Commissioning protocol «Checking the effectiveness of PHRS (Complex testing)». Novovoronezh. Novovoronezh branch of «Atomtechenergo» Co, 2017, 7 p. (in Russian).


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

import com.facebook.presto.hive.InternalHiveSplit.InternalHiveBlock;
import com.facebook.presto.hive.util.AsyncQueue;
import com.facebook.presto.spi.ColumnHandle;
import com.facebook.presto.spi.ConnectorSession;
import com.facebook.presto.spi.ConnectorSplit;
import com.facebook.presto.spi.ConnectorSplitSource;
import com.facebook.presto.spi.PrestoException;
import com.facebook.presto.spi.predicate.TupleDomain;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.ListenableFuture;
import io.airlift.log.Logger;
import io.airlift.stats.CounterStat;
import io.airlift.units.DataSize;

import java.io.FileNotFoundException;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;

import static com.facebook.presto.hive.HiveErrorCode.HIVE_FILE_NOT_FOUND;
import static com.facebook.presto.hive.HiveErrorCode.HIVE_UNKNOWN_ERROR;
import static com.facebook.presto.hive.HiveSessionProperties.getMaxInitialSplitSize;
import static com.facebook.presto.hive.HiveSessionProperties.getMaxSplitSize;
import static com.facebook.presto.spi.StandardErrorCode.GENERIC_INTERNAL_ERROR;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.Maps.transformValues;
import static io.airlift.concurrent.MoreFutures.failedFuture;
import static io.airlift.concurrent.MoreFutures.toCompletableFuture;
import static io.airlift.units.DataSize.succinctBytes;
import static java.lang.Math.min;
import static java.lang.Math.toIntExact;
import static java.lang.String.format;
import static java.util.Objects.requireNonNull;
import static java.util.concurrent.CompletableFuture.completedFuture;

class HiveSplitSource
        implements ConnectorSplitSource
{
    private static final Logger log = Logger.get(HiveSplit.class);

    private final String queryId;
    private final String databaseName;
    private final String tableName;
    private final TupleDomain<? extends ColumnHandle> compactEffectivePredicate;
    private final AsyncQueue<InternalHiveSplit> queue;
    private final AtomicInteger bufferedInternalSplitCount = new AtomicInteger();
    private final int maxOutstandingSplitsBytes;

    private final DataSize maxSplitSize;
    private final DataSize maxInitialSplitSize;
    private final AtomicInteger remainingInitialSplits;

    private final AtomicReference<Throwable> throwable = new AtomicReference<>();
    private final HiveSplitLoader splitLoader;
    private volatile boolean closed;

    private final AtomicLong estimatedSplitSizeInBytes = new AtomicLong();

    private final CounterStat highMemorySplitSourceCounter;
    private final AtomicBoolean loggedHighMemoryWarning = new AtomicBoolean();

    HiveSplitSource(
            ConnectorSession session,
            String databaseName,
            String tableName,
            TupleDomain<? extends ColumnHandle> compactEffectivePredicate,
            int maxInitialSplits,
            int maxOutstandingSplits,
            DataSize maxOutstandingSplitsSize,
            HiveSplitLoader splitLoader,
            Executor executor,
            CounterStat highMemorySplitSourceCounter)
    {
        requireNonNull(session, "session is null");
        this.queryId = session.getQueryId();
        this.databaseName = requireNonNull(databaseName, "databaseName is null");
        this.tableName = requireNonNull(tableName, "tableName is null");
        this.compactEffectivePredicate = requireNonNull(compactEffectivePredicate, "compactEffectivePredicate is null");
        this.queue = new AsyncQueue<>(maxOutstandingSplits, executor);
        this.maxOutstandingSplitsBytes = toIntExact(maxOutstandingSplitsSize.toBytes());
        this.splitLoader = requireNonNull(splitLoader, "splitLoader is null");
        this.highMemorySplitSourceCounter = requireNonNull(highMemorySplitSourceCounter, "highMemorySplitSourceCounter is null");

        this.maxSplitSize = getMaxSplitSize(session);
        this.maxInitialSplitSize = getMaxInitialSplitSize(session);
        this.remainingInitialSplits = new AtomicInteger(maxInitialSplits);
    }

    /**
     * The upper bound of outstanding split count.
     * It might be larger than the actual number when called concurrently with other methods.
     */
    @VisibleForTesting
    int getBufferedInternalSplitCount()
    {
        return bufferedInternalSplitCount.get();
    }

    CompletableFuture<?> addToQueue(List<? extends InternalHiveSplit> splits)
    {
        CompletableFuture<?> lastResult = completedFuture(null);
        for (InternalHiveSplit split : splits) {
            lastResult = addToQueue(split);
        }
        return lastResult;
    }

    CompletableFuture<?> addToQueue(InternalHiveSplit split)
    {
        if (throwable.get() == null) {
            if (estimatedSplitSizeInBytes.addAndGet(split.getEstimatedSizeInBytes()) > maxOutstandingSplitsBytes) {
                // This limit should never be hit given there is a limit of maxOutstandingSplits.
                // If it's hit, it means individual splits are huge.
                if (loggedHighMemoryWarning.compareAndSet(false, true)) {
                    highMemorySplitSourceCounter.update(1);
                    log.warn("Split buffering for %s.%s in query %s exceeded memory limit (%s). %s splits are buffered.",
                            databaseName, tableName, queryId, succinctBytes(maxOutstandingSplitsBytes), getBufferedInternalSplitCount());
                }
                throw new PrestoException(GENERIC_INTERNAL_ERROR, format(
                        "Split buffering for %s.%s exceeded memory limit (%s). %s splits are buffered.",
                        databaseName, tableName, succinctBytes(maxOutstandingSplitsBytes), getBufferedInternalSplitCount()));
            }
            bufferedInternalSplitCount.incrementAndGet();
            return toCompletableFuture(queue.offer(split));
        }
        return completedFuture(null);
    }

    void noMoreSplits()
    {
        if (throwable.get() == null) {
            // Stop the split loader before finishing the queue.
            // Once the queue is finished, it will always return a completed future to avoid blocking any caller.
            // This could lead to a short period of busy loop in splitLoader (although unlikely in general setup).
            splitLoader.stop();
            queue.finish();
        }
    }

    void fail(Throwable e)
    {
        // The error must be recorded before setting the finish marker to make sure
        // isFinished will observe failure instead of successful completion.
        // Only record the first error message.
        if (throwable.compareAndSet(null, e)) {
            // Stop the split loader before finishing the queue.
            // Once the queue is finished, it will always return a completed future to avoid blocking any caller.
            // This could lead to a short period of busy loop in splitLoader (although unlikely in general setup).
            splitLoader.stop();
            queue.finish();
        }
    }

    @Override
    public CompletableFuture<List<ConnectorSplit>> getNextBatch(int maxSize)
    {
        checkState(!closed, "Provider is already closed");

        ListenableFuture<List<ConnectorSplit>> future = queue.borrowBatchAsync(maxSize, internalSplits -> {
            ImmutableList.Builder<InternalHiveSplit> splitsToInsertBuilder = ImmutableList.builder();
            ImmutableList.Builder<ConnectorSplit> resultBuilder = ImmutableList.builder();
            int removedEstimatedSizeInBytes = 0;
            for (InternalHiveSplit internalSplit : internalSplits) {
                long maxSplitBytes = maxSplitSize.toBytes();
                if (remainingInitialSplits.get() > 0) {
                    if (remainingInitialSplits.getAndDecrement() > 0) {
                        maxSplitBytes = maxInitialSplitSize.toBytes();
                    }
                }
                InternalHiveBlock block = internalSplit.currentBlock();
                long splitBytes;
                if (internalSplit.isSplittable()) {
                    splitBytes = min(maxSplitBytes, block.getEnd() - internalSplit.getStart());
                }
                else {
                    splitBytes = internalSplit.getEnd() - internalSplit.getStart();
                }

                resultBuilder.add(new HiveSplit(
                        databaseName,
                        tableName,
                        internalSplit.getPartitionName(),
                        internalSplit.getPath(),
                        internalSplit.getStart(),
                        splitBytes,
                        internalSplit.getFileSize(),
                        internalSplit.getSchema(),
                        internalSplit.getPartitionKeys(),
                        block.getAddresses(),
                        internalSplit.getBucketNumber(),
                        internalSplit.isForceLocalScheduling(),
                        (TupleDomain<HiveColumnHandle>) compactEffectivePredicate,
                        transformValues(internalSplit.getColumnCoercions(), HiveTypeName::toHiveType)));
                internalSplit.increaseStart(splitBytes);

                if (internalSplit.isDone()) {
                    removedEstimatedSizeInBytes += internalSplit.getEstimatedSizeInBytes();
                }
                else {
                    splitsToInsertBuilder.add(internalSplit);
                }
            }
            estimatedSplitSizeInBytes.addAndGet(-removedEstimatedSizeInBytes);

            List<InternalHiveSplit> splitsToInsert = splitsToInsertBuilder.build();
            List<ConnectorSplit> result = resultBuilder.build();
            bufferedInternalSplitCount.addAndGet(splitsToInsert.size() - result.size());

            return new AsyncQueue.BorrowResult<>(splitsToInsert, result);
        });

        // Before returning, check if there is a registered failure.
        // If so, we want to throw the error, instead of returning because the scheduler can block
        // while scheduling splits and wait for work to finish before continuing.  In this case,
        // we want to end the query as soon as possible and abort the work
        if (throwable.get() != null) {
            return failedFuture(throwable.get());
        }

        return toCompletableFuture(future);
    }

    @Override
    public boolean isFinished()
    {
        // the finished marker must be checked before checking the throwable
        // to avoid a race with the fail method
        boolean isFinished = queue.isFinished();
        if (throwable.get() != null) {
            throw propagatePrestoException(throwable.get());
        }
        return isFinished;
    }

    @Override
    public void close()
    {
        // Stop the split loader before finishing the queue.
        // Once the queue is finished, it will always return a completed future to avoid blocking any caller.
        // This could lead to a short period of busy loop in splitLoader (although unlikely in general setup).
        splitLoader.stop();
        queue.finish();

        closed = true;
    }

    private static RuntimeException propagatePrestoException(Throwable throwable)
    {
        if (throwable instanceof PrestoException) {
            throw (PrestoException) throwable;
        }
        if (throwable instanceof FileNotFoundException) {
            throw new PrestoException(HIVE_FILE_NOT_FOUND, throwable);
        }
        throw new PrestoException(HIVE_UNKNOWN_ERROR, throwable);
    }
}


text:
package org.apache.pdfbox;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

import org.apache.pdfbox.io.IOUtils;
import org.apache.pdfbox.io.MemoryUsageSetting;
import org.apache.pdfbox.io.RandomAccessReadBufferedFile;
import org.apache.pdfbox.io.RandomAccessReadBuffer;
import org.apache.pdfbox.io.RandomAccessRead;
import org.apache.pdfbox.pdfparser.FDFParser;
import org.apache.pdfbox.pdfparser.PDFParser;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.encryption.InvalidPasswordException;
import org.apache.pdfbox.pdmodel.fdf.FDFDocument;
import org.apache.pdfbox.util.XMLUtil;

/**
 * Utility methods to load different types of documents
 *
 */
public class Loader
{

    private Loader()
    {
    }

    /**
     * This will load a document from a file.
     *
     * @param filename The name of the file to load.
     *
     * @return The document that was loaded.
     *
     * @throws IOException If there is an error reading from the stream.
     */
    public static FDFDocument loadFDF(String filename) throws IOException
    {
        return Loader.loadFDF(new File(filename));
    }

    /**
     * This will load a document from a file.
     *
     * @param file The name of the file to load.
     *
     * @return The document that was loaded.
     *
     * @throws IOException If there is an error reading from the stream.
     */
    public static FDFDocument loadFDF(File file) throws IOException
    {
        try (RandomAccessRead readBuffer = new RandomAccessReadBufferedFile(file))
        {
            FDFParser parser = new FDFParser(readBuffer);
            return parser.parse();
        }
    }

    /**
     * This will load a document from an input stream.
     *
     * @param input The stream that contains the document.
     *
     * @return The document that was loaded.
     *
     * @throws IOException If there is an error reading from the stream.
     */
    public static FDFDocument loadFDF(InputStream input) throws IOException
    {
        try (RandomAccessRead readBuffer = new RandomAccessReadBuffer(input))
        {
            FDFParser parser = new FDFParser(readBuffer);
            return parser.parse();
        }
    }

    /**
     * This will load a document from a file.
     *
     * @param filename The name of the file to load.
     *
     * @return The document that was loaded.
     *
     * @throws IOException If there is an error reading from the stream.
     */
    public static FDFDocument loadXFDF(String filename) throws IOException
    {
        return Loader.loadXFDF(new BufferedInputStream(new FileInputStream(filename)));
    }

    /**
     * This will load a document from a file.
     *
     * @param file The name of the file to load.
     *
     * @return The document that was loaded.
     *
     * @throws IOException If there is an error reading from the stream.
     */
    public static FDFDocument loadXFDF(File file) throws IOException
    {
        return Loader.loadXFDF(new BufferedInputStream(new FileInputStream(file)));
    }

    /**
     * This will load a document from an input stream.
     *
     * @param input The stream that contains the document.
     *
     * @return The document that was loaded.
     *
     * @throws IOException If there is an error reading from the stream.
     */
    public static FDFDocument loadXFDF(InputStream input) throws IOException
    {
        return new FDFDocument(XMLUtil.parse(input));
    }
    /**
     * Parses a PDF. Unrestricted main memory will be used for buffering PDF streams.
     *
     * @param input byte array that contains the document.
     *
     * @return loaded document
     *
     * @throws InvalidPasswordException If the PDF required a non-empty password.
     * @throws IOException In case of a reading or parsing error.
     */
    public static PDDocument loadPDF(byte[] input) throws IOException
    {
        return Loader.loadPDF(input, "");
    }
    /**
     * Parses a PDF. Unrestricted main memory will be used for buffering PDF streams.
     *
     * @param input byte array that contains the document.
     * @param password password to be used for decryption
     *
     * @return loaded document
     *
     * @throws InvalidPasswordException If the password is incorrect.
     * @throws IOException In case of a reading or parsing error.
     */
    public static PDDocument loadPDF(byte[] input, String password) throws IOException
    {
        return Loader.loadPDF(input, password, null, null);
    }
    /**
     * Parses a PDF. Unrestricted main memory will be used for buffering PDF streams.
     *
     * @param input byte array that contains the document.
     * @param password password to be used for decryption
     * @param keyStore key store to be used for decryption when using public key security
     * @param alias alias to be used for decryption when using public key security
     *
     * @return loaded document
     *
     * @throws InvalidPasswordException If the password is incorrect.
     * @throws IOException In case of a reading or parsing error.
     */
    public static PDDocument loadPDF(byte[] input, String password, InputStream keyStore, String alias)
            throws IOException
    {
        return Loader.loadPDF(input, password, keyStore, alias, MemoryUsageSetting.setupMainMemoryOnly());
    }
    /**
     * Parses a PDF.
     *
     * @param input byte array that contains the document.
     * @param password password to be used for decryption
     * @param keyStore key store to be used for decryption when using public key security
     * @param alias alias to be used for decryption when using public key security
     * @param memUsageSetting defines how memory is used for buffering input stream and PDF streams
     *
     * @return loaded document
     *
     * @throws InvalidPasswordException If the password is incorrect.
     * @throws IOException In case of a reading or parsing error.
     */
    public static PDDocument loadPDF(byte[] input, String password, InputStream keyStore, String alias,
            MemoryUsageSetting memUsageSetting) throws IOException
    {
        RandomAccessRead source = null;
        try
        {
            // RandomAccessRead is not closed here, may be needed for signing
            source = new RandomAccessReadBuffer(input);
            PDFParser parser = new PDFParser(source, password, keyStore, alias, memUsageSetting);
            return parser.parse();
        }
        catch (IOException ioe)
        {
            IOUtils.closeQuietly(source);
            throw ioe;
        }
    }
    /**
     * Parses a PDF. Unrestricted main memory will be used for buffering PDF streams.
     *
     * @param file file to be loaded
     *
     * @return loaded document
     *
     * @throws InvalidPasswordException If the file required a non-empty password.
     * @throws IOException in case of a file reading or parsing error
     */
    public static PDDocument loadPDF(File file) throws IOException
    {
        return Loader.loadPDF(file, "", MemoryUsageSetting.setupMainMemoryOnly());
    }
    /**
     * Parses a PDF.
     *
     * @param file file to be loaded
     * @param memUsageSetting defines how memory is used for buffering PDF streams
     *
     * @return loaded document
     *
     * @throws InvalidPasswordException If the file required a non-empty password.
     * @throws IOException in case of a file reading or parsing error
     */
    public static PDDocument loadPDF(File file, MemoryUsageSetting memUsageSetting) throws IOException
    {
        return Loader.loadPDF(file, "", null, null, memUsageSetting);
    }
    /**
     * Parses a PDF. Unrestricted main memory will be used for buffering PDF streams.
     *
     * @param file file to be loaded
     * @param password password to be used for decryption
     *
     * @return loaded document
     *
     * @throws InvalidPasswordException If the password is incorrect.
     * @throws IOException in case of a file reading or parsing error
     */
    public static PDDocument loadPDF(File file, String password) throws IOException
    {
        return Loader.loadPDF(file, password, null, null, MemoryUsageSetting.setupMainMemoryOnly());
    }
    /**
     * Parses a PDF.
     *
     * @param file file to be loaded
     * @param password password to be used for decryption
     * @param memUsageSetting defines how memory is used for buffering PDF streams
     *
     * @return loaded document
     *
     * @throws InvalidPasswordException If the password is incorrect.
     * @throws IOException in case of a file reading or parsing error
     */
    public static PDDocument loadPDF(File file, String password, MemoryUsageSetting memUsageSetting)
            throws IOException
    {
        return Loader.loadPDF(file, password, null, null, memUsageSetting);
    }
    /**
     * Parses a PDF. Unrestricted main memory will be used for buffering PDF streams.
     *
     * @param file file to be loaded
     * @param password password to be used for decryption
     * @param keyStore key store to be used for decryption when using public key security
     * @param alias alias to be used for decryption when using public key security
     *
     * @return loaded document
     *
     * @throws IOException in case of a file reading or parsing error
     */
    public static PDDocument loadPDF(File file, String password, InputStream keyStore, String alias)
            throws IOException
    {
        return Loader.loadPDF(file, password, keyStore, alias, MemoryUsageSetting.setupMainMemoryOnly());
    }
    /**
     * Parses a PDF.
     *
     * @param file file to be loaded
     * @param password password to be used for decryption
     * @param keyStore key store to be used for decryption when using public key security
     * @param alias alias to be used for decryption when using public key security
     * @param memUsageSetting defines how memory is used for buffering PDF streams
     *
     * @return loaded document
     *
     * @throws IOException in case of a file reading or parsing error
     */
    public static PDDocument loadPDF(File file, String password, InputStream keyStore, String alias,
            MemoryUsageSetting memUsageSetting) throws IOException
    {
        RandomAccessRead raFile = null;
        try
        {
            // RandomAccessRead is not closed here, may be needed for signing
            raFile = new RandomAccessReadBufferedFile(file);
            return Loader.loadPDF(raFile, password, keyStore, alias, memUsageSetting);
        }
        catch (IOException ioe)
        {
            IOUtils.closeQuietly(raFile);
            throw ioe;
        }
    }

    /**
     * Parses a PDF.
     *
     * @param raFile random access read representing the pdf to be loaded
     * @param password password to be used for decryption
     * @param keyStore key store to be used for decryption when using public key security
     * @param alias alias to be used for decryption when using public key security
     * @param memUsageSetting defines how memory is used PDF streams
     *
     * @return loaded document
     *
     * @throws IOException in case of a file reading or parsing error
     */
    public static PDDocument loadPDF(RandomAccessRead raFile, String password,
            InputStream keyStore, String alias, MemoryUsageSetting memUsageSetting)
            throws IOException
    {
        PDFParser parser = new PDFParser(raFile, password, keyStore, alias, memUsageSetting);
        return parser.parse();
    }
    /**
     * Parses a PDF. The given input stream is copied to the memory to enable random access to the pdf. Unrestricted
     * main memory will be used for buffering PDF streams.
     *
     * @param input stream that contains the document. Don't forget to close it after loading.
     *
     * @return loaded document
     *
     * @throws InvalidPasswordException If the PDF required a non-empty password.
     * @throws IOException In case of a reading or parsing error.
     */
    public static PDDocument loadPDF(InputStream input) throws IOException
    {
        return Loader.loadPDF(input, "", null, null, MemoryUsageSetting.setupMainMemoryOnly());
    }

    /**
     * Parses a PDF. Depending on the memory settings parameter the given input stream is either copied to main memory
     * or to a temporary file to enable random access to the pdf.
     *
     * @param input stream that contains the document. Don't forget to close it after loading.
     * @param memUsageSetting defines how memory is used for buffering PDF streams
     *
     * @return loaded document
     *
     * @throws InvalidPasswordException If the PDF required a non-empty password.
     * @throws IOException In case of a reading or parsing error.
     */
    public static PDDocument loadPDF(InputStream input, MemoryUsageSetting memUsageSetting)
            throws IOException
    {
        return Loader.loadPDF(input, "", null, null, memUsageSetting);
    }
    /**
     * Parses a PDF. The given input stream is copied to the memory to enable random access to the pdf. Unrestricted
     * main memory will be used for buffering PDF streams.
     *
     * @param input stream that contains the document. Don't forget to close it after loading.
     * @param password password to be used for decryption
     *
     * @return loaded document
     *
     * @throws InvalidPasswordException If the password is incorrect.
     * @throws IOException In case of a reading or parsing error.
     */
    public static PDDocument loadPDF(InputStream input, String password) throws IOException
    {
        return Loader.loadPDF(input, password, null, null, MemoryUsageSetting.setupMainMemoryOnly());
    }
    /**
     * Parses a PDF. The given input stream is copied to the memory to enable random access to the pdf. Unrestricted
     * main memory will be used for buffering PDF streams.
     *
     * @param input stream that contains the document. Don't forget to close it after loading.
     * @param password password to be used for decryption
     * @param keyStore key store to be used for decryption when using public key security
     * @param alias alias to be used for decryption when using public key security
     *
     * @return loaded document
     *
     * @throws IOException In case of a reading or parsing error.
     */
    public static PDDocument loadPDF(InputStream input, String password, InputStream keyStore,
            String alias) throws IOException
    {
        return Loader.loadPDF(input, password, keyStore, alias, MemoryUsageSetting.setupMainMemoryOnly());
    }

    /**
     * Parses a PDF. Depending on the memory settings parameter the given input stream is either copied to main memory
     * or to a temporary file to enable random access to the pdf.
     *
     * @param input stream that contains the document. Don't forget to close it after loading.
     * @param password password to be used for decryption
     * @param memUsageSetting defines how memory is used for buffering PDF streams
     *
     * @return loaded document
     *
     * @throws InvalidPasswordException If the password is incorrect.
     * @throws IOException In case of a reading or parsing error.
     */
    public static PDDocument loadPDF(InputStream input, String password,
            MemoryUsageSetting memUsageSetting) throws IOException
    {
        return Loader.loadPDF(input, password, null, null, memUsageSetting);
    }

    /**
     * Parses a PDF. The given input stream is copied to memory to enable random access to the pdf.
     *
     * @param input stream that contains the document. Don't forget to close it after loading.
     * @param password password to be used for decryption
     * @param keyStore key store to be used for decryption when using public key security
     * @param alias alias to be used for decryption when using public key security
     * @param memUsageSetting defines how memory is used for buffering PDF streams
     *
     * @return loaded document
     *
     * @throws InvalidPasswordException If the password is incorrect.
     * @throws IOException In case of a reading or parsing error.
     */
    public static PDDocument loadPDF(InputStream input, String password, InputStream keyStore,
            String alias, MemoryUsageSetting memUsageSetting) throws IOException
    {
        RandomAccessRead source = null;
        try
        {
            // RandomAccessRead is not closed here, may be needed for signing
            source = new RandomAccessReadBuffer(input);
            PDFParser parser = new PDFParser(source, password, keyStore, alias, memUsageSetting);
            return parser.parse();
        }
        catch (IOException ioe)
        {
            IOUtils.closeQuietly(source);
            throw ioe;
        }
    }

}


text:
#ifndef AVCODEC_VAAPI_INTERNAL_H
#define AVCODEC_VAAPI_INTERNAL_H

#include <va/va.h>
#include "vaapi.h"
#include "avcodec.h"
#include "internal.h"

/**
 * @addtogroup VAAPI_Decoding
 *
 * @{
 */

typedef struct {
    VADisplay display;                  ///< Windowing system dependent handle
    VAConfigID config_id;               ///< Configuration ID
    VAContextID context_id;             ///< Context ID (video decode pipeline)
    VABufferID pic_param_buf_id;        ///< Picture parameter buffer
    VABufferID iq_matrix_buf_id;        ///< Inverse quantiser matrix buffer
    VABufferID bitplane_buf_id;         ///< Bitplane buffer (for VC-1 decoding)
    VABufferID *slice_buf_ids;          ///< Slice parameter/data buffers
    unsigned int n_slice_buf_ids;       ///< Number of effective slice buffers
    unsigned int slice_buf_ids_alloc;   ///< Number of allocated slice buffers
    void *slice_params;                 ///< Pointer to slice parameter buffers
    unsigned int slice_param_size;      ///< Size of a slice parameter element
    unsigned int slice_params_alloc;    ///< Number of allocated slice parameters
    unsigned int slice_count;           ///< Number of slices currently filled in
    const uint8_t *slice_data;          ///< Pointer to slice data buffer base
    unsigned int slice_data_size;       ///< Current size of slice data
} FFVAContext;

/** Extract vaapi_context from an AVCodecContext */
static inline FFVAContext *ff_vaapi_get_context(AVCodecContext *avctx)
{
    return avctx->internal->hwaccel_priv_data;
}

/** Extract VASurfaceID from an AVFrame */
static inline VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
{
    return (uintptr_t)pic->data[3];
}

/** Common AVHWAccel.init() implementation */
int ff_vaapi_context_init(AVCodecContext *avctx);

/** Common AVHWAccel.uninit() implementation */
int ff_vaapi_context_fini(AVCodecContext *avctx);

/** Common AVHWAccel.end_frame() implementation */
void ff_vaapi_common_end_frame(AVCodecContext *avctx);

/** Allocate a new picture parameter buffer */
void *ff_vaapi_alloc_pic_param(FFVAContext *vactx, unsigned int size);

/** Allocate a new IQ matrix buffer */
void *ff_vaapi_alloc_iq_matrix(FFVAContext *vactx, unsigned int size);

/** Allocate a new bit-plane buffer */
uint8_t *ff_vaapi_alloc_bitplane(FFVAContext *vactx, uint32_t size);

/**
 * Allocate a new slice descriptor for the input slice.
 *
 * @param vactx the VA API context
 * @param buffer the slice data buffer base
 * @param size the size of the slice in bytes
 * @return the newly allocated slice parameter
 */
VASliceParameterBufferBase *ff_vaapi_alloc_slice(FFVAContext *vactx, const uint8_t *buffer, uint32_t size);

int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx);
int ff_vaapi_commit_slices(FFVAContext *vactx);
int ff_vaapi_render_picture(FFVAContext *vactx, VASurfaceID surface);

/* @} */

#endif /* AVCODEC_VAAPI_INTERNAL_H */


text:
1. Apply for Atwood (protected cloud) or Sullivan (open cloud) https://www.opensciencedatacloud.org/apply/
2. Request access to im_lab

My original request to OSDC
```
From:
Hae Kyung Im
haky@uchicago.edu

Organization/University
The University of Chicago

Phone number:
773-702-3898

Access Requested:
OSDC-Atwood

Project Name:
Im-Lab

Project Description
The goal of the project is to investigate the genetic architecture of complex diseases and traits, use latest whole genome and poly-omic approach to prediction, and development of new methods to help with the main goals. Multiple dbGaP datasets and European Genome Phenome Archiv datasets will be downloaded. Currently we are applying for access to close to 200 datasets. Subsets of the data will be downloaded on an as needed basis.

Project Lead
Hae Kyung Im

Project Lead E-mail:
haky@uchicago.edu

Estimated Resources:
Storage 5Tb. 10-20 CPUs at a time for a few hours per week.
```


text:
Imports SistFoncreagro.BussinesLogic
Imports SistFoncreagro.BussinessEntities
Imports System.Data
Imports Telerik.Web.UI
Imports System.Web.Services
Imports System.Data.SqlClient
Imports System.Collections.Generic
Imports System.Collections
Imports System.Configuration
Imports System
Imports System.Web.UI
Public Class ListaBancos
    Inherits System.Web.UI.Page
    Dim BancoBL As New BancoBL
    Dim _Banco As New Banco

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub
    Public Sub ConfigureExport()
        RadGrid1.ExportSettings.ExportOnlyData = True
        RadGrid1.ExportSettings.IgnorePaging = True
        RadGrid1.ExportSettings.OpenInNewWindow = True
    End Sub
    Protected Sub RadGrid1_UpdateCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand
        Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
        Dim userControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)
        Dim Id As String = editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("IdBanco")

        _Banco.Contacto = CType(e.Item.FindControl("TextBox6"), TextBox).Text
        _Banco.Direccion = CType(e.Item.FindControl("TextBox2"), TextBox).Text
        _Banco.IdBanco = Id
        _Banco.Nombre = CType(e.Item.FindControl("TextBox1"), TextBox).Text
        _Banco.Telefono1 = CType(e.Item.FindControl("TextBox3"), TextBox).Text
        _Banco.Telefono2 = CType(e.Item.FindControl("TextBox4"), TextBox).Text
        _Banco.Telefono3 = CType(e.Item.FindControl("TextBox5"), TextBox).Text
        BancoBL.SaveBanco(_Banco)
        Me.RadGrid1.DataBind()
    End Sub

    Protected Sub RadGrid1_InsertCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.InsertCommand

        _Banco.Contacto = CType(e.Item.FindControl("TextBox6"), TextBox).Text
        _Banco.Direccion = CType(e.Item.FindControl("TextBox2"), TextBox).Text
        _Banco.Nombre = CType(e.Item.FindControl("TextBox1"), TextBox).Text
        _Banco.Telefono1 = CType(e.Item.FindControl("TextBox3"), TextBox).Text
        _Banco.Telefono2 = CType(e.Item.FindControl("TextBox4"), TextBox).Text
        _Banco.Telefono3 = CType(e.Item.FindControl("TextBox5"), TextBox).Text
        BancoBL.SaveBanco(_Banco)
        Me.RadGrid1.DataBind()
    End Sub

    Protected Sub RadGrid1_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
        If e.CommandName = Telerik.Web.UI.RadGrid.ExportToExcelCommandName OrElse e.CommandName = Telerik.Web.UI.RadGrid.ExportToWordCommandName OrElse e.CommandName = Telerik.Web.UI.RadGrid.ExportToPdfCommandName Then
            ConfigureExport()
        End If
    End Sub
End Class


text:
git add .
git commit
git push origin HEAD


text:
#region Usings

using System;

using org.GraphDefined.Vanaheimr.Illias;
using org.GraphDefined.Vanaheimr.Illias.Geometry.Maths;

#endregion

namespace org.GraphDefined.Vanaheimr.Illias.Geometry
{

    /// <summary>
    /// A sphere of type T.
    /// </summary>
    /// <typeparam name="T">The internal type of the sphere.</typeparam>
    public class Sphere<T> : ISphere<T>
        where T : IEquatable<T>, IComparable<T>, IComparable
    {

        #region Data

        /// <summary>
        /// Mathoperation helpers.
        /// </summary>
        protected readonly IMaths<T> Math;

        #endregion

        #region Properties

        #region Left

        /// <summary>
        /// The left-coordinate of the sphere.
        /// </summary>
        public T Left   { get; private set; }

        #endregion

        #region Top

        /// <summary>
        /// The top-coordinate of the sphere.
        /// </summary>
        public T         Top    { get; private set; }

        #endregion

        #region Front

        /// <summary>
        /// The front-coordinate of the sphere.
        /// </summary>
        public T         Front  { get; private set; }

        #endregion

        #region Radius

        /// <summary>
        /// The radius of the sphere.
        /// </summary>
        public T         Radius { get; private set; }

        #endregion

        #region Center

        /// <summary>
        /// The center of the sphere.
        /// </summary>
        public IVoxel<T> Center { get; private set; }

        #endregion

        #region Diameter

        /// <summary>
        /// The diameter of the sphere.
        /// </summary>
        public T Diameter
        {
            get
            {
                return Math.Add(Radius, Radius);
            }
        }

        #endregion

        #endregion

        #region Constructor(s)

        #region Sphere(Left, Top, Front, Radius)

        /// <summary>
        /// Create a sphere of type T.
        /// </summary>
        /// <param name="Left">The left-coordinate of the sphere.</param>
        /// <param name="Top">The top-coordinate of the sphere.</param>
        /// <param name="Front">The front-coordinate of the sphere.</param>
        /// <param name="Radius">The radius parameter.</param>
        public Sphere(T Left, T Top, T Front, T Radius)
        {

            #region Initial Checks

            if (Left   == null)
                throw new ArgumentNullException("The given left-coordinate must not be null!");

            if (Top    == null)
                throw new ArgumentNullException("The given top-coordinate must not be null!");

            if (Front  == null)
                throw new ArgumentNullException("The given front-coordinate must not be null!");

            if (Radius == null)
                throw new ArgumentNullException("The given radius must not be null!");

            #endregion

            this.Math   = MathsFactory<T>.Instance;

            #region Math Checks

            if (Radius.Equals(Math.Zero))
                throw new ArgumentException("The given radius must not be zero!");

            #endregion

            this.Left   = Left;
            this.Top    = Top;
            this.Center = new Voxel<T>(Left, Top, Front);
            this.Radius = Radius;

        }

        #endregion

        #endregion

        #region Contains(x, y, z)

        /// <summary>
        /// Checks if the given x-, y- and z-coordinates
        /// are located within this sphere.
        /// </summary>
        /// <param name="x">The x-coordinate.</param>
        /// <param name="y">The y-coordinate.</param>
        /// <param name="z">The z-coordinate.</param>
        /// <returns>True if the coordinates are located within this sphere; False otherwise.</returns>
        public Boolean Contains(T x, T y, T z)
        {

            #region Initial Checks

            if (x == null)
                throw new ArgumentNullException("The given x-coordinate must not be null!");

            if (y == null)
                throw new ArgumentNullException("The given y-coordinate must not be null!");

            if (z == null)
                throw new ArgumentNullException("The given z-coordinate must not be null!");

            #endregion

            if (Center.DistanceTo(new Voxel<T>(x, y, z)).IsLessThanOrEquals(Radius))
                return true;

            return false;

        }

        #endregion

        #region Contains(Voxel)

        /// <summary>
        /// Checks if the given voxel is located
        /// within this sphere.
        /// </summary>
        /// <param name="Voxel">A voxel.</param>
        /// <returns>True if the voxel is located within this sphere; False otherwise.</returns>
        public Boolean Contains(IVoxel<T> Voxel)
        {

            #region Initial Checks

            if (Voxel == null)
                throw new ArgumentNullException("The given voxel must not be null!");

            #endregion

            if (Center.DistanceTo(Voxel).IsLessThanOrEquals(Radius))
                return true;

            return false;

        }

        #endregion

        #region Contains(Sphere)

        /// <summary>
        /// Checks if the given sphere is located
        /// within this sphere.
        /// </summary>
        /// <param name="Sphere">A sphere of type T.</param>
        /// <returns>True if the sphere is located within this sphere; False otherwise.</returns>
        public Boolean Contains(ISphere<T> Sphere)
        {

            #region Initial Checks

            if (Sphere == null)
                throw new ArgumentNullException("The given sphere must not be null!");

            #endregion

            if (Center.DistanceTo(Sphere.Center).IsLessThanOrEquals(Math.Sub(Radius, Sphere.Radius)))
                return true;

            return true;

        }

        #endregion

        #region Overlaps(Sphere)

        /// <summary>
        /// Checks if the given sphere shares some
        /// area with this sphere.
        /// </summary>
        /// <param name="Sphere">A sphere of type T.</param>
        /// <returns>True if the sphere shares some area with this sphere; False otherwise.</returns>
        public Boolean Overlaps(ISphere<T> Sphere)
        {

            #region Initial Checks

            if (Sphere == null)
                throw new ArgumentNullException("The given sphere must not be null!");

            #endregion

            if (Center.DistanceTo(Sphere.Center).IsLessThanOrEquals(Math.Add(Radius, Sphere.Radius)))
                return true;

            return true;

        }

        #endregion

        #region Operator overloadings

        #region Operator == (Sphere1, Sphere2)

        /// <summary>
        /// Compares two instances of this object.
        /// </summary>
        /// <param name="Sphere1">A Sphere<T>.</param>
        /// <param name="Sphere2">Another Sphere<T>.</param>
        /// <returns>true|false</returns>
        public static Boolean operator == (Sphere<T> Sphere1, Sphere<T> Sphere2)
        {

            // If both are null, or both are same instance, return true.
            if (Object.ReferenceEquals(Sphere1, Sphere2))
                return true;

            // If one is null, but not both, return false.
            if (((Object) Sphere1 == null) || ((Object) Sphere2 == null))
                return false;

            return Sphere1.Equals(Sphere2);

        }

        #endregion

        #region Operator != (Sphere1, Sphere2)

        /// <summary>
        /// Compares two instances of this object.
        /// </summary>
        /// <param name="Sphere1">A Sphere<T>.</param>
        /// <param name="Sphere2">Another Sphere<T>.</param>
        /// <returns>true|false</returns>
        public static Boolean operator != (Sphere<T> Sphere1, Sphere<T> Sphere2)
        {
            return !(Sphere1 == Sphere2);
        }

        #endregion

        #endregion

        #region IEquatable Members

        #region Equals(Object)

        /// <summary>
        /// Compares two instances of this object.
        /// </summary>
        /// <param name="Object">An object to compare with.</param>
        /// <returns>true|false</returns>
        public override Boolean Equals(Object Object)
        {

            if (Object == null)
                return false;

            // Check if the given object is an Sphere<T>.
            var SphereT = (Sphere<T>) Object;
            if ((Object) SphereT == null)
                return false;

            return this.Equals(SphereT);

        }

        #endregion

        #region Equals(ISphere)

        /// <summary>
        /// Compares two spheres for equality.
        /// </summary>
        /// <param name="ISphere">A sphere to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public Boolean Equals(ISphere<T> ISphere)
        {

            if ((Object) ISphere == null)
                return false;

            return this.Left.  Equals(ISphere.Left)  &&
                   this.Top.   Equals(ISphere.Top)   &&
                   this.Radius.Equals(ISphere.Radius);

        }

        #endregion

        #endregion

        #region GetHashCode()

        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            return Left.GetHashCode() ^ 1 + Top.GetHashCode() ^ 2 + Front.GetHashCode() ^ 3 + Radius.GetHashCode();
        }

        #endregion

        #region (override) ToString()

        /// <summary>
        /// Return a text representation of this object.
        /// </summary>
        public override String ToString()
        {
            return String.Format("Sphere: Left={0}, Top={1}, Front={2}, Radius={3}",
                                 Left.  ToString(),
                                 Top.   ToString(),
                                 Front. ToString(),
                                 Radius.ToString());
        }

        #endregion

    }

}


text:
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
/*
 * Autogenerated by Thrift Compiler (0.10.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
using System.Text;
using Thrift.Protocol;

namespace Parquet.Thrift
{

   /// <summary>
   /// statistics of a given page type and encoding
   /// </summary>
   public class PageEncodingStats : TBase
   {

      /// <summary>
      /// the page type (data/dic/...) *
      ///
      /// <seealso cref="PageType"/>
      /// </summary>
      public PageType Page_type { get; set; }

      /// <summary>
      /// encoding of the page *
      ///
      /// <seealso cref="Encoding"/>
      /// </summary>
      public Encoding Encoding { get; set; }

      /// <summary>
      /// number of pages of this type with this encoding *
      /// </summary>
      public int Count { get; set; }

      public PageEncodingStats()
      {
      }

      public PageEncodingStats(PageType page_type, Encoding encoding, int count) : this()
      {
         this.Page_type = page_type;
         this.Encoding = encoding;
         this.Count = count;
      }

      public void Read(TProtocol iprot)
      {
         iprot.IncrementRecursionDepth();
         try
         {
            bool isset_page_type = false;
            bool isset_encoding = false;
            bool isset_count = false;
            TField field;
            iprot.ReadStructBegin();
            while (true)
            {
               field = iprot.ReadFieldBegin();
               if (field.Type == TType.Stop)
               {
                  break;
               }
               switch (field.ID)
               {
                  case 1:
                     if (field.Type == TType.I32)
                     {
                        Page_type = (PageType)iprot.ReadI32();
                        isset_page_type = true;
                     }
                     else
                     {
                        TProtocolUtil.Skip(iprot, field.Type);
                     }
                     break;
                  case 2:
                     if (field.Type == TType.I32)
                     {
                        Encoding = (Encoding)iprot.ReadI32();
                        isset_encoding = true;
                     }
                     else
                     {
                        TProtocolUtil.Skip(iprot, field.Type);
                     }
                     break;
                  case 3:
                     if (field.Type == TType.I32)
                     {
                        Count = iprot.ReadI32();
                        isset_count = true;
                     }
                     else
                     {
                        TProtocolUtil.Skip(iprot, field.Type);
                     }
                     break;
                  default:
                     TProtocolUtil.Skip(iprot, field.Type);
                     break;
               }
               iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_page_type)
               throw new TProtocolException(TProtocolException.INVALID_DATA);
            if (!isset_encoding)
               throw new TProtocolException(TProtocolException.INVALID_DATA);
            if (!isset_count)
               throw new TProtocolException(TProtocolException.INVALID_DATA);
         }
         finally
         {
            iprot.DecrementRecursionDepth();
         }
      }

      public void Write(TProtocol oprot)
      {
         oprot.IncrementRecursionDepth();
         try
         {
            TStruct struc = new TStruct("PageEncodingStats");
            oprot.WriteStructBegin(struc);
            TField field = new TField();
            field.Name = "page_type";
            field.Type = TType.I32;
            field.ID = 1;
            oprot.WriteFieldBegin(field);
            oprot.WriteI32((int)Page_type);
            oprot.WriteFieldEnd();
            field.Name = "encoding";
            field.Type = TType.I32;
            field.ID = 2;
            oprot.WriteFieldBegin(field);
            oprot.WriteI32((int)Encoding);
            oprot.WriteFieldEnd();
            field.Name = "count";
            field.Type = TType.I32;
            field.ID = 3;
            oprot.WriteFieldBegin(field);
            oprot.WriteI32(Count);
            oprot.WriteFieldEnd();
            oprot.WriteFieldStop();
            oprot.WriteStructEnd();
         }
         finally
         {
            oprot.DecrementRecursionDepth();
         }
      }

      public override string ToString()
      {
         StringBuilder __sb = new StringBuilder("PageEncodingStats(");
         __sb.Append(", Page_type: ");
         __sb.Append(Page_type);
         __sb.Append(", Encoding: ");
         __sb.Append(Encoding);
         __sb.Append(", Count: ");
         __sb.Append(Count);
         __sb.Append(")");
         return __sb.ToString();
      }

   }

}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member


text:
import IconUtil from "../../services/icon-util";

export class OpsManagerFeedUtil {

    static decorateFeedSummary =  (feed: any) =>{
        //GROUP FOR FAILED

        if (feed.isEmpty == undefined) {
            feed.isEmpty = false;
        }

        var health: string = "---";
        if (!feed.isEmpty) {
            health = feed.healthy ? 'HEALTHY' : 'UNHEALTHY';
            var iconData: any = IconUtil.iconForFeedHealth(health);
            feed.icon = iconData.icon
            feed.iconstyle = iconData.style
        }
        feed.healthText = health;
        if (feed.running) {
            feed.displayStatus = 'RUNNING';
        }
        else if ("FAILED" == feed.lastStatus || ( "FAILED" == feed.lastExitCode && "ABANDONED" != feed.lastStatus)) {
            feed.displayStatus = 'FAILED';
        }
        else if ("COMPLETED" == feed.lastExitCode) {
            feed.displayStatus = 'COMPLETED';
        }
        else if ("STOPPED" == feed.lastStatus) {
            feed.displayStatus = 'STOPPED';
        }
        else if ("UNKNOWN" == feed.lastStatus) {
            feed.displayStatus = 'INITIAL';
            feed.sinceTimeString = '--';
            feed.runTimeString = "--"
        }
        else {
            feed.displayStatus = feed.lastStatus;
        }

        feed.statusStyle = IconUtil.iconStyleForJobStatus(feed.displayStatus);
    }
}


text:
ACCEPTED

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

#### Published in
Phytologia 28: 480 (1974)

#### Original name
Parmelia imshaugii Hale

### Remarks
null


text:
/* eslint-disable */
require('shelljs/global');

/**
 * Adds mark check symbol
 */
function addCheckMark(callback) {
  process.stdout.write(' ✓');
  callback();
}

if (!which('git')) {
  echo('Sorry, this script requires git');
  exit(1);
}

if (!test('-e', 'internals/templates')) {
  echo('The example is deleted already.');
  exit(1);
}

process.stdout.write('Cleanup started...');

// Cleanup components folder
rm('-rf', 'app/components/*');

// Cleanup containers folder
rm('-rf', 'app/containers/*');
mkdir('app/containers/App');
mkdir('app/components/NotFoundPage');
mkdir('app/components/HomePage');
cp('internals/templates/appContainer.js', 'app/containers/App/index.js');
cp('internals/templates/notFoundPage.js', 'app/components/NotFoundPage/index.js');
cp('internals/templates/homePage.js', 'app/components/HomePage/index.js');

// Cleanup sagas folder
rm('-rf', 'app/sagas/*');
cp('internals/templates/sagas.js', 'app/sagas/index.js');

// Cleanup selectors folder
rm('-rf', 'app/selectors/*');
mkdir('-p', 'app/selectors/tests');
cp('internals/templates/selectLocationSelector.js',
  'app/selectors/selectLocationSelector.js');
cp('internals/templates/selectLocationSelector.test.js',
  'app/selectors/tests/selectLocationSelector.test.js');

// Delete utils folder
rm('-rf', 'app/utils');

// Replace app.js, index.html, rootReducer.js, routeReducer.js, routes.js and store.js
cp('internals/templates/app.js', 'app/app.js');
cp('internals/templates/index.html', 'app/index.html');
cp('internals/templates/reducers.js', 'app/reducers.js');
cp('internals/templates/routes.js', 'app/routes.js');
cp('internals/templates/store.js', 'app/store.js');

// Remove the templates folder
rm('-rf', 'internals/templates');

process.stdout.write(' ✓');

// Commit the changes
if (exec('git add . && git commit -qm "Remove default example"').code !== 0) {
  echo('\nError: Git commit failed');
  exit(1);
}

echo('\nCleanup done. Happy Coding!!!');


text:
#ifndef _ALG_SIG_H
#define _ALG_SIG_H

typedef int (*galois_single_multiply_func)(int, int, int);
typedef void (*galois_uninit_field_func)(int);

struct jerasure_mult_routines {
  galois_single_multiply_func galois_single_multiply;
  galois_uninit_field_func galois_uninit_field;
};

#if defined(__MACOS__) || defined(__MACOSX__) || defined(__OSX__) || defined(__APPLE__)
#define JERASURE_SONAME "libJerasure.dylib"
#else
#define JERASURE_SONAME "libJerasure.so"
#endif

typedef struct alg_sig_s
{
  int gf_w;
  int sig_len;
  struct jerasure_mult_routines mult_routines;
  void *jerasure_sohandle;
  int *tbl1_l;
  int *tbl1_r;
  int *tbl2_l;
  int *tbl2_r;
  int *tbl3_l;
  int *tbl3_r;
} alg_sig_t;

alg_sig_t *init_alg_sig(int sig_len, int gf_w);
void destroy_alg_sig(alg_sig_t* alg_sig_handle);

int compute_alg_sig(alg_sig_t* alg_sig_handle, char *buf, int len, char *sig);
int crc32_build_fast_table();
int crc32(int crc, const void *buf, int size);

#endif


text:
Gray box end-to-end testing and automation library for mobile apps.

[![NPM Version](https://img.shields.io/npm/v/detox.svg?style=flat)](https://www.npmjs.com/package/detox)
[![Build Status](https://travis-ci.org/wix/detox.svg?branch=master)](https://travis-ci.org/wix/detox)
[![NPM Downloads](https://img.shields.io/npm/dm/detox.svg?style=flat)](https://www.npmjs.com/package/detox)

- [About](#about)
- [Getting Started](/docs/Introduction.GettingStarted.md)
- [Documentation](/docs/README.md)

<img src="http://i.imgur.com/eoaDEYp.gif">

## What does a Detox test look like?

This is a test for a login screen, it runs on a device/simulator like an actual user:

```js
describe('Login flow', () => {

  it('should login successfully', async () => {
    await device.reloadReactNative();
    await expect(element(by.id('email'))).toBeVisible();

    await element(by.id('email')).typeText('john@example.com');
    await element(by.id('password')).typeText('123456');
    await element(by.text('Login')).tap();

    await expect(element(by.text('Welcome'))).toBeVisible();
    await expect(element(by.id('email'))).toNotExist();
  });

});
```

## About

High velocity native mobile development requires us to adopt continuous integration workflows, which means our reliance on manual QA has to drop significantly. Detox tests your mobile app while it's running in a real device/simulator, interacting with it just like a real user.

The most difficult part of automated testing on mobile is the tip of the testing pyramid - E2E. The core problem with E2E tests is flakiness - tests are usually not deterministic. We believe the only way to tackle flakiness head on is by moving from black box testing to gray box testing. That's where Detox comes into play.

* **Cross Platform:** Write cross-platform tests in JavaScript. Currently supports iOS, Android is nearly complete.  View the [Android status page](/docs/More.AndroidSupportStatus.md).
* **Runs on Devices:** Gain confidence to ship by testing your app on a device/simulator just like a real user.
* **Automatically Synchronized:** Stops flakiness at the core by monitoring asynchronous operations in your app.
* **React Native Support:** Built from the ground up to support React Native projects as well as pure native ones.
* **Made For CI:** Execute your E2E tests on CI platforms like Travis without grief.
* **Test Runner Independent:** Use Mocha, AVA, or any other JavaScript test runner you like.
* **Debuggable:** Modern async-await API allows breakpoints in asynchronous tests to work as expected.

## Getting Started

Read the [Getting Started Guide](/docs/Introduction.GettingStarted.md) to get Detox running on your app in less than 10 minutes.

## Documentation

Learn everything about using Detox from the [documentation](/docs/README.md).

## See it in Action

Open the [React Native demo project](/examples/demo-react-native) and follow the instructions.

Not using React Native? we have a [pure native demo project](/examples/demo-native-ios) too.

## Rethinking Core Principles

We believe that the only way to address the core difficulties with mobile end-to-end testing is by rethinking some of the  principles of the entire approach. See what Detox [does differently](/docs/More.DesignPrinciples.md).

## Contributing to Detox

Open source from the first commit. If you're interested in helping out with our roadmap or you have a new feature to suggest, contact us and we'd love to get you on board.

Dive into Detox core by reading the [Detox Contribution Guide](/docs/Guide.Contributing.md).

## License

* Detox by itself and all original source code in this repo is MIT
* Detox relies on some important dependencies, their respective licenses are:
  * [EarlGrey](https://github.com/google/EarlGrey/blob/master/LICENSE)