Singleton Questions
Ad
Can any one provide me a sample of Singleton in c++?
I write a singleton c++ in the follow way: class a { private: static a* m_pa; a(); virtual ~a();
Thread-safe use of a singleton's members
I have a c# singleton class that multiple classes use. is access through instance to the toggle() method thread-safe? if
Updating reference to a member variable in use
I got this síngleton cache object and it exposes an ienumerable property which just returns a private ienumerable variable. i have a
How to define Singleton pattern with parameter using static keyword?
According to second answer from
How to create a single volley webservice class to use across the android app?
My android application uses multiple network calls in a single activity and i have several of these activities where i have to use both post and
Is it safe to store data in a kotlin object?
I have a question regarding objects in kotlin, to which i couldn't find a satisfying answer so far. it's basically the following scenario: i've
How to implement a singleton with async initialisation and null safety in dart?
I need a singleton for the shared preferences which has async initialisation but also works with null safety. usually i used the following
Dart Singleton with parameters (global app logger)
I'd like to use the logger library in my app. i only want to instasiate it
singleton pattern with __new__ doesn't work in python 2
I try to implement singleton pattern in python 2 but it doesn't work, but it works in python 3, someone help me explain why? class
Force Serial Singleton Function Lock
I'm wanting to run a parallel process using a thread-safe singleton for a portion of that process. i'm using com interop in the singleton and can
Ad
Android/Kotlin: I try to create a simple Singleton, but when I want to use it, it doesn't import the class in the class I want to use
I would like to create a singleton to access some functions, but when i import it, it doesn't find the class to import:
can i add an extra public method in singleton class in java
I have a singleton class and i added the msg method but i'm not sure if is okay to add it to the singleton class or not public
Firestore.getInstance(): how to use?
Firebase firestore provides the getinstance() method, which opens a socket (only one, at any time of execution of the app) and
Which context do i use to load resources in a singleton?
I have a soundpool that i want to play in different fragments. so i load it within a singleton. what context do i have to use?
Null out the Singleton instance and all fields
I have a simple app that uses a player as a singleton. @jvmstatic fun getinstance(context: context): myplayer { return
How to create singleton classes in Javascript?
I am working on a large project where i have multiple managers to handle different tasks, i need an only a single object of these managers to be
does "object" in kotlin get garbage collected
If we have an object like this object repo { var activemovies: arraylist<movie>? = null }
Why isn't this EventEmitter pubsub singleton interface working in node.js?
I am trying to separate publisher and subscriber in node.js to be able to send data to each other through a shared eventemitter instance as
Using a singleton-ish approach for node.js modules
I use node-cache in my expressed based application. it needs to be setup using the following code; const nodecache = require(
Firebase crashing randomly on launch
I have a firebase app in swift. now my issue is very simple to explain but really weird to debug. issue: whenever i open the app, it
How to make a singleton in Typescript work across multiple modules?
I have a database class in a typescript application i'm using that's set up as a singleton like so: export default class database
Ad
Export of a class instance in Javascript
I was looking at this code
Does changing a singleton mailer in PHP (Laravel) affect other user requests?
The laravel 5.3 mailer class is configured as a singleton according to this article
Kotlin singleton: How to copy object from singleton
I'm using singleton object to hold data for the app which are changed or used on multiple places. in my case, i have arraylist of objects
Laravel IoC Container - Binding a singleton then returning it when you don't have the original params
We're trying to register a singleton e.g. $this->app->singleton('blah', function
Getting data once and use it in all activities
I have a question about getting data from server. i get general data in mainactivity of my app and i want to use it across all activities. i was
android sharedPreferences's clear function not working
My pref's clear is not working. this is my preferencmanager.java public class preferencemanager { private static final
isInitialized property for lateinit isn't working in companion object
I have a singleton class which i have implemented it in java fashion : companion object { @volatile private lateinit var
How to avoid singleton in node
I have an npm dependency that i import into a file of my server node. i wish it was not a singleton because it should not be shared between each
Is it good practice use Progress Dialog As Singleton Class
I have progress dialog class which is singleton public class progressdialogmanager { private static progressdialogmanager
SwiftUI: State variable from observed singleton property leads to error
I use a singleton to access subscription offerings from revenuecat as an @observedobject on various views in the app:
C#, Android: Delete Singleton
I am working on a project with a lot of account management going on. unfortunately, the guy who set all of this up is on vacation and something
Ad
How to create singleton task in Luigi?
I need to run once a day task a. at 0:00:00 for specificity. but task execution can take more then 24 hours. in this case, i should not rerun the
How to make Singleton in Swift
I want to use singleton to show ads, but it doesn't work well. when i don't use singleton and use only viewcontroller, it works well.(can through
How to use Singleton class to pass list data from one fragment to another?
My singleton class: here's the singleton class i found on official documentations. public class singleton {
What is the difference between two presented classes? Do they work differently?
What is the difference between this two implementations of singleton. does creating of variable _instance in parent class make it work differently
How to create a singleton observable?
I have a singleton class : let instance = null; class singletonclass { constructor() { if (!instance) {
Reassign or refresh a singleton in Laravel 5
I have a provider and in its register method i defined a singleton like this, $this->app->singleton('my.custom.singleton',
Getting request object in a spring singleton bean
I have a spring's singleton bean and i need to access the request object in that bean. i tried autowiring the
How to destroy an singleton Object in Kotlin and force to call init block
In java, we can destroy the singleton object by below method. public class mysingleton { private static mysingleton
Is this is a singleton pattern
I was trying to write singleton class and initially i wrote the below code, which to me feels like singleton. i showed this to one of the guy and
Why is the insantiation of this singleton class giving different values
Why do these two statement give different outcomes... print(database().id == database().id) (which gives false)
What is the correct way of ensuring a single instance of a class?
In java i would create something like this: private static myclass instance; public static myclass getinstance() { if(instance
Ad
Kotlin Nested Object Classes
Ok so i'v been starting to learn kotlin for a week now, and i love the language:p besides the great utility of extension function, i feel like
First time login Null pointer exception (singleton pattern)
I have a problem. please take a look at these codes. when i click to login button first time it throws null pointer exception even i am typing
Singleton in JavaScript with module.export and require?
I am trying to implement singleton in javascript where i use node.js module.export and require(). my issue is that
Flex/AS3 Problem listening to an event dispatched from a Singleton Class
I have a singleton class for global access to config information. this singleton class called configurationdata extends eventdispatcher. here is
Should you create a Generic Singleton class in java?
I am trying to create a cachemanager class for my cache in which i want to register an object of type cache. my cache
Container guarantees when putting a singleton session bean with bean concurrency into service
I have the following code: @concurrencymanagement(bean) @startup @singleton public class mysingletonbean {
Should I initialise a singleton in onCreate by subclassing Application?
I tried to use a singleton
How to achieve the effect of UITableViewCell selection by clicking a button in UITableViewCell?
I have a menuview in a list view controller. the menuview added on the uitableviewcell when a more button in the cell being taped.
What is the best practice to prevent an instance from init() in a Singleton class in Swift
I learned from using swift with cocoa and objective-c that a singleton can be created like this: class singleton { static let
Ad
Blog Categories
Ad