syntax

Difference between %i and %d in printf() for C and C++

what is the difference between %d and %i when used in printf function ? ...

gnu assembler: get address of label/variable [INTEL SYNTAX]

Hi guys. I have a code like this: .bss woof: .long 0 .text bleh: ...some op codes here. now I would like to move the address of woof into eax. What's the intel syntax code here for doing that? The same goes with moving bleh's address into, say, ebx. Your help is much appreciated! ...

sqlite3 syntax error

I am having some problem with sqlite. I want to insert some data to database,however,when I use the function sqlite3_exec(db,sql,0,0,&zErrMsg);, the zErrMsg returns: near '\x90' syntax error. the code is : (void) ExecuteCommand:(NSString *)command DBRef:(sqlite3 *)db { const char *sql = [command UTF8String]; char *zEr...

What characters are valid in hash keys?

As per subject: what are the characters that can be used in hash keys or, if it's shorter, which ones can't be used? Also, are there any problems in using long hash keys (like full path names)? ...

What is the name of the language used to define the following syntax?

[ FROM {<table_source>} [,...n] ] <join_type> ::= [ INNER | { { LEFT | RIGHT | FULL } [OUTER] } ] [ <join_hint> ] JOIN ...

Caret in objective C

What does the caret in objective C mean? ie. void (^handler)(NSInteger); from Mac Dev Center ...

C++/CLI: Native Reference vs Tracking Reference

What is the difference between the following two functions? ref class SomeClass; void swap(SomeClass^& a, SomeClass^& b){ SomeClass^ c = a; a = b; b = c; } void swap2(SomeClass^% a, SomeClass^% b){ SomeClass^ c = a; a = b; b = c; } ...

What is this syntax in PHP?

I'm working on modifying a script to better suit my needs, and I came across this line in the code: return isset($_COOKIE[$parameter_name]) ? $_COOKIE[$parameter_name] : ""; I know that the function itself is essentially a cookie getter method, but I'm not quite sure what that syntax (i.e. the "?" and ":") means. I apologize if this i...

Speedup writing C programs using a subset of the Python syntax

I am constantly trying to optimize my time. Writing a C code takes a lot of time and requires much more keyboard touches than say writing a Python program. However, in order to speed up the time required to create a C program, one can automatize many things. I'd like to write my programs using smth. like Python but with C semantics. I...

jquery variable syntax

I'm learning jQuery by trying to understand other people's code. I ran into this: jQuery.fn.myFunc = function(options, callback) { //stuff jQuery(this)[settings.event](function(e) { var self = this, $self = jQuery( this ), $body = jQuery( "body" ); //etc. } //more stuff } My understanding is that $ refers to ...

C++ array initialization

is this form of intializing an array to all 0s char myarray[ARRAY_SIZE] = {0} supported by all compilers? , if so, is there similar syntax to other types? for example bool myBoolArray[ARRAY_SIZE] = {false} ...

Boolean Query..

if: x = 0 b = x==0 and i print be it would print 'true' but if i did: x = 0 b = x ==3 and i printed be it would be false. In stead of it printing false how would i take the boolean value 'b' to print what text i wanted? let me explain further: bool = all(n > 0 for n in list) if bool != 'True': print 'a value is not gr...

jQuery selector syntax gives Firefox warning

The following code stringref = "tab_2"; jQuery('.someclass a:not(.someclass #a_someclass_'+stringref+')').css('color', '#000'); gives me this warning in the FF 3.5.5 error console and I can't figure out why: Warning: Missing closing ')' in negation pseudo-class '#a_someclass_tab_2'. Is my syntax failing me or has FF gone bonkers ? ...

Eclipse (with Pydev) keeps throwing SyntaxError

My code: print "Hello World!" I even tried adding a semicolon behind, but everytime I save and run (as Python run) it says: File "E:\Software\Eclipse\Workspace\Python1\src\main.py", line 1 print "Hello World!"; SyntaxError: invalid syntax I have no idea why. ...

Declaring functions in JavaScript

Possible Duplicate: Javascript: var functionName = function() {} vs function functionName() {} What's the difference between these two ways of declaring a function? function someFunc() { ... } var someFunc = function() { ... } I'm not asking in the technical sense. I'm not asking which is better for readability, or which sty...

Bash syntax: What is the "<<"?

Could someone explain the "<<" in the following code? mysql test<<E0Q Select * from signins I'd try to search for it myself, but symbols are hard to search for... Thanks, Dan ...

Parsing a custom string-generating-pattern syntax

Background: I'm developing a custom regex-like syntax for URL filenames. It will work like this: User writes a pattern, something like "[a-z][0-9]{0,2}", and passes it as input It is parsed by the program and translated into the set of permutations it represents i.e. 'a', 'a0', 'a00' ... 'z99' These patterns will vary in complexity, ...

How to escape identifiers in Boo?

If I have an identifier with a same name as existing keyword, how do I escape it? ...

LINQ, Where() vs FindAll()

Hi, can someone explain how the LINQ functions Where(..) and FindAll(..) differ? they both seem to do the same thing.... ...

More elegant way to do this in Ruby

I've started with Ruby and am finding new, shorter, elegant ways to write code everyday. In solving Project Euler problems, I've written a lot of code like if best_score < current_score best_score = current_score end Is there a more elegant way to write this? ...