syntax

How to specify only some optional arguments when calling function in ColdFusion?

I have a ColdFusion function "foo" which takes three args, and the second two are optional: <cffunction name="foo" access="public" returntype="any"> <cfargument name="arg1" type="any" required="true" /> <cfargument name="arg2" type="any" required="false" default="arg2" /> <cfargument name="arg3" type="any" required="false" d...

mySQL - Using data from another table.field to determine results in a query.

Hello Hello, Buried in mySQL syntax and query structure problems once more. I'm currently doing this query fine:- SELECT DATE_FORMAT(`when`, '%e/%c/%Y')date , COUNT(`ip`) AddressCount FROM `metrics` WHERE `projID` = '$projID' GROUP BY DATE(`when`) This works fine to find the specific number of ip address's hit. However, what...

Two C syntax tidbits: no init for and char *w[4] vs char w[4]

Just studying the C style of Jon Bentley's Programming Pearls and was wondering if someone could please explain to me the following two pieces of C syntax: A for with no init condition (see line 2 in wordncmp in the file above): for ( ; *p == *q; p++, q++) and the semantic difference between char *word[800000]...

What's the difference between "keyword" and "reserved word"?

What's the difference between keyword and reserved word? Fore example in the concepts' proposal one can read the following statement This proposal introduces five new keywords: concept, concept map, where, axiom, and late check. All of these keywords will also be reserved words. ...

"for each" statement in C++/CLI

array<int> ^ints = gcnew array<int>{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; for each(int i in ints) if(i % 2 == 0) Debug::WriteLine("Even\n"); else Debug::WriteLine("Odd\n"); Why does the above fail to compile? It works fine if I use a for(int i; ...) or if I enclose the if-else within braces. I know that the manual cl...

What is the PHP ? : operator called and what does it do?

Can someone please explain what the "?" and ":" operators are in PHP? e.g.: (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) ...

Which programming language has the least amount of syntax?

Which programming language has the least amount of syntax? How can I calculate how many syntax a programming language has? Thanks. ...

jQuery Syntax Help

Sorry for asking such a newbie question, I know it makes a few of you here angry. But I think learning the syntax is the hardest part so don't flame me too badly. Right, I'm using the Tabs widget from the jQuery UI. I'm stuck with setting the options for this. This is how it stands... <script type="text/javascript"> $(function() { ...

A textbox/richtextbox that has syntax highlighting? [C#]

Where can I find a control for WinForms that will highlight source code pasted into it? I would like one that has syntax highlighting support for many different languages but if it only works with C# I would be fine with that also. ...

Is there a way to nest (or escape) ASP.NET inline code inside HTML angle brackets?

is it possible to do something like the following in ASP.NET: <tr<%= index++ % 2 == 0 ? " class=\"alt-row\"" : ""; %>> in other words, is there a way to escape the angle brackets for the inline code block or something? (i know the alternative is: <% if (index++ % 2 == 0) { %> <tr class="alt-row"> <% } else { %> <tr> <% } %> ...

Why won't Perl let me chain a postfix loop from a postfix comparison?

This is ok: $foo++ if $condition; And this is ok: $foo++ for (1..10); But this isn't: $foo++ if $condition for (1..10); I find the latter quite readable if things aren't complicated, and it fits on one line! Is there a way to do this or should I move on with my life? ...

Is there a difference between x++ and ++x in java?

Is there a difference between ++x and x++ in java? ...

How can I eliminate left recursion in the following grammar?

Here's the grammar, which is supposed to describe a language of nested braces with commas as delimiters: L ::= {L} | L,L | A few more examples of strings I'd expect the grammar to accept and reject: Accept: {,{,,{,}},,{,}} {{{{}}}} {,{}} Reject: {}{} {,{}{}} {{},{} ...

what is the role of the plus sign(+) in the following function which is excerpt from jquery source code

function now(){ return +new Date; } questions : what does the plus sign mean? when can you create a new object with a constructor function but without the following parentheses, such as new Date but not new Date() great thanks! ...

mySQL Select visits and display all by month?

Hi guys, I'm punching way above my weight for mySQL Queries and syntax right now. I could do with some help achieving the following:- I have a metrics/analytics table with country of visit in a row. I have the following query:- SELECT `country`, COUNT(`ip`) AS `cViews` FROM `metrics` WHERE `projID` = 'projID' AND `country` != 'XX' AND...

What's the Difference Between <s:property ..> and ${param}

In struts I notice there are two different ways to access variables. I am curious what the difference is and when to properly use each one. For example, suppose we set the variable height like so: <s:set var="height">300px</s:set> Now I can use it two ways: <div style="height: ${height}">&nbsp;</div> ..or.. <div style="height: <...

SQL Server: any equivalent of strpos()?

I'm dealing with an annoying database where one field contains what really should be stored two separate fields. So the column is stored something like "The first string~@~The second string", where "~@~" is the delimiter. (Again, I didn't design this, I'm just trying to fix it.) I want a query to move this into two columns, that would...

question about java constructor call syntax

Dear all. Unfortunately I haven't coded Java for about five years and I absolutely can not remember how or why the following code is working. I stumbled across a similar example and broke it down to this. The emphasis is on the part below the comment: I don't get the constructor notation followed by the block in double brackets. And ...

Is it possible to undefine a variable in ColdFusion?

Is it possible to undefine a variable in ColdFusion? For example, something like this: <cfset myVar = "lsajflksd" /> <cfoutput> <p>myVar is Defined? #IsDefined("myVar")#</p> <!--- Prints YES ---> </cfoutput> <cfset Undefine(myVar) /> <!--- Doesn't exist... ---> <cfoutput> <p>myVar is Defined? #IsDefined("myVar")#</p> <!--- I want i...

Another simple "if-else" form in PHP?

Hi, i read somewhere before, there is another way to perform the if-else statement, the code should be similar to this: <?php $var = "stackoverflow"; // Here is the if-else if(strlen($var) > 1) ? echo "TRUE" : echo "FALSE"; ?> I could only remember something like this, but it doesn't work, anyone knows how to write this 1 line i...