Questions tagged [syntax-error]
A syntax error occurs when a program does not follow the syntactical rules of the programming language.
9,528
questions
-5
votes
1
answer
49
views
why doesn't k += 1 work in a one-line loop?
I would like to write such a loop instead of the lower one, but it throws an error
[k += 1 for g in new if g % 2 == 0]
R = bin(39)[2:]
k = 0
new = []
lst1 = [i for i, char in enumerate(R) if char == '...
-3
votes
0
answers
64
views
SyntaxError: f-string: unterminated string [duplicate]
I am a newbie in Python and have no idea how to tackle this problem: every time I start running my code, it comes to a hold on the 2d line:
def ask_question(question, options):
# ask user for answer ...
0
votes
0
answers
20
views
estimating eblupfh model: Error in median.default(vardir) : need numeric data
When I am running syntax error masseage is shown "Error in median.default(vardir) : need numeric data"
Syntax:
library(sae) eblupFH <- eblupFH(formula = income ~ urbanC + RuralC + ...
-7
votes
1
answer
57
views
WHAT İS "error: expected '(' after 'if' if else(y>z)" THİS ERROR [closed]
I'm new at the software and I took this error in visual studio code.
#include<stdio.h>
int main()
{
float x,y,z;
printf("1. sayiyi giriniz");
scanf("%f",&x);
...
0
votes
0
answers
14
views
How to read Syntax of Error Log in Google Cloud Platform?
I have the following error log:
2023/11/28 15:37:26 [error] 106#106: *44 connect() failed (111: Connection refused) while
connecting to upstream, client: XXX.XXX.XXX.XXX, server: DOMAIN.com, request: ...
1
vote
1
answer
47
views
Why do parentheses as a python argument cause a syntax error? [duplicate]
When following a python2 tutorial, it often defines functions like this:
def scale(self, (centre_x, centre_y), scale):
which throws a SyntaxError in python3, highlighting the parenthesis in front of &...
-3
votes
0
answers
20
views
Need some help Unexpected token SyntaxError [closed]
This is my index.ejs and im getting SyntaxError: Unexpected token 'if' in /Users/mertbsr/Desktop/coddo/RecipeBlog-MongoDB-Node.js/views/index.ejs while compiling ejs
<!-- Categories Start -->
&...
0
votes
1
answer
21
views
Why is my SELECT Portion of my Syntax Showing Up as an Unrecognized Name Error on Big Query?
I've been practicing the big query exercises provided by Coursera. For this specific exercise, I wanted to collect tree sizes from the tree size databases that big query provided to me.
My SELECT ...
0
votes
1
answer
28
views
getting error - Cannot read properties of undefined (reading '1') when iam trying to access my chat array of objects
import { Box, Button, Stack, Text, useToast } from "@chakra-ui/react";
import React, { useEffect, useState } from "react";
import { ChatState } from "../context/ChatProvider&...
0
votes
0
answers
12
views
How to combine TODATE and REGEXP_REPLACE in Looker?
I want to retrieve the front value of the 'rentang' column for my 'start date' column by creating a field in Looker.
The value of my rentang column is "Oct 23, 2023 - Oct 27, 2023" and I ...
-5
votes
0
answers
20
views
Issue with Python Requests Module and SSL/TLS [duplicate]
I am currently working on a Python project that involves making HTTP requests using the requests module. However, I am facing an issue related to SSL/TLS when trying to connect to a specific API. Here ...
0
votes
0
answers
27
views
How to fix this variable undefined error in pi value when math.h is used? [duplicate]
#include<stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
void Multiply2Nos (float x, float y) {
float result = x * y;
printf("%.3f X %.3f = %.2f\n",x,y,result);
}
...
-1
votes
1
answer
35
views
Is it correct command to create foreign key with index creation also? I got ORA-01735: invalid ALTER TABLE option [duplicate]
Is it correct or not?
alter table test
add constraint test_fk foreign key (prim_id)
references prim (prim_id)
using index
(create index i_test_prim_fk
on test(prim_id) tablespace index01)
on delete ...
-2
votes
0
answers
52
views
/usr/bin/bash: 5: find:: not found [closed]
torbrowser-launcher
Tor Browser Launcher
By Micah Lee, licensed under MIT
version 0.3.6
https://github.com/micahflee/torbrowser-launcher
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/...
0
votes
0
answers
10
views
Can't create sbt addCommandAlias to skip tests and just do clean assembly
I am working on a old sbt 0.13.12 project and want to create an alias for the command:
$sbt "set test in Test := {}" clean assembly
I have tried the following below, which all fail with ...
-2
votes
0
answers
26
views
How to solve firebase errors syntax error export and index
`<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Documento</title>
</head>
<body>
<form action=...
-1
votes
0
answers
25
views
Uncaught SyntaxError Unexpected end of input [closed]
i have this error in my web site :
VM554:2 Uncaught SyntaxError: Unexpected end of input
at t.activateScript (rocket-loader.min.js:1:11855)
at rocket-loader.min.js:1:11052
at t.run (rocket-...
0
votes
0
answers
12
views
Why my code is running correctly in IDLE, but not in hackerearth?
I tried to solve my first problem in hackerearth.com, i wrote my code in python 3.10. My program ran perfectly in IDLE, but the same program is giving a wrong output in hackerearth.com. Someone please ...
0
votes
1
answer
24
views
SQL: Error using charindex when trying to remove all characters after second dot
I have some data that looks like "5823.9.8", these are not dates but amounts of value. What I want to do is to remove the last "." and everything coming after the last dot. I ...
0
votes
0
answers
40
views
How do I fix this PICO-8 error? ')' expected near '='
So I started working with the PICO-8 web version this week, and I wanted to make a simple dungeon crawling game. I started working on the code and got the player sprite moving left and right. The ...
0
votes
2
answers
65
views
Cannot create new python file in VSCode called "calculator" Terminal when putting: "vim calculator.py [closed]
When I write in my terminal: vim calculator.py
It gives me the following error:
>>> vim calculator.py
File "<stdin>", line 1
vim calculator.py
^^^^^^^^^^
...
-1
votes
0
answers
22
views
Snort3 can't find output.alert_syslog
I've been changing codes for my "alert_syslog" for my snort3 output currently my code is
code. and got an error of can't find output.alert_syslog also changed permission of my snort so it ...
0
votes
1
answer
40
views
Why does this code give me a syntax error?
Why does this code give me a syntax error in idle?
if I use python online, which was correct.
I was expecting an output like the second photo.
What is the problem and how can I fix it?
0
votes
2
answers
30
views
How can I fix this File Error in my Program
I found this error while coding:
FileNotFoundError: [Errno 2] No such file or directory: 'us_baby_names'
please how can I fix this?
Us_baby_names is the name of my dataset file.
I have tried moving ...
0
votes
0
answers
32
views
Smarty Compiler: Syntax error in config file
ERROR
Uncaught --> Smarty Compiler: Syntax error in config file 'example.conf' on line 1 '# Column names of example' - Unexpected "# Column names of example", expected one of: NEWLINE &...
0
votes
1
answer
35
views
List indices must be integers or slices, not str; - DIctionary error in text based game for class [closed]
In the code, the player has a dictionary set to them with weapon details in them.
weapons = {
"sword" : {
"damagelow" : 3,
"damagehigh"...
0
votes
0
answers
14
views
I have a warnings and errors with adding Countdown Date in my app. Can someone help me?
After using Countdown in my project to set the time on the menu, I got errors and warnings called: Warning: Text content did not match. Server: "42" Client: "40", Warning: An error ...
0
votes
0
answers
31
views
Module not found: Mysql.connector
I am working on connectivity for a project, but importing mysql.connector is showing a 'ModuleNotFoundError: No module named 'mysql'' error. This isn't an issue with the code, either, since I have ...
0
votes
0
answers
38
views
Receiving syntax error in python shell, code works in python command prompt
I am receiving a syntax error in python IDLE shell 3.12.0, the "f" in "for" is highlighted red and it says SyntaxError: invalid syntax.
The code works in python command prompt, why ...
-1
votes
0
answers
26
views
ERROR: CREATE DATABASE cannot run inside a transaction block [duplicate]
-- Database: my_bag
-- DROP DATABASE IF EXISTS my_bag;
CREATE DATABASE my_bag
WITH
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'English_United States.1256'
LC_CTYPE = '...
0
votes
0
answers
56
views
Scala3 doesn't display type mismatch or format errors in Intellij
I'm using Scala 3.3.1 and Intellij isn't giving me helpful build error outputs and no error highlighting.
For example, if my project uses any 3.x Scala SDK, and I have the following incorrect code, it ...
-1
votes
0
answers
18
views
How to find element with XPATH?
I run the code:
botao=navegador.find_element(by=By.XPATH,value="//*[@id="q-app"]/div/div/div[1]/div[3]/div[5]/div[3]/div")
And returns me this syntaxerror:
SyntaxError: invalid ...
1
vote
1
answer
94
views
ACR task for cleanup avoiding specific tags giving syntax error
I'm trying to create ACR tasks that would run acr purge command to cleanup of ACR registry.
Here is a command for ACR cleanup of 3 repositories, except those with the tag latest :
az acr run --cmd '...
0
votes
2
answers
38
views
Postgres Syntax error caused by dash ind CLI command
I have a script with this command
/usr/bin/psql postgres -h localhost -U postgres -c "GRANT CONNECT ON DATABASE "famdb-develop" TO fullwood;"
When I ran it, I got this error:
...
0
votes
1
answer
31
views
Why is wont my button pressed functions be declared to my attached interrupts?
I am making a reaction game for my school project using Arduino and I want to use attach interrupt to register my button presses but the functions I have made won't be declared in the attach interrupt ...
0
votes
0
answers
17
views
Ruby on Rails : uninitialized constant (NameError)
I am completely new to Ruby on Rails and I have to migrate an application from Ruby 1.9.2 and Rails 3.0.3 to Ruby 3.0.0 and Rails 7.1.2.
I copied my old application structure to a new directory of a ...
-1
votes
1
answer
66
views
Why my C# syntax doesnt register in vscode? [closed]
so i when i use vs code for c# the syntax wont work example:
'
using System;
'
it wont do anything if tried to run it it wont work,
i alredy tried to reinstall vs code
and still not working, the ...
0
votes
0
answers
21
views
Execution failed for task ':app:mergeDexRelease
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDexRelease'.
A failure occurred while executing com.android.build.gradle.internal.tasks....
-1
votes
1
answer
23
views
'Invalid operands "Array" and "int" for "*" operator' in Godot
I am new in Godot and I'm getting this error when I made this array:
var RL = [' '] + [atlas_coord_0[5]] * 5 + [atlas_coord_0[3]] * 5 + [atlas_coord_0[1]] * 10 * 5 + [main_block] * 25 * 5 + [...
0
votes
1
answer
45
views
Trying to solve a Coursera problem and keep getting syntax error [duplicate]
I am trying to complete this query in Bigquery but continue to get syntax error. What am I doing wrong??? I have looked at others solutions and I can't locate why I am unable to get the query to run.
...
0
votes
0
answers
39
views
Python flight price tracker keeps looping through months screen
I am building a flight price tracker in Python using Selenium but I am having some problems with code looping thorugh the months. It keeps pressing the next arrow but it does not select the dates I ...
2
votes
1
answer
102
views
ignoring return value of function declared with 'warn_unused_result' attribute
I'm copying a script, and it seems to be not having any syntax error.
But every time I compile it, error occurs from the scanf.
Why does this occur? and how can I fix this script?
my coding ...
-1
votes
0
answers
93
views
Why I get an error in VS Code "Code Runner" but it is working properly in the browser?
I have two JS files and when I run the main JS file in Code Runner in VS Code, I get an error, but it works fine in browser, why does that happen?
I used type="module" in the HTML script tag:...
0
votes
3
answers
61
views
Postgres insert data into composite type [duplicate]
I am working in Postgres. I have the below composite type
CREATE TYPE negotiation.diff_type AS
(
operation int,
content text
);
This is my table
CREATE temp TABLE temp_input
(
...
-1
votes
0
answers
36
views
How to solve missing values with true values
I want to solve the missing value problem in the data by entering the actual value. I have a Suburb column and a CouncilArea column. The Suburb column, there are no missing values, while in the ...
0
votes
0
answers
25
views
While performing clustering with mutualcluster using R I have come across an error
library(hybridCluster)
mutual.cluster <-mutualCluster(jarakeuclid, method="average", plot=T)
Output:
Error in if (class(dmat) == "dist") dmat <- as.matrix(dmat) :
the ...
0
votes
1
answer
61
views
I get 'canvas object has no attribute get_tk_widget' error in the tkinter
When I run the following codes in the thinkter library, I get an attribute error from get_tk_widget().I get 'canvas object has no attribute get_tk_widget' error. What can I write instead of this code?
...
-2
votes
1
answer
57
views
(beginner) angular binding issues
i've started really fresh just with coding.
and i find myself stuck on probably something verry simple.
im doing assignments from out a book
it litterly tells me what to do, and it doesnt work.
(...
0
votes
1
answer
28
views
Syntax Error in Server Response in Typo3 Backend
I just stumbled accross a problem when I wanted to analyze the database structure in my Typo3 Install Tool. It won't stop loading. When I took a look in the browser developer tools I found an error ...
0
votes
1
answer
29
views
"Return of a Function() in PHP" skip syntex error in filter_var()
private function getURL(){
$url = isset($_GET['url']) && $_GET['url'] != "" ? $_GET['url'] : "home";
return explode("/", filter_var(trim($url,"/"...