C++ singleton GetInstance() return
When implementing a singleton in C++, is it better for GetInstance() to return a pointer to the singleton object, or a reference? Does it really matter? ...
When implementing a singleton in C++, is it better for GetInstance() to return a pointer to the singleton object, or a reference? Does it really matter? ...
I am currently working on a server control for other applications in our company to interface with a WCF service. Every time I make a change code change and recompile the control, I increment the the AssemblyVerison and AssemblyFileVersion class in the AsseemblyInfo.cs by one. For example, my latest build went from 1.0.07.0 to 1.0.08....
Why is it impossible to have a reference to void? The only thing I found in the C++ Standard is this line, at 8.3.2.1 A declarator that specifies the type "reference to cv void" is ill-formed. Why is it that way? Why can't I write a "generic" function that accept a void&? Just to be clear, I have no useful application in mind whe...
I'm looking for a book that introduces one to the various computing paradigms in existence and then goes in depth into each. What I'd like to take away from the end is a basic understanding of each and the ability to make a much more informed decision on which ones to get deeper into. ...
typedef void (FunctionSet::* Function)(); class MyFunctionSet : public FunctionSet { protected: void addFunctions() { addFunction(Function(&MyFunctionSet::function1)); } void function1() { // Do something. } }; The addFunction method adds the function to a list in the base class, which can then be en...
I'm trying to write a script in VB, but I'm not finding any good tutorials or references to start from. It's something relatively simple (playing a song whenever it reaches a certain time), but most of the stuff that I'm finding is more geared towards embedding the scripts into webpages. Do you have any suggestions for some good refere...
I'm writing this question with reference to this one which I wrote yesterday. After a little documentation, it seems clear to me that what I wanted to do (and what I believed to be possible) is nearly impossible if not impossible at all. There are several ways to implement it, and since I'm not an experienced programmer, I ask you which ...
How do you call a client codes methods from inside a class defined in the client code? For example, I have a memory reading class, that can read values from the memory of a process at a certain address. I also have classes for managing the type of data that is read from memory (I am reading about an in-game 'object'. In the 'client code...
Is it possible in Ruby to get a reference to methods of an object ( I would like to know if this can be done without procs/lambdas ) , for example , consider the following code : class X def initialize @map = {} setup_map end private def setup_map # @map["a"] = get reference to a method # @map["b"] = get refere...
I am intending this to be an entry which is a resource for anyone to find out about aspects of sql that they may have not run into yet, so that the ideas can be stolen and used in their own programming. With that in mind... What sql tricks have you personally used, that made it possible for you to do less actual real world programmin...
Hi, Does anyone know how much memory is taken up when you create a reference type variable? String s = "123"; How much memory would 's' take up as a reference, not the data pointing to it? ...
Hi. Im making an inerface to a DLL library, so i can use it with Java. I need my native function to modify the value of a jlong parameter. Like the parameter was passed by reference. My Java method must have the exact parameters as the native function MPUSBWrite shown down here. Example of actual not working code: The MPUSBWrite gets it...
I'm having several "undefined reference" (during linkage) and "unresolved symbol" (during runtime after dlopen) issues where I work. It is quite a large makefile system. Are there general rules and guidelines for linking libraries and using compiler flags/options to evade these types of errors? ...
Can anyone recommend a good online notation reference for XSD diagrams? I've been looking at the UML references I typically refer to and there is nary a mention of XSD/XML notation elements. Thanks, Matt ...
Hello, I have something unclear concerning casting reference variable in Java. I have two classes A and B. A is the super class of B. If I have the two objects, and then the print statement: A a = new A(); //superclass B b = new B(); //subclass System.out.println ((A)b); then what exactly is happening when the println method is e...
Just like Carl's question over here I would like to ask you (because I couldn't find it out on my own :( ) if there is any benefit by removing an assembly reference that is not statically nor dynamically (via reflection for example) used. ...
This question was suggested by Kyralessa in the What is your most useful sql trick to avoid writing more sql?. I got so many good ideas to try from the last question, that I am interested to see what comes up with this question. Once again, I am not keeping the reputation from this question. I am waiting 7 days, for answers, then mar...
Hi all, I have quite a few programming e-books, and while they're useful, I don't find myself using them very much. I think this is because they are in digital format and take up my screen, and overall I would prefer a physical book. Are there any services out there that will print a pdf file for me in a nice book-ish fashion? I suppos...
Hi, Is it possible to join two classes without specified mapping between them (using Criteria API)? I must join two classes and retrieve data from both but I can't mapping them. I know only foreign key SomeID in the first class and primary key ID in second. How to create Criteria to join them? Is it possible without mapping? Please, ...