syntax-error

Rails 3.2 Postgres Save Error “ActiveRecord::StatementInvalid: PG::Error: ERROR: Syntax error near 'T' at position 5”

萝らか妹 提交于 2019-11-29 09:17:42
My app has started throwing errors when I try to save a particular class to the database. I'm not sure exactly what caused this to start happening - I've been having all kinds of database issues for the last few days.... In any case, my model seems to be working fine (it is properly calculating all of the before_save values), but then it tries to save to the database and blows up. SQL (0.8ms) INSERT INTO "portfolios" ("correlation_matrix", "created_at", "data", "mean_return", "std_dev", "updated_at", "weights") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["correlation_matrix", "--- \n-

How to fix the YAML syntax error: did not find expected '-' indicator while parsing a block?

折月煮酒 提交于 2019-11-29 05:37:53
I have some code written in my .travis.yml written for a Python library. Using lint.travis-ci.org , I came to know that there is some indentation problem in my YAML file. Here is the part which the error points to install: - if [[ "${TEST_PY3}" == "false" ]]; then pip install Cython; python setup.py build; # To build networkx-metis mkdir core; # For the installation of networkx core cd core; git clone https://github.com/orkohunter/networkx.git; cd networkx/; git checkout addons; python setup.py install; cd ..; fi Where am I wrong? The error says syntax error: (<unknown>): did not find expected

Unexpected token < in first line of HTML

a 夏天 提交于 2019-11-29 05:23:45
I have an HTML file : <!DOCTYPE HTML> <html lang="en-US" ng-app="Todo"> <head> <meta charset="UTF-8"> <title>DemoAPI</title> <meta name="viewport"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script> <link rel="stylesheet" href="./Client/css/styling.css" /> <script type="text/javascript" src="core.js"></script> </head> The error says: Uncaught

Python relative import causes SyntaxError exception

一世执手 提交于 2019-11-29 05:21:05
According to the python docs , relative importing and intrapackage referencing has been supported since python 2.5. I am currently running Python 2.7.3. So, I tried to implement this in my own package in order to use it for simpler importing. I was surprised to find it threw a SyntaxError exception at me, and I was hoping someone could help lead the way to the cause. I setup a test directory for testing: tester ├── __init__.py ├── first_level.py └── sub ├── __init__.py └── second_level.py Both __init__.py modules are empty. The other modules are: # first_level.py print "This is the first level

Incrementing Multiple Genvars in Verilog Generate Statement

有些话、适合烂在心里 提交于 2019-11-29 03:57:30
I'm trying to create a multi-stage comparator in verilog and I can't figure out how to increment multiple genvars in a single generate loop. I'm trying the following: genvar i,j; //Level 1 generate j=0; for (i=0;i<128;i=i+1) begin: level1Comp assign ci1[i] = minw(tc[j],tc[j+1]); j = j+2; end endgenerate And getting the following error: Error-[SE] Syntax error Following verilog source has syntax error : "encoder.v", 322: token is '=' j=0; Anyone know how to increment multiple genvars in the same generate statement? Or at least get equivalent functionality? Assuming that ci1 has half the depth

Uncaught SyntaxError: Unexpected token u in JSON at position 0

泄露秘密 提交于 2019-11-29 01:08:42
Only at the checkout and on individual product pages I am getting the following error in the console log: VM35594:1 Uncaught SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse (<anonymous>) at run (layout.min.js:9) at app.min.js:1 at main.min.js:2 at Object.execCb (require.min.js:112) at Module.check (require.min.js:56) at Module.<anonymous> (require.min.js:72) at require.min.js:11 at require.min.js:74 at each (require.min.js:3) I am using a one page checkout extension, but when I disable that the error still shows. I thought it might had something to do with the reviews on

SYNTAX_ERR: DOM Exception 12 - Hmmm

﹥>﹥吖頭↗ 提交于 2019-11-28 21:03:22
I have been working on a small slideshow / public display for a client that uses HTML5 Rock's Slideshow code . I have run into a DOM Exception 12 - a syntax error that is supposedly related to CSS selectors - while monkeying around with it... but I can't trace it back to any changes I made in the code. I am thinking it might be something that was uncovered as I added features. I have traced it down to this object (live version here ): var SlideShow = function(slides) { this._slides = (slides || []).map(function(el, idx) { return new Slide(el, idx); }); var h = window.location.hash; try { this

Syntax error with std::numeric_limits::max

若如初见. 提交于 2019-11-28 17:48:44
I have class struct definition as follows: #include <limits> struct heapStatsFilters { heapStatsFilters(size_t minValue_ = 0, size_t maxValue_ = std::numeric_limits<size_t>::max()) { minMax[0] = minValue_; minMax[1] = maxValue_; } size_t minMax[2]; }; The problem is that I cannot use 'std::numeric_limits::max()' and the compiler says: Error 8 error C2059: syntax error : '::' Error 7 error C2589: '(' : illegal token on right side of '::' The compiler which I am using is Visual C++ 11 (2012) Your problem is caused by the <Windows.h> header file that includes macro definitions named max and min :

C error: Expected expression before int

馋奶兔 提交于 2019-11-28 17:00:45
When I tried the following code I get the error mentioned. if(a==1) int b =10; But the following is syntactically correct if(a==1) { int b = 10; } Why is this? sheu This is actually a fairly interesting question. It's not as simple as it looks at first. For reference, I'm going to be basing this off of the latest C11 language grammar defined in N1570 I guess the counter-intuitive part of the question is: if this is correct C: if (a == 1) { int b = 10; } then why is this not also correct C? if (a == 1) int b = 10; I mean, a one-line conditional if statement should be fine either with or without

Why is whitespace sometimes needed around metacharacters?

萝らか妹 提交于 2019-11-28 14:54:40
A few months ago I tattooed a fork bomb on my arm, and I skipped the whitespaces, because I think it looks nicer without them. But to my dismay, sometimes (not always) when I run it in a shell it doesn't start a fork bomb, but it just gives a syntax error. bash: syntax error near unexpected token `{:' Yesterday it happened when I tried to run it in a friend's Bash shell, and then I added the whitespace and it suddenly worked, :(){ :|:& };: instead of :(){:|:&};: Does the whitespace matter; have I tattooed a syntax error on my arm?! It seems to always work in zsh , but not in Bash. A related