syntax

Is there a performance hit in using the 'var' keyword in C#?

Possible Duplicate: C# var vs specific type performance I use the 'var' keyword extensively. A colleague told me there was a performance hit in using it, but couldnt back up his comment. Does anyone know of such a performance hit? ...

PHP specific - clean code, naming conventions and documentation

What are some of the best practices for clean code, naming conventions and documentation for PHP? I see users/people saying this is a bad practice, Example: // Create an array to hold x values $arr_x = array(); That this is a unnecessary comment cause the syntax alone explains the functionality. That is should be more of a header com...

Why 3 equal symbols in boolean comparisons?

Possible Duplicate: Javascript === vs == : Does it matter which equal operator I use? Why do I see lots of javascript code lately with expressions that look like this: if(val === "something") Why "===" instead of just "=="? What's the difference? When should I use one or the other? ...

templated operator() overload C++

someone already asked this question, but the thread ended up with the original question not getting answered. suppose you have this: template<size_t i, class f_type> void call_with_i(f_type f); functor_type is either: a) a struct with a method that has the following signature: template<size_t i> operator()() const; or, b) a fun...

What is the purpose of these PHPDOC properties?

In general, the PHPDOC properties are self-explanatory, but I'm having hard time understanding these: @category - what is this exactly? @package - could some one provide me examples about the usage of this property? ...

Unable to detect what line is causing a syntax error

Howdy! I'm working on an old project from one of my programming courses and having some issues tracking down which line in my code is causing a syntax error. When I attempt to compile the code, Visual Studio tells me that there is a syntax error towards the end of main on the line containing this function call: sortData(carray, numRe...

Convert java syntax to actionscript

I'm porting an existing java library to actionscript and since they are both realy similar, 95% of the work is simply flipping variable and function definition around. public int foo(int bar) {} //converts to public function foo(bar:int):void {} Boring stuff. Is there a tool to automate the transition between java syntax and actionsc...

Strange "type class::method() : stuff " syntax C++

While reading some stuff on the pImpl idiom I found something like this: MyClass::MyClass() : pimpl_( new MyClassImp() ) First: What does it mean? Second: What is the syntax? Sorry for being such a noob. ...

Why is this Haskell incorrect?

I have a Haskell file which looks like this: longest::[Integer]->[Integer]->[Integer] max a b = if length a > length b then a else b llfs::[Integer]->Integer llfs li = length(foldl longest group(li)) llfs([1, 2, 3, 3, 4, 5, 1, 1, 1]) Which should print out the result of the function call at the end, however when I run the file I get...

Whats wrong in this query?

ALTER TABLE Physician Modify (RefLastName nvarchar(500), RefFirstName nvarchar(500)); Getting Incorrect syntax error... ...

Semicolon after classes and structs

Possible Duplicate: Why must I put a semicolon at the end of class declaration in C++? Found duplicate, vote to close please. Why do classes and structs have to be concluded with semicolon in C++? Like in the following code: class myClass { }; struct muStruct { }; This syntax isn't necessary in Java or C#. Why does the...

MFC visibile function

Hi guys, I have an assignment using MFC which is a completely foreign language to me. I have to be able to upload Image1, and Image2 into 2 picture controls. And using a slider: when it is on the far left, you see Image1 in a third picture control, when it is on the far right you see Image2. Anywhere in between you should see a transitio...

Python: Invalid Syntax with test data using Pyparser

Using pyparser, I am trying to create a very simple parser for the S-Expression language. I have written a very small grammar. Here is my code: from pyparsing import * alphaword = Word(alphas) integer = Word(nums) sexp = Forward() LPAREN = Suppress("(") RPAREN = Suppress(")") sexp << ( alphaword | integer | ( LPAREN + ZeroOr...

What exactly is is this in ruby: `&:capitalize`

I just read this answer http://stackoverflow.com/questions/1791639/regular-expression-in-ruby-to-convert-uppercase-title-into-lowercase/1792102#1792102. There is the following line of code "abc".split(/(\W)/).map(&:capitalize).join What exactly is &:capitalize? Before I had put this into irb myself, I would have told you, it's not va...

Why does GCC give me a syntax error when trying to return a struct pointer?

I'm using CodeLite on Ubuntu and for some bizzare reason GCC keeps throwing this error whenever I try to compile code with a function that returns a pointer to a struct: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token Here is an example I wrote up to demonstrate this error: #include <stdio.h> typedef struct ...

Oracle JOIN USING + Subquery : ora-00904 string: invalid identifier

Hi, i m having a little syntax problem in my query (simplified) : select * from table1 t1 inner join table2 t2 using (pk1) inner join table3 t3 using (pk2) where not exists (select1 from table4 t4 where t4.pk1 = t1.pk1) By using the "using" keyword, oracle doesnt allow table identifier in front of the column name (eg : t1.pk1, only p...

jQuery form zip code to state function

I'm trying to convert a preexisting javascript function into a jQuery function. The function comes from http://javascript.internet.com/forms/zip-to-state.html and aims to convert a user-entered zip code into a state. I'm using jQuery 1.3.2, with all the necessary plugins, but I'm not very familiar with jQuery syntax and how to convert th...

What is the correct syntax for SQL Statement using MySQL

In access i used this and its works fine: (tblReservations_Dates.Date) Between #" & dteBegDate & "# And #" & dteEndDate & "# Using MySQL I used this: (tblReservations_Dates.Date) Between '" & dteBegDate & "' And '" & dteEndDate & "' However the data is not displayed I was just wondering if this is the correct syntax for SQL Stateme...

Can I use a logical "or" in a PHP switch statement case?

Is it possible to use "or" or "and" in a switch case? Here's what I'm after: case 4 || 5: echo "Hilo"; break; ...

Difference between <?php and <?

I am new to php and would like to know if there are any differences between these server tags : <?php ?> and <? ?> ...