Stuff (etl_core v0.1.55)

Useful functions

Summary

Functions

Converts a time in seconds to the understandable format hh:mm:ss

Takes the first elements of the list

Converts a number to a string, with the particularity that if the number is one digit, it adds the zero before it

Subtract between lists. It generalizes, and uses, the one implemented by Kernel.--/2. The difference is for when a term to "subtract" is a map; in this case its values are obtained and it is transformed into lists of tuples, applying the subtraction to them.

Generates a random string with the symbols '0123456789abcdefghijklmnopqrstuvwxyz'

Functions

Link to this function

convert_seconds_to_humans(time)

Converts a time in seconds to the understandable format hh:mm:ss

###Parameter:

- time: Integer. Time in second.

Return:

- String
Link to this function

get_firsts(list, n)

Takes the first elements of the list

Parameters:

- list: List. List.

- n: Integer. Number of elements to be taken consecutively, starting with the first.

Return:

- {A, B} (A + B = list) where

    A List the first `n` elements of `list`

    B List of the remaining elements of `list`
Link to this function

integer_to_string_with_2_digits(n)

Converts a number to a string, with the particularity that if the number is one digit, it adds the zero before it

Parameter:

- n: Integer. Number to convert.

Return:

- String.
Link to this function

list_subtraction(l1, l2)

Subtract between lists. It generalizes, and uses, the one implemented by Kernel.--/2. The difference is for when a term to "subtract" is a map; in this case its values are obtained and it is transformed into lists of tuples, applying the subtraction to them.

Parameters:

- l1: List of tuples of size 2. List of items.

- l2: List of tuples of size 2. List of elements used to compare in `l1`. Those tuples that are the same are removed from `l1`.

Return:

- List of tuples of size 2
Link to this function

random_string_generate(len)

Generates a random string with the symbols '0123456789abcdefghijklmnopqrstuvwxyz'

Parameter:

- len: Integer. Chain length.

Return:

- String.