tagged [syntax]

C# is there a foreach oneliner available?

C# is there a foreach oneliner available? I just want to know if there is a foreach oneliner in C#, like the if oneliner `(exp) ? then : else`.

22 Dec at 15:35

Your favourite Abstract Syntax Tree optimization

Your favourite Abstract Syntax Tree optimization If you were constructing a compiler, what optimization at the AST level would be the nicest to have?

What are [] in C#?

What are [] in C#? For example: [TestFixtureSetUp] in this example, what does it do? From my experience, [] usually refers to lists.

20 Jul at 12:56

How can I throw an exception in C?

How can I throw an exception in C? I typed this into Google, but I only found how-tos in C++. How can I do it in C?

10 Jun at 12:20

Cross-reference (named anchor) in markdown

Cross-reference (named anchor) in markdown Is there syntax for the equivalent of:

30 Nov at 21:42

Question mark and colon in JavaScript

Question mark and colon in JavaScript I came across the following line What do the `?` and `:` mean in this context?

What's the u prefix in a Python string?

What's the u prefix in a Python string? Like in: My guess is that it indicates "Unicode", is that correct? If so, since when has it been available?

19 Oct at 16:51

What does the "@" symbol do in PowerShell?

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?

21 May at 21:23

Ruby - test for array

Ruby - test for array What is the right way to: or to get the count of items in it?

6 Oct at 20:21

What does "-ne" mean in bash?

What does "-ne" mean in bash? What does the command "-ne" mean in a bash script? For instance, what does the following line from a bash script do?

20 Mar at 03:21

keyword "auto" C++ and "dynamic" C#

keyword "auto" C++ and "dynamic" C# Does "dynamic" keyword in C# work like "auto" in C++ More details: `auto a = 5; //C++` `dynamic a = 5; //C#` Are they similar?

22 May at 04:19

What is the C# Using block and why should I use it?

What is the C# Using block and why should I use it? What is the purpose of the `Using` block in C#? How is it different from a local variable?

26 Feb at 21:0

Copy Notepad++ text with formatting?

Copy Notepad++ text with formatting? I'm using Notepad++ to write code. How do I copy code in Notepad++ along with its formatting to paste into Microsoft Word? (i.e. syntax highlights, etc)

6 Dec at 08:37

Is there a difference between "!=" and "is not" in C#?

Is there a difference between "!=" and "is not" in C#? Is this: different from this: Or are there no differences between the two conditions?

20 Nov at 17:36

How can I do a line break (line continuation) in Python?

How can I do a line break (line continuation) in Python? Given: How do I write the above in two lines?

9 Apr at 08:53

What does Method<ClassName> mean?

What does Method mean? I've seen this syntax a couple times now, and it's beginning to worry me, For example:

1 Jul at 16:44

What does += mean in Python?

What does += mean in Python? I see code like this for example in Python: What does the `+=` mean?

12 Dec at 22:20

What does the question mark and the colon (?: ternary operator) mean in objective-c?

What does the question mark and the colon (?: ternary operator) mean in objective-c? What does this line of code mean? The `?` and `:` confuse me.

Comments in Markdown

Comments in Markdown How do you write a comment in Markdown, i.e. text that is not rendered in the HTML output? I found nothing on the [Markdown project](http://daringfireball.net/projects/markdown/).

21 Dec at 07:54

Kotlin secondary constructor

Kotlin secondary constructor How do I declare a secondary constructor in Kotlin? Is there any documentation about that? Following does not compile...

10 Oct at 15:7

What does "static" mean in C?

What does "static" mean in C? I've seen the word `static` used in different places in C code; is this like a static function/class in C# (where the implementation is shared across objects)?

29 Oct at 15:42

What are the advantages of list initialization (using curly braces)?

What are the advantages of list initialization (using curly braces)?

What does "DateTime?" mean in C#?

What does "DateTime?" mean in C#? I am reading a .NET book, and in one of the code examples there is a class definition with this field: What does `DateTime?` mean?

13 Dec at 20:42

Syntax Highlighting VS Addins

Syntax Highlighting VS Addins What tools are out there that compete with this product? [CodeKana](http://www.codekana.com/) I know ReSharper has improved syntax highlighting. Is it comparable to this?

Why does C# allow {} code blocks without a preceding statement?

Why does C# allow {} code blocks without a preceding statement? Why does C# allow code blocks without a preceding statement (e.g. `if`, `else`, `for`, `while`)?

26 May at 13:19