syntax-error

TypeError: unsupported operand type(s) for &: 'float' and 'float'

谁都会走 提交于 2019-11-26 23:38:44
问题 I wrote this simple program to calculate one's BMI. But I am unable to execute it complete. Below is my program, PROGRAM h = input("Please Enter your height in meters:") q = raw_input("Do you want to enter your weight in kg or lbs?") if q=="kg": w1 = input("Please Enter your weight in kgs:") bmi1 = w1/(h*h) print "Your BMI is", bmi1 if bmi1 <= 18.5: print "Your are underweight." if bmi1 > 18.5 & bmi1 < 24.9: print "Your weight is normal." if bmi1 > 25 & bmi1 < 29.9: print "Your are overweight

JavaScript error (Uncaught SyntaxError: Unexpected end of input)

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 23:33:34
I have some JavaScript code that works in FireFox but not in Chrome or IE. In the Chrome JS Console I get the follow error: "Uncaught SyntaxError: Unexpected end of input". The JavaScript code I am using is: <script> $(function() { $("#mewlyDiagnosed").hover(function() { $("#mewlyDiagnosed").animate({'height': '237px', 'top': "-75px"}); }, function() { $("#mewlyDiagnosed").animate({'height': '162px', 'top': "0px"}); }); </script> It says the error is on the last line which is }); Add a second }); . When properly indented, your code reads $(function() { $("#mewlyDiagnosed").hover(function() { $

Running SQL script through psql gives syntax errors that don't occur in PgAdmin

前提是你 提交于 2019-11-26 22:19:00
问题 I have the following script to create a table: -- Create State table. DROP TABLE IF EXISTS "State" CASCADE; CREATE TABLE "State" ( StateID SERIAL PRIMARY KEY NOT NULL, StateName VARCHAR(50) ); It runs fine in the query tool of PgAdmin. But when I try to run it from the command line using psql: psql -U postgres -d dbname -f 00101-CreateStateTable.sql I get a syntax error as shown below. 2: ERROR: syntax error at or near "" LINE 1: ^ psql:00101-CreateStateTable.sql:6: NOTICE: CREATE TABLE will

Babel unexpected token import when running mocha tests

旧巷老猫 提交于 2019-11-26 22:00:17
The solutions offered in other related questions, such as including the proper presets (es2015) in .babelrc, are already implemented in my project. I have two projects (lets call them A and B) which both use ES6 module syntax. In Project A, I'm importing Project B which is installed via npm and lives in the node_modules folder. When I run my test suite for Project A, I'm getting the error: SyntaxError: Unexpected token import Which is preceded by this alleged erroneous line of code from Project B: (function (exports, require, module, __filename, __dirname) { import createBrowserHistory from

MySQL: “error in your SQL syntax … near key …”? [closed]

纵然是瞬间 提交于 2019-11-26 21:40:46
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I found one very cool scirpt for lost password but this row is making me problems $r = mysql_query('INSERT INTO `keys` (username,key, vreme) VALUES ("'.$user.'", "'.$acckey.'", "'.$keyexp.'"') or die(mysql_error()); error You have an error in your SQL syntax; check the manual that corresponds to your MySQL

Why does a module level return statement work in Node.js?

感情迁移 提交于 2019-11-26 21:31:41
When I was answering another question I came across a Node.js module with a top-level return statement. For example: console.log("Trying to reach"); return; console.log("dead code"); This works without any errors and prints: Trying to reach in the standard output but not " dead code " - the return actually ceased execution. But according to the specification of return statements in ECMAScript 5.1 , Semantics An ECMAScript program is considered syntactically incorrect if it contains a return statement that is not within a FunctionBody . In the program shown above return is not within any

“EOL while scanning single-quoted string”? (backslash in string)

两盒软妹~` 提交于 2019-11-26 21:25:27
问题 import os xp1 = "\Documents and Settings\" xp2 = os.getenv("USERNAME") print xp1+xp2 Gives me error File "1.py", line 2 xp1 = "\Documents and Settings\" ^ SyntaxError: EOL while scannning single-quoted string Can you help me please, do you see the problem? 回答1: The backslash character is interpreted as an escape. Use double backslashes for windows paths: >>> xp1 = "\\Documents and Settings\\" >>> xp1 '\\Documents and Settings\\' >>> print xp1 \Documents and Settings\ >>> 回答2: Additionally to

Common lisp error: “should be lambda expression”

末鹿安然 提交于 2019-11-26 17:59:17
I just started learning Common Lisp a few days ago, and I'm trying to build a function that inserts a number into a tree. I'm getting an error, *** - SYSTEM::%EXPAND-FORM: (CONS NIL LST) should be a lambda expression From googling around, it seems like this happens when you have too many sets of parenthesis, but after looking at this for an hour or so and changing things around, I can't figure out where I could be doing this. This is the code where it's happening: (defun insert (lst probe) (cond ((null lst) (cons probe lst)) ((equal (length lst) 1) (if (<= probe (first lst)) (cons probe lst)

Python: SyntaxError: keyword can't be an expression

心不动则不痛 提交于 2019-11-26 17:48:42
问题 In a Python script I call a function from rpy2 , but I get this error: #using an R module res = DirichletReg.ddirichlet(np.asarray(my_values),alphas, log=False, sum.up=False) SyntaxError: keyword can't be an expression What exactly went wrong here? 回答1: sum.up is not a valid keyword argument name. Keyword arguments must be valid identifiers. You should look in the documentation of the library you are using how this argument really is called – maybe sum_up ? 回答2: I guess many of us who came to

Calling a Sub in VBA

北战南征 提交于 2019-11-26 17:37:48
This my simplified script: Sub SomeOtherSub(Stattyp As String) 'Daty and the other variables are defined here CatSubProduktAreakum(Stattyp, Daty + UBound(SubCategories) + 2) End Sub Sub CatSubProduktAreakum(Stattyp As String, starty As Integer) 'some stuff End Sub The call of CatSubProduktAreakum is marked red as a "syntax error". I don't understand the error. It is a simple sub-routine call with two arguments. Why does VBA not accept the call? ipr101 Try - Call CatSubProduktAreakum(Stattyp, Daty + UBound(SubCategories) + 2) As for the reason, this from MSDN via this question - What does the