Most voted "syntax" questions
Syntax is the set of rules that defines how the different symbols of a language (natural or programming) can combine validly.
Learn more…268 questions
Sort by count of
-
2
votes1
answer3402
views"TS1005: ';' expected" error when compiling class with Typescript
I am studying Typescript classes through official documentation: https://www.typescriptlang.org/docs/handbook/classes.html. I used exactly the same example code as the documentation: class Greeter {…
-
2
votes1
answer180
viewsIndentation error
I’m trying to create a TextInput in the Kivy and define its dimensions, only whenever it puts its dimensions of error: invalid indentation,must be a Multiple of 4 Spaces. I still don’t understand…
-
2
votes1
answer190
viewsWhy suppress zero before the point in decimals, as in 0.5 == . 5?
Sometimes I face a code where the programmer wrote a decimal without zero, like 0.5 being .5, for example: var decimal1 = 0.5; var decimal2 = .5; console.log(decimal1 == decimal2);…
-
2
votes1
answer150
viewsDoes using or not block definition in simple "if" influence application performance?
Between one line and another there are some doubts that do not change the flow of decisions at all, but perhaps can influence the performance of the application by the amount of extra lines…
-
2
votes1
answer1137
viewsHow do auto increment in Mysql without declaring columns in INSERT?
I noticed that when I have a column with auto_increment, I have to declare the columns on INSERT. For example, I created this test table: create table teste( id int auto_increment, nome varchar(100)…
-
2
votes3
answers17023
viewsDo while in python
Is there a similar command to while de c and Java in python? I am entering the language now and already developing in java then I got this doubt
-
2
votes1
answer1508
viewsSQL Server Connection - Python
Good afternoon guys I’m having trouble making a connection with sql, whenever I try to make the connection the following error occurs: ('08001', '[08001] [Microsoft][ODBC Driver 17 for SQL…
-
2
votes1
answer106
viewsMeaning of the parentheses in the instantiation in C#
I can’t understand the need for () to instantiate a class. Retangulo n1 = new Retangulo(); Is it the language’s own thing or has meaning behind?
-
2
votes2
answers146
viewsHow to give an UPDATE by swapping for ?
I am trying to perform an UPDATE to change the \\ for \ , as in SQL below: UPDATE `post` SET `descricao`= replace(descricao, '\\','\'); I was told that Mysql does not accept regular expression on…
-
2
votes1
answer279
views -
2
votes2
answers98
viewsWarning: format '%f' expectts a matching 'double' argument (en)(en)
My first post here and I would like to know, because when I compile my code it gives an error saying the format %f expecting a double, whereas the f is used to float and the variable I’m putting is…
-
2
votes1
answer69
viewsHow do I use the semicolon in the "for" command?
What’s the difference between a for ending with a semicolon and a for ending without a semicolon? Example: for(i=0; i<=10; i++)**;** //Termina com ponto e vírgula// Example: for(i=0; i<=10;…
-
2
votes1
answer81
viewsWhy declare Static for all methods of a Static class?
I was studying here C# until I got to the part about the static. The teacher shows that it is possible to use this statement in methods and even in the class itself. The problem is that when using…
-
1
votes1
answer2330
viewsDelete a folder even if it is with files
What code should I use to delete a folder where it contains files within it? This code I used only erases an empty folder. void ApagarPasta(string nameOf, bool subPastas){ Directory.Delete(nameOf,…
-
1
votes1
answer1351
viewsERROR syntax error, Unexpected T_VARIABLE
I have a problem and am beginner in PHP, I do not know if it is easy to fix this error. (Parse error: syntax error, Unexpected T_VARIABLE in…
-
1
votes1
answer108
viewsSort result with 4 different columns
I have a table with 4 different columns, 2 of them indicating the beginning (date and time) and 2 other indicating end (also date and time). Is there a way to sort the result so that it prioritizes…
-
1
votes1
answer101
viewsHow to get the name of the parent object of the Javascript property
I have the following code: var teste = 'objeto': { version: '5.x.x', name:this[??] // 'objeto' }; What could be done for that property name has the same name of the object to which it belongs (which…
-
1
votes1
answer168
viewsChange soon according to the page
Hello. I need the logo of the site to change according to the page the user visits. I have a site made in PHP in which the top is a include. So I thought to change the logo via Javascript. I put the…
-
1
votes1
answer119
viewsPointer use
I need to use pointers, but I’m not sure how to express the syntax, it’s part of the goal of the task (change the value of the parameters passed by reference to the functions, such that these…
-
1
votes1
answer57
viewsUnderstanding pl/sql syntax Oracle 11g
I have an Oracle PROC 11g. Inside proc has something like this: v_prazo_subs_ans ts_odo.odo_controle_sistema.val_parametro%type; Where: v_prazo_subs_ans is a variable ts_odo.odo_controle_sistema is…
-
1
votes1
answer36
viewsUnderline between two variables
I have the following code in a file . sh: echo "$pasta/Dados/$MA/$ano\_$mes/$tabela" With all variables set correctly. However, running the script, echo results in…
-
1
votes2
answers57
viewsRedirect Flex input to a string
Good, I have a flex file and a C routine to check the writing of texts. I’ve been testing at command-prompt using test < inputFile What I wanted now was to be able to indicate in my C file a…
-
1
votes1
answer158
viewsDoubt Mysql Insert
Good morning, I’m trying to make an Insert,plus this giving error and seems to be in the hour field,could help me identify what is wrong: Follows the Insert and the error. INSERT INTO senhas…
-
1
votes2
answers150
viewsMap array on function return - PHP
Testing local (xampp), with the return of the function mapping an array. Example: <?php $res = $obj->Function()[0]['name']; ?> And on the production server (typical hosts) this interpolated…
-
1
votes1
answer866
viewsError syntax error, Unexpected T_CONSTANT_ENCAPSED_STRING
add_filter('wp_nav_menu_items', 'add_search_form', 10, 2); function add_search_form($items, $args) { if( $args->theme_location == 'primary' ) $items .= '<li><div…
-
1
votes1
answer273
viewsSyntax doubt in Angularjs
I’m starting in Angular and in some cases I saw that you pass parameters in the bracket of the "module" and in other cases in the "Function", and in the function I’ve seen 2 forms of declaration.…
-
1
votes1
answer223
viewsHow to select a larger number of records based on another SQL table
I have an IMMOBILE table ID | Tipo | endereço 1 | Casa | Rua teste 2 | Casa | Rua teste 3 | Apartamento | Rua teste And a sales chart id | ID_do imovel 1 | 1 2 | 2 I need to know based on the sales…
-
1
votes1
answer153
viewsHow to set up "gdb" for Intel syntax
I’m trying to set up the gdb for syntax intel, however I am getting the following message : Ambiguous set command "dis intel": disable-randomization, disassemble-next-line, disassembly-flavor,…
-
1
votes2
answers55
viewsBest Way to Implement Dataannotations
There is some difference in the following implementations? [Required, StringLength(150, ErrorMessage = "Insira no máximo 150 caracteres")] [Index(IsUnique =true)] public int MyProperty { get; set; }…
-
1
votes1
answer1393
viewsDifference between if and elsif
I know these two terms don’t exist in the same language (correct me if I’m wrong), but in some languages (C#, in the example below), we have the following code: if(condicao){ ... } else if…
-
1
votes0
answers29
views; in Javascript
It’s been a while since I realized that Javascript does not care for the absence of ; between instructions, as long as there is a line break between them. My question is: is there any difference…
-
1
votes2
answers3880
viewsWhat is the unless command for in Ruby
Can anyone explain how this command works unless in Ruby? ruby_is_ugly = false puts "Ruby não é feio!" unless ruby_is_ugly Got out "Ruby não é feio!"…
-
1
votes1
answer89
viewsWhy some methods have ' :: '
Why some methods like Perl or Ruby: Net::FTP, has these two points; how is the construction of the methods of this class and why is created in this way (with this syntax) and not in the way used by…
-
1
votes1
answer1070
viewsVBA: Declare variables online
To declare variables in VBA, I always used the following method: all variables of the same type I put in the same line and declared their type only at the end, as in the example below: Dim…
-
1
votes1
answer116
viewssyntax error, Unexpected ( Arg, expecting end-of-input )
I came across this syntax error: syntax error, Unexpected ( Arg, expecting end-of-input ) larguraDaLinha = 40 str = '--> text <--' puts str.ljust larguraDaLinha puts str.center larguraDaLinha…
-
1
votes2
answers1099
viewsInclude or Require in Nodejs to separate codes
Hello! I wonder if in nodejs it is possible to separate some codes in different files as this example below, and how to do this: Currently I have only one file this way: File 111.js var app =…
-
1
votes1
answer11590
viewsWhat is Java & quot?
I wonder what it means " java. Example: used to form the name of an object: ClasseObjeto celula+""+col+"_"+lin = new ClasseObjeto();…
-
1
votes1
answer43
viewsHow I define a unit of measure in the value of the variable
I have a question asking that I calculate the volume value of an oil can, and thinking about it I will use float. How do I place a unit of measure, for example the variable altura = 50cm.…
-
1
votes2
answers187
viewsRuby syntax
What happens in this part here? def permut(vet) return [vet] if vet.size < 2 perm = [] vet.each{ |e| permut(vet - [e]).each{|p| perm << ([e] + p) } } perm end The first lines I understand,…
-
1
votes2
answers306
viewsGo function with parameters
I came across the following function in a framework of Map Reduce, but I didn’t understand her syntax. func (fc *FlowContext) newNextDataset(shardSize int, dType reflect.Type) (ret *Dataset) { ret =…
-
1
votes2
answers29
viewsOnline error of the form
In the browser of the following error, I have tried everything if you can help Parse error: syntax error, Unexpected $end, expecting T_VARIABLE or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN in…
-
1
votes1
answer83
viewsSignature of a generic function in Kotlin
I was watching the part about Generics and I’d like to know why the fun <T> addToList(vararg arg : T): ArrayList<T> { and not the fun addToList(vararg arg : T): ArrayList<T> {…
-
1
votes1
answer51
viewsSyntax error in final key
In my code are appearing the following errors: Error 1 } expected** Error 2 Type or namespace Definition, or end-of-file expected** using System; using System.Collections.Generic; using System.Linq;…
-
1
votes1
answer377
viewsFOR syntax in C
I’m new to the community, and I recently noticed in a C code, a FOR loop, with the following syntax. for(;;). Someone could explain that syntax to me. Thanks in advance.
-
1
votes1
answer188
viewsJavascript - Quiz
I’m studying Javascript, beginner level. So, I’m trying to assemble a quiz according to a tutorial I found but find the following error while running: ["SyntaxError: expected expression, got…
-
1
votes1
answer602
viewsTry & Except, correct way
The right way to use the try and except in the Python it’s like? try: variavel = funcao() except: return 'error' Or do I: variavel = funcao() and then I’ll deal with it that way variavel = funcao()…
-
1
votes1
answer66
viewsAt what point do syntaxes in programming languages become important?
I’m in the mood to discuss the subject of when a syntax of an N programming language becomes important for the production of systems. For example: A language with simple syntax and easy to learn,…
-
1
votes1
answer43
viewsSelect on condition
I have the following example table (tbl_Local) in Mysql: ID| LOCAL| COR 1 | A |RED 2 | A |RED 3 | B |RED 4 | B |BLACK 5 | B |WHITE 6 | C |RED 7 | D |BLUE 8 | E |BLUE 9 | E |ORANGE 10| E |YELLOW 11|…
-
1
votes1
answer108
viewsC code, url=inet_ntoa(*(struct in_addr *)ip->h_addr); I don’t understand what’s going on
I was studying sockets for this stuff https://www.exploit-db.com/papers/13634/ and I came across a code that I don’t understand what’s going on. That’s the part of the code: struct hostent *ip; ...…
-
1
votes2
answers322
viewsWhat does a semicolon mean after an "if"?
I was analyzing a code and came across a semicolon after a if, which means using the semicolon after a if? code: int base_calc(int cb) { if( cb < 30 ) { ; } else if( cb < 20 ) { cb = 30 - 1; }…