Difference between join with and join on [duplicate] - symfony

This question already has answers here:
Symfony2 QueryBuilder join ON and WITH difference
(2 answers)
Closed 5 years ago.
I wondering about this line
->leftJoin(
'AppBundle\Entity\UserGroups',
'UserGroups',
\Doctrine\ORM\Query\Expr\Join::WITH,
'User.group_id = UserGroups.id'
);
This works fine, the result is okay.
But when I replace ::WITH with ::ON this causes an error:
Error: Expected Doctrine\ORM\Query\Lexer::T_WITH, got 'ON'
So what are difference between ::WITH and ::ON ?

Look here:
https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/Lexer.php
T_ON is not even a valid constant inside Doctrine's Lexer class, which is why you are seeing the error.

Related

What's the difference between using 'mean(Complete_measurements$`High Freq (Hz)`)' and 'mean(Complete_measurements[4])'? [duplicate]

This question already has answers here:
The difference between bracket [ ] and double bracket [[ ]] for accessing the elements of a list or dataframe
(11 answers)
Dynamically select data frame columns using $ and a character value
(10 answers)
Closed 4 months ago.
This post was edited and submitted for review 4 months ago and failed to reopen the post:
Original close reason(s) were not resolved
So I'm working through a multivariate analysis for a project and trying to familiarize myself with R as I do so, and I keep getting the error
Warning message:
In mean.default(Complete_measurements[4]) :
argument is not numeric or logical: returning NA
I'm not using 'mean.default' anywhere, but I have tracked the specific location to just my mean(complete_measurements[4])
I've noticed that when I instead use mean(Complete_measurements$High Freq (Hz)) it seems to work fine, but since I'm intending to use an array of data (ie columns 4-11), I was wondering if there was an easy solution to do so?
Thanks in advance!
So I've tried and gotten:
> mean(Complete_measurements$`High Freq (Hz)`)
[1] 6689.791
> mean(Complete_measurements[4])
[1] NA
Warning message:
In mean.default(Complete_measurements[4]) :
argument is not numeric or logical: returning NA
I expected to get the same result for both? So the 6689.791, but I'm not sure why I get the error instead
Edit: while I get an answer when using '''mean(Complete_measurements[[4]])''', it gives me a different one - any reason why?

Get current method name in .NET Core 6 [duplicate]

This question already has answers here:
Get current method name from async function?
(9 answers)
What is '<Invoke>d__40'?
(2 answers)
Closed 4 months ago.
I am looking to get the current executing method in .NET Core 6
When using
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName
the output is <MethodName>d__6
How to get only MethodName ?
What is d__6 ?
try this:
System.Reflection.MethodBase.GetCurrentMethod().Name;

SQLITE3 + execute Insert [duplicate]

This question already has answers here:
SQLite parameter substitution problem
(8 answers)
Closed 7 years ago.
Trying to execute insert an item coming from a list:`
item=u'Sunil Goyal'
c.execute('''INSERT INTO bpersons(person_name) VALUES (?)''',item)`
is simple enough, but it returns
Incorrect number of bindings supplied. The current statement uses 1, and there are 11 supplied.
Clearly instead of reading item as one element, it is reading characters. There is no problem with the earlier code which returns this list:
>>> if meta[7]:#bcoz list could be empty also
for item in meta[7]:
print item
Sunil Goyal
Rehan Yar Khan
Khan
Kae Capital
Ashish Shankar
Karthik Reddy
Feroze Azeez
len(meta[7])
7
Any idea where I am going wrong?
insert is looking for an iterable (documentation) and this succeeds because your unicode string is an iterable, but you should put it inside of a tuple or list to be handled properly by sqlite3.
c.execute('''INSERT INTO bpersons(person_name) VALUES (?)''',(item,))`

Delete with Inner Join [duplicate]

This question already has answers here:
Does SQLite support "delete from from"
(2 answers)
Closed 8 years ago.
I am performing this SQLite command:
DELETE FROM t1027 INNER JOIN translationsmain ON t1027.textid=translationsmain.textid WHERE translationsmain.osb=0
The column "textid" exists both in the table "t1027" and in "translationsmain".
The column "osb" only exists in "translationsmain".
I am getting a syntax error, but I am not sure why.
I am getting a syntax error, but I am not sure why.
Simply, because such syntax is not allowed by SQLite.
Use this syntax, instead:
DELETE FROM t1027 WHERE textid IN (SELECT textid FROM translationsmain WHERE osb = 0)

Trying to write PHP code to parse a simple XML response from an API, but I'm getting a PHP error. What am I doing wrong? [duplicate]

This question already has answers here:
SimpleXML Reading node with a hyphenated name
(2 answers)
Closed 9 years ago.
I have the following code:
$url = 'http://api.creativecommons.org/rest/1.5/license/standard/get'
.'?commercial=y&derivatives=y&jurisdiction=ca';
$response = simplexml_load_file($url);
echo $response->result->license-name;
Which uses this URL: http://api.creativecommons.org/rest/1.5/license/standard/get?commercial=y&derivatives=y&jurisdiction=ca
But the only output I get is:
PHP Parse error: parse error, expecting T_STRING' orT_VARIABLE' or '{'' or'$'' in /path/to/script.php on line 3
What am I doing wrong?
Special characters in name will not fetch you the value.
You need to use it like this:
echo $response->{'license-name'};

Resources