Forum Discussion
Thanks its working!
Can you please explain this expression , actually how its working internally.
sl.range(6)
- Generates me a list with number of elements.
Inside the parameter is specified how many elements to have the list.
Ex. [0,1,2,3,4,5]
After that with the map()
function I iterate through that list.
And while iterating, for each element is generated a random number between 0 and 15.
Random number is generated with Math.random()
and Math.round()
functions.
-
Math.random()
- Generates a decimal number between 0 and 1. -
Math.random()*15
- Generated number is multiplied by the number of characters in the string. -
Math.round(Math.random()*15)
- Decimal number is rounded to the nearest whole number.
Ex.3.656
- will be rounded to4
.
Generated random number I use it as an index from which I get character from the string.
Ex. "0123456789ABCDEF"[4] = "3"
(returns the 4th index from the string).
Now if we look at the preview of this expression, result will be list of strings.
Ex. ["3", "8", "A", "1", "C", "D"]
At the end the list is joined with join()
function. This function is used for transforming list into string. Parameter inside join function (''
) means that it will join the elements together without nothing between the elements.
Result at the end will be this:
"38A1CD"
Hope this will help understand the expression 🙂
A true production setup would require four nodes: 2 Feed-Masters and 2 JCCs. There should also be a load-balancer for the Feed-Masters. The Ultra Tasks should also be configured to have at least two instances. The redundancy is required to satisfy the high-reliability goals of Ultra. For example, if one of the nodes fails, the other node can handle the load until the failed machine can be restored.
Both nodes cannot be hosted on the same VM, they must be separate.