« first day (56 days earlier)      last day (837 days later) » 

10:01 AM
0
Q: Testing dates for singleton

Badman6I've always tested Dates in such way, that I had a protected method getDate() in my class, which I've overriden for test purposes. Example: public class MyClass { protected Date getDate(){ return new Date(); }; } Test: MyClass myclass = new MyClass(){ @Override protect...

 
10:40 AM
0
Q: Singleton Implementation in perl6

teodozjanWhat is the correct implementation of singleton pattern in perl6? I've tried this but I dont' know how to use static keyword in perl6: class LegalInteractionDelegator{ has static LegalInteractionDelegator $!instance; static method getInstance(){ $!instance = LegalInterac...

 
 
5 hours later…
3:56 PM
0
Q: Managing processes in WCF Service

PbirkoffI have a question about managing processes in a WCF Service. My service allows to start a Process (it starts an instance of FFMpeg.exe, to record a certain video). When a user wants to start a new recording, he calls the service and a new (Async) Process is started, an ID is assigned and the proc...

 
4:53 PM
0
Q: more than one instance of singleton c#

SiwarIs there a realisation of a Singleton-like pattern which allows to create more than one instance. My class is public class Logger { private Logger(string logPath) { this.logPath = logPath; } /// <summary> /// Creates singleton /// </summary> /...

 
5:14 PM
0
Q: Qualifier on function type .. has unspecified behavior

Teodora#ifndef SHAPEFACTORY_H_ #define SHAPEFACTORY_H_ #include <istream> #include <map> #include <string> #include "shape.h" typedef Shape *(createShapeFunction)(void); /* thrown when a shape cannot be read from a stream */ class WrongFormatException { }; class ShapeFactory { pub...

 
 
2 hours later…
6:50 PM
0
Q: Memory allocation, Singletons, and when to use/avoid them

MehrdadI came across this page which has a very nice, comprehensive overview of Singletons. Instead of the common "A Singleton is a class with a private constructor and only one global instance", it describes a Singleton as follows: It's important to define exactly what we mean by "singleton". ...

 
 
1 hour later…
8:11 PM
1
Q: iOS web api data management (singleton?)

NebsThis is a pretty typical scenario but I'd like to know what the best approach is. Let's say I need to build an app that interacts with a REST API. The data from the web server is then displayed in multiple ways throughout the app. Typically the way I handle this is to have a singleton handle a...

 
 
1 hour later…
9:12 PM
-1
Q: Factory c++ issues

user2221404I'm trying to do the Factory simulation on c++ to creates a particular shape given the shape enum. When the user then clicks the left mouse button, I invoke the Factory method to create the Shape shared_ptr I need...but it's not working CDrawView: is my main class in it, I have an enum shape{li...

 
 
3 hours later…
11:49 PM
0
Q: Create a ruby object from a supertype object

rlandsterI am using the Selenium Webdriver libraries in Ruby. A typical piece of code looks like this: require 'rubygems' require 'selenium-webdriver' driver = Selenium::WebDriver.for :firefox # driver is an instance of Selenium::WebDriver::Driver url = 'http://www.google.com/' wait = Selenium::WebDriv...

 

« first day (56 days earlier)      last day (837 days later) »