explicit

Format Table Variable Output with FOR XML AUTO

Using SQL Server 2008. I have a table variable with a single column and single row. If I do this: Declare @testsToRun Table ( testsId BigInt ) Insert Into @testsToRun Select testsId From tests Where testsId = 10 Select Top 1 * From @testsToRun For Xml Auto , Type , Root('testMessage') I get XML that looks like this: <testMessage>...

F#: explicit type parameters in operator binding

I'm trying to define operator with the explicit type parameters and constraints: let inline (===)<'a, 'b when 'a : not struct and 'b : not struct> a b = obj.ReferenceEquals (a,b) It works well in F# 2.0, but produces the: warning FS1189: Type parameters must be placed directly adjacent to the type name, e.g. "type C<'...

ASP.NET: explicit vs implicit localization?

To my mind the advantage of implicit localization over explicit localization is that if you have more than one property to localize for a given control, it's a more economical syntax. In the case where you just need to localize some text I use the asp:Localize control which only has a single property (Text) that renders to the UI. Is t...

Best (safest) way to convert from double to int

I'm curious as to the best way to convert a double to an int. Runtime safety is my primary concern here (it doesn't necessarily have to be the fastest method, but that would be my secondary concern). I've left a few options I can come up with below. Can anyone weigh in on which is best practice? Any better ways to accomplish this that...

Efficiency of explicit initialization

I have a class which has a constructor that takes a const char*. It is: c::c(const char* str) { a = 32; f = 0; data = new char[strlen(str)]; memcpy(data, str, strlen(str)); } And a function which takes one of them: int foo(c& cinst); You can call this function either by passing it an instance of a c: c cinst("asdf"...

Explicit template instantiation with member template function

I have a template class with a template member function. I want to explicitly instantiate the class to avoid a drastic compilation slowdown. I am using g++ 4.1.2. I get ambiguous template specialization errors from the compiler. This the shortest code which will reproduce the problem: template <class T, class S > class Test { public: ...

Javascript use explicit self/window objects to improve performance

I read on MSDN that to improve scripting efficiency, you can use self to make implicit window references explicit. Do you know if this is true? Does this basically mean that for instance calling self.location is somewhay more efficient than calling simply location with no window opject before? Since the MSDN text is referred to the sel...

Declaring an instance of an explicit specializtion of a template within a regular class

I can't get this to compile at all. I may not be possible but I don't know why it should not be. class A { template <typename T> class B { int test() { return 0; } }; //template <> class B<int>; <-with this, namepace error B<int> myB_; }; template <> class A::B<int> { int test() { return 1; } }; As it appears ...

I need to call a dll that is calling 5 other dlls repeatedly in one application.

I'm currently using SQLitening (www.sqlitening.com) in a C++ application where I'm calling SQLitening.dll. SQLitening.dll makes subsequent calls to SQLiteningClient.dll, Zlib.dll and SQLite3.dll. I am hooking SQLitening.dll explicitly, executing a few functions, and then I am closing the connection and dereferencing the dll with FreeLi...

Problem understanding explicit constructor in C++

After reading this thread http://stackoverflow.com/questions/121162/what-does-the-explicit-keyword-in-c-mean I made up this program class MyClass { public: explicit MyClass(int a) { cout<<"Int was called"<<endl; val = a; } MyClass(char *a) { cout<<"Char was called"<<endl; val = atoi(a); } MyClass(const...

How can I get a compilation error on accidental construction?

Given 2 classes: ... class Grades{ public: Grades(int numExams) : _numExams(numExams){ _grdArr = new double[numExams]; } double GetAverage() const; ... private: // The only data members of the class int _numExams; double *_grdArr; }; class Student{ public: Student(Grades g) : _g(g){ } ......

When running NUnit and specifying a category, can all uncategorized tests be included too?

We have several hundred test classes, with a few dozen of them marked with the following attributes: [TestFixture] [Explicit] [Category("IntegrationTests")] so they will only be run in our over-night automated build. The remaining TestFixtures don't have a Category specified (and are not marked Explicit either). Here is the...

VB.NET namespace issue regarding explict (named) vs. implicit (global or root) namespaces

I have a solution that contains many projects all using the same root namespace. No code files explicitly name a namespace. So lets say the root namespace is ExampleRootNamespace. Now a problem comes into play when I want to add an explicitly named namespace to one of the code files I am working on. I want to be able to isolate this cod...

Replacing recursion (with return values) with explicit stack

I was just wondering whether if it was possible to replace recursion with an explicit stack when you need the return value(s) and are comparing them to find the best solution (like dynamic programming)? So something like (it doesn't do anything, just an example): int resursiveFunction (int state) { if (known[state]) return cache[s...