syntax

What does the 'where' keyword mean in C?

I stumbled across this C code today. Can anyone tell me what the 'where' keyword means: *y = sy + exit->y + (where * (entry->y + esy - exit->y)); Edit: Ah.. my bad. It is just a variable name. VC++ highlighted it as though it was a keyword though. ...

Proper usage of double and single quotes?

I'm talking about the performance increase here. From all I know you can echo variables in double quotes ("), like so: <?php echo "You are $yourAge years old"; ?> But single quotes will just return You are $yourAge years old. But what about performance differences? I've always gone by the rule that single quotes are faster because t...

How to create a view and update it later?

Is it possible to update the same view with new data? Using UPDATE after CREATE didn't seem to work. Have only 1 table. Want the view to be a subset of that table. After using the view, I would like the same view to hold a different subset of the data from the only table. Was thinking I can create the view, drop it, then create it ...

php syntax confusion accessing database result

I am trying to do the following: <?php foreach($sqlResult as $row): ?> <tr> <?php foreach($formdata['columns'] as $column): ?> <td><?php echo $row->$column['name']; ?></td> <?php endforeach; ?> </tr> <?php endforeach; ?> This does not work. $row is returned by my mysql query, it has the following :...

Anonymous object properties by string?

How can I instantiate an anonymous object while passing the propertynames and values as string? new With { .SomeProperty = "Value" } new With { ".SomeProperty" = "Value" } //something like this? :) ...

which sql consumes less memory

Yesterday I asked a question on how to re-write sql to do selects and inserts in batches. I needed to do this to try and consume less virtual memory, since I need to move millions of rows here. The object is to move rows from Table B into Table A. Here are the ways I can think of doing this: SQL #1) INSERT INTO A (x, y, z) SELEC...

Concise (yet still expressive) C++ syntax to invoke base class methods

I want to specifically invoke the base class method; what's the most concise way to do this? For example: class Base { public: bool operator != (Base&); }; class Child : public Base { public: bool operator != (Child& child_) { if(Base::operator!=(child_)) // Is there a more concise syntax than this? return true; /...

syntax error, unexpected '.', expecting ')'

Hi, I've got a problem when I'm calling a static var from another class. I get this pretty syntax error where php is unexpected the '.' Here is where I'm calling it : private $aLien = array( "menu1" => array("Accueil","statique/".Variable_init::$langue."/accueil.html",0,0), //This line "menu2" => array("Infos Pratiques","stat...

Effect of suffixes in memory to cache operations

In x86 GNU Assembler there are different suffixes for memory related operations. E.g.: movb, movs, movw, movl, movq, movt(?) Now my question is the following: Does the suffix has ANY effect on how the processor is getting the data out of main memory or will always be one or more 32-bit (x86) chunks loaded into the cache ? What are t...

Basic help needed with pointers (double indirection)

Hi, i asked some time ago on an account i cant remember how to manipulate basic pointers and someone gave me a really good demo for example char *ptr = "hello" (hello = a char array) so now *ptr is pointing at h ptr++ = moves the ptr to point at the next element, to get its value i do *ptr and that gives me e ok so far i hope :D ...

C# - Does function get called for each iteration of a foreach loop?

Possible Duplicate: How does foreach work when looping through function results? If I have functionality like the following - will ReturnParts() get called for each iteration in a foreach loop, or will it get called just the once? private void PrintParts() { foreach(string part in ReturnParts()) { // Do So...

Drawing up a session value within SQL query? PHP and MySQL

Hi, on one of my web pages I want my manager user to view all activities assigned to them (personally). In order to do this, I need something like this: $sql = "SELECT * FROM activities WHERE manager = $_SESSION['SESS_FULLNAME']"; Now obviously this syntax is all wrong, but because I am new to this stuff, is there a way I can call up ...

Problem with a SQL statement

I'm trying to enter values into a database table using a form and a PHP function. The PHP seems to be fine as the SQL statement it creates looks okay, but the database always throws up an error. This is the SQL statement that my code has generated (with arbitrary values): INSERT INTO Iteminfo ('itemName', 'itemSeller', 'itemCategory', '...

Why does the program give "illegal start of type" error ?

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...

Javascript/JQuery if statement

This is probably pretty simple, but I can't figure out how to do it: I have this code: $.post("/admin/contract", { 'mark_paid' : true, 'id' : id }, In pseudo code, how can I do this: $.post("/admin/contract", { 'mark_paid' : true, ...

String formatting named parameters?

I know it's a really simple question, but I have no idea how to google it. how can I do print '<a href="%s">%s</a>' % (my_url) So that my_url is used twice? I assume I have to "name" the %s and then use a dict in the params, but I'm not sure of the proper syntax? just FYI, I'm aware I can just use my_url twice in the params, but t...

actionscript - testing actionscript via command line

Hello, I would like to know if is there any easy way to test actionscript by using some kind of application like ruby's irb or javasctip spidermonkey where you can just open up your terminal and type the code straight away. This would be a good time saver when speaking of actionscript, since to test some syntaxes, classes, etc. you woul...

Why would you use "AS" when aliasing a SQL table?

I just came across a SQL statement that uses AS to alias tables, like this: SELECT all, my, stuff FROM someTableName AS a INNER JOIN someOtherTableName AS b ON a.id = b.id What I'm used to seeing is: SELECT all, my, stuff FROM someTableName a INNER JOIN someOtherTableName b ON a.id = b.id I'm assuming there's no difference ...

How to add an integer into String using objective c?

I am a java programer, I found that the Java is very gd at doing string. If I want to do this objective c, how can I do in objective c: System.out.println("This is a "+123+" test"); ...

what does ~(uint32_t) mean in C?

I'm reading a bit of C code in an OS kernel that says x & ~(uint32_t)CST_IEc; What does the ~() mean? ...