I have Mako taking a template from a preprocessor, and now thinks there is a 'pass' after my if statement.
Here is the complete traceback
Error !
SyntaxException: (SyntaxError) invalid syntax (, line 1) (u"if ${session['anonymous']}:pass") in file '/.../site/templates/shpaml/views/index.html' at line: 3 char: 1
1 <p>your anonymous stat...
Hi,
I'm trying to write a prediate that returns every third letter of a list. This is my code so far:
third([],X):-X=[].
third([_],X):-X=[].
third([_,_],X):-X=[].
third([_,_,C|T],X):- third[T,Z], X=[C|Z].
I get the "operator expected" error on the last line.
Does anyone know why?
...
I'm running into a bit of a problem here, I'm messing around with machine code and function pointers, and there's a bit of my code that VC++ simply refuses to compile.
This compiles and runs exactly as expected:
#include <stdlib.h>
#include <stdio.h>
int main()
{
char tarr[] = {0xb8, 222, 0, 0, 0, 0xc3};
int (*testfn)() = tar...
<?python class += 1 ?>
One really simple line of code which definitely should work, but still it gives me this error:
TemplateSyntaxError: invalid syntax (file.html, line 22)
I shorted the filepath for readability, but that's the exact error. I'm definitely sure it should work, as I've used
<?python
i += 1
?>
In another file,...
I'm trying to do some C++ exercises, but I'm running into a error on build, which doesn't just jump out at me. What am I missing? I'm just getting back to C++ from C# et al after having done it years ago.
[ERROR]
syntax error : 'return'
[/ERROR]
#include <iostream>
using namespace std;
/* Pre-compiler directives / macro...
In Ruby, I can define a method foo=(bar):
irb(main):001:0> def foo=(bar)
irb(main):002:1> p "foo=#{bar}"
irb(main):003:1> end
=> nil
Now I'd like to check if it has been defined,
irb(main):004:0> defined?(foo=)
SyntaxError: compile error
(irb):4: syntax error, unexpected ')'
from (irb):4
from :0
What is the proper syntax to use...
I'm having troubles with a syntax error when trying to create a function in MySQL to convert a decimal grade into a letter grade.
What could be the issue?
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your mySQL server version for the right syntax to use near 'conv(gpa DOUBLE)
RETUR...
This is the test page: http://www.onebagoneearth.com/ OBOEKindBag (spaces between the page name and domain because I don't want the URL indexed as such)
If you click on one of the thumbnails, or on the main image, you see a popup window, and if you enter a quantity and then click "add to cart" here, in IE7 (at least on Vista, and als...
Hello there,
I'm trying to build something on javascript that I can have an input that can be everything
like string, xml, javascript and (non-javascript string without quotes) as follows:
//strings
eval("'hello I am a string'"); /* note the following proper quote marks */
//xml
eval(<p>Hello I am a XML doc</p>);
//javascri...
I'm trying to create a method that will sum two timeO objects and return a new TimeO object called sum.
Here is the relevant code snippet:
public static TimeO add (TimeO t1, TimeO t2)
{
TimeO sum = new TimeO ;
...
}
When i try to compile it i get this error message:
TimeO.java:15: '(' or '[' expected
...
here is the relevent code snippet:
public static Rand searchCount (int[] x)
{
int a ;
int b ;
int c ;
int d ;
int f ;
int g ;
int h ;
int i ;
int j ;
Rand countA = new Rand () ;
for (int l= 0; l<x.length; l++)
{
if (x[l] = 0)
a++ ;
els...
I am just getting started with NHaml and ran into a snag.
This is my application.haml file:
%html
%head
%title = Get Some Data
%link{ href="/media/css/styles.css", rel="Stylesheet", type="text/css" }
%body
%div.page
%h1 = Get Some Data
_
When I try to view in a browser it throw the following error:
NHa...
I get the following error from the SQL Script I am trying to run:
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near ','.
This is the SQL script:
IF NOT EXISTS (SELECT *
FROM dbo.sysobjects
WHERE id = OBJECT_ID(N'[dbo].HDDB_DataSource]')
AND OBJECTPROPERTY(id, N'IsUserTable'...
I'm new to PHP so maybe I am overlooking something here but the following:
class someClass {
var $id = $_GET['id'];
function sayHello() {
echo "Hello";
}
}
gives the following error:
Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\files\classes.php on line 13
If instead of $_GET['id'] I s...
I'm unfortunately having an unknown error with my php file. (for joomla 1.5)
I don't seem to get what's wrong.
This is my entire code, with an apparent error on line 84. Would appreciate some feedback, thanks.
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
if ( ! defined('modMainMenuXMLCallbackDefined') )
...
This code works when I try it from a .py file, but fails in the command line interpreter and Idle.
>>> try:
... fsock = open("/bla")
... except IOError:
... print "Caught"
... print "continue"
File "<stdin>", line 5
print "continue"
^
SyntaxError: invalid syntax
I'm using python 2.6
...
Hey guys! I keep getting a syntax error (unexpected $end), and I've isolated it to this chunk of code. I can't for the life of me see any closure issues. It's probably something obvious but I'm going nutty trying to find it. Would appreciate an additional set of eyes.
function generate_pagination( $base_url, $num_items, $per...
Hi
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 0010...
I'm somewhat new to object oriented programming in Javascript and I'm trying to build a handler object and library for a list of items I get back from an API call. Ideally, I'd like the library functions to be members of the handler class. I'm having trouble getting my class method to work however. I defined as part of the class bcObj...
I use the following mysql query,
DELIMITER $$
DROP PROCEDURE IF EXISTS `allied`.`aboutus_delete`$$
CREATE DEFINER=`allied`@`%` PROCEDURE `aboutus_delete`(
IN p_Id int(11)
)
BEGIN
if exists( select aboutUsId
from aboutus
where aboutUsId=p_id
and isDeleted=0
)
...