syntax

Contextual Selectors in CSS2

I'm wondering why styling an element within a specific class, like this: .reddish H1 { color: red } is shown as an example of correct syntax in the CSS1 specification under Contextual selectors: Cascading Style Sheets, level 1 but it's not shown as an example in the CSS2 spec: Cascading Style Sheets, Level 2 At least I can't find ...

What does Method<ClassName> mean?

I've seen this syntax a couple times now, and it is beginning to worry me: for example: iCalendar iCal = new iCalendar(); Event evt = iCal.Create<Event>(); Google can't help, but I know SO can! ...

How to use if then else to build a string in a crystal reports formula

This is Crystal Reports 9 in Visual Studio 2003 by the way Simple question about crystal reports formula syntax: How do I build the formula's result using if then clauses? Specifically I would like something like this: dim val as string val = {table.level} if {table.uom_id} = 5 then val = val & ' feet' else val = val $ ' meters'...

Is there a disadvantage to using "USING" instead of "ON" in MySQL?

Two snippets of MySQL: SELECT * FROM annoyingly_long_left_hand_table LEFT JOIN annoyingly_long_right_hand_table ON annoyingly_long_left_hand_table.id = annoyingly_long_right_hand_table.id; vs SELECT * FROM annoyingly_long_left_hand_table LEFT JOIN annoyingly_long_right_hand_table USING (id); Given that both...

C++ strings: [] vs. *

Hi all.. Been thinking, what's the difference between declaring a variable with [] or * ? The way I see it: char *str = new char[100]; char str2[] = "Hi world!"; .. should be the main difference, though Im unsure if you can do something like char *str = "Hi all"; .. since the pointer should the reference to a static member, which ...

How to refer to the outer class in another instance of a non-static inner class?

I'm using the Apache Commons EqualsBuilder to build the equals method for a non-static Java inner class. For example: import org.apache.commons.lang.builder.EqualsBuilder; public class Foo { public class Bar { private Bar() {} public Foo getMyFoo() { return Foo.this } private int myInt ...

Where can I find pascal-style railroad diagrams to describe C++ syntax?

(As an alternative to EBNF) ...

C# Syntax - Split String into Array by Comma, Convert To Generic List, and Reverse Order

What is the correct syntax for this: IList<string> names = "Tom,Scott,Bob".Split(',').ToList<string>().Reverse(); What am I messing up? What does TSource mean? ...

How do I reference a scalar in a hash reference in Perl?

Simple question: How do I do this on one line: my $foo = $bar->{baz}; fizz(\$foo); I've tried \$bar->{baz}, \${$bar->{baz}}, and numerous others. Is this even possible? -fREW Update: Ok, the hashref is coming from DBI and I am passing the scalar ref into template toolkit. I guess now that I look more closely the issue is somethin...

Python: Invalid Token

Some of you may recognize this as Project Euler's problem number 11. The one with the grid. I'm trying to replicate the grid in a large multidimensional array, But it's giving me a syntax error and i'm not sure why grid = [ [ 08, 02, 22, 97, 38, 15, 00, 40, 00, 75, 04, 05, 07, 78, 52, 12, 50, 77, 91, 08 ], [ 49, 49, 99, 40, 17, 81, 18...

C# Syntax - Your preferred practice for getting 2 or 3 answers from a method

I'm just wondering how other developers tackle this issue of getting 2 or 3 answers from a method. 1) return a object[] 2) return a custom class 3) use an out or ref keyword on multiple variables 4) write or borrow (F#) a simple Tuple<> generic class http://slideguitarist.blogspot.com/2008/02/whats-f-tuple.html I'm working on some cod...

C# Syntax - Example of a Lambda Expression - ForEach() over Generic List

First, I know there are methods off of the generic List<> class already in the framework do iterate over the List<>. But as an example, what is the correct syntax to write a ForEach method to iterate over each object of a List<>, and do a Console.WriteLine(object.ToString()) on each object. Something that takes the List<> as the first a...

Why is there "class" in "template <class x>"?

What does the "class" part of a template statement do? Example: template <class T> class Something { public: Something(const T &something); } And what else can go there? I usually only see "class". ...

Is it possible to make Eclipse ignore syntax checking/formatting for one specific file?

I'm using Eclipse as an IDE for Ruby/Rails development (using Aptana plugin). I have one very, very large file that encompasses an initial data load of several thousand rows of data. When this file is open, everything grinds to a halt (on both Windows and Linux), presumably because Eclipse is tied up trying to parse and format/syntax-che...

How do I do a join in SQL based on table name?

Ok, so we have a bunch of tables that are named like this: training_data_001 training_data_002 training_data_003 training_data_004 training_data_005 And then to find those we look at a field in another table, let's just call it master.training_type. Anyway, I was wondering if anyone knew of a way to do a weird table name based join w...

Casting null as an object?

I came across this code today AsyncInvoke(OnTimeMessageTimer, (object)null, (ElapsedEventArgs)null); Is there anything wrong with it or no? ...

Problem with for /f command on Windows XP

Hello. I'm using Windows XP Service Pack 3 and have Command Extensions enabled by default in the Windows Registry. Somehow, the following command does not work on this version of Windows but if I run it in Windows Server 2003 or Windows Vista Business, it works just fine. Any clue? The problem is that on Windows XP, it seems like the /...

Eclipse PDT HTML attribute assignment operator colour?

Hi, I would like to know how to change the colour of the equality sign and double quotes for html documents in the eclipse PDT IDE. I can change most colours in Preferences -> Web & XML -> HTML Files -> syntax coloring, but can't change the characters = or " e.g. in an anchor tag Anyone know if this is possible? ...

How do you concatenate text when using Bind expression in asp.net

What is the syntax to concatenate text into a binding expression for an asp.net webpage (aspx). For example if I had a hyperlink that was being bound like this: <asp:HyperLink id="lnkID" NavigateUrl='<%# Bind("Link") %>' Target="_blank" Text="View" runat="server"/> How do you change, say, the Text to concaten...

What does the "@" symbol do in Powershell?

I've seen the @ symbol used in PowerShell to initialise arrays. What exactly does the @ symbol denote and where can I read more about it? ...