UNPKG

@senx/warpview-editor

Version:

WarpView Editor Elements

238 lines (233 loc) 4.38 MB
import { languages, Range, editor, MarkerSeverity } from 'monaco-editor'; import * as i0 from '@angular/core'; import { Injectable, Component, ViewEncapsulation, Input, ViewChild, EventEmitter, Output, HostListener, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { catchError } from 'rxjs/operators'; import { of } from 'rxjs'; import * as uuid from 'uuid'; import { v4 } from 'uuid'; import dayjs from 'dayjs'; import * as i1 from '@angular/common/http'; import { HttpClientModule } from '@angular/common/http'; import BigNumber from 'bignumber.js'; import * as i2 from '@angular/common'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; /* * Copyright 2020 SenX S.A.S. * * 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. */ class Utils { static mergeDeep(...sources) { // Variables const extended = {}; const deep = true; let i = 0; // Merge the object into the extended object // Loop through each object and conduct a merge for (; i < sources.length; i++) { const obj = sources[i]; Utils.merge(obj, extended, deep); } return extended; } static merge(obj, extended, deep) { for (const prop in obj) { if (obj.hasOwnProperty(prop)) { // If property is an object, merge properties if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') { extended[prop] = Utils.mergeDeep(extended[prop], obj[prop]); } else { extended[prop] = obj[prop]; } } } } static toArray(obj) { const arr = []; Object.keys(obj).forEach(k => arr.push(obj[k])); return arr; } } /* * Copyright 2020 SenX S.A.S. * * 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. */ class Config { constructor() { this.buttons = { class: '' }; this.execButton = { class: '', label: 'Execute' }; this.datavizButton = { class: '', label: 'Visualize' }; this.hover = true; this.readOnly = false; this.messageClass = ''; this.errorClass = ''; this.addLocalHeader = false; this.editor = { quickSuggestionsDelay: 10, quickSuggestions: true, tabSize: 2, minLineNumber: 10, enableDebug: false, rawResultsReadOnly: false, }; this.codeReview = { enabled: false, readonly: false, cancelButton: { class: '', label: 'Cancel' }, addButton: { class: '', label: 'Add comment' }, replyButton: { label: 'Reply' }, removeButton: { label: 'Remove' }, editButton: { label: 'Edit' } }; } } /* * Copyright 2020 SenX S.A.S. * * 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. */ class Logger { constructor(className, isDebug = false) { this.isDebug = false; this.className = className.name; this.isDebug = isDebug; } setDebug(debug) { this.isDebug = debug; } log(level, methods, args) { let logChain = []; logChain.push(`[${this.className}] ${methods.join(' - ')}`); logChain = logChain.concat(args); switch (level) { case LEVEL.DEBUG: { if (this.isDebug) { // tslint:disable-next-line:no-console console.debug(...logChain); } break; } case LEVEL.ERROR: { console.error(...logChain); break; } case LEVEL.INFO: { console.log(...logChain); break; } case LEVEL.WARN: { console.warn(...logChain); break; } default: { if (this.isDebug) { console.log(...logChain); } } } } debug(methods, ...args) { this.log(LEVEL.DEBUG, methods, args); } error(methods, ...args) { this.log(LEVEL.ERROR, methods, args); } warn(methods, ...args) { this.log(LEVEL.WARN, methods, args); } info(methods, ...args) { this.log(LEVEL.INFO, methods, args); } } /** * */ var LEVEL; (function (LEVEL) { LEVEL[LEVEL["DEBUG"] = 0] = "DEBUG"; LEVEL[LEVEL["ERROR"] = 1] = "ERROR"; LEVEL[LEVEL["WARN"] = 2] = "WARN"; LEVEL[LEVEL["INFO"] = 3] = "INFO"; })(LEVEL || (LEVEL = {})); /* * Copyright 2020 SenX S.A.S. * * 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. */ class BubblingEvents { /** * Angular provides support for custom events via Output properties and the EventEmitter. Unlike DOM events Angular custom events do not bubble. * see : http://blog.davidjs.com/2018/02/angular-custom-event-bubbling/ * This class allow to create events that can bubble up outside angular element webcomponents */ static emitBubblingEvent(el, eventname, eventdetail) { el.nativeElement.dispatchEvent(new CustomEvent(eventname, { bubbles: true, detail: eventdetail, composed: true })); } } class WarpScript { } WarpScript.reference = [{ "name": "!", "detail": "input<BOOLEAN> ! result<BOOLEAN>\ngtsinput<GTS> ! gtsresult<GTS>", "documentation": "Negates a boolean.\n\nThe `!` function is synonymous for [`NOT`](/doc/NOT). It consumes a boolean value x from the top of the stack and pushes back the result of appying the\n`NOT` logical function.\n\nSince Warp 10™ 2.1, `!` can be applied on a boolean GTS to flip all values.\n\nFor a true input value it returns false, for a false one it returns true.\n\n@param `input` Boolean value to negate\n\n@param `result` Negated boolean value\n\n@param `gtsinput` Since 2.1, a GTS with boolean value.\n\n@param `gtsresult` Since 2.1, a GTS with negated boolean value. GTS is not sorted by the operation. Metadata are kept.\n\n", "tags": ["logic", "operators"], "since": "1.0.0", "OPB64name": "7F" }, { "name": "!=", "detail": "p1<ANY> p2<ANY> != result<BOOLEAN>\ninputgts<GTS> constant<ANY> != outgts<GTS>\nconstant<ANY> inputgts<GTS> != outgts<GTS>\ngts1<GTS> gts2<GTS> != outputgts<GTS>", "documentation": "Tests if both parameters are different.\n\nThe `!=` operator consumes two parameters from the top of the stack and pushes onto the stack true if they are different, false otherwise.\n\nThe two parameters must be homogeneous of numeric, boolean or string types.\n\nSince Warp 10™ 2.1, as every other comparison operators, `!=` can also be used between two GTS or a GTS and a constant.\n\n`$gts 42 !=` is strictly equivalent of a `42 mapper.ne` MAP operation, with a simplified syntax.\n\n@param `p1` First parameter to compare, anything except a GTS.\n\n@param `p2` Second parameter to compare, anything except a GTS.\n\n@param `result` True if p1 and p2 are different, false otherwise\n\n@param `constant` Since Warp 10™ 2.1, a string or a number to compare with.\n\n@param `inputgts` Since Warp 10™ 2.1, a GTS with numbers or strings.\n\n@param `outgts` Since Warp 10™ 2.1, a new GTS containing only values different from constant.\n\n@param `gts1` Since Warp 10™ 2.1, an input GTS with numbers or strings.\n\n@param `gts2` Since Warp 10™ 2.1, an input GTS with numbers or strings.\n\n@param `outputgts` Since Warp 10™ 2.1, for each common ticks between gts1 and gts2, outputgts contains gts1 value and locations when gts1 value is different from gts2 value.\n\n", "tags": ["operators"], "since": "1.0.0", "OPB64name": "7Io" }, { "name": "%", "detail": "divisor<LONG> dividend<LONG> % modulo<LONG>\ndivisor<DOUBLE> dividend<LONG> % modulo<DOUBLE>\ndivisor<LONG> dividend<DOUBLE> % modulo<DOUBLE>\ndivisor<DOUBLE> dividend<DOUBLE> % modulo<DOUBLE>\ndivisor<COUNTER> dividend<COUNTER> % modulo<LONG>\ndivisor<DOUBLE> dividend<COUNTER> % modulo<DOUBLE>\ndivisor<COUNTER> dividend<DOUBLE> % modulo<DOUBLE>\ndivisor<LONG> dividend<COUNTER> % modulo<LONG>\ndivisor<COUNTER> dividend<LONG> % modulo<LONG>", "documentation": "The `%` operator consumes two parameters from the top of the stack and pushes back the remainder of the Euclidean division of the first one by the second one.\n\nThe two parameters must be of numeric types.\n\n@param `dividend` Number divided by divisor\n\n@param `divisor` Number used to divide dividend\n\n@param `modulo` Modulo of the two given parameters\n\n", "tags": ["operators", "math"], "since": "1.0.0", "OPB64name": "8F" }, { "name": "&", "detail": "p1<LONG> p2<LONG> & result<LONG>\ninputgts<GTS> mask<LONG> & maskedgts<GTS>\ngts1<GTS> gts2<GTS> & outputgts<GTS>", "documentation": "Performs a bitwise **AND** operation.\n\nThe `&` operator consumes two **LONG** from the top of the stack and pushes back their bitwise **AND**.\n\nSince Warp 10™ 2.1, `&` can be applied on two long GTS, or on one long GTS and a long mask.\n\n@param `p1` The first parameter\n\n@param `p2` The second parameter\n\n@param `result` The bitwise **XOR** result\n\n@param `inputgts` Since 2.1, a GTS with long values\n\n@param `gts1` Since 2.1, a GTS with long values\n\n@param `gts2` Since 2.1, a GTS with long values\n\n@param `mask` Since 2.1, a long which will be AND to every value of inputgts\n\n@param `outputgts` Since 2.1, a new sorted GTS with AND between each input values. Values are presents only for common input ticks.\n\n@param `maskedgts` Since 2.1, a new sorted GTS where values are inputs from inputgts AND with mask\n\n", "tags": ["binary", "operators"], "since": "1.0.0", "OPB64name": "8V" }, { "name": "&&", "detail": "p1<BOOLEAN> p2<BOOLEAN> && result<BOOLEAN>\nl<LIST> && result<BOOLEAN>\ngts1<GTS> gts2<GTS> && gtsresult<GTS>", "documentation": "The `&&` operator is a synonymous for [`AND`](/doc/AND).\n\nIt performs a logical **&&** on its parameters. When applied to a list of parameters, the parameter scan stops at the first `false` value encountered.\n\nSince Warp 10™ 2.1, `&&` can be applied on two boolean GTS to produce a new GTS.\n\n@param `p1` The first boolean\n\n@param `p2` The second boolean\n\n@param `l` The list containing BOOLEANs or MACROs returning BOOLEANs\n\n@param `result` The boolean result of the logical && applied to the parameters\n\n@param `gts1` Since 2.1, a boolean GTS input\n\n@param `gts2` Since 2.1, a boolean GTS input\n\n@param `gtsresult` Since 2.1, a new sorted GTS with && between each common tick input values.\n\n", "tags": ["operators", "logic"], "since": "1.0.0", "OPB64name": "8XN" }, { "name": "(", "detail": " ( mark<MARK>", "documentation": "Starts a set creation.\n\nThe `(` function creates a set by pushing a mark onto the stack. This is a syntactic help to better present set constructions. This function behaves like [`MARK`](/doc/MARK).\n\n@param `mark` A MARK object.\n\n", "tags": ["sets"], "since": "1.2.13", "OPB64name": "9." }, { "name": "()", "detail": "content<ANY> () newset<SET>", "documentation": "The `()` function creates an empty SET on the top of the stack.\nA Set is a collection that cannot contain duplicate elements.\n\nThis is an implementation of java [HashSet](https://docs.oracle.com/javase/8/docs/api/java/util/HashSet.html). NULL object is permitted. It makes no guarantees as to the iteration order of the set.\n\nThe SET object could not be represented on the stack.\nIt has to be converted in a list to be displayed.\n\nStoring GTS into sets do not guarantee uniqueness. each GTS has a hidden id. see example.\n\n\n@param `content` 0 to n elements.\n\n@param `newset` set instance, initialized with content.\n\n", "tags": ["sets"], "since": "1.2.13", "OPB64name": "91Z" }, { "name": ")", "detail": "mark<MARK> v1<ANY> vN<ANY> ) set<SET>", "documentation": "Closes a currently open set and pushes it onto the stack.\n\nThe `)` function pops from the stack the elements of the set up to the first mark encountered. The marks are consumed.\n\n@param `v1` The first value\n\n@param `vN` The Nth value\n\n@param `set` The built set\n\n@param `mark` The mark indicating the deepest level to consider when building the set\n\n", "tags": ["sets"], "since": "1.2.13", "OPB64name": "9F" }, { "name": "*", "detail": "p1<NUMBER> p2<NUMBER> * result<NUMBER>\np1<VECTOR> p2<NUMBER> * result<VECTOR>\np1<NUMBER> p2<VECTOR> * result<VECTOR>\np1<MATRIX> p2<NUMBER> * result<MATRIX>\np1<NUMBER> p2<MATRIX> * result<MATRIX>\np1<MATRIX> p2<VECTOR> * result<VECTOR>\np1<VECTOR> p2<MATRIX> * result<VECTOR>\np1<MATRIX> p2<MATRIX> * result<VECTOR>\np2<GTS> p1<GTS> * result<GTS>\np2<GTS> p1<NUMBER> * result<GTS>\np2<NUMBER> p1<GTS> * result<GTS>", "documentation": "The `*` operator consumes two parameters from the top of the stack and pushes back the result of multiplying both of them.\n\nIf you want to multiply two matrices together, they have to be of the same size.\n\n@param `p1` First parameter\n\n@param `p2` Second parameter\n\n@param `result` Multiplication result\n\n", "tags": ["operators", "math"], "since": "1.0.0", "OPB64name": "9V" }, { "name": "**", "detail": "b<LONG> n<LONG> ** result<LONG>\nb<DOUBLE> n<LONG> ** result<DOUBLE>\nb<LONG> n<DOUBLE> ** result<DOUBLE>\nb<DOUBLE> n<DOUBLE> ** result<DOUBLE>\nb<COUNTER> n<COUNTER> ** result<LONG>\nb<DOUBLE> n<COUNTER> ** result<DOUBLE>\nb<COUNTER> n<DOUBLE> ** result<DOUBLE>\nb<COUNTER> n<LONG> ** result<LONG>\nb<LONG> n<COUNTER> ** result<LONG>\nbgts<GTS> n<NUMBER> ** outgts<GTS>\nb<NUMBER> ngts<GTS> ** outgts<GTS>\nbgts<GTS> ngts<GTS> ** outgts<GTS>\nblist<LIST> n<NUMBER> ** outlist<LIST>\nb<NUMBER> nlist<LIST> ** outlist<LIST>\nbgts<GTS> n<NUMBER> ** outgts<GTS>\nb<NUMBER> ngts<GTS> ** outgts<GTS>", "documentation": "Returns the value of the first argument raised to the power of the second argument.\n\nThe `**` operator consumes two parameters from the top of the stack (a base **b** and an exponent **n**) and pushes back the result raising b to the power of n,\ni.e. b<sup>n</sup>. For special cases see [pow()](https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#pow-double-double- \"javadoc\").\n\nSince 2.7.1, this function can be applied to a **LIST** of numerical values and a numerical value. Considering this function as `F`, the result of `$a [ $b $c ] F` is `[ $a $b F $a $c F ]` and the result of `[ $a $b ] $c F` is `[ $a $c F $b $c F ]`.\n\nAlso since 2.7.1, this function can be applied to a **GTS** of numerical values. This is very similar to how this function works on **LIST**s, considering the values of the GTS. In that case the result is a GTS.\n\n@param `b` First parameter, the base\n\n@param `n` Second parameter, the exponent\n\n@param `blist` List of bases\n\n@param `nlist` List of exponents\n\n@param `bgts` Numerical GTS of bases\n\n@param `ngts` Numerical GTS of exponents\n\n@param `result` The result of b<sup>n</sup>\n\n@param `outlist` List of b<sup>n</sup>\n\n@param `outgts` GTS of b<sup>n</sup>\n\n", "tags": ["math", "operators"], "since": "1.0.0", "OPB64name": "9Xc" }, { "name": "+", "detail": "param1<STRING> param2<STRING> + result<STRING>\nparam1<LONG> param2<LONG> + result<LONG>\nparam1<DOUBLE> param2<LONG> + result<DOUBLE>\nparam1<COUNTER> param2<LONG> + result<LONG>\nparam1<LONG> param2<DOUBLE> + result<DOUBLE>\nparam1<DOUBLE> param2<DOUBLE> + result<DOUBLE>\nparam1<COUNTER> param2<DOUBLE> + result<DOUBLE>\nparam1<COUNTER> param2<COUNTER> + result<LONG>\nparam1<DOUBLE> param2<COUNTER> + result<DOUBLE>\nparam1<LONG> param2<COUNTER> + result<LONG>\nparam1<LIST> param2<ANY> + result<LIST>\nparam1<SET> param2<ANY> + result<SET>\nparam1<VECTOR> param2<NUMBER> + result<VECTOR>\nparam1<NUMBER> param2<VECTOR> + result<VECTOR>\nparam1<VECTOR> param2<VECTOR> + result<VECTOR>\nparam1<MACRO> param2<MACRO> + result<MACRO>\nparam1<MATRIX> param2<NUMBER> + result<MATRIX>\nparam1<NUMBER> param2<MATRIX> + result<MATRIX>\nparam1<MATRIX> param2<MATRIX> + result<MATRIX>\nparam2<GTS> param1<GTS> + result<GTS>\nparam2<GTS> param1<DOUBLE> + result<GTS>\nparam2<GTS> param1<LONG> + result<GTS>\nparam2<GTS> param1<STRING> + result<GTS>\nparam2<DOUBLE> param1<GTS> + result<GTS>\nparam2<LONG> param1<GTS> + result<GTS>\nparam2<STRING> param1<GTS> + result<GTS>\nparam1<BYTES> param2<BYTES> + result<BYTES>", "documentation": "The `+` operator consumes two parameters from the top of the stack and pushes back the result of adding them.\n\nThe meaning of adding depends on the type of parameter:\n\n- If both parameters are numbers, the result is the sum of both numbers.\n\n- If both parameters are strings, the result is the concatenation of both strings.\n- If both parameters are byte arrays, the result is the concatenation of both byte arrays (version 2.1+).\n\n- If the first parameter is a list, the + operator clones the list and appends the second parameter to the cloned list.\n\n- If the first parameter is a set, the + operator clones the set and appends the second parameter to the cloned set.\n\n- If both parameters are macros, the result is a macro concatenating the two others in any other case + with throw an exception.\n\n- If the first parameter is a vector, the + operator adds the second numeric parameter to each element of the vector.\n- If the second parameter is a vector, the + operator adds the first numeric parameter to each element of the vector.\n- If both parameters are vectors, the + operator adds each element of vectors which are on the same index. Vectors must be the same size.\n\n- If the first parameter is a matrix, the + operator adds the second numeric parameter to each element of the matrix.\n- If the second parameter is a matrix, the + operator adds the first numeric parameter to each element of the matrix.\n- If both parameters are matrices, the + operator adds each element of matrices which are on the same index. Matrices must be the same size.\n- If one of the parameters is a Geo Time Series™, the result will be a Geo Time Series™ of type DOUBLE.\n\n@param `param1` First parameter\n\n@param `param2` Second parameter\n\n@param `result` Result of the addition\n\n", "tags": ["math", "operators"], "since": "1.0.0", "OPB64name": "9k" }, { "name": "+!", "detail": "input<LIST> item<ANY> +! output<LIST>\ninput<SET> item<ANY> +! output<SET>", "documentation": "The +! operator adds the element on top of the stack to the set or list below it. \nThe element is added to the existing collection. \n\n\n@param `input` reference to the list or set to be modified\n\n@param `output` copy of input list or set reference.\n\n@param `item` the item to append to inputlist. Depending on list content, could be any type.\n\n", "tags": ["lists", "operators"], "since": "1.2.0", "OPB64name": "9m3" }, { "name": "-", "detail": "p1<LONG> p2<LONG> - result<LONG>\np1<LONG> p2<DOUBLE> - result<DOUBLE>\np1<DOUBLE> p2<LONG> - result<DOUBLE>\np1<DOUBLE> p2<DOUBLE> - result<DOUBLE>\np1<COUNTER> p2<COUNTER> - result<LONG>\np1<COUNTER> p2<DOUBLE> - result<DOUBLE>\np1<DOUBLE> p2<COUNTER> - result<DOUBLE>\np1<LONG> p2<COUNTER> - result<LONG>\np1<COUNTER> p2<LONG> - result<LONG>\np1<MATRIX> p2<MATRIX> - result<MATRIX>\np1<VECTOR> p2<VECTOR> - result<VECTOR>\np2<GTS> p1<GTS> - result<GTS>\np2<GTS> p1<NUMBER> - result<GTS>\np2<NUMBER> p1<GTS> - result<GTS>", "documentation": "Subtracts two parameters.\n\nThe `-` operator consumes two parameters from the top of the stack and pushes back the result of subtracting the second one from the first one.\n\n- If both parameters are numbers, the result is the subtraction of both numbers.\n\n- If both parameters are vectors, the - operator subtracts each element of vectors which are on the same index. Vectors must be the same size.\n\n- If both parameters are matrices, the - operator subtracts each element of matrices which are on the same index. Matrices must be the same size.\n\n@param `p1` First parameter\n\n@param `p2` Second parameter\n\n@param `result` Subtraction result\n\n", "tags": ["operators"], "since": "1.0.0", "OPB64name": "AF" }, { "name": "->B58", "detail": "input<STRING> ->B58 result<STRING>\ninput<BYTES> ->B58 result<STRING>", "documentation": "Encodes the string on top of the stack in [Base58](https://tools.ietf.org/id/draft-msporny-base58-03.txt).\n\n@param `input` String or byte array to encode\n\n@param `result` Base58 encoded string\n\n", "tags": ["strings", "conversion"], "since": "2.8.0", "OPB64name": "AIt1CIV" }, { "name": "->B58C", "detail": "input<STRING> prefix<BYTES> ->B58C result<STRING>\ninput<BYTES> prefix<BYTES> ->B58C result<STRING>", "documentation": "Encodes the string on top of the stack in [Base58Check](https://en.bitcoin.it/wiki/Base58Check_encoding).\n\n@param `prefix` Prefix to use for Base58Check encoding\n\n@param `input` String or byte array to encode\n\n@param `result` Base58Check encoded string\n\n", "tags": ["strings", "conversion"], "since": "2.8.0", "OPB64name": "AIt1CIW2" }, { "name": "->B64", "detail": "input<STRING> ->B64 result<STRING>\ninput<BYTES> ->B64 result<STRING>", "documentation": "Encodes the string on top of the stack in [base64](https://en.wikipedia.org/wiki/Base64).\n\n@param `input` String or byte array to encode\n\n@param `result` Base64 encoded string\n\n", "tags": ["strings", "conversion"], "since": "1.0.0", "OPB64name": "AIt1CYF" }, { "name": "->B64URL", "detail": "input<STRING> ->B64URL result<STRING>\nbytes<BYTES> ->B64URL result<STRING>", "documentation": "Encodes the string on top of the stack in [base64url](https://en.wikipedia.org/wiki/Base64#Variants_summary_table).\n\n@param `input` String to encode\n\n@param `bytes` Byte array to encode\n\n@param `result` Base64url encoded string\n\n", "tags": ["strings", "conversion"], "since": "1.0.0", "OPB64name": "AIt1CYGKJZk" }, { "name": "->BIN", "detail": "input<STRING> ->BIN output<STRING>\ninput<BYTES> ->BIN output<STRING>\ninput<LONG> ->BIN output<STRING>\ninput<BITSET> ->BIN output<STRING>", "documentation": "The ->BIN function converts the byte array or the string on top of the stack \nto its binary representation.\n\nSince the 2.8.0 version, it also converts a **LONG** to its 64 bits binary representation. Thus, this function and [TOBIN](/doc/TOBIN) are equivalent.\n\nApplied on a string, `->BIN` replaces ` 'utf-8' ->BYTES ->BIN `\n\nIf the encoded content is not a valid UTF-8 representation, the resulting string will reflect that. \n\n@param `input` Any string or byte array.\n\n@param `output` Binary representation of the input.\n\n", "tags": ["conversion", "binary"], "since": "1.0.6", "OPB64name": "AIt1HJs" }, { "name": "->BYTES", "detail": "input<STRING> charset<STRING> ->BYTES output<BYTES>", "documentation": "->BYTES function converts a string into a bytes array given a charset\nand put the result on top of the stack.\n\n\nCharset could be any supported by your java platform. Example: UTF-8 US-ASCII ISO-8859-1 Cp852...\n\nBytes array cannot be represented on the stack.\n\n\n@param `input` String input.\n\n@param `charset` Charset to use.\n\n@param `output` Byte array representation of input.\n\n", "tags": ["conversion"], "since": "1.0.6", "OPB64name": "AIt1LKG4Jk" }, { "name": "->DOUBLEBITS", "detail": "number<NUMBER> ->DOUBLEBITS bits<LONG>\ngts<GTS> ->DOUBLEBITS longgts<GTS>", "documentation": "Converts a number or each numerical value of a Geo Time Series™ into a LONG with the same bits as the DOUBLE ([IEEE754](https://en.wikipedia.org/wiki/IEEE_754)) encoding of the original number.\n\n@param `number` Numeric value to represent, will first be converted to a DOUBLE if not already the case.\n\n@param `bits` LONG containing the same bits as the double precision IEEE754 representation of the input.\n\n@param `gts` Numerical Geo Time Series™ to convert.\n\n@param `longgts` Result GTS with LONG values.\n\n", "tags": ["math", "gts", "binary"], "since": "1.2.3", "OPB64name": "AIt3IpK1I3K1HKGI" }, { "name": "->ENCODER", "detail": "elements<LIST> ->ENCODER output<GTSENCODER>\nlgts<LIST<GTS>> ->ENCODER output<GTSENCODER>\nlwrappedgts<LIST<STRING>> ->ENCODER output<GTSENCODER>\nlrawwrappedgts<LIST<BYTES>> ->ENCODER output<GTSENCODER>", "documentation": "The `->ENCODER` function takes a list of points and encode them in a single encoder. Each point is a list of ( timestamp, latitude, longitude, elevation, value ). Since 2.1.1, a point can also be a Geo Time Series™ or a wrapped one. In that case all the points of the Geo Time Series™ are added to the encoder.\n\nAn encoder is very similar to a Geo Time Series™, it differs by its ability to store values of all four types (LONG, DOUBLE, BOOLEAN, STRING) where a GTS is limited to the type of the first value stored. An encoder can also have a name, labels and attributes.\n\nThe set of operations which can be performed on encoders is more limited than those that can be performed on GTS.\n\n@param `elements` List of list of ( timestamp, latitude, longitude, elevation, value ). See example to see which element(s) can be omitted.\n\n@param `lgts` A list of Geo Time Series™ instances.\n\n@param `lwrappedgts` A list of wrapped Geo Time Series™ instances, such as produced by [`WRAP`](/doc/WRAP).\n\n@param `lrawwrappedgts` A list of raw wrapped Geo Time Series™ instances, such as produced by [`WRAPRAW`](/doc/WRAPRAW).\n\n@param `output` Encoder\n\n", "tags": ["encoder", "conversion"], "since": "1.2.9", "OPB64name": "AIt4IZCEG3KH" }, { "name": "->ENCODERS", "detail": "encoder<GTSENCODER> ->ENCODERS output<MAP>\nwrappedencoder<STRING> ->ENCODERS output<MAP>\nrawwrappedencoder<BYTES> ->ENCODERS output<MAP>", "documentation": "The `->ENCODERS` function converts an encoder into one encoder per type in the encoder. The result is a map, with key describing the type. If defined, name, labels and attributes are kept in the result.\nFunction also accepts wrapped or raw-wrapped encoders.\n\nAn encoder is very similar to a Geo Time Series™, it differs by its ability to store values of all four types (LONG, DOUBLE, BOOLEAN, STRING) and since 2.1 also BINARY content, when a GTS is limited to the type of the first value stored. An encoder can also have a name, labels and attributes.\n\nThe set of operations which can be performed on encoders is more limited than those that can be performed on GTS.\n\n@param `encoder` Encoder input.\n\n@param `wrappedencoder` Encoder after WRAP.\n\n@param `rawwrappedencoder` Encoder after WRAPRAW.\n\n@param `output` Map with a key/value per type encountered in the input encoder.\n\n", "tags": ["gts", "encoder", "conversion"], "since": "2.1.0", "OPB64name": "AIt4IZCEG3KHJk" }, { "name": "->FLOATBITS", "detail": "input<NUMBER> ->FLOATBITS result<LONG>", "documentation": "Converts a numeric value to a **FLOAT** then to a **LONG** value of the raw bits of its representation.\n\nOnly the lower 32 bits of the **LONG** value are significant.\n\n@param `input` Double to convert\n\n@param `result` Raw bits representation\n\n", "tags": ["math", "binary"], "since": "1.2.3", "OPB64name": "AIt5I3x0K388K4B" }, { "name": "->GEOCELL", "detail": "hhPrefixS<STRING> ->GEOCELL geocell<LONG>\nhhPrefixB<BYTES> ->GEOCELL geocell<LONG>", "documentation": "The `->GEOCELL` function converts a **STRING** or a **BYTES** HHCode prefix to a **LONG** geocell. The length of the input implicitly specifies the resolution of the cell.\n\nA geocell is a **LONG** where the 4 MSBs store the resolution and the 60 LSBs store a trimmed HHCode. The value stored in the 4 MSBs must be multiplied by 2 to give the resolution of the trimmed HHCode, thus only even resolutions can be represented in a geocell. A resolution of 0 is considered invalid and the highest resolution is 30. The value stored in the 60 LSBs are the 60 MSBs of a HHCode but only the 2*resolution MSBs must be considered.\n\nHere is an example of the bits representation of a geocell and their meaning:\n\n```\n1001101101010111001001011000100010101111000000000000000000000000\n\\__/\\__________________________________/\\______________________/\n || || ||\nRes: 9*2=18 || ||\n 18*2 relevant bits of HHCode 60-18*2 unrelevant bits\n```\n\nA **GEOSHAPE** is simply a list of geocells, see [\\->GEOSHAPE](/doc/AIt6GJxIH34FGF) to build a **GEOSHAPE** from geocells.\n\n@param `hhPrefixS` A HHCode prefix representing a cell. Resolution is twice the length of the **STRING**.\n\n@param `hhPrefixB` A HHCode prefix representing a cell. Resolution is four times the length of the **BYTES**.\n\n@param `geocell` The geocell representation.\n\n", "tags": ["geo"], "since": "2.6.0", "OPB64name": "AIt6GJx2GJlB" }, { "name": "->GEOHASH", "detail": "lat<DOUBLE> lon<DOUBLE> ->GEOHASH geohash<STRING>\nhhcode<LONG> ->GEOHASH geohash<STRING>\nshape<GEOSHAPE> ->GEOHASH geohashes<LIST<STRING>>", "documentation": "The `->GEOHASH` function packs a latitude and a longitude into a STRING [Geohash](https://en.wikipedia.org/wiki/Geohash), converts a [HHCode](https://en.wikipedia.org/wiki/HHCode) into its Geohash counterpart, or converts a `GEOSHAPE` into a list of Geohashes covering the same geographical area.\n\n@param `lat` Latitude to pack.\n\n@param `lon` Longitude to pack.\n\n@param `geohash` Geohash string packing the specified latitude and longitude.\n\n@param `hhcode` HHCode to transform.\n\n@param `shape` `GEOSHAPE` to convert.\n\n@param `geohashes` List of Geohashes covering the same area as `shape`.\n\n", "tags": ["geo"], "since": "1.0.11", "OPB64name": "AIt6GJx7FKC7" }, { "name": "->GEOJSON", "detail": "shape<GEOSHAPE> ->GEOJSON geojson<STRING>\nshape<GEOSHAPE> allCells<BOOLEAN> ->GEOJSON geojson<STRING>\nwkt_kml_gml<STRING> ->GEOJSON geojson<STRING>\nwkb<BYTES> ->GEOJSON geojson<STRING>", "documentation": "The `->WKB` function converts a WKT **STRING**, WKB **BYTES**, a GML **STRING, a KML **STRING** or a **SHAPE** to a GeoJSON **STRING**.\n\nThe resulting GeoJSON is a string representing a MultiPolygon geometry. By default, it defines the boundaries of the covered areas and any holes it these areas, if any.\n\nIt is also possible for this function to return a GeoJSON representing all the cells in the GeoShape.\n\n GeoJson could be visualized on the map, if you let a special object on the map. See example.\n\n@param `shape` The GeoShape to be translated.\n\n@param `allCells` Optional parameter specifying if all the cells (true) or only the boundaries of the overall shape (false) must be represented in the GeoJSON. Defaults to false.\n\n@param `geojson` The resulting GeoJSON.\n\n@param `wkt_kml_gml` A WKT, KML or GML string\n\n@param `wkb` WKB bytes\n\n", "tags": ["geo"], "since": "2.4.1", "OPB64name": "AIt6GJx9JoxD" }, { "name": "->GEOSHAPE", "detail": "geocells<LIST<LONG>> ->GEOSHAPE geoshape<GEOSHAPE>\nhhPrefixesS<LIST<STRING>> ->GEOSHAPE geoshape<GEOSHAPE>\nhhPrefixesB<LIST<BYTES>> ->GEOSHAPE geoshape<GEOSHAPE>", "documentation": "The `->GEOSHAPE` function converts a list of **LONG** geocells or HHCode prefixes (**STRING** or **BYTES**) to a **GEOSHAPE**.\n\n@param `geocells` List of geocells, as **LONGs**.\n\n@param `hhPrefixesS` List of HHCode prefixes, as **STRINGs**.\n\n@param `hhPrefixesB` List of HHCode prefixes, as **BYTESs**.\n\n@param `geoshape` The resulting **GEOSHAPE**.\n\n", "tags": ["geo"], "since": "2.6.0", "OPB64name": "AIt6GJxIH34FGF" }, { "name": "->GML", "detail": "shape<GEOSHAPE> ->GML gml<STRING>\nshape<GEOSHAPE> allCells<BOOLEAN> ->GML gml<STRING>\ngeojson_wkt_kml<STRING> ->GML gml<STRING>\nwkb<BYTES> ->GML gml<STRING>", "documentation": "The `->GML` function converts a GeoJSON **STRING**, a WKT **STRING**, WKB **BYTES**, a KML **STRING** or a **SHAPE** to a GML **STRING**.\n\nThis function accepts an optional boolean on top of the **SHAPE** to choose whether all cells are outputted or not. Defaults to false.\n\n@param `shape` The GeoShape to be translated.\n\n@param `allCells` Optional parameter specifying if all the cells (true) or only the boundaries of the overall shape (false) must be represented in the GeoJSON. Defaults to false.\n\n@param `geojson_wkt_kml` A GeoJSON, WKT or KML string.\n\n@param `gml` The resulting GML.\n\n@param `wkb` WKB bytes.\n\n", "tags": ["geo", "conversion"], "since": "2.9.0", "OPB64name": "AIt6IJk" }, { "name": "->GTS", "detail": "encoder<GTSENCODER> ->GTS output<MAP>\nwrappedencoder<STRING> ->GTS output<MAP>\nrawwrappedencoder<BYTES> ->GTS output<MAP>\nlencoder<LIST<GTSENCODER>> ->GTS loutput<MAP>\nlwrappedencoder<LIST<STRING>> ->GTS loutput<MAP>\nlrawwrappedencoder<LIST<BYTES>> ->GTS loutput<MAP>\nencoder<GTSENCODER> conversionmap<MAP> ->GTS conversionoutput<GTS>\nwrappedencoder<STRING> conversionmap<MAP> ->GTS conversionoutput<GTS>\nrawwrappedencoder<BYTES> conversionmap<MAP> ->GTS conversionoutput<GTS>\nlencoder<LIST<GTSENCODER>> conversionmap<MAP> ->GTS conversionoutput<LIST<GTS>>\nlwrappedencoder<LIST<STRING>> conversionmap<MAP> ->GTS conversionoutput<LIST<GTS>>\nlrawwrappedencoder<LIST<BYTES>> conversionmap<MAP> ->GTS conversionoutput<LIST<GTS>>", "documentation": "The `->GTS` function converts an encoder into one GTS per type in the encoder. The result is a map, with key describing the type. If defined, name, labels and attributes are kept in the result.\nFunction also accepts wrapped or raw-wrapped encoders.\n\n###### Since 2.4.0:\n- `->GTS` function can also take a conversion MAP input. Using this conversion MAP, the output is always a list of GTS.\n- The conversion map can also take a list of selectors for each output type.\n- The conversion map can be empty: In this case, the GTS type is enforced by the type of the first element in the encoder input.\n- The first selector match stops the research. It means key order matters. See Examples.\n- A new '.type' label is added to each output GTS. This could be overridden with the 'label.type' parameter of the conversion MAP.\n- `->GTS` function can handle encoders, or list of encoders.\n\n###### What is an encoder ?\nA Geo Time Series™ is limited to the type of the first value stored.\nAn encoder is very similar to a Geo Time Series™, it differs by its ability to store values of all four types (LONG, DOUBLE, BOOLEAN, STRING) and since 2.1 also BINARY content.\nThe set of operations which can be performed on encoders is more limited than those that can be performed on GTS.\n\n\n@param `encoder` Encoder input.\n\n@param `wrappedencoder` Encoder after WRAP.\n\n@param `rawwrappedencoder` Encoder after WRAPRAW.\n\n@param `output` Map with a key/value per type encountered in the input encoder. Values are GTS.\n\n@param `lencoder` List of encoders input (supported since 2.4.0).\n\n@param `lwrappedencoder` List of encoders after WRAP (supported since 2.4.0).\n\n@param `lrawwrappedencoder` List of encoders after WRAPRAW (supported since 2.4.0).\n\n@param `loutput` Map with a key/value per type encountered in the input encoder. Values are a list of GTS.\n\n@param `conversionmap` Map with type as keys, selectors or list of selectors as values. The special key `label.type` allow to change the default `.type` label. Set `label.type` to NULL to avoid any new label. The conversion map could be empty.\n\n@param `conversionoutput` A GTS, or a list of GTS.\n\n", "tags": ["gts", "encoder", "conversion", "multivariate"], "since": "1.2.9", "OPB64name": "AIt6K4B" }, { "name": "->GTSHHCODE", "detail": "lat<NUMBER> lon<NUMBER> ->GTSHHCODE hhcode<STRING>", "documentation": "The `->GTSHHCODE` function packs a latitude and a longitude into a STRING [HHCode](https://en.wikipedia.org/wiki/HHCode). This function is very similar to [`->HHCODE`](/doc/AIt7H3CEG3J) except that when given `NaN NaN` it pushes back the internal value used by Geo Time Series™ for a missing location.\n\nThe packed HHCode uses 32 bits for each the latitude and longitude.\n\n@param `lon` Longitude to pack.\n\n@param `lat` Latitude to pack.\n\n@param `hhcode` Resulting HHCode, as a string of 16 hexadecimal digits.\n\n", "tags": ["geo"], "since": "2.2.0", "OPB64name": "AIt6K4C7H3CEG3J" }, { "name": "->GTSHHCODELONG", "detail": "lat<NUMBER> lon<NUMBER> ->GTSHHCODELONG hhcode<STRING>", "documentation": "The `->GTSHHCODE` function packs a latitude and a longitude into a LONG [HHCode](https://en.wikipedia.org/wiki/HHCode). This function is very similar to [`->HHCODE`](/doc/AIt7H3CEG3J) except that when given `NaN NaN` it pushes back the internal value used by Geo Time Series™ for a missing location.\n\nThe packed HHCode uses 32 bits for each the latitude and longitude.\n\n@param `lon` Longitude to pack.\n\n@param `lat` Latitude to pack.\n\n@param `hhcode` Resulting HHCode, as a 64 bits LONG.\n\n", "tags": ["geo"], "since": "2.2.0", "OPB64name": "AIt6K4C7H3CEG3KBIot6" }, { "name": "->HEX", "detail": "input<STRING> ->HEX output<STRING>\ninput<BYTES> ->HEX output<STRING>\ninput<LONG> ->HEX output<STRING>", "documentation": "The `->HEX` function decodes an hex encoded string or a byte array. For different encodings, use bytes array conversion [`BYTES->`](/doc/F__JGKBhEV).\n\nApplied on a string, `->HEX` replaces `'utf-8' ->BYTES ->HEX`\n\nSince 2.8.0 this function also converts a long to its 64 bits hexadecimal representation. Thus this function is equivalent to [TOHEX](/doc/TOHEX).\n\nIf the encoded content is not a valid UTF-8 representation, the resulting string will reflect that.\n\n\n@param `input` Valid hexadecimal string representation.\n\n@param `output` Decoded string of input, assuming utf-8 encoding of input.\n\n", "tags": ["conversion"], "since": "1.0.0", "OPB64name": "AIt7GKV" }, { "name": "->HHCODE", "detail": "lat<NUMBER> lon<NUMBER> ->HHCODE hhcode<STRING>", "documentation": "The `->HHCODE` function packs a latitude and a longitude into a STRING [HHCode](https://en.wikipedia.org/wiki/HHCode).\n\nThe packed HHCode uses 32 bits for each the latitude and longitude.\n\n@param `lon` Longitude to pack.\n\n@param `lat` Latitude to pack.\n\n@param `hhcode` Resulting HHCode, as a string of 16 hexadecimal digits.\n\n", "tags": ["geo"], "since": "1.0.11", "OPB64name": "AIt7H3CEG3J" }, { "name": "->HHCODELONG", "detail": "lat<NUMBER> lon<NUMBER> ->HHCODELONG hhcode<LONG>", "documentation": "The `->HHCODELONG` function packs a latitude and a longitude into a LONG [HHCode](https://en.wikipedia.org/wiki/HHCode).\n\nThe packed HHCode uses 32 bits for each the latitude and longitude.\n\n@param `lon` Longitude to pack.\n\n@param `lat` Latitude to pack.\n\n@param `hhcode` Resulting HHCode, as a 64 bits LONG.\n\n", "tags": ["geo"], "since": "1.2.5", "OPB64name": "AIt7H3CEG3KBIot6" }, { "name": "->JSON", "detail": "object<ANY> ->JSON output<STRING>", "documentation": "The `->JSON` functions serialize structures containing numbers, strings, booleans, lists, vlists and maps which do not reference the same list/map multiple times.\n\n@param `object` Object to serialize\n\n@param `output` JSON formatted string\n\n", "tags": ["conversion"], "since": "1.0.0", "OPB64name": "AIt9JoxD" }, { "name": "->KML", "detail": "shape<GEOSHAPE> ->KML kml<STRING>\nshape<GEOSHAPE> allCells<BOOLEAN> ->KML kml<STRING>\ngeojson_wkt_gml<STRING> ->KML kml<STRING>\nwkb<BYTES> ->KML kml<STRING>", "documentation": "The `->KML` function converts a GeoJSON **STRING**, a WKT **STRING**, a GML **STRING, WKB **BYTES** or a **SHAPE** to a KML **STRING**.\n\nThis function accepts an optional boolean on top of the **SHAPE** to choose whether all cells are outputted or not. Defaults to false.\n\n@param `shape` The GeoShape to be translated.\n\n@param `allCells` Optional parameter specifying if all the cells (true) or only the boundaries of the overall shape (false) must be represented in the GeoJSON. Defaults to false.\n\n@param `geojson_wkt_gml` A GeoJSON, WKT or GML string.\n\n@param `kml` The resulting KML.\n\n@param `wkb` WKB bytes.\n\n", "tags": ["geo", "conversion"], "since": "2.9.0", "OPB64name": "AItAIJk" }, { "name": "->LIST", "detail": "content<ANY*> N<LONG> ->LIST newlist<LIST>", "documentation": "The `->LIST` function create a list from N elements on the stack.\nN and the N next elements on the stack are consumed.\n\nIf N is greater than current stack depth, the function raises an error.\n\n@param `N` The number of elements to take on the top of the stack to build the list.\n\n@param `newlist` The list of N elements. [deepest in stack ... TOP-1 ]\n\n@param `content` 0 to n elements\n\n", "tags": ["lists", "conversion"], "since": "1.0.0", "OPB64name": "AItBHKCJ" }, { "name": "->LONGBYTES", "detail": "number<LONG> nbbytes<LONG> ->LONGBYTES output<BYTES>\nnumberList<LIST<LONG>> nbbytes<LONG> ->LONGBYTES output<BYTES>", "documentation": "`->LONGBYTES` converts a LONG to a byte array. It expects a number of bytes on the top of the stack.\n\nSince Warp 10™ 2.1, `->LONGBYTES` can also convert a list of LONG.\n\n@param `nbbytes` Number of bytes for number conversion: nbbytes could be 1 to 8. If less than 8, most significant bytes will be truncated.\n\n@param `number` must be a LONG\n\n@param `output` byte array, from 1 to 8 bytes per number\n\n@param `numberList` Since Warp 10 2.1, a list of LONG\n\n", "tags": ["binary", "conversion"], "since": "2.1.0", "OPB64name": "AItBIot6F__JGKB" }, { "name": "->MACRO", "detail": "statements<LIST> ->MACRO macro<MACRO>", "documentation": "The `->MACRO->` creates a `MACRO` from a `LIST` of statements such as the ones created by `MACRO->`.\n\n@param `macro` `MACRO` containing the statements from `statements`.\n\n@param `statements` List of statements.\n\n", "tags": ["platform"], "since": "2.8.0", "OPB64name": "AItCFJCHIk" }, { "name": "->MAP", "detail": "content<ANY*> N<LONG> ->MAP newmap<MAP>", "documentation": "The ->MAP function creates a MAP from an even number N of elements on the stack. \nN is consumed off the top of the stack. For each pair, the deepest element is the key, the shallowest is the value.\n\n\n@param `content` 0 to n pairs of key-value elements. Keys must be different.\n\n@param `N` Number of content elements to consume on the stack. It must be even.\n\n@param `newmap` map instance, initialized with content.\n\n", "tags": ["maps", "conversion"], "since": "1.0.0", "OPB64name": "AItCFK." }, { "name": "->MAT", "detail": "[ input<LIST> ] ->MAT result<MATRIX>", "documentation": "The `->MAT` function converts nested lists of numbers (2D array with same number of columns) into a Matrix.\n\nMATRIX objects cannot be represented on the stack. \n\nMatrix entries must be numbers.\n\n\n@param `input` List of lists of values\n\n@param `result` A MATRIX object\n\n", "tags": ["lists", "math", "conversion"], "since": "1.0.6", "OPB64name": "AItCFKF" }, { "name": "->MVSTRING", "detail": "input<STRING> ->MVSTRING mvstring<STRING>\ninput<BYTES> ->MVSTRING mvstring<STRING>\ninput<GTS> ->MVSTRING mvstring<STRING>\ninput<GTSENCODER> ->MVSTRING mvstring<STRING>", "documentation": "The `->MVSTRING` function generates a STRING representation of an ENCODER in the format expected by the `/update` endpoint for multi values.\n\nWhen encountering a binary element, the function attempts to interpret it as a wrapped encoder, if that fails then it will output the element as a binary (`b64:...`) value.\n\n@param `input` Wrapped or unwrapped Geo Time Series™ or ENCODER.\n\n@param `mvstring` MultiValue format representation of the wrapped encoder/GTS.\n\n", "tags": ["gts", "encoder", "multivariate"], "since": "2.1.0", "OPB64name": "AItCK_CJJZ_DGk" }, { "name": "->OPB64", "detail": "input<STRING> ->OPB64 output<STRING>\ninput<BYTES> ->OPB64 output<STRING>", "documentation": "Encode a String in order preserving base64. OPB64 is a Base64 like encoding which preserves the lexicographic order of\nthe original byte arrays in the encoded ones. This is useful to compare encoded byte arrays without having to first decode them.\n\n@param `input` Could be a string or a byte array.\n\n@param `output` OPB64 of input.\n\n", "tags": ["conversion"], "since": "1.0.6", "OPB64name": "AItEJ37qC." }, { "name": "->PICKLE", "detail": "input<ANY> ->PICKLE output<BYTES>", "documentation": "The `->PICKLE` function converts the object on top of the stack to a Python object and serializes it using Pickle protocol version 2.\nThe conversion table used is as follow:\n\n| WarpScript | Python |\n|------------|--------|\n| NULL | None |\n| BOOLEAN | bool |\n| BYTES | bytearray |\n| STRING | str/unicode |\n| DOUBLE | float |\n| LONG | int |\n| LIST | list |\n| MAP | dict |\n| SET | set |\n| GTS | dict |\n| ENCODER | dict |\n\nOther types are unsupported.\n\nPython examples with `->PICKLE ->HEX` output:\n\n**Python2**\n```python\n>>> s=\"80025d71002858060000005049434b4c4571015806000000535452494e4771025d7103284b0547400921fb54442d1865652e\"\n>>> import pickle\n>>> pickle.loads(s.decode(\"hex\"))\n[u'PICKLE', u'STRING', [5, 3.141592653589793]]\n```\n**Python3** \n```python\n>>> s=\"80025d71002858060000005049434b4c4571015806000000535452494e4771025d7103284b0547400921fb54442d1865652e\"\n>>> import pickle, codecs\n>>> pickle.loads(codecs.decode(s, \"hex\"))\n['PICKLE', 'STRING', [5, 3.141592653589793]]\n```\n\n@param `input` A serializable object\n\n@param `output` Pickle encoded content\n\n", "tags": ["platform"], "since": "1.0.7", "OPB64name": "AItFHJCAI3J" }, { "name": "->Q", "detail": "w<DOUBLE> x<DOUBLE> y<DOUBLE> z<DOUBLE> ->Q result<LONG>", "documentation": "The `->Q` function consumes on the stack 4 doubles (w, x, y, z, with z being on top) representing a [quaternion](https://en.wikipedia.org/wiki/Quaternion)\nand push back quaternion representation into a **LONG**.\n\nEach quaternion dimension is encoded with 16 bits.\n\n@param `w` W\n\n@param `x` X\n\n@param `y` Y\n\n@param `z` Z\n\n@param `result` Quaternion representation\n\n", "tags": ["quaternions"], "since": "1.0.0", "OPB64name": "AItG" }, { "name": "->RLP", "detail": "str<STRING> ->RLP encoded<BYTES>\nbytes<BYTES> ->RLP encoded<BYTES>\nlong<LONG> ->RLP encoded<BYTES>\nlist<LIST> ->RLP encoded<BYTES>", "documentation": "The `->RLP` function converts an individual `LONG`, `STRING` or `BYTES` element or a list of elements (including lists) into a byte array using the [Recursive Length Prefix](https://eth.wiki/fundamentals/rlp) encoding.\n\n@param `str` `STRING` to encode. It will first be converted to `BYTES` using the `UTF-8` character set.\n\n@param `bytes` Byte array to encode.\n\n@param `long` `LONG` value to encode.\n\n@param `list` `LIST` to encode.\n\n@param `encoded` Result of encoding.\n\n", "tags": ["conversion", "binary"], "since": "2.8.0", "OPB64name": "AItHI4." }, { "name": "->SET", "detail": "input<LIST> ->SET newset<SET>", "documentation": "The -`>SET` function converts a **LIST** on top of the stack into a **SET**.\n\nSETs are not viewable, null will be return if it remains on the stack.\n\nThe order in the SET is not guaranteed, see [`()`](/doc/91Z).\n\n\n@param `input` The input list\n\n@param `newset` The new set reference. SETs are not viewable, null remains on the stack.\n\n", "tags": ["sets"], "since": "1.0.0", "OPB64name": "AItIGKF" }, { "name": "->SSSS", "detail": "secret<BYTES> N<LONG> K<LONG> randomness<BOOLEAN> ->SSSS splits<LIST<BYTES>>", "documentation": "The `->SSSS` function splits a byte array into `N` shares so `K` of them can reconstruct the original byte array.\n\nThe splitting is done using a Shamir Secret Sharing Scheme as