Slang Documentation

Index

There are currently 102 Slang operators with 32 tags

Aggregate operators

There are 9 operators tagged with aggregate

Sum
Emits the sum of a stream of numbers.
Finds greatest number in a stream of numbers.
Finds the best item using a chooser delegate to decide which item is better.
Counts number of items in a stream of generic items.
Emits last item of a stream of generic items.
Finds smallest number in a stream of numbers.
Emits first item of a stream of generic items.
Emits the product of a stream of numbers.
Emits the median number of a stream of numbers.

Arithmetic operators

There are 5 operators tagged with arithmetic

Divides number A by number B.
Multiplies two numbers A and B and emits their product.
Add
Adds two numbers A and B and emits their sum.
Subtracts number B from number A and emits the resulting difference.
Emits the modulo, the remainer of a division of two numbers A and B.

Boolean operators

There are 6 operators tagged with boolean

Evaluates an expression.
Xor
Emits true only if the given boolean values A and B are not equal.
Or
Emits true only if at least one of the given booleans A and B is true.
Emits true only if both booleans A and B are equal.
Emits the inverse of a given boolean.
And
Emits true only if both given booleans A and B are true.

Color operators

There are 1 operators tagged with color

Transforms an RGB pixel into a gray pixel.

Compare operators

There are 7 operators tagged with compare

Emits true only if number A is less than number B.
Emits true only if number A is greater than number B.
Emits true only if number A is greater than or equal to number B.
Emits true only if number A does not equal number B.
Emits true if number A equals number B.
Emits true only if number A is less than or equal to number B.
Emits true only if both booleans A and B are equal.

Compression operators

There are 2 operators tagged with compression

Packs a stream of binary content into a zip archive.
Unpacks a zip archive and emits a stream of files and their binary content.

Control operators

There are 6 operators tagged with control

Emits a constant value for each item.
Takes two items and emits one of them, using a chooser delegate as decider.
Merges two streams using a compare delegate deciding which item has precedence.
Emits either the first or the second item depending on the given boolean.
Emits items of a stream to either outgoing stream depending on the control value.
Performs a task repetetively, at least once..

Convert operators

There are 4 operators tagged with convert

Takes a map of items and serializes them into a stream.
Takes a stream and emits a map of items, selected by given indices.
Takes a map and emits a stream of key-value pairs.
Takes a map and emits a stream of key-value pairs.

Csv operators

There are 1 operators tagged with csv

Reads a CSV file and emits a stream of lines, separated into columns.

Data operators

There are 5 operators tagged with data

Lets an iterator delegate process a state until the controller tells it to stop.
Uses an iterator delegate to aggregate items of a stream.
Converts the type of a value.
Reduces the items of a stream pairwise using a reducer delegate.
Emits a constant value for each item.

Database operators

There are 2 operators tagged with database

Queries an SQL query on a relational database and emits the result set.
Executes an SQL query on a relational database.

Email operators

There are 1 operators tagged with email

Sends an email.

Encoding operators

There are 5 operators tagged with encoding

Reads a CSV file and emits a stream of lines, separated into columns.
Encodes a Slang map into the corresponding URL-encoded string.
Decodes Excel data into a stream of sheets, each being a 2d-stream of cells.
Decodes a JSON string and emits the corresponding Slang data.
Encodes Slang data into a JSON string.

Exception operators

There are 2 operators tagged with exception

Replaces null items with specified value in a stream of primitive items.
Emits true only if a given primitive is null.

File operators

There are 6 operators tagged with file

Creates or replaces a file and writes binary data to it.
Reads the contents of a file line by line and emits them as stream.
Reads the contents of a file and emits them.
Reads a file, deserializes each line and emits one item per line.
Appends binary data to a file or creates it if non existent.
Appends serialization of generic item to file.

Function operators

There are 3 operators tagged with function

Evaluates an expression.
Emits the greatest integer less than or equal to a given number.
Calculates square root of a number.

Http operators

There are 7 operators tagged with http

Decodes Excel data into a stream of sheets, each being a 2d-stream of cells.
Encodes a Slang map into the corresponding URL-encoded string.
Queries a given URL via GET request and emits its parsed response.
Starts an HTTP server, uses a handler delegate to process requests.
Performs an HTTP get request at a given URL and emits body and status code.
Sends an HTTP request.
Queries a given URL via GET using given parameters and emits the parsed response.

Image operators

There are 3 operators tagged with image

Reads an encoded image binary and emits its pixels as stream of rgb values.
Takes pixels as stream of rgb values and encodes it into an image binary.
Transforms an RGB pixel into a gray pixel.

Json operators

There are 2 operators tagged with json

Encodes Slang data into a JSON string.
Decodes a JSON string and emits the corresponding Slang data.

Math operators

There are 22 operators tagged with math

Evaluates an expression.
Divides number A by number B.
Emits true only if number A is less than number B.
Emits true only if number A is less than or equal to number B.
Calculates square root of a number.
Emits the z-score for each number of a stream of numbers.
Emits true if number A equals number B.
Emits true only if number A is greater than or equal to number B.
Calculates and emits moving average for each number of a stream of numbers.
Emits the greatest integer less than or equal to a given number.
Emits true only if number A does not equal number B.
Add
Adds two numbers A and B and emits their sum.
Emits true only if number A is greater than number B.
Multiplies two numbers A and B and emits their product.
Finds smallest number in a stream of numbers.
Sum
Emits the sum of a stream of numbers.
Finds greatest number in a stream of numbers.
Flips the sign of a given number and emit the resulting number.
Emits the modulo, the remainer of a division of two numbers A and B.
Emits the product of a stream of numbers.
Subtracts number B from number A and emits the resulting difference.
Emits the median number of a stream of numbers.

Mqtt operators

There are 2 operators tagged with mqtt

Publishes an MQTT message at a given topic.
Subscribes at a given topic, behaves like an MQTT client.

Network operators

There are 8 operators tagged with network

Sends an email.
Starts an HTTP server, uses a handler delegate to process requests.
Queries a given URL via GET using given parameters and emits the parsed response.
Publishes an MQTT message at a given topic.
Sends an HTTP request.
Queries a given URL via GET request and emits its parsed response.
Subscribes at a given topic, behaves like an MQTT client.
Performs an HTTP get request at a given URL and emits body and status code.

Smtp operators

There are 1 operators tagged with smtp

Sends an email.

Sort operators

There are 2 operators tagged with sort

Sorts a stream of primitive items.
Sorts a stream, using a comparator delegate specifying the order.

Statistics operators

There are 2 operators tagged with statistics

Emits standard deviation of a stream of numbers.
Emits the z-score for each number of a stream of numbers.

Stream operators

There are 29 operators tagged with stream

Lets an iterator delegate process a state until the controller tells it to stop.
Cuts a stream into windows of a certain size and emits them.
Takes a stream of key-value pairs and emits the value with the given key.
Uses an iterator delegate to aggregate items of a stream.
Collects items from a stream until released.
Emits standard deviation of a stream of numbers.
Emits first item of a stream of generic items.
Filters a stream letting items pass only if given boolean pass is true.
Emits the z-score for each number of a stream of numbers.
Emits the median number of a stream of numbers.
Releases windows of items collected before.
Takes a map and emits a stream of key-value pairs.
Takes a stream and emits a map of items, selected by given indices.
Transforms a stream by iterating it using an iterator delegate.
Emits a sub-stream of another stream.
Selects the n-th item in a stream of generic items, n being the index.
Emits last item of a stream of generic items.
Creates stream containing one single generic item.
Emits all collected values for multiple streams at once in a given interval.
Filters generic items of a stream, using a filter delegate as decider.
Takes a map of items and serializes them into a stream.
Takes a map and emits a stream of key-value pairs.
Sends an email.
Reduces the items of a stream pairwise using a reducer delegate.
Calculates and emits moving average for each number of a stream of numbers.
Counts number of items in a stream of generic items.
Sorts a stream of primitive items.
Sorts a stream, using a comparator delegate specifying the order.
Finds the best item using a chooser delegate to decide which item is better.

String operators

There are 7 operators tagged with string

Places values formatted in a C-like manner inside a string.
Tells if a string contains another string.
Concatenates strings A and B.
Tells if a string begins with another string.
Splits a string at a given separator and emits its pieces as stream.
Replaces placeholders in a given string with given values.
Tells if a string ends with another string.

Synchronize operators

There are 1 operators tagged with synchronize

Emits all collected values for multiple streams at once in a given interval.

System operators

There are 1 operators tagged with system

Executes a command on the host system.

Time operators

There are 5 operators tagged with time

Now
Emits the current date and time.
Takes an item and emits it again after a given number of milliseconds has passed.
Takes a string containing date and time and emits its parsed values.
Emits triggers using a given crontab.
Takes a UNIX crontab string, sends triggers to its handler delegate accordingly.

Window operators

There are 3 operators tagged with window

Releases windows of items collected before.
Cuts a stream into windows of a certain size and emits them.
Collects items from a stream until released.

Zip operators

There are 2 operators tagged with zip

Packs a stream of binary content into a zip archive.
Unpacks a zip archive and emits a stream of files and their binary content.