473,385 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

singleton initialization

I created a singleton class as in the example below. The application
sporadically crashes in the second line of the main function as shown.
However, when I change the singleton such that the static pointer is a
class member (defined in the cpp file) and the instance function
creates the object if the pointer is NULL, then it works fine. I would
appreciate any explanations as to why this happens.

class CTestClass
{
public:
static CTestClass& instance()
{
static CTestClass* m_instance = new CTestClass;
return *m_instance;
}
private:
CTestClass() { /* do some stuff */ }
};

int main()
{
CTestClass::instance(); // initialize singleton here to
avoid future race conditions
// sporadically crashes here when using CTestClass::instance()
}
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 15 '07 #1
24 2535
Eric wrote:
I created a singleton class as in the example below. The application
sporadically crashes in the second line of the main function as shown.
However, when I change the singleton such that the static pointer is a
class member (defined in the cpp file) and the instance function
creates the object if the pointer is NULL, then it works fine. I would
appreciate any explanations as to why this happens.
There seems not to be anything bad in your code (except from not having
the choice of deallocating the pointer, doing that way). Could it be
some static variable initialization order in the context in which you
use it?

Regards,

Zeppe
May 15 '07 #2
[cross-posting deleted]

On May 15, 4:00 pm, Eric <shoo...@yahoo.comwrote:
I created a singleton class as in the example below. The application
sporadically crashes in the second line of the main function as shown.
However, when I change the singleton such that the static pointer is a
class member (defined in the cpp file) and the instance function
creates the object if the pointer is NULL, then it works fine. I would
appreciate any explanations as to why this happens.

class CTestClass
{
public:
static CTestClass& instance()
{
static CTestClass* m_instance = new CTestClass;
return *m_instance;
}
private:
CTestClass() { /* do some stuff */ }

};

int main()
{
CTestClass::instance(); // initialize singleton here to
avoid future race conditions
// sporadically crashes here when using CTestClass::instance()

}
If you run this code and only this code, it crashes sporadically? If
so, what compiler are you using and what options? If not, post a
complete but minimal sample that demonstrates the problem (see FAQ
5.4), since it may not be directly related to the singleton business
even if it appears that way.

Cheers! --M

May 15 '07 #3
On May 15, 3:36 pm, mlimber <mlim...@gmail.comwrote:
If not, post a
complete but minimal sample that demonstrates the problem (see FAQ
5.4),
Oops. I meant FAQ 5.8.

Cheers! --M

May 15 '07 #4
On 15 maio, 17:00, Eric <shoo...@yahoo.comwrote:
I created a singleton class as in the example below. The application
sporadically crashes in the second line of the main function as shown.
However, when I change the singleton such that the static pointer is a
class member (defined in the cpp file) and the instance function
creates the object if the pointer is NULL, then it works fine. I would
appreciate any explanations as to why this happens.

class CTestClass
{
public:
static CTestClass& instance()
{
static CTestClass* m_instance = new CTestClass;
return *m_instance;
}
private:
CTestClass() { /* do some stuff */ }

};

int main()
{
CTestClass::instance(); // initialize singleton here to
avoid future race conditions
// sporadically crashes here when using CTestClass::instance()

}
try:

class CTestClass
{
public:
static CTestClass* instance()
{

if (!m_instance) m_instance = new CTestClass;
return m_instance;
}
private:
static CTestClass* m_instance;
CTestClass() { /* do some stuff */ }

};

It must works.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 15 '07 #5
On May 15, 4:00 pm, Eric <shoo...@yahoo.comwrote:
I created a singleton class as in the example below. The application
sporadically crashes in the second line of the main function as shown.
However, when I change the singleton such that the static pointer is a
class member (defined in the cpp file) and the instance function
creates the object if the pointer is NULL, then it works fine. I would
appreciate any explanations as to why this happens.

class CTestClass
{
public:
static CTestClass& instance()
{
static CTestClass* m_instance = new CTestClass;
return *m_instance;
}
private:
CTestClass() { /* do some stuff */ }

};

int main()
{
CTestClass::instance(); // initialize singleton here to
avoid future race conditions
// sporadically crashes here when using CTestClass::instance()

}
By 'race conditions', did you think that some local persistant
variable is immune to thread locks because its static?

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 15 '07 #6
Eric wrote:
I created a singleton class as in the example below. The application
sporadically crashes in the second line of the main function as shown.
However, when I change the singleton such that the static pointer is a
class member (defined in the cpp file) and the instance function
creates the object if the pointer is NULL, then it works fine. I would
appreciate any explanations as to why this happens.

class CTestClass
{
public:
static CTestClass& instance()
{
static CTestClass* m_instance = new CTestClass;
This doesn't make sense. How can the compiler create this object at
compile time? Change this to:
static CTestClass& instance()
{
static CTestClass* m_instance;
if(!m_instance) m_instance = new CTestClass;
return m_instance;
}
return *m_instance;
}
private:
CTestClass() { /* do some stuff */ }
};

int main()
{
CTestClass::instance(); // initialize singleton here to
avoid future race conditions
// sporadically crashes here when using CTestClass::instance()
}

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 15 '07 #7
* Fei Liu:
Eric wrote:
>>
class CTestClass
{
public:
static CTestClass& instance()
{
static CTestClass* m_instance = new CTestClass;

This doesn't make sense. How can the compiler create this object at
compile time?
The object is created at run time.

Change this to:
static CTestClass& instance()
{
static CTestClass* m_instance;
if(!m_instance) m_instance = new CTestClass;
return m_instance;
}
This merely replicates the code generated by the compiler for the
original, but in a more verbose and possibly less efficient way.

See §6.7/4, "is initialized the first time control passes through its
declaration".

Hth.,

- Alf, 16.05.2007 00:22

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 15 '07 #8
Salt_Peter wrote:
On May 15, 4:00 pm, Eric <shoo...@yahoo.comwrote:
>I created a singleton class as in the example below. The application
sporadically crashes in the second line of the main function as shown.
However, when I change the singleton such that the static pointer is a
class member (defined in the cpp file) and the instance function
creates the object if the pointer is NULL, then it works fine. I would
appreciate any explanations as to why this happens.

class CTestClass
{
public:
static CTestClass& instance()
{
static CTestClass* m_instance = new CTestClass;
return *m_instance;
}
private:
CTestClass() { /* do some stuff */ }

};

int main()
{
CTestClass::instance(); // initialize singleton here to
avoid future race conditions
// sporadically crashes here when using CTestClass::instance()

}

By 'race conditions', did you think that some local persistant
variable is immune to thread locks because its static?
It's immune to race conditions because he hasn't started any other
threads yet (assuming that he doesn't try to start any threads from
static initializers).

--

John Moeller
fi******@gmail.com

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 16 '07 #9
Alf P. Steinbach wrote:
Fei Liu:
static CTestClass& instance()
{
static CTestClass* m_instance;
if(!m_instance) m_instance = new CTestClass;
return m_instance;
}

This merely replicates the code generated by the compiler for the
original, but in a more verbose and possibly less efficient way.
And it's still more verbose and possibly less efficient than:

static CTestClass& instance()
{
static CTestClass m_instance;
return m_instance;
}

which also destroys the instance properly and automatically.

KHD
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 16 '07 #10
Eric wrote:
I created a singleton class as in the example below. The application
sporadically crashes in the second line of the main function as shown.
However, when I change the singleton such that the static pointer is a
class member (defined in the cpp file) and the instance function
creates the object if the pointer is NULL, then it works fine. I would
appreciate any explanations as to why this happens.

class CTestClass
{
public:
static CTestClass& instance()
{
static CTestClass* m_instance = new CTestClass;
return *m_instance;
}
private:
CTestClass() { /* do some stuff */ }
};
I'm not sure if you're attempting to use a "Meyers Singleton," which is
very similar to what you are doing here, but that style singleton just
constructs the object locally, instead of allocating it on the heap:

....
static CTestClass & instance()
{
static CTestClass m_instance;
return m_instance;
}
....
int main()
{
CTestClass::instance(); // initialize singleton here to
avoid future race conditions
// sporadically crashes here when using CTestClass::instance()
}
It's a memory leak (there's no matching delete, not that it matters with
singletons most of the time, though it can), and constructing it locally
will solve that.

I can't claim to know why your program crashes, however. I tried
running your original program repeatedly on my platform, and no such
crash happened. It may be that your platform dislikes leaked memory.

--

John Moeller
fi******@gmail.com

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 16 '07 #11
On May 16, 6:26 am, Keith H Duggar <dug...@alum.mit.eduwrote:
Alf P. Steinbach wrote:
Fei Liu:
static CTestClass& instance()
{
static CTestClass* m_instance;
if(!m_instance) m_instance = new CTestClass;
return m_instance;
}
This merely replicates the code generated by the compiler for the
original, but in a more verbose and possibly less efficient way.
And it's still more verbose and possibly less efficient than:
static CTestClass& instance()
{
static CTestClass m_instance;
return m_instance;
}
which also destroys the instance properly and automatically.
And thus introduces order of destruction issues. As a general
rule, it is preferable that the instance of a singleton NOT be
destructed. Ever.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 16 '07 #12
{ Edits: double-spacing removed. -mod/aps }

On Wed, 16 May 2007 04:13:40 CST, James Kanze <ja*********@gmail.com>
wrote:
>And thus introduces order of destruction issues. As a general
rule, it is preferable that the instance of a singleton NOT be
destructed. Ever.
Won't the destructor of a static singleton object be called
automatically at program shutdown?

--
Bob Hairgrove
No**********@Home.com
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 16 '07 #13
{ Edits: quoted signature removed. -mod }

Alf P. Steinbach wrote:
* Fei Liu:
>Eric wrote:
>>>
class CTestClass
{
public:
static CTestClass& instance()
{
static CTestClass* m_instance = new CTestClass;

This doesn't make sense. How can the compiler create this object at
compile time?

The object is created at run time.

>Change this to:
static CTestClass& instance()
{
static CTestClass* m_instance;
if(!m_instance) m_instance = new CTestClass;
return m_instance;
}

This merely replicates the code generated by the compiler for the
original, but in a more verbose and possibly less efficient way.

See §6.7/4, "is initialized the first time control passes through its
declaration".
Ah, so this is the C++ way of doing it...I may be wrong, but in C at
least for plain old datatype, function static variable initialization
happens at compile time.

Fei

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 16 '07 #14
Fei Liu wrote:
>
Ah, so this is the C++ way of doing it...I may be wrong, but in C at
least for plain old datatype, function static variable initialization
happens at compile time.
You sure about that? Sorry I am moving house and all my reference books
are packed away, but that would mean that a function static could only
be initialised with a const expression. I thought that functions statics
were initialised the first time the flow of execution passes through them.

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 16 '07 #15
On May 16, 6:13 pm, James Kanze <james.ka...@gmail.comwrote:
And thus introduces order of destruction issues. As a general
rule, it is preferable that the instance of a singleton NOT be
destructed. Ever.
Would you elaberate on your preference further? Which I failed to see
as a good generic solution.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 16 '07 #16
On May 16, 5:48 pm, Fei Liu <fei...@aepnetworks.comwrote:
Alf P. Steinbach wrote:
* Fei Liu:
Eric wrote:
>class CTestClass
{
public:
static CTestClass& instance()
{
static CTestClass* m_instance = new CTestClass;
This doesn't make sense. How can the compiler create this object at
compile time?
The object is created at run time.
Change this to:
static CTestClass& instance()
{
static CTestClass* m_instance;
if(!m_instance) m_instance = new CTestClass;
return m_instance;
}
This merely replicates the code generated by the compiler for the
original, but in a more verbose and possibly less efficient way.
See §6.7/4, "is initialized the first time control passes through its
declaration".
Ah, so this is the C++ way of doing it...I may be wrong, but in C at
least for plain old datatype, function static variable initialization
happens at compile time.
Sort of. C doesn't actually say when the initialization occurs,
except to require that it occur before the variable first
becomes usable. Since it only allows constant expressions in
the initializers, there's no way a conforming program can find
out when the initialization actually occurs.

C++ has the same concept: if the type has a trivial constructor,
and it initialized with a constant expression, the
initialization is said to be static, and all that is required is
that it occur before the first time the variable can possibly be
used---in all of the implementations I know of, the initialized
object is laid out by the compiler are part of the binary image,
at compile time. If the constructor isn't trivial, however,
some code must be executed, and it suddenly because possible for
a program to know when it is executed. So C++ defined a precise
moment for this.

--
James Kanze (Gabi Software) email: ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 17 '07 #17
In article <f2*******************@news.demon.co.uk>, Francis Glassborow
<fr******@robinton.demon.co.ukwrote:
Fei Liu wrote:

Ah, so this is the C++ way of doing it...I may be wrong, but in C at
least for plain old datatype, function static variable initialization
happens at compile time.
You sure about that? Sorry I am moving house and all my reference books
are packed away, but that would mean that a function static could only
be initialised with a const expression. I thought that functions statics
were initialised the first time the flow of execution passes through them.
The C99 standard does require the initializers of static variables to
be constant expressions [6.7.7 of c99]. So it is possible for a C
compiler to initailize all statics at compile time, removing a need to
test for first entry, but it is not requried by what I read unless
'may' means 'is'. [c99, section 6.7.8 para 4] reads:
/quote
All the expressions in an initializer for an object that has static
storage duration shall be constant expressions or string literals.
/endquote
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 17 '07 #18
And thus introduces order of destruction issues. As a general
rule, it is preferable that the instance of a singleton NOT be
destructed. Ever.

Won't the destructor of a static singleton object be called
automatically at program shutdown?
Unless it is allocated dynamically (e.g. by new).
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 17 '07 #19
On May 16, 11:45 am, Bob Hairgrove <inva...@bigfoot.comwrote:
>
On Wed, 16 May 2007 04:13:40 CST, James Kanze <james.ka...@gmail.com>
wrote:
And thus introduces order of destruction issues. As a general
rule, it is preferable that the instance of a singleton NOT be
destructed. Ever.

Won't the destructor of a static singleton object be called
automatically at program shutdown?
I do not quite understand how you would run into issues when
destructing the instance of a singleton. Kindly elaborate.

Prasanna.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 17 '07 #20
On May 16, 9:35 pm, "\"fr3@K\".invalid" <f...@fsfoundry.orgwrote:
On May 16, 6:13 pm, James Kanze <james.ka...@gmail.comwrote:
And thus introduces order of destruction issues. As a general
rule, it is preferable that the instance of a singleton NOT be
destructed. Ever.
Would you elaberate on your preference further? Which I failed
to see as a good generic solution.
What is there to elaborate on? If the singleton object is
destructed, you potentially have order of destructor problems.
So it's usually a good idea to create them in a way that they
won't get destructed.

--
James Kanze (Gabi Software) email: ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 17 '07 #21
Prasanna wrote:
On May 16, 11:45 am, Bob Hairgrove <inva...@bigfoot.comwrote:
>Won't the destructor of a static singleton object be called
automatically at program shutdown?
Yes. But the problem here is the order of destruction of static object.
I do not quite understand how you would run into issues when
destructing the instance of a singleton. Kindly elaborate.
Static objects are destroyed in the reverse order of construction.
While this may seem perfectly reasonable, sometimes it is not; suppose
for example you have a Server singleton and a Client singleton, where
the latter uses the former. Consider the following scenario:

Client::instance().use_server()
Client::Client()
// now Client constructed
Client::use_server()
Server::instance().serve_client()
Server::Server()
// now Server constructed
Server::serve_client()

Here, Server is constructed after Client, so at program shutdown, Server
is destroyed before Client. Now suppose the destructor of Client tries
to use Server, which doesn't exist any more.

Server::~Server()
// now Server destroyed
Client::~Client()
Server::instance().serve_client() // boom!

The right thing to happen is that Server should outlive Client, whether
Server is created before Client or after Client. One way to ensure that
is to let the Client's constructor use Server at least once, which
ensures that Server is constructed before Client. (And an object is
considered to be constructed when its constructor finishes, without
throwing an exception.)

--
Seungbeom Kim

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 18 '07 #22
{ Edits: quoted clc++m banner removed. Please quote only relevant text.
-mod }

On May 15, 1:00 pm, Eric <shoo...@yahoo.comwrote:
I created a singleton class as in the example below. The application
sporadically crashes in the second line of the main function as shown.
However, when I change the singleton such that the static pointer is a
class member (defined in the cpp file) and the instance function
creates the object if the pointer is NULL, then it works fine. I would
appreciate any explanations as to why this happens.

class CTestClass
{
public:
static CTestClass& instance()
{
static CTestClass* m_instance = new CTestClass;
return *m_instance;
}
private:
CTestClass() { /* do some stuff */ }

};

int main()
{
CTestClass::instance(); // initialize singleton here to
avoid future race conditions
// sporadically crashes here when using CTestClass::instance()

}
There is not enough real information to find out why it sporadically
crashes.
Sporadically suggests: There is a timing issue which suggests threads
are involved, and since I don't see any in main it suggests they are
created by constructors of global variables (But again not enough
information).
Moving the pointer to class static: As this seems to solve the problem
this suggests there is a memory corruption somewhere else. This
becomes hard to track down without other tools.

What does jump out. Is that the "Copy Constructor" and "Assignment
Operator" are not defined in your singelton. Thus some global object
may by making a copy of the singelton (in its constructor) and the
destruction of this copy may be interfering with the singelton
(especially if your singelton contains raw pointers).
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 18 '07 #23
{ Edits: quoted clc++m banner removed. Please don't quote the banner.
Also, please don't top-post in this group, see FAQ item 5.4. -mod }

Hello,
Make sure that your destructor also made private to avoid 'deleting
the instance pointer.

Regards,
Sarath

br**************@gmail.com wrote:
On 15 maio, 17:00, Eric <shoo...@yahoo.comwrote:
I created a singleton class as in the example below. The application
sporadically crashes in the second line of the main function as shown.
However, when I change the singleton such that the static pointer is a
class member (defined in the cpp file) and the instance function
creates the object if the pointer is NULL, then it works fine. I would
appreciate any explanations as to why this happens.

class CTestClass
{
public:
static CTestClass& instance()
{
static CTestClass* m_instance = new CTestClass;
return *m_instance;
}
private:
CTestClass() { /* do some stuff */ }

};

int main()
{
CTestClass::instance(); // initialize singleton here to
avoid future race conditions
// sporadically crashes here when using CTestClass::instance()

}

try:

class CTestClass
{
public:
static CTestClass* instance()
{

if (!m_instance) m_instance = new CTestClass;
return m_instance;
}
private:
static CTestClass* m_instance;
CTestClass() { /* do some stuff */ }

};

It must works.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 22 '07 #24
CTestClass() { /* do some stuff */ }

By any chance the "/* do some stuff */" is the reason why it crashes?
Did you try to test it without doing _any_ stuff in constructor?

Thanks,
Neel.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

May 22 '07 #25

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Vinay Aggarwal | last post by:
I have been thinking about the lazy initialization and double checked locking problem. This problem is explain in detail here http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html...
26
by: Uwe Mayer | last post by:
Hi, I've been looking into ways of creating singleton objects. With Python2.3 I usually used a module-level variable and a factory function to implement singleton objects. With Python2.4 I...
6
by: ank | last post by:
Hi, I have some question about Singleton Pattern in C++. I think I understand that static initialization order across translation unit is unspecified by the standard, but what can I do to...
8
by: Robert Zurer | last post by:
I have a server application that makes a MarshalByReferenceObject available via remoting. It's lifetime is set to never expire and it is implemented as a Singleton. Are calls to this object...
15
by: Mountain Bikn' Guy | last post by:
Is the second version shown below better? I couldn't locate enough info about in order to tell. 1.. My commonly used singleton pattern implementation looks like this (it was inspired by Eric...
2
by: Xing Zhou | last post by:
How to use reflection on a singlton object (i.e. the default constructor is private)? I have a configuration file which contains a list of class names. All these class are simplified singleton...
6
by: Manuel | last post by:
Consider the classic singleton (from Thinking in C++): ----------------------------------------------------- //: C10:SingletonPattern.cpp #include <iostream> using namespace std; class...
7
by: John A Grandy | last post by:
For a singleton class utilizes by ASP.NET 2.0 page processing: When initial instantiation is performed during the initial call to the retrieve instance method (let's call the method...
6
by: toton | last post by:
Hi, If I have a singleton class based on dynamic initialization (with new ) , is it considered a memory leak? Anything in C++ standard says about it ? And little off - topic question , If the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.