syntax

Syntax Error? Jquery script not working in IE7

I am using the following code to open a modal box when a button is clicked. Works fine in all browsers but IE7 where I get an error. This is the code. Have I done something wrong??? <script type="text/javascript"> $(document).ready(function(){ var dialogOpts = { modal: true, bgiframe: true, autoOpen: false...

Please help me to recover parse error in my code

Hello, I have this weird problem, I know how to select and insert, BUT I don't know how to UPDATE, well at least I thought I did. And all of the code from tutorials brings back errors. Here's the error I'm getting: ...

Java array initialization list ending with a comma

The comma , items separator used in an array initialization list may end the list in C, this is mentioned in The C Programming Language 2nd ed by Kernighan & Ritchie . e.g. int c[] = { 1, 2, 3, }; This is convenient when the list is long, and one doesn't want to have to change/check the previous line when adding items long long...

What's #pragma comment (lib, "lib/glut32.lib")?

I saw the code on the top of a GLUT demo and I'm curious about its functionality. Why would someone want to write a #pragma instead of just including the library? ...

Is there a easier / clearer syntax like Markdown that can compile into LaTeX?

I love LaTeX. Let's get that straight right off the bat. The only thing I'm wishing for is a clearer syntax that compiles into LaTeX, like Markdown for HTML. This is because most of the simple document creation that I do (like taking notes in class), could be faster and improved if I could just type 1/2 instead of \frac{1}{2} and it com...

Syntax error with IF statement in Python 3.0

I am teaching myself some Python and I have come across a problem which is probably plainly obvious, except that I can't see it and I need another pair of eyes. I am making a small game I made into a gui program. I have this section of code, which when run gives me "Traceback (most recent call last): File "", line 21, in Syntax Er...

How can this IF statement code snippet be Refactored?

I've read a lot of Refactoring literature as of late and a common theme I see in examples is the reduction of lots of IF statements. The below is a very simple code block that first checks to see if an email address is supplied and if so, then proceeds to validate the email address. I typically see a lot of this type of code which always...

Splitting C++ Strings Onto Multiple Lines (Code Syntax, Not Parsing)

Not to be confused with how to split a string parsing wise, e.g.: http://stackoverflow.com/questions/236129/how-to-split-a-string I am a bit confused as to how to split a string onto multiple lines in c++. This sounds like a simple question, but take the following example: #include <iostream> #include <string> main() { //Gives error...

What does the partial mean?

public partial class Form1 : Form What does the partial in this declaration mean? I understand we have a class Form1 that inherits from Form. But what does the partial mean? ...

Setting default function parameters with variable in php

I would like to do something like: function func($var1 = 'Hello', $var2 = "{$var1} World") { echo $var2; } This is not possible! My idea is to avoid extra code lines inside my function but I don't know if that is possible. Does someone know if a similar procedure is possible in php? Thanks. ...

zsh give file argument without creating a file - syntax?

Suppose I have have a program P which has a filename as argument. For example P file reads the file "file" and does something with it. Now sometimes the content of "file" is very small, e.g. just one line. So instead of creating a file f with that line and calling P f I want to give the content of line directly as an argument t...

Why bother to write -> rather than . ?

Possible Duplicate: Why does C have a distinction between -> and . ? What is the real reason for a programmer to have to differentiate between . and -> when accessing a member of an object? void foo( Point &p ) { p.x ; p->y; // syntax error } void foo( Point *p ) { p.x ; // syntax error p->y; } I mean, on...

Statements only in methods, but what about declarations?

On MSDN I found: In C#, every executed instruction is done so in the context of a method. But I also read that an int A=5; statement can be in the class body. It seems it's not in a method body, so why this is possible? It is probably just term confusion but I would like to know. ...

Why does Joomla display this error?

I have made a website in Joomla and have i on my local machine. Everything works perfectly, but when i upload the site to my domain i get this error: Parse error: syntax error, unexpected T_STRING in /home/www/fotohandleren.mathiasbak.dk/templates/fotohandleren_dk/index.php on line 1 I have edited the configuration file so it connects ...

Converting Actionscript syntax to Objective C

I have a game I wrote in Actionscript 3 I'm looking to port to iOS. The game has about 9k LOC spread across 150 classes, most of the classes are for data models, state handling and level generation all of which should be easy to port. However, the thought of rejiggering the syntax by hand across all these files is none too appealing. A...

SQL LEFT JOIN strange syntax error?

===problem=== i'm using a LEFT JOIN, SQL expression, on 3 tables. i'm getting an unexpected error "JOIN expression not supported" from MS ACCESS 2007 when i try to run it. ===details=== these tables are all connected parent: is at the highest level child1: child of parent child2: child of parent grandchild1: child of child1 thi...

Stored Procedure return multiple result sets

I need a SP to return multiple sets of results. The second set of results would be based on a column of the first set of results. So: declare @myTable1 table(field0 int,field1 varchar(255)) insert into @myTable1 select top 1 field0, field1 from table1 declare @myTable2 table(field0 int,field3 varchar(255)) insert into @myTable2 selec...

Why to use empty parentheses in Scala if we can just use no parentheses to define a function which does not need any arguments?

As far as I understand, in Scala we can define a function with no parameters either by using empty parentheses after its name, or no parentheses at all, and these two definitions are not synonyms. What is the purpose of distinguishing these 2 syntaxes and when should I better use one instead of another? ...

How does bash parameter expansion work?

I'm trying to understand a bash script with help of google :) Then I stumbled upon this: DIR=${1:-"/tmp"} What does that mean? Google does not give any relevant result :( ...

How to deal with IndentationError?

Error Details: File "imp.py", line 55 key = get Key() ^ IndentationError: expected an indented block Below is the Code: # Caesar Cipher MAX_KEY_SIZE = 26 def getMode(): while True: print('Do you wish to encrypt or decrypt or brute force a message?') mode = raw_input().lower() if mode in 'encryp...