syntax

ASP.NET <%= %> vs <%: %>

It seems I am missing something. But ever since .Net 4.0 came out I have been seeing reference to <%: %> syntax for ASP.NET. It seems like it is similar to <%= %> but clearly there is a reason for the new syntax. I tried google but searching <%: %> doesn't seem to return anything. What does the <%: %> syntax do? Was it introduced i...

Lambda notation and logical comparisons

The lambda notation x => x.MyProperty is easily confused, by some humans, with greater than or equal to. Ie if (x => y) ... the question is: Does the compiler ever confuse these? Ie, should one adopt a convention whereby greater than or equal to is always coded as: if (x >= y) ... I guess the compiler can distinguish between ...

Colons after variable name on C code.

Possible Duplicate: What does 'unsigned temp:3' means This is C code sample of a reference page. signed int _exponent:8; What's the meaning of the colon before '8' and '8' itself? ...

How to put comments on .html.tpl file

I am trying to do some commenting on a .html.tpl file I'm maintaining using <!-- --> but it would return syntax error. How do you put comment on such files? ...

> jQuery Child Selector without a parent allowed?

Quick question, is a jQuery child selector without a parent ever valid? If so, how would you use it? Example of the jQuery child selector: $('ul > li') Example of jQuery child selector without parent: $('> li') The second example above doesn't work. However I can't remember if I saw it in the past before or I've seen something adv...

MySQL FK syntax: insert column called practice into table cred_insurances that is FK to table practices

I need to insert a column called "practice" into table "cred_insurances" that is a FK referencing table "practices" PK "id" ...

Can I define a nameless method in a Scala class?

Is this possible to reach? If yes, please correct my Foo declaration syntax. class Foo (...) { ... def /* the nameless method name implied here */ (...) : Bar = new Bar (...) ... } class Bar (...) { ... } val foo : Foo = new Foo (...) val fooBar : Bar = foo (...) ...

Jquery "hide on load" causing a Javascript error.

I am trying to write a menu whose subitems vanish when the page is loaded. If you need full HTML, I will copy it, however it just consists of a bunch of DIVs, the items under the headers have a class of subitems. I have managed to do what I need via: $(document).ready( $(".subitems").hide() ); However, in Chrome, despite...

ColdFusion EntityLoad Filter

How would I in ColdFusion add <= in my Filter Criteria. I was trying this EntityLoad("Entity",{someProperty <= value}); but with no luck ...

Filter tweeter feed by username and hashtag

I have started using the twitter API and would like to filter the tweets by just pulling in tweets from a specific user under a certain #hashtag. Any ideas what the corrent syntax would be, or if its possible? This is the code I am currently using: <?php $username = "TwitterUsername"; // Your twitter username. $limit = "5"; // N...

Does the word "object" have any special meaning in PHP?

Adobe Dreamweaver highlights the word object in PHP sources and I'm wondering why. It's definitely not the name of the generic class, which is generic (Edit: sorry, it's actually stdClass not generic, which I always define myself in all projects). And as you might have guessed it's not easy to google for answers to this question. ...

Searching systematic, comprehensive and complete comparison between the syntax of VB.NET and C#

I’m an experienced VB.NET developer, who wants to start with C#. I’m searching for a web based comparison between both languages syntax as quick reference. I found myself arranging VB.NET syntax templates such as... Public MustInherit Class BaseClass Public MustOverride Sub PublicMustOverrideSub(ByVal byValParam As Integer, ByRef b...

Does Razor syntax provide a compelling advantage in UI markup?

I notice Scott Guthrie is starting to mention Razor a fair bit on his blog but I'm just not that sure that it's a good fit for my style. Granted it's a fairly unfamiliar style for someone who's pretty used to a "standard" sort of ASP.Net markup (content place holders and inline code), but it just feels like a lot of additional pages to ...

What is the inner difference between (MyType)SomeObj.Property1 and (MyType)(SomeObj.Property1) in C# ?

It's probably very lame question, but I found no references in C# specification about round brackets. Please point me to spec or msdn if answer on that question will be obvious. What is the inner difference between (MyType)SomeObj.Property1 and (MyType)(SomeObj.Property1) in C# ? AFAIK, in first case ( (x)SomeObj.Property1 cast ) - it ...

Alternative to if statement in this simple example

if(metres >= 0) return true; else return false; Can I do this with a single calculation? (ignoring the ternary operator) ...

Copying fields in OCaml

Hi Guys, I have a very basic question regarding OCaml records. Suppose I have a record defined: type r = {a:int;b:int;c:int} let x = {a=3;b=8;c=2} Now, suppose I want to create a new record which has all fields equal to x but which has c=4. I could write: let y = {a=3;b=8;c=4} but this is annoying because there's not need to re-wr...

Interpreting SQL's BNF

I'm looking at the syntax of SQL, specifically the character string literal. <character string literal> ::= [ <introducer> <character set specification> ] <quote> [ <character representation> ... ] <quote> [ { <separator> <quote> [ <character representation> ... ] <quote> }... ] Ignoring the [ <introducer> <character set s...

What does the syntax function() { name = function() {} mean in JavaScript?

I'm trying to understand the following code block and am a bit stumped.. specifically I'm confused as to what the YAHOO.example.XHR_JSON = part is about. It looks like we're creating an anonymous method that creates a named anonymous method? YAHOO.util.Event.addListener(window, "load", function() { YAHOO.example.XHR_JSON = function...

C++ class ordering

I'm starting to play around with C++, coming from C and Objective C (and a bit of Java). I thought a good place to start building my skills is by writing a simple hash table from scratch, using linked lists for collisions. So I started out by writing the skeletons for each class. class HashTable { public: ... private: .....

Can anyone tell why this Hibernate query is invalid?

I have criteria query that, when executed, results the following exception thrown: java.lang.IllegalArgumentException: org.hibernate.QueryException: illegal syntax near collection: id [select generatedAlias0.permissions from temp.package.commons.user.Role as generatedAlias0 where generatedAlias0.id=2L] at org.hibernate.ejb.AbstractEntit...