What exactly is the data type "array" in TypoScript - typo3

In the TypoScript Reference, the data type for some properties is defined as "array" or "array of ... with stdWrap" or something similar.
In the list of data types in the TSRef however, "array" is nowhere to be found.
I know, essentially it really is an array when converted to PHP, but what does data type array mean exactly in this context?

There are further arrays (like array of cObjects for subparts and marks in templates)
They all define another level of elements in your typoscript. The kind of array may give you a hint what index and what kind of values are expected.
Sometimes the index is ordered for evaluation (e.g. COA, layoutRootPaths), sometimes it does not matter (e.g. marks, subparts) or are evaluated in the order of the typoscript (e.g. includeJS). As you could have multiple kinds of array in PHP each can be evaluated in multiple ways.
The kind of values (in the documentation) depend on the further evaluation. Simple integer, strings, cObjects, ...
Not everywhere you are able to add stdWrap functions (so values evaluated in the core should have it).
As you already mentioned: typoscript is scanned and stored as multidimensional array.
Each part of (core-)code evaluates this array with an individual logic. So the interpretation of an array is done individually.
And until now there is no full consens about which kind of arrays are representative or typical to be an own type. An unification would probably need code changes, in core and in multiple extensions.
For optimization of the manuals you should open a forge ticket requesting an explanation in the manuals with the kind of arrays you found.

The docs are kind of confusing in that regard, because there are no "arrays" in TypoScript at all, because TypoScript isn't even a programming language.
TypoScript is just a configuration, like YAML or JSON and will be converted into an array itself by PHP. I think it should rather be called "a list of things" instead of "an array of things", but since arrays are kinda lists themselfes and developers, who are the main audience of the docs, should know what the docs are talking about when talking about "an array of things", it is kinda valid to leave it as is.

Related

What are the function-call/procedure-call pairs in GAP?

By function-call/procedure-call pairs, I mean pairs of functions that do the same thing, except one returns it's result whereas the other alters it's argument(s) to be the result. For example the pair List/Apply.
List(list, func) Returns the list resulting from applying the function func to every value of list.
Apply(list, func) Applies the function func to every value of a mutable list list, changing list.
I've become annoyed of writing my own functions to find that GAP already had a built in version I should be using, so it'd help to know these pairs. Like, does Filtered have a procedural counterpart I don't know about? Or do I need to write my own? If a function does have a counterpart will it necessarily be listed in the documentation for that function? The only other such pair that I can think of right now is Concatenation/Append. What are other such pairs of functions/procedures in GAP?
Although this may be of little help, as Alexander Hulpke explained in https://math.stackexchange.com/questions/3704518, "The general language convention is that verbs do something to an object, while nouns create a new object with the desired characteristics." GAP naming conventions are described in the GAP Reference Manual here.
So, a counterpart to Filtered would likely be called Filter - but there is no such function (and Filter has another meaning in GAP). We do try to mention counterparts in corresponding manual sections - if you find them missing, then please suggest improvements to the GAP documentation, preferably at the GAP repository on GitHub.

what exactly is the phytree object in matlab?

This question has bothered me for a while, so I post it here just in case someone else has the similar issue. After debugging the code to ask it print out the variables, I understand that the phytree object is a struct array with three fields, i.e., tree, dist and names. Here, tree is a matrix with the size the number of branches times 2. But because the data is large, I cannot quite figure out what exactly is the matrix tree. Can someone help? Thanks in advance.
The output of seqneighjoin is not a struct array with the fields tree dist and names, it's a phytree object that has some internal properties called tree, dist and names. Since you're already taking a look at the code with the debugger, take a look at the line right at the end of phytree.m - you'll see that it specifies that the output tr is an object of class phytree, not a struct.
I'm not sure if you have much background using object-oriented programming in MATLAB, but it's a bigger topic than I can discuss here - I'll just say that an "object" is something that has properties that store information in the same way that a struct has fields that store information; but an object also has methods that are functions stored as part of the object and that act on it. For the phytree object, these methods are functions such as prune for removing branches, getnewickstr for getting a Newick-formatted string, and so on.
You can find out more about MATLAB OO programming in the documentation. Unfortunately, there's a bit of an issue with that - in R2008a, MATLAB introduced a new form of OO, and all the current documentation is based on that style of OO. phytree is implemented using the old style of OO, so you may need to look at the doc for an old version of MATLAB to find out its syntax.
You shouldn't be trying to access the internal tree property directly. If you want to get it, use get(tr, 'Pointers'). It's an array listing which branches are connected to which other branches/leaves.

How to workout Arrays, objects and Arrays within object in crate?

I have done preliminary studies on Crate. Now i would like to work on Objects, Arrays and Arrays within Object using crate. It seems very basic document was given on
https://crate.io/docs/current/sql/ddl.html#object.
I need advanced examples using objects, arrays Arrays within objects. I need to accomplish this using my php-client which is on development.
i found a note saying
in the python client a python list can be used as an argument to the cursors execute method.
I want to know more on this. Especially I would like to do this on php.
You have to use the args field in the JSON payload to specify nested values. The value in args is just a plain JSON array, so it should be straight forward to send them with your php client.
Details on the HTTP endpoint of crate, which you probably already use via PHP, can be found here https://crate.io/docs/current/sql/rest.html . There is also an example for argument passing.
greetings, bernd

what does tag do in ASN.1 notation?

I have been reading ASN.1 specification, but I am not quite sure what exactly does tag do in this notation schema, for example:
ETYPE-INFO-ENTRY ::= SEQUENCE {
etype [0] Int32,
salt [1] OCTET STRING OPTIONAL
}
In this representation, what information did the tags "0" and "1" convey? I had thought that the tags may serve as a indicator of the data type of the field, but it seems not, the ASN.1 specification says that the tags mainly serves as a label, is it that simple? In that sense, I can assign arbitrary tag numbers to fields, is that right? Thank you.
Tags identify types. Technically, they define types, but it may not be helpful to think of them that way.
Consider having two optional fields of type INTEGER. If they were just encoded using the tag for INTEGER, you couldn't distinguish them. By putting unique tags on them, you can.
Tagging is somewhat complicated, and this isn't the best place to try to explain them. We have two books listed on our resources page which are helpful. If you Google for them, you can find some earlier(?) editions available on-line for free. They should help you get a better handle on tags.

POST/GET bindings in Racket

Is there a built-in way to get at POST/GET parameters in Racket? extract-binding and friends do what I want, but there's a dire note attached about potential security risks related to file uploads which concludes
Therefore, we recommend against their
use, but they are provided for
compatibility with old code.
The best I can figure is (and forgive me in advance)
(bytes->string/utf-8 (binding:form-value (bindings-assq (string->bytes/utf-8 "[field_name_here]") (request-bindings/raw req))))
but that seems unnecessarily complicated (and it seems like it would suffer from some of the same bugs documented in the Bindings section).
Is there a more-or-less standard, non-buggy way to get the value of a POST/GET-variable, given a field name and request? Or better yet, a way of getting back a collection of the POST/GET values as a list/hash/a-list? Barring either of those, is there a function that would do the same, but only for POST variables, ignoring GETs?
extract-binding is bad because it is case-insensitive, is very messy for inputs that return multiple times, doesn't have a way of dealing with file uploads, and automatically assumes everything is UTF-8, which isn't necessarily true. If you can accept those problems, feel free to use it.
The snippet you wrote works when the data is UTF-8 and when there is only one field return. You can define it is a function and avoid writing it many times.
In general, I recommend using formlets to deal with forms and their values.
Now your questions...
"Is there a more-or-less standard, non-buggy way to get the value of a POST/GET-variable, given a field name and request?"
What you have is the standard thing, although you wrongly assume that there is only one value. When there are multiple, you'll want to filter the bindings on the field name. Similarly, you don't need to turn the value into a string, you can leave it as bytes just fine.
"Or better yet, a way of getting back a collection of the POST/GET values as a list/hash/a-list?"
That's what request-bindings/raw does. It is a list of binding? objects. It doesn't make sense to turn it into a hash due to multiple value returns.
"Barring either of those, is there a function that would do the same, but only for POST variables, ignoring GETs?"
The Web server hides the difference between POSTs and GETs from you. You can inspect uri and raw post data to recover them, but you'd have to parse them yourself. I don't recommend it.
Jay