syntax

Syntax to bind to the current dataitem's default indexer in WPF?

I have a Listbox with an itemssource set to an ObservableCollection of DataRow. Let's say each DataRow has 5 columns for this example. In the DataTemplate of the ListBox I have 5 textblocks (1 for each column). My question is how can I bind to an indexer of the row to get the columns value? Here is my attempt but nothing displays so I ...

C# question for VBer. Do private fields have to be declared Static?

Hello, I am a vb.net programmer switching to C#. I have the following code for a console application (targeting NET20) using System; using System.IO; using System.Data; using System.Data.SqlClient; using System.Configuration; namespace eScoreSwapper { class Program { private string _dbName = ConfigurationManager.Ap...

What does the % symbol do or mean in Ruby?

if counter % 2 == 1 I am trying to decode this line -its rails project and I am trying to figure out what the % does in this if statement. ...

What is the purpose of this c++ declaration?

Hi, I got a C++ struct: struct Student{ Student(){ } }; And the enum: enum studenttype_t { levelA = 0, levelB = 1, levelC = 2 }; Then somewhere else it is declared: vector<Student *> student; Could it be used as follows: student[levelA] = new Student(); If so, what does the student[levelA] m...

Column not found error with simple SQL query

I know its almost there, but base is telling me it can't find a column called table1.id when I know its there! UPDATE table2 SET col1 = (SELECT field1 FROM table1 WHERE table2.id = table1.id) WHERE table1.id = table2.id ...

Need beginner help with C++ syntax

I am busy with an assignment an I am getting an error from the compiler. I've got 4 yrs C# experience nil in C++. I'm getting the error "Invalid conversion from nodeType, initializing argument 1 of void linkedListType::deleteNode(const Type&) [with Type = int]' " on the line deleteNode(current->link); of this function: template<class...

python target string key count invalid syntax

Hi Why am i getting an "invalid syntax" when i run below code. Python 2.7 from string import * def countSubStringMatch(target,key): counter=0 fsi=0 #fsi=find string index while fsi<len(target): fsi=dna.find(key,fsi) if fsi!=-1: counter+=1 else: counter=0 fsi=...

Help with Objective-C variable declaration syntax

Is there a difference between these two declarations? Is one better practice? NSString* hello = @"HelloWorld"; NSString *hello = @"HelloWorld"; Thanks-- ...

COCO/R Expression syntax failing

Hi All, I've got this little COCO/R grammar fragment that roughly mimics the syntax of c-style languages for expressions (only vastly simpler). But for some reason, it refuses to parse a compound expression. Perhaps it's been a long week, or perhaps I'm missing something totally obvious. I've boiled the Expression grammar down as much a...

What's wrong with the c++ code below?

HRESULT SaveGraphFile(IGraphBuilder *pGraph, WCHAR *wszPath) { const WCHAR wszStreamName[] = L"ActiveMovieGraph"; HRESULT hr; IStorage *pStorage = NULL; // First, create a document file that will hold the GRF file hr = StgCreateDocfile( wszPath, STGM_CREATE │ STGM_TRANSACTED │ STGM_READWRITE │ ...

C# Syntax Highlighter that outputs HTML

I'm looking for a C# syntax highlighter that will take my C# code and turn it into standalone HTML that is neatly tagged. I have found some websites that offer this but only output HTML that is coupled with a CSS stylesheet. If anyone knows if what I'm describing exists please gimme a link! ...

Why it's valid to include a header file twice in c++?

#include "DLLDefines.h" #include "DLLDefines.h" The above actually passed compilation, but why? ...

Anonymous inner classes in C# ?

Is there something like anonymous inner classes (used in Java) in C#? I explain what I would use it for by example: I'm declaring and initializing field of type IDictionary<Person, Account> and I need to write custom IEqualityComparer<Person>. That is because I want two Persons to be treated as equal by the IDictionary when they have e...

Java =+ operator

Possible Duplicate: What is the difference between += and =+? I know what saying x+=1; means but what does saying x=+1; mean? ...

How to declare a variable in header file to be used in two .cpp ?

My target module is an executable to be built from X.cpp and Y.cpp, both these two files need a common .h file: extern HANDLE hPipe; extern IMediaSample *pSave = NULL; But when I build the module, I got an error saying : Y.obj : error LNK2005: "struct IMediaSample * pSave" (?pSave@@3PAUIMediaSample@@A) already defined in X.obj How ...

Appended '= x' after a method declaration in c++.

In C++, when a method is declared, I've noticed that sometime the method may have an assignement appended to it. Could anyone tell me what this is? For example: virtual void MyMethod () = 0; What doe the '= 0' mean. :) Thanks everyone !!! ...

How do I declare the version number for a Perl module?

I thought I knew how to declare version numbers for modules. But after reading the article "$VERSION Confusion" at Modern Perl Books, a Modern Perl Blog; I'm now more confused than I started. (Ignorance was indeed bliss.) Not that I have hangups about "perfect" code but I'm just really curious why such a trivial matter apparently has no ...

Purpose of Scala's Symbol?

Possible Duplicate: What are some example use cases for symbol literals in Scala? What's the purpose of Symbol and why does it deserve some special literal synatx e. g. 'FooSymbol? ...

Any difference between these two in c++?

new char[1] and new char,essentially the same thing,hm? ...

Objective C syntax question...

I see that the UIColor class can call the variable like this [UIColor redColor]; How can I write my class to do the same thing? Also, can I have a method only for class, for example, like this: [MyClass callingMyMethod]; Thank you. ...