syntax

syntax for nolock in sql

I have seen sql statements using nolock and with(nolock) e.g - select * from table1 nolock where column1 > 10 AND select * from table1 with(nolock) where column1 > 10 Which of the above statements is correct and why? ...

Why is the usage of "#" comments frequently discouraged in PHP?

As far as I know, there are 3 types of comments recognized by PHP: /* A block comment */ // A single-line comment # Also a single-line comment However, many coding standards, for example, those of PEAR or Kohana, discourage the last type of comments with no explanation. The question is, why is it so? Is this syntax planned for deprec...

XSD: specifying element with 12 characters and area code is digit

What is the XSD syntax, given <xs:element name="PhoneNumber" type="xs:string" ...? > , to specify the following format for a phone number: 12 characters and area code is digits. example of values: <PhoneNumber>213-555-5845</PhoneNumber> <PhoneNumber>213-695-CARE</PhoneNumber> <PhoneNumber>213-4URGENT</PhoneNumber> ...

How to correct a jQuery syntax error?

I'm trying to update a Total: (span.wrap p span) field at the bottom of a form using jQuery. I have a few checkboxes, each of which has an associated price contained within the title attribute like so: title="$2". I'd the Total: field to update dynamically when the user clicks a checkbox. Here is the script I have, but it's throwing a ...

Php syntax error

Hello, here is my error: Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home3/*/www/modules/mysql_worker.php on line 9 Here is file mysql_worker.php http://pastie.org/697284 ...

I wish I could correlate an "inline view"...

I have a Patient table: PatientId Admitted --------- --------------- 1 d/m/yy hh:mm:ss 2 d/m/yy hh:mm:ss 3 d/m/yy hh:mm:ss I have a PatientMeasurement table (0 to many): PatientId MeasurementId Recorded Value --------- ------------- --------------- ----- 1 A d/h/yy hh:mm:ss 100 1 A d/h/yy hh:mm:ss 200 1 ...

How to add option to select list in jquery

My select list is called dropListBuilding. The folliowng code seems to not work: for (var i = 0; i < buildings.length; i++) { var val = buildings[i]; var text = buildings[i]; alert("value of builing at: " + i.toString() + " is: " + val); $("#dropListBuilding").addOption(val, text, false); } This line dies: $("#dr...

pdo database abstraction

Hello, Can someone help me to see what is going wrong with this setup I build the @sql query in the function below like this. The extra quotes are setup in the conditions array. $sql .= " WHERE $field = \"$value\""; The pdo update function loops the conditions array like this. if (!is_null($conditions)) { $cond = ' WHERE'; $ob...

MySQL query syntax question

Let's say I have a query like this- SELECT * FROM table_name WHERE venue = "1" OR venue = "10" That's great, works fine. But let's say I have a list of 50 venue numbers. Is there an easy way to do this where I don't have to write out 50 different ORs? Thanks! ...

How to interpret hexadecimal numbers like 0x0A?

What does 0x0A mean in C++ and how should I interpret or read such hexadecimal values? if (version < 760 || version > 760){ disconnectClient(0x0A, STRING_CLIENT_VERSION); } uint32_t accnumber = msg.GetU32(); std::string password = msg.GetString(); if(!accnumber){ disconnectClient(0x0A, "You must enter your account number."); ...

How to change out-of-focus text selection color in Xcode?

Okay, I'll bite. I've got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, however, the results list stays in focus and the found text remains out of focus, using a different background color. This color is extremely h...

VC++ Error on template inheritance

This is child's play, but I'm a bit of a vc n00b. I get an error: error C2143: syntax error : missing ',' before '<'. on the second line of the following code: template<int i, int j> class B : public A<i, j> { } template<int i, int j> class A { } Thanks for the help! ...

Do you use the OUTER keyword when writing left/right JOINs in SQL?

I often see people who write SQL like this: SELECT * from TableA LEFT OUTER JOIN TableB ON (ID1=I2) I myself write simply: SELECT * from TableA LEFT JOIN TableB ON (ID1=I2) To me the "OUTER" keyword is like line noise - it adds no additional information, just clutters the SQL. It's even optional in most RDBMS that I know. So... why...

SQL Syntax question

What does the following statement mean? Is it an equivalent for TOP? select +10 as ContentID ...

GraphViz: How to change arrowhead type?

I want to simulate non-directional graphs with .dot. To that end, I want the arrowhead type to be "none". How do I set this? "f" -> "t" [label=2],[arrowhead=none] "m" -> "d" [label=0],[arrowhead=none] The above is not working. ...

Adding code in constructor with alternative class syntax

type Foo = class inherit Bar val _stuff : int new (stuff : int) = { inherit Bar() _stuff = stuff } end I want to add this code in above constructor: if (stuff < 0) then raise (ArgumentOutOfRangeException "Stuff must be positive.") else () How can I achieve this in F#...

What's wrong with my grammar

I try to input the following into my yacc parser: int main(void) { return; } It looks valid to me according to what's defined in the yacc file, but I get a "syntax error" message after the return. Why is that? The yacc file: /* C-Minus BNF Grammar */ %{ #include "parser.h" #include <string.h> %} %union { int intval; struct...

Syntax query please help me?????

Hello All, Please can anyone tell me all the properties or methods which I can use while using the following method of HTML syntax <%= Html.TextBox("email", "", new { maxlength = 200 })%> <%= Html.ValidationMessage("email", "*")%> i want the link where i can get the complete synatx of the above . please help me Thank...

What is the reasoning behind the Makefile whitespace syntax?

G'day, I'm revisiting Python after Michael Sparks's excellent walkthrough of Peter Norvig's Python spell checker at the SO DevDay in London. One of the points he highlighted was how clean Python is to look at. Not cluttered with braces for scopes but using white space to indicate block scope instead. This got me thinking. I wonder if ...

MySQL deleting multiple columns from two table

Hello. I have Two tables like this: Table categories: columns: id, name, parent 1, Foods, 0 2, Drinks, 0 3, FastFood, 1 4, Hamburger, 3 Table documents: columns: id, name, categoryID 1, CheseBurger, 4 2, shop, 3 the parent column has the parent category's id. So When i want to delete Foods entry from categories, i want to delete all ...