Download the PHP package symlex/stream-sampler without Composer

On this page you can find all versions of the php package symlex/stream-sampler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package stream-sampler

Example CLI app based on Symlex Core

Build Status Documentation Community Chat

This application is compatible with PHP 7.1+ with the curl extension enabled.

Clone this repository to a local directory and run composer:

git clone https://github.com/symlex/stream-sampler.git
cd stream-sampler
composer update

Alternatively you can run composer to create a new project from the latest stable release and fetch external dependencies:

composer create-project symlex/stream-sampler my-stream-sampler

Composer will ask for config values to generate app/config/parameters.yml for you.

YAML files located in app/config configure the app based on parameters and services. The main config file is app/config/console.yml.

What does a stream sampler do?

It randomly returns a representative sample of k items from a stream of values with unknown and possibly very large length. The implementation relies on Algorithm R, which has a complexity of O(N). See https://en.wikipedia.org/wiki/Reservoir_sampling

Usage

app/console sample [options]

Options:
  -i, --input[=INPUT]   Input source (stdin, random.org, internal) [default: "stdin"]
  -s, --size[=SIZE]     Sample size (1 - 2000) [default: 5]
  -V, --version         Display the application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output

Note: If you're using random.org or the internal random character source, input data size will be 10 times the sample size. The maximum sample size is 2000.

Examples

# app/console sample -i internal -s 10
vgB4xtQTF3

# app/console sample -i random.org -s 8
FcojkJX1

# app/console sample < LICENSE
TegcI

# echo 'Pe7emsXm0EHfwAVx' | app/console sample
Xe7es

Tests

Stream Sampler comes with a pre-configured PHPUnit environment that automatically executes tests found in src/:

PHPUnit 7.5.1 by Sebastian Bergmann and contributors.

.......                                         7 / 7 (100%)

Time: 431 ms, Memory: 8.00MB

OK (7 tests, 16892 assertions)

See also: https://github.com/lastzero/test-tools (self-initializing database fixtures and dependency injection for unit tests)

Similar work


All versions of stream-sampler with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
symlex/symlex-core Version ^4.1
incenteev/composer-parameter-handler Version ~2.0
kriswallsmith/buzz Version 0.15
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package symlex/stream-sampler contains the following files

Loading the files please wait ....