Can’t DISTRIBUTE BY in psql GreenPlum

I am trying to create a table on a RHEL5 machine running GreenPlum (Postgres) server. The table I am trying to create needs to have a “DISTRIBUTE BY” clause with a few of the columns as its predicate. Without the “distribute by” the whole command works well creating the table, but when I add it I get the following syntax…
Read more

How to fix this syntax error in php? [duplicate]

This question already has an answer here: PHP Parse/Syntax Errors; and How to solve them? 10 answers I am trying to create a php file that displays the average score out of 5 numbers for class, but when i ever I try to display it i keep getting this error “Parse error: syntax error, unexpected ‘print’ (T_PRINT) in C:xampphtdocsscores.php on…
Read more

PHP apc_store() about "cache a variable"

The PHP manual says bool apc_store ( string $key , mixed $var [, int $ttl = 0 ] ) about the $var var The variable to store But there is no mention anywhere that $var may actually be a value, a literal. So $e = 2.71828; apc_store(“mykey”, $e); works, but what about setting the value directly apc_store(“mykey”, 2.71828); does it…
Read more

Dynamic mpdf filename

I am trying to create dynamic pdf file names based on the user who is logged in using mpdf now in my mind this (or something similar) should work – but doesn’t. $User = $_POST [‘Username’] $filename = $User $Extension = “.pdf”; $mpdf->Output($filename, $Extension ,’F’); Which returns the error: mPDF error: Incorrect output destination: .PDF and $mpdf->Output($filename $Extension ,’F’); or…
Read more

Correctly passing an array from a function

I have some code to generate an array of size [user_input] in a function called array_generator, using size of array from scanf in main(), and then filling it with the numbers 0 to user_input (0, 1, 2, 3, if user input is 4). The array fills correctly as printf prints `The array contains the value 1` `The array contains the…
Read more

Defining syntax at the top

Inside my functions I have this phrase that I use quite frequently: ((AAAA *)(BBBB->next + sizeof(CCCC))) Where AAAA,BBBB, and CCCC are different structs and I’m casting the pointer to the struct AAAA (by the (AAAA *)). My question is, since I do this so much, can I just define this at the top of the file? #define BBBBNext ((AAAA *)(BBBB->next…
Read more

Syntax in Java `|`

I have the following line of code: papaIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); Please help me explain what mean of | sign in this situation. Thank you! Source: syntax

Sweet Alert Syntax

I am failing to get sweet alert going and i think it has something to do with the syntax. Can someone show me what i should be doing <!DOCTYPE html> <html> <head> <title>Testing</title> <script src=”dist/sweetalert.min.js”></script> <link rel=”stylesheet” type=”text/css” href=”dist/sweetalert.css”> </head> <body> <script> swal({ title: ‘Confirm’, text: ‘Are you sure to delete this message?’, type: ‘warning’, showCancelButton: true, confirmButtonText: ‘Yes, sir’,…
Read more

Java code will not compile

I have this piece of code but when I try to compile it, I just receive errors. could anyone spot the sytnax error, or what I’m doing wrong? public double getTotalBalance(ArrayList<String> accounts) { double sum = 0; while (studentNames.size() > 0) { BankAccount account = accounts.remove(O); // Not recommended sum = sum + account.getBalance(); } return sum; } Source:…
Read more

Write grammar automatically using dyacc

I’m doing my task about compiler project. I’m using Lex and Yacc for Delphi tools. I am unclear about how to generate grammar automatically using dyacc tools. I want to make a parse tree from source code input, but I don’t know how to use a grammar to make a parse tree. I’ve already made it manually, but not clearly…
Read more