In computer science, the syntax of a programming language is the set of rules that define the combinations of symbols that are considered to be correctly structured programs in that language.

learn more… | top users | synonyms

0
votes
0answers
46 views

Python Syntax — variable with a text string

I am new to both python and stackOverflow so pardon any etiquitte mistakes that i make. I am trying to figure out correct syntax for python. If i define a variable that is a long string of ...
0
votes
2answers
20 views

Java MySQL executeUpdate syntax error

Here's the code: try{ Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM mytable WHERE array=\"" + arrayName + "\""); if(rs.next()){ ...
0
votes
1answer
12 views

AngularJS - passing variable to function returns preprocessed syntax

I want to send an AngularJS variable to a function in my controller. Here's a sample snippet of my code: <ul> <li ng-repeat="score in scores | filter:search | orderBy : 'first'"> ...
0
votes
1answer
10 views

Range activation in a different worksheet

I was wondering if there is an alternative for the following code: Dim Arr() as Variant Arr = Range("A1:I511") that refers to a specified worksheet. I tried the following Dim Arr() as Variant Arr ...
0
votes
3answers
26 views

alternate defining method in javascript [duplicate]

When should I use such syntax to define a function in JavaScript myfunc = myfunc || function(n){ return this.length; }; instead of myfunc = function(n){ return this.length; ...
0
votes
1answer
11 views

PowerShell Get-ADUser Filter manager empty

I'm looking for a way to retrieve all the users that have no manager assigned to them in the active directory. Whatever I try, it always spits out errors. Works fine: Get-ADUser -Filter ...
1
vote
2answers
48 views

How do I count the number of child collection's items using LINQ Method Syntax?

Let's say I have a schema, representing Question entities. Each question can be voted up, voted down or, of course, not voted at all - just like here in StackOverflow. I want to get the number of ...
0
votes
0answers
26 views

C syntax and static keyword [duplicate]

I have the following in a book and don't understand one bit what it is talking about. Why is static in brackets? Why would you have a function parameter be static? double stick(double ar[static ...
1
vote
1answer
37 views

How to re-write Objective C Delegate Method in Swift

I'm trying to re-write a cocoapod's Objective-C delegate protocol in Swift. The cocoapod is MZTimerLabel and I'm trying to notify my View Controller when the timer has finished. Xcode tries to layout ...
1
vote
1answer
14 views

applying function to each element in matrix --arrayfun

I'm trying to apply a function I wrote to each element in a matrix using arrayfun, but I'm either using the wrong function or getting my syntax wrong. I've written a function with 3 inputs, 1 output ...
0
votes
1answer
16 views

text highlight in markdown

Within a Markdown editor I want to support text highlight, not in the sense of code highlighting, but the type of highlighting people do on books. Normally in code oriented sites people can use ...
0
votes
1answer
21 views

Sum function referenced to column number VBA

I need to reference columns by number in Sum function (i.e. Column B =2, C=3, E=5, etc) i tried this code but it didn't work (ColN is the column number read from a listbox index) Range("M5") = ...
-1
votes
0answers
32 views

MySQL Error 1064: You have an error in your SQL syntax. Probably a rookie mistake [on hold]

Mysql query is as follows:: SELECT `company`.`id` , `investigation`.`nefco_number` , `investigation`.`claim_number` , `investigation`.`loss_time` , `investigation_insured`.`name` ...
-1
votes
5answers
39 views

Using ternary operator inside MYSQL query in PHP syntax error [on hold]

I have this simple PHP/MYSQL prepare statement: $DBH->prepare("SELECT * FROM books '.($_POST['author'] ? '' : '').' WHERE id = '1'"); The ternary operator above leads to a syntax ...
0
votes
1answer
39 views

how to use anonymous function as a property value? [duplicate]

I want to store a function in an associative array but PHP throws this error: Parse error: syntax error, unexpected 'function' (T_FUNCTION) in C:\Program Files\wamp\www.... on line 12 Code is ...
1
vote
2answers
43 views

rust syntax: reason for &mut foo instead of &foo in rust when foo declared mut

For a c routine like MPI_Comm_rank(MPI_Comm comm, int *rank); the rust foreign function interface could be declared like this: extern crate libc; use libc::{c_int}; #[link(name = "mpi")] extern { ...
0
votes
2answers
13 views

jQuery's Request To Javascript Function

Okay so look at these to alert()s. Here is the full code: function OfficialFacebookLikes(Title) { $.getJSON('https://graph.facebook.com/'+Title, function(data) { ...
0
votes
2answers
26 views

Pass parameters to an application

I'm attempting to use ghostscript to set a specific page size for scanned PDF files. I can run the script when it resides in the same folder as the executable but when I move the .vbs file out of the ...
5
votes
1answer
174 views

Why does this Haskell code become invalid if I add spaces?

Sorry for probably a noob question. I'm getting this: Prelude> all (\x -> x==1) ([n | n <- [1..20]]) False Prelude> all (\x -> x == 1) ([n | n <- [1..20]]) ...
0
votes
0answers
15 views

Trying to compile sources on Mac OS X

Here is the tarball I'm trying to compile on the macbook pro I'm currently working with : http://sourceforge.net/projects/pure-data/files/pd-extended/0.42.5/Pd-0.42.5-extended.tar.gz/download ...
0
votes
0answers
25 views

Python: Datagram error

As a test, I'm using datagrams for my Laughing Man head in my toontown server. However, it returns a syntax error. from direct.distributed.PyDatagram import PyDatagram from pandac.PandaModules import ...
1
vote
1answer
24 views

SQL - Use of Group By with case

I have often seen CASE statements being written inside GROUP BY in SQL whenever one writes CASE statements after SELECT statements. Is it a rule ?Or, if it carries some significance then when should ...
-2
votes
2answers
21 views

What is the meaning of the addition at the end of this array declaration?

I'm tasked with implementing an algorithm which was supplied as Matlab (which none of us have any experience with) into our c++ application. There is an array declared as such: encrypted = [18 10 ...
7
votes
3answers
62 views

What is this C syntax (used in Linux drivers/net/bonding/bond_main.c)?

I've written plenty of C before, but I don't recognize this syntax: static const char *names[] = { [BOND_MODE_ROUNDROBIN] = "load balancing (round-robin)", [BOND_MODE_ACTIVEBACKUP] = ...
0
votes
0answers
36 views

double[ ] syntax error [on hold]

I am trying to implement convert codes from WGS84(longitude and latitude) to OSGB36 (British National Grid). I am using a conversion code of Chris Veness at this moment. ...
0
votes
1answer
63 views

What does the rust compiler “error: can't capture dynamic environment in a fn item; use the || { … } closure form instead” mean, and how to fix it?

I get a rust compiler error: src/main.rs:33:31: 33:35 error: can't capture dynamic environment in a fn item; use the || { ... } closure form instead The error occurs because I have a function in ...
0
votes
0answers
4 views

Syntax Error Missing Operator Access Report

Getting run-time error '3075': Syntax error (missing operator) in query expression 'Customer Number LIKE 'cv001" My program allows an individual to choose a search category from a combobox: Customer ...
3
votes
8answers
134 views

Compound if statement using ?: operator in C [duplicate]

Is it possible to write the equivalent compound "if" statement using the "?" operator in C? I want to write an "if - else if - else" statement and was wonder if I could utilize the "?" operator. I ...
1
vote
3answers
31 views

How to extract substring in Groovy?

I have a Groovy method that currently works but is real ugly/hacky looking: def parseId(String str) { System.out.println("str: " + str) int index = href.indexOf("repositoryId") ...
0
votes
3answers
35 views

Use PHP require() on localhost with windows

Problem: I want to use the require() command from scripte\sicherheit\verschluesselung.php to scripte/reg_einlesen.php (1 folder above the one I m within) But I dont know the right Syntax for a ...
0
votes
1answer
5 views

Eggplant wait command only accepts numeric literals as parameters?

I hate magic numbers in my code, so I want to replace the numeric literals in my wait commands with constant variable names. For example: wait 60 //How it is now wait MAX_HALT_TIME //How I would ...
0
votes
1answer
22 views

Sublime colour syntax highlighting using regex

I've managed to put together a syntax (.tmLanguage) file for use in Sublime Text 2. I'd quite like to highlight numerals. I tried: <string>0|1|2|3|4|5|6|7|8|9</string> which works, but ...
1
vote
1answer
36 views

what is the “@” meaning in a asm inline function?

I looking into a inline asm function, and I found a statement can't understand, the code is: static inline void arch_local_irq_enable(void) { unsigned long temp; asm volatile( " ...
0
votes
2answers
42 views

Calling non-empty constructor when defining a member object within a header file

I feel like this is a mere syntactical question, but I can't find a unique/succinct way to describe it so Google isn't helping. Here is a code snippet to see what I am talking about. The part that is ...
1
vote
6answers
57 views

Python: Complete list with items

Let's say I have many lists. Each of these lists may have different length. The thing I want to do is to complete each of this lists with (for example) string "EMPTY". Is there a build-in function or ...
-1
votes
3answers
68 views

Perl increment or decrement, but not both?

$a++; # ok $a--; # ok --$a; # ok ++$a; # ok --$a++; # syntax error $a++--; # syntax error ($a++)--; # syntax error --$a--; # syntax error On some of these, I can sort of see ...
0
votes
1answer
22 views

mysql IFNULL syntax i don't know what's wrong

I'm going to use IFNULL check in my select query I want to execute like this, when sum is null then print 0 This is my whole query SELECT IFNULL(SELECT SUM(TOT_SALES_PRICE) FROM ...
0
votes
1answer
26 views

Issue with for loop with sqlite data insertion

I need to insert 5 rows where only one column values gets changed and remaining are same in all rows. var Category1_fr ="one"; var Category2_fr ="one"; var Category3_fr ="one"; var Category4_fr ...
-2
votes
1answer
75 views

How to Groovy-ify a null check?

Is there a more "Groovy" way to write this Groovy code: def myVar=(System.getProperty("props") == null)? null : System.getProperty("props") Logic is: If System.getProperty("props") is NULL, I ...
6
votes
1answer
74 views

Task.Run how to write it with action and ref variable name

I am standing for a "little" syntax problem and cannt figure out how to correctly write what I desire. I have the following method: public void DoSomeMagic(string foo, ref string bar) { ...
-2
votes
0answers
24 views

SQL Error getting when try to update table

i have a private script with php and i got some error's when i try to upload some text data in my sql table . its show a error that is below MYSQL ERROR: A log will be crated, try again later: ...
-1
votes
0answers
31 views

SyntaxError in UserFriendshipsController#index

app/controllers/user_friendships_controller.rb:57: syntax error, unexpected end-of-input, expecting keyword_end I have been adding and removing 'ends' to no avail. I am not sure what I am missing. ...
-1
votes
1answer
58 views

How to add a new syntax feature for perl?

I want to add a new feature for Perl language, in order to type less $self->. For example, Translate: use Moo; has a_attr => (is=>'rw'); sub XXX { print $self->a_attr; } To: use ...
0
votes
2answers
19 views

Python MySQLdb error when trying to alter a table

I am trying to alter a database but I am not sure of the exact syntax and I am having trouble finding it online. The line that is giving the error is: cur.execute("ALTER TABLE Units ADD FOREIGN ...
1
vote
2answers
26 views

SyntaxError in Python IDLE 2.7 but not in PythonTutor

I'm getting a SyntaxError: invalid syntax in response to the following code when I run in it IDLE, but not in PythonTutor. Can anyone help with why? def apples(x, y): try: result = x/y ...
0
votes
2answers
66 views

Javascript function calling syntax

(function($,window,undefined) { $.fn.simplyScroll = function(options) { return this.each(function() { new $.simplyScroll(this,options); }); }; var defaults = ...
-5
votes
0answers
29 views

Parse error: syntax error, unexpected end of file 36 [closed]

I struggle to see where I've gone wrong here: </p> <dl> <? $permissions = checkPermissions(); ?> <?php foreach($permissions as $permission) { ?> <dt ...
0
votes
2answers
62 views

C functions without return type and parentheses?

I've came across a piece of C code (allegedly - the file has .c suffix). It has a bunch of functions defined like so: do_stuff { // some stuff } do_other_stuff { // some more stuff } There ...
1
vote
1answer
67 views

Incorrect Syntax in Insert statement

Open and Close Connection: OleDbConnection conn; private void ConnectToDatabase() { // Creates a connection to the database using an absolute path. conn = new ...
2
votes
1answer
20 views

Vlookup Syntax and user input issues

I'm trying to create a macro that compares two user in-putted worksheets then moves the differences to different sheets depending on why its different. The code first asks for input of the newest ...