Syntax Questions
Ad
Function pointer cast as void without being called
While perusing some stm32 middleware code, i came across this very odd line and can't parse it. it's basically,
difference between ...this.state and this.state
In my react application i am passing parent's state to child as a prop like so: <child parentsstate={...this.state} />
DataTables how to call data.json properly
My data for a datatable is currently located at the bottom of my app.js and looks something like this: var data = {
What does this anonymous-like C block mean?
I saw similar code when reading a reference, and i tried this piece of code which can compile and run: #include <stdio.h>
How to transpile python Compare ast nodes to c?
Let's start by considering python3.8.5's grammar, in
Parse error: syntax error, unexpected $end in myfile on line 1
Here's my code: <?php if(empty($_post['id'])) { echo '<form method="post"><input type="text"
new MyFunction() vs. new(MyFunction)
I'm looking through the vows documentation and in several places it uses the
javac.exe AST programmatic access example
Is it possible to access the abstract syntax tree(ast) inside the javac.exe programmatically? could you provide an example?
Finding Uploads in Parameters on Submit in Rails
I'm trying to figure out which of these parameters contains an uploaded file. this code works params[:upload].each do |
Displaying code in blog posts
What libraries and/or packages have you used to create blog posts with code blocks? having a javascript library that would support line numbers
Ad
What is the error show underline in this Python code
I'm just a beginner in python. do you know why it's underline here?
Sources for learning about Scheme Macros: define-syntax and syntax-rules
I've read jrm's syntax-rules primer for
Getting SyntaxError: Name argument is not a valid custom element name
I am trying to do unit testing of my react app using enzyme with jest but getting this error ` fail
Postgres syntax error in IF statement with NOT EXIST statement
I want to use if statement in insertion. insert into <table_name>(<columns>) values (if not exists
PL/SQL ERROR cannot identify what the error is, PSL-00103
I was asked to write a simple procedure, that inserts a new row into a table under certaing condition. the database: table users - user_id ....
SyntaxError: Unexpected token 'const'
How can i solve my error in line 16 witch is syntax error can any one help me to fix it this is 'command handler' for discord js
Laravel syntax error in trying to load simple view: unexpected '=>' (T_DOUBLE_ARROW), expecting ']'
Just starting out with laravel. i am simply trying to pass a variable into a data array and load the view, but come up with the following syntax
Fail on that syntax .liquid (learning stage)
On my way to learn .liquid, i can't found issue on that syntax: {{ 'visa.svg' | asset_img_url | image_url: width: 36, height: 36 |
Creating a backend typescript module in react-typescript project
What i want to happen i'm working on a react project which i created using npx create-react-app my-app --typescript i
Syntax error checking in a Laravel controller
I have a syntax error in this code, but i can't find it. i need to use the laravel framework. public function create()
What would the best way to clean these if statements up?
I am working with a very simple if statement tree and want to write the code as dry as possible, i believe i am implementing the
Ad
Do I need to install babel to be able to write ES6 code in my react-app?
I created a react app and started trying to connect it to a server i have prepared using mongodb. whenever i check my localhost to see the react
What does the @ ('at sign') sign mean in dart?
What does the @(at sign) mean in dart? @immutable @jsonserializable(createtojson: false) class classa { @jsonkey(name:
Invalid character in identifier when using Python bitwise shift
I'm trying to implement a tausworthe random number generator in python for use in a simulation comparison with some vhdl fpga code.
Getting this error "syntax error, unexpected 'echo' (T_ECHO), expecting ';' " in Laravel while creating simple controller
Hey i just start to learn laravel. i have created controller successfully with php artisan make:controller youtube command. but the thing is when
Infinity, NaN and undefined: an unreserved keyword?
The mdn documentation states: reserved words actually only apply to identifiers (vs. identifiernames) . as described in
Javascript react Uncaught SyntaxError: Unexpected token '<' or Syntax error
I am starting with react and i am doing an exercice from an edx-class (not for certification but for fun). the code is supposed to load buttons
Syntax highlighting editor with PyQt5
I'm currently working on an pyqt5 based application i could use an (embedded) editor for which provides some syntax highlighting for yaml (and
Function parameter with a dot gives SyntaxError
I am trying to run a python script from a command line and this is my script: import sys def printsomething(sys.argv): text =
DATE_ADD Function
A glitch in code on my website caused the start date and end date in an sql table to be set to the same day for my online member directory. i
Why do i keep getting error in the given python code?
I keep getting a syntax error in line 12 even afer removing the elif block. if __name__ == '__main__': n = int(input())
Ad
Problem when use zebrautility on flutter from pub.dev
I recently add zebrautility: ^0.0.38 from
Declaring expected variable type cause error: type '(Map<String, dynamic>) => University' is not a subtype of type '(dynamic) => dynamic' of 'f'
I am using this logic to convert json data to a custom university model. import 'dart:convert'; class
How to use "multer" module in Node.Js apps
I am watching a node.js tutorial, but in the following code i can't understand where the file and it's originalname
How to put two conditions in the Onpressed FlatButton?
I tried to put two conditions with the values of an email and a password in order to activate my button only if the two conditions are validated
What is the difference between these two kind of requiring in Javascript?
In a tutorial i saw a code like this: var session = require('express-session'); var filestore =
react-redux, change object key/value with parameters from two input fields with one actions
I'm trying to change input values in the object with one action. so the action gets key("title" and "content") value as a parameter from each
Invalid Syntax on variables in python
May i know why there be a invalid syntax on my f variable on the first elif loop? def bsd(): if price_of_properties <= 180000:
SyntaxError in Python decorators
Why does the following python code snippet: def f(): def g(): def h(x): pass return h return g
Ampersand "&" syntax error running any Python script in VSCode?
In vscode, i typically run a python script using the python extension and right clicking a .py script and selecting "run python file in terminal".
Difference between setting array equal to another one, or using three dots
When using hooks in react and using an array as a state, i found that updating only one element of that state array with the setter function did
How to efficiently syntax
I wrote some code. i realized when i wanted to expand the code below, it would make the syntax wasteful. how to make it efficient?
Ad
What does `class Popup extends DivOverlay<LeafletElement, Props>` syntax mean in javascript?
I am working a lot with react-leaflet, and i see that part of the way it is constructed is using syntax like this:
Python `+=` operator and single line for loop
Weights is a numpy array of a certain number of values, which is being multiplied by x^i. without summing the elements of
how to use IF EXISTS statement in node mysql?
I am using nodejs mysql module and i want to check account existence before actually querying the password. here is the sql:
node.js/JavaScript syntax - add extra parameter to passed parameters
I'm building a rest api using node.js/express. i have some middleware applied to certain routes. i have a javascript syntax error which i
Syntax Highlighting/Coloring for Python in Visual Studio 2019 is not working
I cannot get the syntax highlighting to properly work in python with visual studio 2019 community edition. i get very basic syntax
if i use jQuery syntax : $("<img src='img.jpg'>") , will the image actually be downloaded to the client?
If i use jquery syntax : $("<img src='img.jpg'>") , will the image actually be downloaded to the client? or do i have to append
`forall {..}` in GHC 9
This is valid syntax in ghc 9. what do the {..} mean (as distinct from (..) which ghc 8.10 requires here)?
SyntaxError: Unexpected end of JSON input in Flutter
Im trying to stablished a signup backend for my flutter aplication. in order to do that, i have this class: class _myhomepagestate
Parsing error: Unexpected token, expected ";
I am having a lot of issues in reactjs learning which i dont understand. i have line 5: parsing error: unexpected token, expected ";
What is #_currentArena? (Syntax)
I found this code in arena.dart in the ffi examples of flutter: /// the last [arena] in the zone. factory arena.current() {
Are parentheses ignored if they only contain a property accessor?
Given the following code, why doesn't (obj.foo)() receive window as this? it seems to me like the
Ad
Using if then statements R to changing existing values of variable
I have a data frame with a variable age_yr. i want to convert any ages less than 1 to 1. i am unsure how to write this using an if
Error: Syntax error, unrecognized expression: #whitelist_end option[value*= + value + ]
I'm getting a syntax error, but mainly because of my own not knowing how to write it. i have tried, but i have become really stuck. whilst
Laravel 5.7 : Trying to get property 'role' of non-object
I'm get : trying to get property 'role' of non-object (view: e:\xampp\htdocs\demo\resources\views\pages\home.blade.php)
Babel 7 spread syntax in IE/Edge not working
So i have babel 7 installed, along with the plugin "@babel/plugin-proposal-object-rest-spread" included within my preset-env, however i'm still
convert javascript spread syntax to older version code
I have a piece of code which uses spread syntax. on my main server, the node js version is 0.10. for some reason, it's not possible to
Script is returning a syntax error on blank line
This code is returning a "syntax error: line:26" the line where the error it mentioned is the blank line under "don't modify these
nodejs: Unexpected token "<"
I have a piece of code like this:
How does this Flutter constructor call work?
I am new to flutter and as i was reading through the tutorial i saw the following code snippet: // within the `firstroute` widget
Error while inserting data into database in android
I'm getting error like this while inserting item details : 09-28 16:30:32.558 9471-9471/com.example.android.inventoryapp
Unexpected token, expected "," in JSX
I am currently a student working on a react app, and keep getting returned syntax errors for unexpected tokens in my onsubmit() function. it wants
minify code creates syntax problem python
I am trying to minify code to save stress on my hard disk computer. this caused syntax error. i am not sure if token or comment is illegal and
Ad
Dart Flutter: Syntax confusion in setting default value for class properties
Here are two examples of class constructors: class a { final string name; final string sex; a({ this.name = 'unknown',
Is it necessary for webpack to converting the code to AST, if the browser support all the syntax about javascript and css,
Recently i have learned the process of webpack bundling are as follows: read the config file and register the hooks
removing an arbitarry property from an object, when said property is abstracted as a string
Let's say i have an object myobject with properties a,b,c. if i want to get rid of property a, i
How to use multiple quotes inside php echo
Im trying to use a fallback image with javascript inside a php echo, but im confused with the quotes, what´s the proper way to write
How do I change the "sleep" function to work in Internet Explorer?
So i have a website where you can click a button which then redirects you to a different page. the redirection should not happpen instantly but
What is happening in this Javascript code?
I am trying to understand how this script is doing what it does. object.variable = function(_) { return arguments.length ?
When making an and statement, I get an Syntax Error
When making a tax calculator, i seem to continue to be getting an error at the "=" in the following line of code: elif
Flutter "argument type not assignable" Error with two identical types
Flutter shows me this error, but the two types are identical. [cartitem it's just a simple model; there was a conflict since another
nodejs, basic question: What is this syntax?
I am learning nodejs, coming from other languages (c#, etc) and some of the syntax has be confused. for example this piece of code (i am
Update State of a Component from Another in ReactJS
I'm following this article (original implementation sibling sibling):
Compile and execute AST using pybind11 or Python C API
I would like to translate this python code into c++ code using pybind11 or directly the python c api:
Ad
How to find CSS/SCSS classes that contains single property
I have bunch of scss files. i'd like to find blocks which contains only single property, like: &__input { width: 100%; }
Why does Firefox throw an error for the literal {"a": 1} while Chrome accepts it?
In firefox console it throws an error because of the colon: {"a": 1} syntaxerror: unexpected token: ':' in
Python "TypeError" when writing to HTML File in "while" Loop
I have getting error for typeerror: must be str, not int this function below new_file.write works fine when it outside
react stateless component to class component syntax
I just upgraded react from v15.6.2 to v 16.5.2 and now i am getting a few errors along the lines of... warning: stateless
Please Explain syntax - flutter bloc provider using inherited widget
I do not understand the constructor part and static function part. super? dependoninheritedwidgetofexacttype? import
Syntax for pointers to a structure
When declaring a pointer to a struct, both the following code snippets compile without error: a) struct foo { int data; foo*
Clang ast-dump results in infinite loop
For some reason when i try to get the ast-dump of any c/c++ code with clang, i get an infinite loop which eventually results in clang:
PyCharm warning "End of statement expected" inside of type hints
I'm getting this weird "end of statement expected" warning inside of a comment, which functions as a python 2/3 type hint:
React + Redux + Babel (SyntaxError in ...state unexpected token)
I try to repeat the example:
AngularJS Cannot read property 'forEach' of undefined
This code is causing an error in the developer console: $scope.addcandidatestocompannies = function() {
awesome-typescript-loader: spread of empty array returns empty array
Well, everything was awesome until i went into spread of the empty array to render a couple of similar index-dependable components. i
Ad
Try statement in nested for-loop to bypass errors (syntax error )
I have a data frame with the text entries dataframe['text'] as well as a list of features to compute for the function. although not
Error in python code, not sure how to solve it?
I am using selenium with webdriver for login on a particular website but got stuck in the middle. the error comes when it starts to type email
flutter meaning of () for various widgets
Ofter times in flutter i come across () used in the code, and i've just been rote memorizing when they need to be there. however, i don't exactly
firebase + create-react-app hosting error
I was trying to deploy my react spa on firebase, but got only blank page with such console error: "uncaught syntaxerror: unexpected token
how can I change error view of laravel 5.2 like 5.3?
How can i change the error view of laravel 5.2 like 5.3? i want the same error view of 5.3 in laravel 5.2... can anyone please help me in
React JSX defaultProps syntax error
I try to use this code: import react, { component } from 'react'; export default class hello extends component { static
Invalid syntax python 3.7 turtle game
#boundary checking if goals[count].ycor() > 240 or goals[count].ycor() < -240: goals[count].right(180)
How can I combine a conditional with a for loop in Python?
I have a simple example i've drawn up. i thought it was possible to combine if statements and for loops with minimal effort in python.
Requesting Data not Working in browsers except Chrome, JavaScript and Contentful API
The requested data works in chrome but not any other browser that i have. i don't know why. i tried firefox, explorer, edge as well. no response
SyntaxError: invalid syntax (when running python code from shell)
In jupyter notebook my code runs fine, but when i run it from shell i get a syntax error at this part of my code: res = f'"x"'+"
What is this Javascrip/node variable/constant assinging notation/syntax called ?
I've been trying to find out what this notation is called so i can better google it. it's from the gmail api node example but wont run for me.
Ad
How to extend Javascript with new while statment
I am trying to create a new way of implementing loops in javascript. the user would type loop(n) { //
Highlight code dynamically in React using hljs library
I fetch code snippets from the server to display. if i want to display the code, i attach the node to dom. if there is no code to display,
Ad
Blog Categories
Ad