syntax – What does the option ‘Complexexpand’ do in the Collect command?

I’m trying to re-write a long chain of commands I’ve received in pdf from Mathematica language to Maxima. I have this command:

Collect(%, ε, ComplexExpand)

I know what the Collect command does. But what does the ComplexExpand option do here? Will it perform

Collect(ComplexExpand(%),ε)

or

ComplexExpand(Collect(%),ε)

or something else? I did not see the ComplexExpand option for Collect in the documentation. Thanks in advance.

8 – Syntax for using getValue to get value in an array

I created a form for a block plugin. I’m attempting to save the values to the form after submitting. However I’m having trouble saving the values if they are within an array.

For instance

public function blockForm($form, FormStateInterface $form_state){
    $form('plugins_string_text') = array(
      '#type' => 'text_format',
      '#title' => $this->t('Block contents'),
      '#format' => 'full_html',
      '#description' => $this->t('This text will appear in the block.'),
      '#default_value' => $this->configuration('plugins_string_text-submit'),
    );

    $form('header')('margin-top') = array(
        '#type' => 'textfield',
        '#title' => t('Margin Top (pixels)'),
        '#default_value' => $this->configuration('header')('margin-top-submit'),
        );
    $form('header')('margin-bottom') = array(
        '#type' => 'textfield',
        '#title' => t('Margin Bottom (pixels)'),
        '#default_value' => $this->configuration('header')('margin-bottom-submit'),
        );
    $form('header')('margin-left') = array(
        '#type' => 'textfield',
        '#title' => t('Margin Left (pixels)'),
        '#default_value' => $this->configuration('header')('margin-left-submit'),
        );
    $form('header')('margin-right') = array(
        '#type' => 'textfield',
        '#title' => t('Margin Right (pixels)'),
        '#default_value' => $this->configuration('header')('margin-right-submit'),
        );
}

    public function blockSubmit($form, FormStateInterface $form_state) {
        $this->configuration('plugins_string_text-submit')  = $form_state->getValue('plugins_string_text');
        $this->configuration('header')('margin-top-submit') = $form_state->getValue('header','margin-top');
        $this->configuration('header')('margin-bottom-submit') = $form_state->getValue('header','margin-bottom');
        $this->configuration('header')('margin-right-submit') = $form_state->getValue('header','margin-right');
        $this->configuration('header')('margin-left-submit') = $form_state->getValue('header','margin-left');
}

This is saved to the form properly

$this->configuration('plugins_string_text-submit')  = $form_state->getValue('plugins_string_text');

However each of the lines below display the entirety of the ‘header’ array instead of the individual margin values.

$this->configuration('header')('margin-top-submit') = $form_state->getValue('header','margin-top');
$this->configuration('header')('margin-bottom-submit') = $form_state->getValue('header','margin-bottom');
$this->configuration('header')('margin-right-submit') = $form_state->getValue('header','margin-right');
$this->configuration('header')('margin-left-submit') = $form_state->getValue('header','margin-left');

What is the proper way to use getValue to reach an element within an array. Or is there another function I should be using?

syntax – Powershell : Update Registry value for RDPFileContent by making change in server port to XXX from XXX

Requirement: to update registry value i.e. server port for one of the property : RDPFileContent using powershell.

Attempt Taken: Tried fetching entire value first of RDPFileContent using get-childitem method and redirected the content to text file and replaced only server port value using replace parameter. But, while setting it back using set-item property, we are not able to set back in proper format by extracting it from updated text file.

Please help us here .

Thanks in advance,

syntax error – Process finished with exit code -1073741819 (0xC0000005) – PYQTQ5

Estou tentando executar um código de um sistema criado pelo Pyqt5 e o mesmo me retorna este erro ‘Process finished with exit code -1073741819 (0xC0000005)’

Tentei executa lo pelo debug para tentar localizar o erro, e pelo debug o código funciona sem erro algum, do jeito que eu quero, o que pode ser?

Cannot perform SQL injection because of the weird postgresql syntax that is used

So I have a website which uses ManageEngine Service Plus and it has a SQL injection vulnerability:
https://www.exploit-db.com/exploits/35890

Here it says that with the help of following url we would be able to inject postgresql commands to get the complete control of the system:
/reports/CreateReportTable.jsp?site=0 AND
3133=(SELECT 3133 FROM PG_SLEEP(1))

Here I don’t understand the part “3133=(SELECT 3133 FROM PG_SLEEP(1))”. I know the db is Postgresql but when I try to find an appropriate injection command on PayloadsAllTheThings or other sites I cannot anything in that format.
Can you give me tips on how to dump table names or so since it doesn’t seem to execute any function other than pg_sleep().

windows 10 – With psubst version 3 what is the proper syntax when the path contains one or more blanks?

Obviously there are two separate issues: The syntax must be accepted by psubst version 3. Alas, just because that works doesn’t mean that the new virtual drive will actually work. Let’s assume that you have a directory named c:one blank
and you want to define virtual drive t: to be that directory. So what needs to
be added to

                   psubst t: c:one blank 

to make it work?

syntax – Polyadic infix operators

tl;dr

Can triadic (or greater adicity) infix operators be syntactically represented and incorporated into expressions in a general fashion?

If so, how?

And if so, why don’t existing programming languages allow custom triadic infix operators to be defined and employed?

The long read

We’re all familiar with basic dyadic infix operators, such as the addition operator + in the expression a + b.

In a functional style of syntax we would represent this as something like ADD(a, b).

In C and in C-influenced languages, there is often a triadic conditional operator in the style x ? y : z, meaning the same as ‘if x then y else z’.

Some languages also incorporate an ‘if’ function, in the style of if(x, y, z), with the first operand representing the condition, the second operand the value to be returned if the condition is true, and the third operand the value if the condition is false.

Computer scientist Tony Hoare also came up with a representation of the triadic conditional operator as y ⊲ x ⊳ z (or in case these Unicode arrows do not represent to the reader properly, the equivalent in ASCII: y <| x |> z).

The pair of infixed arrows here represent Hoare’s conditional operator syntactically, and serve to separate the operands from one another, in much the same way (but differing in the order of the operands) as the C-style representation.

From what I understand, in programming languages like C that have these triadic conditional operators, they are parsed somehow as special cases, and there is no facility to define custom triadic operators.

In SQL, we have join operators that are (nowadays, following the supersession of an older syntax) represented syntactically in the form of a Join b On a.Id = b.id.

This syntactical construct is not strictly treated as an expression in SQL (and there is additional syntactical ceremony around these constructs, the presence of which is mandatory for a valid SQL statement, but which I have elided here).

But I have come to understand such join syntax as basically that of a triadic operator, which accepts as operands firstly two tables, and as a third operand an expression which defines a condition that is evaluated for each combination of the rows from each table.

In the theory of relational algebra, these joins are indeed understood as operators, but syntactically they are represented in a form which requires complex mathematical-style typesetting. Typically, the join condition is provided in a smaller font, and as a subscript attached to the join operator symbol. The join operator symbol itself is infixed between two table operands, and appears (notwithstanding the presence of the attached subscript) to be a dyadic operator.

In my view, this mathematical style (besides requiring special facilities to typeset) produces a garbled appearance.

For this reason, SQL was designed so that the expression which represents the join condition falls third in sequence. That is, with the Join keyword falling between the two table operands, and the On keyword falling between the second operand (which is the second table) and the third operand (which is the join condition). This ‘On’ keyword is not an independent operator or syntactical element, but is associated with the prior presence of the ‘Join’ keyword.

And for this reason the join syntax in SQL appears, to me at least, to take on the form of being a triadic infix operator, in a similar way structurally as the various representations of the conditional operator in other contexts (and albeit infixing English words, as is a tenet of SQL, rather than infixing symbols).

In SQL, further joins with additional tables can continue be specified in order of evaluation, in the manner of a Join b On a.Id = b.Id Join c On b.Id = c.Id. The output of the first join, which is itself a table, forms the first operand for the second join.

In a language such as C#, a method which performs one such join could probably be represented in a functional style as Join(a, b, (a,b) => a.Id = b.Id). But a series of two or more such joins, within one expression, would entail a mess of syntax and brackets with this functional-style representation.

What I’m interested in is whether there is any systematic approach to the representation of triadic (or higher adicity) infix operators within expressions.

For example, does a system of parsing exist to differentiate a triadic (or greater adicity) operator, from merely a series of two (or more) dyadic operators?

Can the approach which exists to handle the triadic conditional operator, be made to work generically in expressions consisting of any kind of triadic operator (and successfully handle expressions containing mixtures of operators of differing adicities, and resolve ambiguities sensibly)?

Syntax error while generating images

I have this code to generate an image with a scale bar and a label:

tema=Import["https://i.ibb.co/M67YjjP/tema.png"];
scalea=Graphics[{White,Rectangle[{0,0},{125,15}],Text[Style["100 nm",16,"TR",White,Bold],{62,23}]},ImageSize->125];
scaleb=Graphics[{White,Rectangle[{0,0},{125,15}],Text[Style["100 nm",16,"TR",White,Bold],{62,23}]},ImageSize->125];
labela=Graphics[Text[Style["a]",30,"TR",White,Bold]]];
labelb=Graphics[Text[Style["b]",30,"TR",White,Bold]]];
fig1=Rasterize[Show[tema,Epilog->{Inset[scalea,Scaled[{0.8,0.1}]],Inset[labela,Scaled[{0.1,0.9}]]},ImagePadding->None]]

Which works and outputs this image:

enter image description here

However, when I try to generate multiple images like that, I get a Syntax error: incomplete expression, more output is needed. If I add this line to the previous code:

fig2=Rasterize[Show[tema,Epilog->{Inset[scaleb,Scaled[{0.8,0.1}]],Inset[labelb,Scaled[{0.1,0.9}]]},ImagePadding->None]]

No image is generated. What could be the source of this problem?

magento2.4.0 – Uncaught Error: Syntax error, unrecognized expression: ui/template/modal/modal-popup.html magento 2.4.0

Uncaught Error: Syntax error, unrecognized expression: ui/template/modal/modal-popup.html 2.4.0

custom.js

popupTpl: “ui/template/modal/modal-popup.html”,

jquery.js:1508 Uncaught Error: Syntax error, unrecognized expression: ui/template/modal/modal-popup.html
at Function.Sizzle.error (jquery.js:1508)
at Sizzle.tokenize (jquery.js:2165)
at Sizzle.select (jquery.js:2586)
at Function.Sizzle (jquery.js:909)
at Function.jQuery.find (jquery-migrate.js:290)
at jQuery.fn.init.find (jquery.js:2832)
at jQuery.fn.init.jQuery.fn.find (jquery-migrate.js:677)
at jQuery.fn.init (jquery.js:2955)
at new jQuery.fn.init (jquery-migrate.js:241)
at jQuery (jquery.js:80)

https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/widgets/widget_modal.html#modal_popupTpl

Was this an idiomatic and prudent way to extend R’s matrix multiplication syntax? Should I have used R’s object system?

After reading one too many Lisp books, I decided to try extending R’s syntax. My goal was to implement repeated matrix multiplication in a way such that I could write matrix%^%n to produce the result from multiplying matrix by itself n times (where n is a natural number). I produced the following working code that gives the expected outputs, but found it unsatisfactory.

`%^%`<-function(squareMat,exponent)
{
  stopifnot(is.matrix(squareMat),is.numeric(exponent),exponent%%1==0)
  out<-diag(nrow = nrow(squareMat))
  for(i in seq_len(exponent)){out<-squareMat%*%out}
  out
}
testMatrix<-matrix(c(0,10,20,30),2,2)
lapply(0:3,function(k) testMatrix%^%k)#tests

For the purposes of this question, I’m happy to ignore the contents of my for loop. I know that it’s not optimised. What I’m more interested in investigating is if this was a prudent way to extend R’s syntax. I have listed my objection to my code below. If they are valid, how can they be addressed?

  1. The method for checking if exponent is an integer is pathetic. I don’t think that doing better is possible, but I would dearly love to be proven wrong.
  2. My strongest objection is that I believe that this problem calls for an S3 or S4 solution, but I do not believe that one is possible. isS4(testMatrix) tells me that matrices are not S4 objects, ruling that out. S3 might be possible, but I’m unsure if this will make problem #1 even worse (because S3 is not very strict on types) or requiring risky hacking of the matrix type.
  3. Because of problem #1, stopifnot does not throw useful error messages.
  4. The job of throwing errors regarding the multiplication is delegated to %*%. I’m OK with that, but I don’t know if I should be.
  5. Again, ignoring the content of the for loop, was for actually the right thing to use? Is there something like an apply family function for “the index of my loop doesn’t actually matter, I just want to run this code seq_len(exponent) times”?