non (4,346)


sql server - What is the best way to copy a database?

sql server - What is the best way to copy a database?

I always create a new empty database, after that backup and restore of the existing database into it, but is this really the best way? As it seems very error prone and over complicated for me.…


unit testing - How do you mock a Sealed class?

Mocking sealed classes can be quite a pain. I currently favor an Adapter pattern to handle this, but something about just keeps feels weird. So, What is the best way you mock sealed classes? Java answ…


c# - Is there a “Set” data structure in.Net?

Ideally, I'm looking for a templated logical Set class. It would have all of the standard set operations such as Union, Intersection, Etc., and collapse duplicated items. I ended up creating my own s…


c++ - GCC issue: using a member of a base class that depends on a template argument

The following code doesn't compile with gcc, but does with Visual Studio: template<typename T> class A{public: T foo;}; template<typename T> class B: public A<T>{public: void bar(){…


unix - How do you do a case insensitive search using a pattern modifier using less?

It seems like the only way to do this is to pass the-i parameter in when you initially run less. Does anyone know of some secret hack to make something like this work/something to search for/i…


Non Public Members for C# Interfaces

In C#, when you implement an interface, all members are implicitly public. Wouldn't it be better if we could specify the accessibility modifier(protected,internal,except private of course), or should…



Sending a mouse click to a button in the taskbar using C#

In an application that I am currently working on, a requirement is to bring a window of an external application to the foreground. Making Win32 API calls such as BringWindowToTop and SetForeground w…


Random integer in VB.NET

I need to generate a random integer between 1 and n(where n is a positive whole number) to use for a unit test. I don't need something overly complicated to ensure true randomness-just an old-fashione…


Is there a way to call a private Class method from an instance in Ruby?

Other than self.class.send:method, args..., of course. I'd like to make a rather complex method available at both the class and instance level without duplicating the code. UPDATE: @Jonathan Bran…


In C++ can constructor and destructor be inline functions?

VC++ makes functions which are implemented within the class declaration inline functions. If I declare a class Foo as follows, then are the CONSTRUCTOR and DESTRUCTOR inline functions? class Foo{int*…




how example not with java and type from class function