Questions tagged [syntax]

Syntax refers to the actual language elements and symbols themselves. Questions should be tagged as syntax when the question specifically and almost completely relates to syntax alone. This tag should be used with a specific language tag

Filter by
Sorted by
Tagged with
0 votes
1 answer
15 views

Python error when using /play command on Discord

this is the error I've recieved when I tried to use /play (/pusti on my lang) command on Discord in order to play a song from YT: 2023-12-01 21:25:11 ERROR discord.ext.commands.bot Ignoring ...
exibo's user avatar
  • 1
0 votes
0 answers
36 views

How do I sort a dictionary by value by all possible ways?

To sort a list in dictionary by value in python, I want to get to know about various method to sort dictionary by value. I tried the method called or known as "Using sorted() + join() + lambda&...
Surjeet Singh Gill's user avatar
-1 votes
2 answers
251 views

How to convert a string or char* input to a data type in C++

In C++ I'm looking for a way to write a function that accepts two inputs: char* typeName, int L based on the typeName variable I will declare an array, so if typeName is "int" I will declare ...
Qasdew's user avatar
  • 1
0 votes
1 answer
26 views

Plotting uncertainty incorrectly resulting a weird graph

I am trying to plot a model output and two confidence intervals but I am getting some weird graphs and I do not understand what I have done wrong. enter image description here My code : #plotting ...
Jack Poole's user avatar
-3 votes
1 answer
30 views

how to write code for pascal triangle in python? [closed]

How to write code or logic to print pascal triangle in python? I tried to write logic for pascal triangle, I expected output to be a pascal triangle but in my result it was showing syntax error? so, ...
Aniket kumar's user avatar
-1 votes
0 answers
19 views

What does the Round function do in SQL [closed]

I am using sql for data analysis and I can't understand what the Round function does. I tried by watching a video but I couldn't understand it. I want to know when and why is the Round function used ...
Naseem khan's user avatar
1 vote
1 answer
50 views

How can I pass a keyword argument to a function when the name contains a dot `.`?

Given a function that accepts "**kwargs", e.g., def f(**kwargs): print(kwargs) how can I pass a key-value pair if the key contains a dot/period (.)? The straightforward way results in ...
xebtl's user avatar
  • 480
0 votes
0 answers
6 views

How to combine Language Server and Code Formatter?

I am new to VS code and I am using it to code for a custom macro language. There is a marketplace extension for the language syntax highlighting however this does not auto format / auto align the code....
cj2023's user avatar
  • 1
0 votes
0 answers
21 views

syntax error : 1064 , when creating a stored procedure on XAMPP

platform: MySQL on XAMPP CREATE PROCEDURE percent(erp varchar(20)) BEGIN DECLARE percent DECIMAL(10,2); SELECT AVG(sub1 + sub2 + sub3) INTO percent FROM marksheet WHERE erp = erp; END; here i get the ...
Abhinav Gupta's user avatar
0 votes
0 answers
37 views

In R, how do I get a + symbol in the next line that is flush left? [closed]

In R, how do I get a + on the next line that is flush left? I am using a Mac. My textbook gives me commands like the example below that I can paste in. These work and a + symbol appears flush left. ...
Scott Thomson's user avatar
-1 votes
0 answers
24 views

Multiline "with" statement with comments [duplicate]

This doesn't work in Python: with open("foo.txt", "r") as f, # input file open("bar.txt", "r") as g, # another file open("baz.txt&...
Basj's user avatar
  • 42.4k
-4 votes
3 answers
82 views

does the variable naming in python does not support `-` in between the variable names [closed]

i am creating a dictionary is python3 and getting syntax error while initializing the dictionary to a variable named movie-rating movie-rating = {"harry potter":10,"stranger things"...
mohammad ali hanfi's user avatar
0 votes
0 answers
8 views

JavaScript Syntax Uses Benefits

JavaScript Code Syntax Detail information about JavaScript How to use JavaScript when to use this what type of language is this? how JavaScript different from html and CSS what are its applications ...
Tanu's user avatar
  • 1
0 votes
1 answer
54 views

Beginning bash writer struggles with if test [duplicate]

I have a rather simple bash script which is: #!/bin/bash -xe source /reTech/REB3bastionscripts/setup/setenv.sh echo "##### Begin check/create reportuser #########################################...
Wolfgang's user avatar
  • 195
3 votes
1 answer
34 views

Import a custom validation function for use in the arguments block

I have a function file my_function.m that uses function argument validation: function b = my_function(a) arguments a (1, 1) double {mustBeReal} end b = a + 1; end I have written a ...
chesnutcase's user avatar
1 vote
1 answer
28 views

MySQL Logical ALL

I'm trying to get a Logical ALL function working, but can't figure out the syntax. I already have a boolean column in my data, and I'm trying to aggregate by some other column using a Logical ALL. If ...
Eoin Horgan's user avatar
0 votes
0 answers
18 views

What language uses `and` and `or` keywords to mean "do this thing without affecting the result"?

I remember encountering a language that has && and || for boolean logic, but also and and or keywords that have a special purpose. Something like a = b and print "correct" would set ...
Sod Almighty's user avatar
  • 1,806
-3 votes
1 answer
110 views

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax. line 1 [closed]

I just finished installing MySQL 8.0.35 and Python 3.12.0. I added the path to my environment variables. But in my command prompt, I keep getting this error message. Welcome to the MySQL monitor. ...
Leah Oramas's user avatar
-2 votes
0 answers
46 views

Need help understanding Go syntax with curly brace and equal-sign use in map declarations [duplicate]

I'm learning Go, still very beginner, and I'm having trouble grokking the style/intent/grammar of variable declaration. Specifically, the code example below has confused me about when to use curly-...
StoneThrow's user avatar
  • 5,416
1 vote
2 answers
62 views

What is the Powershell equivalent of export PATH=$PATH:$HOME/dotnet

Couldn't find powershell equivalent for the below commands in the Dotnet SDK installation page. I need to add these lines to the Powershell Profile file C:\Program Files\PowerShell\7\profile.ps1 ...
blogs4t's user avatar
  • 2,399
1 vote
1 answer
43 views

Combine interfaces without defining a new one

In go can you combine interface inline with a function signature or is that not possible and the only option is to create a third interface that combines the smaller ones? // _Interfaces_ are named ...
ControlAltDelete's user avatar
0 votes
1 answer
53 views

Syntax interpretation for pwrss package in R (power analysis on proportions data)

I'm having a hard time translating my research question into the correct syntax as the documentation for the pwrss package seems vague. My goal is to calculate the power to detect both a hypothetical ...
Nate's user avatar
  • 413
0 votes
0 answers
23 views

MySQL query with reserved keyword and multiple select in MySQL 8.0 [duplicate]

I have no clue which one is incorrect with my query: SELECT rank FROM ( SELECT @rn := @rn +1 AS rank, t1.* FROM ( SELECT * FROM playdata WHERE game_id = ...
wdyz's user avatar
  • 195
0 votes
0 answers
7 views

SPSS syntax style for correlation matrix

In the correlation matrix, for each variable, there are 3 rows; correlation value (r) significance value number of cases (n) I use the style function when producing the matrix to colour the ...
dronnos's user avatar
  • 11
0 votes
1 answer
37 views

magical typo corrector in postgres?

I have some trouble understanding the PostgreSQL documentation. Apparently, the example is text searching for words that are similar(?) to 'caterpiler'. Example is taken from documentation 41.3. ...
okzoomer's user avatar
  • 324
1 vote
1 answer
50 views

Vimscript syntax with use of registry [duplicate]

I am trying to copy in Vim that does not have clipboard support (xclip will be used, do not suggest to enable clipboard support somehow, please). I am just, lost with the syntax, adding in and ...
Ella H's user avatar
  • 11
1 vote
1 answer
49 views

Logical operators in C# used as words 'is' and 'and' [duplicate]

In the code base of the project that I'm working on I saw a syntax for equality checks and for a range check between enums like that: public enum DaysOfWeek { Monday, Tuesday, Wednesday, ...
SimeonYordanov's user avatar
-1 votes
0 answers
30 views

Calculate number of bits inside entity declaration in VHDL

I am creating a multiplexer entity that has a generic number of n-bit inputs, as part of a larger project. For that, I have a generic value specifying how many inputs the multiplexer should have. How ...
rubemnobre's user avatar
0 votes
1 answer
26 views

Combining AND/OR statements in one python line

I am writing some code in python now I run into a problem with the following IF statement: if Row1==['X', 'X', 'X'] or Row2==['X', 'X', 'X'] or Row3==['X', 'X', 'X'] or ((Row1[0] and Row2[0] and ...
Schieper's user avatar
0 votes
2 answers
69 views

I need to add a whole list of people to an Active Directory Group

I know how to add a single member: Add-ADGroupMember -Identity "Adobe-Acrobat Standard DC" -Members Lgonzalez I want to add multiple members in a single operation. I know how to do it by ...
Cristian Morales's user avatar
0 votes
1 answer
40 views

macro error: A character operand was found in %IF condition

I am getting the "A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: &no. = 4" error on the following code: %...
Aura's user avatar
  • 51
0 votes
0 answers
27 views

Syntax template for SAS partitioning of variance

For class I’m asked to see analyze the variance individually- with the presence of other variables AND WITHOUT the presence of variables. What is the code to partition variance (I know I will input my ...
Ava Wolski's user avatar
0 votes
3 answers
47 views

Understanding Smalltalk Method Invocation with Multiple Colons

I'm currently learning Smalltalk, and I've encountered a behavior that I find puzzling regarding method invocation with multiple colons. I understand that colons play a crucial role in specifying ...
Ofir's user avatar
  • 100
-2 votes
1 answer
27 views

C++ Vector Declaration Syntax

Confused why vector declaration syntax is different than any other data structure. For example an Array. vector<int> myvector Whereas an array can be declared as such int arr[] = {1, 2}
Harry's user avatar
  • 281
0 votes
1 answer
21 views

Syntax error with PHP script from Essential Grid that shows "Sold out" badges in WooCommerce

I am trying to put into my WooCommerce e-shop badges for products that are sold out. Plugins are available, but I am using the Essential Grid plugin to display products (so classic plugins are off the ...
Nikola Styrcikova's user avatar
3 votes
1 answer
118 views

Meaning of the { } -> "operator" in C++

My activities in C++ have been dormant for a while, so maybe my question isn't appropriate. I have seen in the definition of concepts a 'strange' syntax like e.g.: {x + 1} -> std::same_as<int>...
user2961818's user avatar
1 vote
2 answers
91 views

Convert .json to .csv

jq version jq-1.6 on Ubuntu 22.04.2 LTE Looking to convert large .json file to .csv json example: {"_id":{"$oid":"5200a366e36f237975000783"},"derived_form":{&...
faszikam's user avatar
0 votes
0 answers
37 views

why java does not report missing return error when return is only available in if-block? [duplicate]

This is a dup question, already answered in Why do I not need to provide a return value after an endless loop? [duplicate] I wonder why the following codes are OK. (From Leetcode #1 two sum). I think ...
wushuzh's user avatar
-1 votes
1 answer
43 views

MySQL joins and COUNT(*) or MAX() from another table [duplicate]

I have the following syntax returning the expected results: SELECT material.period AS "Period", material.style AS "Style", material.artist AS "Artist", material.title ...
shdawson's user avatar
-1 votes
0 answers
42 views

Vague "RuntimeError: near "exists": syntax error" message when I execute a SQLite query

[SOLVED: see first comment] I have this table in my (SQLite) database: CREATE TABLE IF NOT EXISTS 'item_existences'( 'id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 'address_id' TEXT NOT NULL, '...
kimforestleaf's user avatar
0 votes
1 answer
28 views

2 tables in one gallery but view different titled columns

Morning all, I am creating an app from 2 SPL. The fist list is an action item tracker, and the second list contains all the updates for those items. (this is to keep all historic updates and not loose ...
Kat Lambourne's user avatar
0 votes
1 answer
50 views

Understanding Arrow Function Behavior with Conditional Operations in JavaScript

I'm learning arrow functions in JavaScript and attempting to conditionally set the value of show to false based on a certain value. While using the '&&' operator for this purpose, I ...
karthiK's user avatar
  • 17
0 votes
1 answer
45 views

I don't know how to format my FROM statement to avoid syntax error string literal

I don't know why SQL isn't recognizing the table names in the FROM statements. It returns a syntax error saying expected string literal "peak-bit-402819.warehouse_orders.Orders" at [7:10] I ...
Michael Turner's user avatar
-2 votes
1 answer
25 views

why does it say 'comma is not valid at this position' (position indicated below) [closed]

the error warning is shown on the third line 'title_id' CREATE TABLE books( book_id INT PRIMARY KEY, title_id, #it gives the error warning here. publisher_id, author_id, book_type VARCHAR (50), #aka ...
frank m's user avatar
0 votes
1 answer
35 views

AMPL Syntax Error - N is already defined, but i didnt define it

Here is the .dat code: # ---------- Sets ---------- set N := 1 2 3 4 5 6 7 8 9 10; set L := 1 2 3; set N_l[1] := 1 7 8; set N_l[2] := 2 4 5 6; set N_l[3] := 3 9 10; # ---------- Parameters ---------- ...
SupBrudi's user avatar
1 vote
2 answers
91 views

unusual C# syntax

I have some C# code which I don't understand: CliRootCommand _outerCommand = new CliRootCommand { new CliCommand("inner") { new ...
megaman's user avatar
  • 1,065
0 votes
0 answers
27 views

SwiftUI syntax highlighter autobracket undeletable

I have a syntax highlighting App that usually works fine but the auto brackets closing part doesn’t work. When I type ( it add ) but I can’t delete that, however when I move the cursor I somehow can ...
Karl Ehrlich's user avatar
1 vote
1 answer
30 views

SwiftUI value not getting updated

I have a SwiftUI Texteditor and whenever I press the update button the color should be applied to the text however it just gets reseted to initialValue. Can anyone help me? import SwiftUI class ...
Karl Ehrlich's user avatar
0 votes
1 answer
32 views

Syntax error regarding line 15 characters 27-34 in an OCaml tree search function

I wrote the function below to look through a tree and return a list in increasing order that contains all the indexes/subscripts of even elements in the tree. However I am getting a syntax error at ...
user16275866's user avatar
0 votes
1 answer
71 views

What C# compiler am I running and what is the latest version of C# syntax it supports?

I am overhauling a legacy solution that contains several projects, in their csproj files some have <LangVersion>default</LangVersion> and others have a version specified such as <...
BLoB's user avatar
  • 9,566

1
2 3 4 5
431