473,770 Members | 4,198 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

class variables: scoping

Hello,

Suppose I have some method:

Foo::foo() {
static int x;
int y;
/* ... */
}

Here variables x is shared by all instances of the class, but has
function scope. On the other hand, variable y, also has function
scope, but is reinitialized each time the method is called.

Now, I would like to have a variable which has function scope,
that is, is not visible by other class functions. However, every
time I instantiate an instance of Foo a new such variable is created.
Essentially, I would like to have something like the equivalent of:

class Foo {
/* ... */
private:
/* ... */
int z;
/* ... */
};

However, I do not want to have all methods inside Foo see z. I only
want method foo to see it, just like I did for x which can only be
seen by foo().

The value of z should survive different calls from within the same
instance, but should be initialized for each new instance, like above.
But it should have method scope, not class scope.

It would be nice if C++ were extended to include this nice idea.
It could for example allow something like:

Foo::foo() {
static int x;
int y;
semistatic z;
/* ... */
}

Where semistatic means: shared by all invocations within the same
instance, and only visible within foo().

I think this feature is missing from C++ and is quite useful. Because
if some class variable is used only in one method, then why should I
have to place it in the class definition. It's like having to make
things global just because they are shared by instances.
Comments welcome.

Regards,

Neil
Jul 22 '05
30 2274
Leor Zolman <le**@bdsoft.co m> wrote in message:
Foo::foo() {
static int x;
int y;
/* ... */
}

Here variable x is shared by all instances of the class,
Not /that/ variable x, if you're referring to the one in Foo:foo(). That's
a block-scope static, which means it can only be referred to within that
function (and its value persists across multiple calls to it. By the way,
it gets initialized to zero the first time the function is called, if you
don't give it an initializer.)


Perhaps my explanation was somewhat inadequate. What you have stated in the
above paragraph is correct. Indeed, x can only be referred to from within
member function Foo::foo(). And indeed since it is static the compiler will
automatically arrange for it to be initialized to zero when no initializer
is present. What I meant to express by saying that x is shared by all
instances of Foo is exemplified in the following code:

#include <iostream>

class Foo {
public:
void foo() {
static int x;
std::cout << x++ << std::endl;
}
};

int main() {
Foo foo;
foo.foo();
foo.foo();
Foo bar;
bar.foo();
Foo foobar;
foobar.foo();
}

Output:

0
1
2
3

The goal is to achieve the output:

0
1
0
0

without changing the contents of main and without changing the contents
of the class definition (which seems impossible in C++, since it does not
support the feature I describe).
The value of z should survive different calls from within the same
instance, but should be initialized for each new instance, like above.
But it should have method scope, not class scope.


I /think/ I see what you want, but there's no primitive way to declare that
in C++: You want an instance variable (one copy associated with each
instance of an object) that is only in scope within a particular function,


Correct. That is indeed the feature I was describing. Furthermore I was
poining out that C++ supports combinations:

(one copy per class, class scope) (static data members in class body)
(one copy per class, function scope) (static data members in function body)
(one copy per instance, class scope) (automatic data in class body)

but not the combination:

(one copy per instance, function scope)

I think this is poor design of the C++ language, because several functions
need have boolean variables called initialize which act as follows. Class
Foo has methods foo(), bar(), and foobar(). We don't want the constructor
to call these because they consume too much precious time, sometimes only
to initialize data members that are not needed later on. So we have the
functions foo(), bar(), and foobar() do the respective data member
initializations they need when they are called. Given that the
sets of data members they initialize are disjoint in the
given scenario, and that foo() may initialize more than
one data member, it makes sense to have a variable
which satisfies the missing C++ feature in order
to perform the initialization when foo() is called.
Alas, I need put such initializer variables inside
the function body.

I wonder if any languages have what I describe. Smalltalk?
right? No can do. You'll just have to exercise some self-discipline by
declaring a private data member and being careful to only access it from
within the one function.

I think this feature is missing from C++ and is quite useful. Because
if some class variable is used only in one method, then why should I
have to place it in the class definition.


To indicate to the compiler that it has to make room for it in each object
instantiated. At least the way C++ is currently defined ;-)


Hmmm... but the compiler went and fetched those static variables for
the BSS segment. I gues they belong to another data segment altogether
hence that is what makes it possible???

Regards,

Neil
Jul 22 '05 #11
"Neil Zanella" <nz******@cs.mu n.ca> wrote in message
news:b6******** *************** ***@posting.goo gle.com...
I think this is poor design of the C++ language, because several functions need have boolean variables called initialize which act as follows. Class Foo has methods foo(), bar(), and foobar(). We don't want the constructor to call these because they consume too much precious time, sometimes only to initialize data members that are not needed later on. So we have the functions foo(), bar(), and foobar() do the respective data member
initializations they need when they are called. Given that the
sets of data members they initialize are disjoint in the
given scenario, and that foo() may initialize more than
one data member, it makes sense to have a variable
which satisfies the missing C++ feature in order
to perform the initialization when foo() is called.
Alas, I need put such initializer variables inside
the function body.


I'm afraid I don't get it. If all three functions need to know if any
of the other's have already run, wouldn't a common variable to all
functions serve the purpose; i.e. a member in the class? If each of
the functions needed to know just which of the functions has already
run, then three statics named fooran, barran, and foobarran would
serve.
Is this right?
--
Gary
Jul 22 '05 #12
"Neil Zanella" <nz******@cs.mu n.ca> wrote in message
news:b6******** *************** ***@posting.goo gle.com...
I think this is poor design of the C++ language, because several functions need have boolean variables called initialize which act as follows. Class Foo has methods foo(), bar(), and foobar(). We don't want the constructor to call these because they consume too much precious time, sometimes only to initialize data members that are not needed later on. So we have the functions foo(), bar(), and foobar() do the respective data member
initializations they need when they are called. Given that the
sets of data members they initialize are disjoint in the
given scenario, and that foo() may initialize more than
one data member, it makes sense to have a variable
which satisfies the missing C++ feature in order
to perform the initialization when foo() is called.
Alas, I need put such initializer variables inside
the function body.


I'm afraid I don't get it. If all three functions need to know if any
of the other's have already run, wouldn't a common variable to all
functions serve the purpose; i.e. a member in the class? If each of
the functions needed to know just which of the functions has already
run, then three statics named fooran, barran, and foobarran would
serve.
Is this right?
--
Gary
Jul 22 '05 #13
al***@start.no (Alf P. Steinbach) wrote in message news:<40******* *********@news. individual.net> ...
* nz******@cs.mun .ca (Neil Zanella) schriebt:

Essentially, I would like to have something like the equivalent of:

class Foo {
/* ... */
private:
/* ... */
int z;
/* ... */
};

However, I do not want to have all methods inside Foo see z. I only
want method foo to see it, just like I did for x which can only be
seen by foo().

The value of z should survive different calls from within the same
instance, but should be initialized for each new instance, like above.
But it should have method scope, not class scope.

class Foo;

class FooFunctor
{
private:
Foo& myFoo;
int myZ;
public:
FooFunctor( Foo& aFoo ): myFoo( aFoo ), myZ( 0 ) {}
int operator()();
};

class Foo
{
private:
int x;
FooFunctor foo;
public:
Foo(): x(0), foo(*this) {}

void bar()
{
x = foo();
}
};

int FooFunctor::ope rator()(){ ... }


Thank you for your reply..

I am not sure how your example would help in the situation I describe.
Consider the following code example where having the runFooi variables
being local to the current function would be of practical use. These
would then also have to be initialized within that function with
a scheme similar to that of the initialization of static variables:
on first call for an instance the variable is constructed,
subsequent calls within same object ignore the
construction and use the old value
for current object.

#include <iostream>
#include <cstdlib>

class Foo {
public:
Foo() { init(); }
Foo(int y): y(y) { init(); }
void init() {
/* defer initialization until needed */
runFoo1 = runFoo2 = runFoo3 = runFoo4 = true;
}
int foo1() { if (runFoo1) x1 = compute(0, 0); return x1; }
int foo2() { if (runFoo2) x2 = compute(0, 1); return x2; }
int foo3() { if (runFoo3) x3 = compute(1, 0); return x3; }
int foo4() { if (runFoo4) x4 = compute(1, 1); return x4; }
private:
int compute(int a, int b) {
/* suppose this takes a long time to run */
return rand() + 2 * a + b; /* for simplicity */
}
int x1, x2, x3, x4;
int y;
private:
bool runFoo1, runFoo2, runFoo3, runFoo4;
};

int main() {

/* run program without waiting for unnecessary computations */
/* available which would unnecessarily initialize class data */

Foo foo1;
std::cout << foo1.foo1() << std::endl;

/* foo1.foo2(), foo1.foo3(), and foo1.foo4() never called */
/* hence OO program can run as fast as a procedural program */

Foo foo2;
std::cout << foo2.foo2() << std::endl;
std::cout << foo2.foo3() << std::endl;
std::cout << foo2.foo4() << std::endl;

/* foo1.foo1() never called */
/* hence OO program can run as fast as a procedural program */

}
Jul 22 '05 #14
al***@start.no (Alf P. Steinbach) wrote in message news:<40******* *********@news. individual.net> ...
* nz******@cs.mun .ca (Neil Zanella) schriebt:

Essentially, I would like to have something like the equivalent of:

class Foo {
/* ... */
private:
/* ... */
int z;
/* ... */
};

However, I do not want to have all methods inside Foo see z. I only
want method foo to see it, just like I did for x which can only be
seen by foo().

The value of z should survive different calls from within the same
instance, but should be initialized for each new instance, like above.
But it should have method scope, not class scope.

class Foo;

class FooFunctor
{
private:
Foo& myFoo;
int myZ;
public:
FooFunctor( Foo& aFoo ): myFoo( aFoo ), myZ( 0 ) {}
int operator()();
};

class Foo
{
private:
int x;
FooFunctor foo;
public:
Foo(): x(0), foo(*this) {}

void bar()
{
x = foo();
}
};

int FooFunctor::ope rator()(){ ... }


Thank you for your reply..

I am not sure how your example would help in the situation I describe.
Consider the following code example where having the runFooi variables
being local to the current function would be of practical use. These
would then also have to be initialized within that function with
a scheme similar to that of the initialization of static variables:
on first call for an instance the variable is constructed,
subsequent calls within same object ignore the
construction and use the old value
for current object.

#include <iostream>
#include <cstdlib>

class Foo {
public:
Foo() { init(); }
Foo(int y): y(y) { init(); }
void init() {
/* defer initialization until needed */
runFoo1 = runFoo2 = runFoo3 = runFoo4 = true;
}
int foo1() { if (runFoo1) x1 = compute(0, 0); return x1; }
int foo2() { if (runFoo2) x2 = compute(0, 1); return x2; }
int foo3() { if (runFoo3) x3 = compute(1, 0); return x3; }
int foo4() { if (runFoo4) x4 = compute(1, 1); return x4; }
private:
int compute(int a, int b) {
/* suppose this takes a long time to run */
return rand() + 2 * a + b; /* for simplicity */
}
int x1, x2, x3, x4;
int y;
private:
bool runFoo1, runFoo2, runFoo3, runFoo4;
};

int main() {

/* run program without waiting for unnecessary computations */
/* available which would unnecessarily initialize class data */

Foo foo1;
std::cout << foo1.foo1() << std::endl;

/* foo1.foo2(), foo1.foo3(), and foo1.foo4() never called */
/* hence OO program can run as fast as a procedural program */

Foo foo2;
std::cout << foo2.foo2() << std::endl;
std::cout << foo2.foo3() << std::endl;
std::cout << foo2.foo4() << std::endl;

/* foo1.foo1() never called */
/* hence OO program can run as fast as a procedural program */

}
Jul 22 '05 #15
"Siemel Naran" <Si*********@RE MOVE.att.net> wrote in message:
Of course, comments are a nice idea too!


I don't understand exactly how usnig functors could
help in this situation. However I have come up with
another solution that solves the problem which I
originally posted. Essentially I achieve the desired
result and feature using an std::map which
associates with each instance the desired variable.
Hence using static local variables associated with
instances achieves the effect of instance specific
local variables, as originally requested. Here we
go. Finally, something that seems to work neatly! I
was getting quite tired of inspecting my class
variables to see whether I don't have some variable
which is not being used by any method. Cluttering
all my function specific methods was simply
unstylish IMHO.

Comments on the solution posted below very welcome!

Regards,

Neil

#include <iostream>
#include <cstdlib>
#include <map>

class Foo {
public:
int foo1() {
static std::map<Foo *, bool> computed;
if (!computed[this]) {
std::cout << "Computing foo1..." << std::endl;
x1 = compute(0, 0);
computed[this] = true;
} else
std::cout << "Reusing computed foo1 result..." << std::endl;
return x1;
}
int foo2() {
static std::map<Foo *, bool> computed;
if (!computed[this]) {
std::cout << "Computing foo2..." << std::endl;
x2 = compute(0, 1);
computed[this] = true;
} else
std::cout << "Reusing computed foo2 result..." << std::endl;
return x2;
}
int foo3() {
static std::map<Foo *, bool> computed;
if (!computed[this]) {
std::cout << "Computing foo3..." << std::endl;
x3 = compute(1, 0);
computed[this] = true;
} else
std::cout << "Reusing computed foo3 result..." << std::endl;
return x3;
}
int foo4() {
static std::map<Foo *, bool> computed;
if (!computed[this]) {
std::cout << "Computing foo4..." << std::endl;
x4 = compute(1, 1);
computed[this] = true;
} else
std::cout << "Reusing computed foo4 result..." << std::endl;
return x4;
}
private:
int compute(int a, int b) {
/* suppose this takes a long time to run */
return rand() + 2 * a + b; /* for simplicity */
}
int x1, x2, x3, x4; /* data to be computed */
};

int main() {

/* run program without waiting for unnecessary computations */
/* available which would unnecessarily initialize class data */

std::cout << "Foo 1 Instance:" << std::endl;

Foo foo1;
std::cout << foo1.foo1() << std::endl;
std::cout << foo1.foo1() << std::endl;
std::cout << foo1.foo2() << std::endl;

/* foo1.foo3(), and foo1.foo4() never called */
/* hence OO program can run as fast as a procedural program */

std::cout << "Foo 2 Instance: " << std::endl;

Foo foo2;
std::cout << foo2.foo2() << std::endl;
std::cout << foo2.foo3() << std::endl;
std::cout << foo2.foo4() << std::endl;
std::cout << foo2.foo4() << std::endl;

/* foo1.foo1() never called */
/* hence OO program can run as fast as a procedural program */

}
Output:

Foo 1 Instance:
Computing foo1...
1804289383
Reusing computed foo1 result...
1804289383
Computing foo2...
846930887
Foo 2 Instance:
Computing foo2...
1681692778
Computing foo3...
1714636917
Computing foo4...
1957747796
Reusing computed foo4 result...
1957747796
Jul 22 '05 #16
"Siemel Naran" <Si*********@RE MOVE.att.net> wrote in message:
Of course, comments are a nice idea too!


I don't understand exactly how usnig functors could
help in this situation. However I have come up with
another solution that solves the problem which I
originally posted. Essentially I achieve the desired
result and feature using an std::map which
associates with each instance the desired variable.
Hence using static local variables associated with
instances achieves the effect of instance specific
local variables, as originally requested. Here we
go. Finally, something that seems to work neatly! I
was getting quite tired of inspecting my class
variables to see whether I don't have some variable
which is not being used by any method. Cluttering
all my function specific methods was simply
unstylish IMHO.

Comments on the solution posted below very welcome!

Regards,

Neil

#include <iostream>
#include <cstdlib>
#include <map>

class Foo {
public:
int foo1() {
static std::map<Foo *, bool> computed;
if (!computed[this]) {
std::cout << "Computing foo1..." << std::endl;
x1 = compute(0, 0);
computed[this] = true;
} else
std::cout << "Reusing computed foo1 result..." << std::endl;
return x1;
}
int foo2() {
static std::map<Foo *, bool> computed;
if (!computed[this]) {
std::cout << "Computing foo2..." << std::endl;
x2 = compute(0, 1);
computed[this] = true;
} else
std::cout << "Reusing computed foo2 result..." << std::endl;
return x2;
}
int foo3() {
static std::map<Foo *, bool> computed;
if (!computed[this]) {
std::cout << "Computing foo3..." << std::endl;
x3 = compute(1, 0);
computed[this] = true;
} else
std::cout << "Reusing computed foo3 result..." << std::endl;
return x3;
}
int foo4() {
static std::map<Foo *, bool> computed;
if (!computed[this]) {
std::cout << "Computing foo4..." << std::endl;
x4 = compute(1, 1);
computed[this] = true;
} else
std::cout << "Reusing computed foo4 result..." << std::endl;
return x4;
}
private:
int compute(int a, int b) {
/* suppose this takes a long time to run */
return rand() + 2 * a + b; /* for simplicity */
}
int x1, x2, x3, x4; /* data to be computed */
};

int main() {

/* run program without waiting for unnecessary computations */
/* available which would unnecessarily initialize class data */

std::cout << "Foo 1 Instance:" << std::endl;

Foo foo1;
std::cout << foo1.foo1() << std::endl;
std::cout << foo1.foo1() << std::endl;
std::cout << foo1.foo2() << std::endl;

/* foo1.foo3(), and foo1.foo4() never called */
/* hence OO program can run as fast as a procedural program */

std::cout << "Foo 2 Instance: " << std::endl;

Foo foo2;
std::cout << foo2.foo2() << std::endl;
std::cout << foo2.foo3() << std::endl;
std::cout << foo2.foo4() << std::endl;
std::cout << foo2.foo4() << std::endl;

/* foo1.foo1() never called */
/* hence OO program can run as fast as a procedural program */

}
Output:

Foo 1 Instance:
Computing foo1...
1804289383
Reusing computed foo1 result...
1804289383
Computing foo2...
846930887
Foo 2 Instance:
Computing foo2...
1681692778
Computing foo3...
1714636917
Computing foo4...
1957747796
Reusing computed foo4 result...
1957747796
Jul 22 '05 #17
* nz******@cs.mun .ca (Neil Zanella) schriebt:
al***@start.no (Alf P. Steinbach) wrote in message news:<40******* *********@news. individual.net> ...
* nz******@cs.mun .ca (Neil Zanella) schriebt:

Essentially, I would like to have something like the equivalent of:

class Foo {
/* ... */
private:
/* ... */
int z;
/* ... */
};

However, I do not want to have all methods inside Foo see z. I only
want method foo to see it, just like I did for x which can only be
seen by foo().

The value of z should survive different calls from within the same
instance, but should be initialized for each new instance, like above.
But it should have method scope, not class scope.

class Foo;

class FooFunctor
{
private:
Foo& myFoo;
int myZ;
public:
FooFunctor( Foo& aFoo ): myFoo( aFoo ), myZ( 0 ) {}
int operator()();
};

class Foo
{
private:
int x;
FooFunctor foo;
public:
Foo(): x(0), foo(*this) {}

void bar()
{
x = foo();
}
};

int FooFunctor::ope rator()(){ ... }


Thank you for your reply..


You're welcome..

I am not sure how your example would help in the situation I describe.
Try it.
Consider the following code example where having the runFooi variables
being local to the current function would be of practical use. These
would then also have to be initialized within that function with
a scheme similar to that of the initialization of static variables:
on first call for an instance the variable is constructed,
subsequent calls within same object ignore the
construction and use the old value
for current object.


That's the same problem again, and it's no more difficult with four
variables than with one.

In addition you have added an irrelevant aspect, namly logical constness.

Look up the keyword 'mutable' for that.

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 22 '05 #18
* nz******@cs.mun .ca (Neil Zanella) schriebt:
al***@start.no (Alf P. Steinbach) wrote in message news:<40******* *********@news. individual.net> ...
* nz******@cs.mun .ca (Neil Zanella) schriebt:

Essentially, I would like to have something like the equivalent of:

class Foo {
/* ... */
private:
/* ... */
int z;
/* ... */
};

However, I do not want to have all methods inside Foo see z. I only
want method foo to see it, just like I did for x which can only be
seen by foo().

The value of z should survive different calls from within the same
instance, but should be initialized for each new instance, like above.
But it should have method scope, not class scope.

class Foo;

class FooFunctor
{
private:
Foo& myFoo;
int myZ;
public:
FooFunctor( Foo& aFoo ): myFoo( aFoo ), myZ( 0 ) {}
int operator()();
};

class Foo
{
private:
int x;
FooFunctor foo;
public:
Foo(): x(0), foo(*this) {}

void bar()
{
x = foo();
}
};

int FooFunctor::ope rator()(){ ... }


Thank you for your reply..


You're welcome..

I am not sure how your example would help in the situation I describe.
Try it.
Consider the following code example where having the runFooi variables
being local to the current function would be of practical use. These
would then also have to be initialized within that function with
a scheme similar to that of the initialization of static variables:
on first call for an instance the variable is constructed,
subsequent calls within same object ignore the
construction and use the old value
for current object.


That's the same problem again, and it's no more difficult with four
variables than with one.

In addition you have added an irrelevant aspect, namly logical constness.

Look up the keyword 'mutable' for that.

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 22 '05 #19
"Neil Zanella" <nz******@cs.mu n.ca> wrote in message
I don't understand exactly how usnig functors could
help in this situation. However I have come up with
I think I misunderstood your original requirement. Thought you wanted to
make a private variable which is accessible to only 1 member function.
#include <iostream>
#include <cstdlib>
#include <map>

class Foo {
public:
int foo1() {
static std::map<Foo *, bool> computed;
if (!computed[this]) {
std::cout << "Computing foo1..." << std::endl;
x1 = compute(0, 0);
computed[this] = true;
} else
std::cout << "Reusing computed foo1 result..." << std::endl;
return x1;
}
int foo2() {
static std::map<Foo *, bool> computed;
if (!computed[this]) {
std::cout << "Computing foo2..." << std::endl;
x2 = compute(0, 1);
computed[this] = true;
} else
std::cout << "Reusing computed foo2 result..." << std::endl;
return x2;
}
int foo3() {
static std::map<Foo *, bool> computed;
if (!computed[this]) {
std::cout << "Computing foo3..." << std::endl;
x3 = compute(1, 0);
computed[this] = true;
} else
std::cout << "Reusing computed foo3 result..." << std::endl;
return x3;
}
int foo4() {
static std::map<Foo *, bool> computed;
if (!computed[this]) {
std::cout << "Computing foo4..." << std::endl;
x4 = compute(1, 1);
computed[this] = true;
} else
std::cout << "Reusing computed foo4 result..." << std::endl;
return x4;
}
private:
int compute(int a, int b) {
/* suppose this takes a long time to run */
return rand() + 2 * a + b; /* for simplicity */
}
int x1, x2, x3, x4; /* data to be computed */
};
Why not just

class Foo {
public:
Foo() : x1(), x1_computed(fal se) { }
private:
int x1;
bool x1_computed;

If you want to get fancy, you can try the recursive derivation idea I posted
in "set/get in c++".

int main() {

/* run program without waiting for unnecessary computations */
/* available which would unnecessarily initialize class data */

std::cout << "Foo 1 Instance:" << std::endl;

Foo foo1;
std::cout << foo1.foo1() << std::endl;
std::cout << foo1.foo1() << std::endl;
std::cout << foo1.foo2() << std::endl;

/* foo1.foo3(), and foo1.foo4() never called */
/* hence OO program can run as fast as a procedural program */

std::cout << "Foo 2 Instance: " << std::endl;

Foo foo2;
std::cout << foo2.foo2() << std::endl;
std::cout << foo2.foo3() << std::endl;
std::cout << foo2.foo4() << std::endl;
std::cout << foo2.foo4() << std::endl;

/* foo1.foo1() never called */
/* hence OO program can run as fast as a procedural program */

}


Jul 22 '05 #20

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

Similar topics

29
428
by: Neil Zanella | last post by:
Hello, Suppose I have some method: Foo::foo() { static int x; int y; /* ... */ }
166
8673
by: Graham | last post by:
This has to do with class variables and instances variables. Given the following: <code> class _class: var = 0 #rest of the class
7
2116
by: WXS | last post by:
Vote for this idea if you like it here: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=5fee280d-085e-4fe2-af35-254fbbe96ee9 ----------------------------------------------------------------------------- This is a consortium of ideas from another thread on topic ----------------------------------------------------------------------------- One of the big issues of organizing items within a class, is there are many...
0
9592
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8887
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6679
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.